Skip to content

Commit b8459ac

Browse files
authored
chore: promote develop to main (#2)
1 parent 1285968 commit b8459ac

13 files changed

Lines changed: 388 additions & 125 deletions

.storybook/preview-head.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<link
2+
rel="stylesheet"
3+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css"
4+
/>
5+
<link
6+
rel="stylesheet"
7+
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css"
8+
/>

.storybook/preview.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@ import type { Preview } from '@storybook/react-vite';
22

33
const preview: Preview = {
44
parameters: {
5-
actions: {
6-
argTypesRegex: '^on[A-Z].*'
7-
},
8-
controls: {
9-
matchers: {
10-
color: /(background|color)$/i,
11-
date: /Date$/i
12-
}
13-
}
5+
chromatic: { pauseAnimationAtEnd: true, delay: 400 },
6+
actions: { argTypesRegex: '^on[A-Z].*' },
7+
controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } }
148
},
159
tags: ['autodocs']
1610
};

lib/components/DualScrollSync/DualScrollSync.module.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
--dual-scroll-sync-highlight-background-color,
1313
#{$highlight-background-color}
1414
);
15-
16-
* {
17-
box-sizing: border-box;
18-
margin: 0;
19-
padding: 0;
20-
border: none;
21-
}
2215
}
2316

2417
.scrollSyncNav {
@@ -41,6 +34,7 @@
4134
height: calc(100% / var(--menu-nav-visible-count));
4235
min-height: 56px;
4336
padding: var(--dual-scroll-sync-space-m, #{$space-m}) var(--dual-scroll-sync-space-s, #{$space-s});
37+
border: none;
4438
border-bottom: 1px solid var(--dual-scroll-sync-border-color, #{$border-color});
4539

4640
text-align: left;
@@ -71,8 +65,11 @@
7165
.scrollSyncNavItemLabel {
7266
display: flex;
7367
align-items: center;
68+
7469
height: 100%;
7570
padding: 0 var(--dual-scroll-sync-space-m, #{$space-m});
71+
72+
font-size: smaller;
7673
}
7774

7875
.scrollSyncContentSectionLabel {
@@ -81,11 +78,11 @@
8178
}
8279

8380
.scrollSyncNavItemActive {
84-
background-color: var(--dual-scroll-sync-highlight-color, #{$highlight-background-color});
81+
background-color: var(--dual-scroll-sync-background-color, #{$highlight-background-color});
8582

8683
span {
8784
border-left: 3px solid
88-
var(--dual-scroll-sync-highlight-background-color, #{$highlight-foreground-color});
85+
var(--dual-scroll-sync-highlight-foreground-color, #{$highlight-foreground-color});
8986
font-weight: bold;
9087
color: var(--dual-scroll-sync-highlight-foreground-color, #{$highlight-foreground-color});
9188
}

lib/components/DualScrollSync/DualScrollSync.stories.tsx

Lines changed: 0 additions & 92 deletions
This file was deleted.

lib/components/DualScrollSync/DualScrollSync.types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ export type DualScrollSyncItem = PropsWithChildren<DualScrollSyncBaseProps>;
99

1010
export type DualScrollSyncProps = {
1111
/**
12-
* Unique identifier for the DualScrollSync component.
12+
* Unique identifier for the DualScrollSync component. (Optional)
1313
* @default 'dual-scroll-sync'
1414
*/
1515
id?: string;
1616
/**
17-
* Array of `ScrollSyncItem` objects.
17+
* Array of `DualScrollSyncItem` objects.
1818
* @default []
1919
*/
2020
items: DualScrollSyncItem[];
2121
/**
22-
* Maximum visible items in the navigation menu. If the number of items exceeds this value, scrolling is activated.
22+
* Maximum visible items in the navigation menu. If the number of items exceeds this value, scrolling is activated. (Optional)
2323
* @default 6
2424
*/
2525
maxVisibleItems?: number;

lib/components/DualScrollSync/DualScrollSync.docs.mdx renamed to lib/components/DualScrollSync/stories/DualScrollSync.docs.mdx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,30 @@ import {
1919

2020
**DualScrollSync** is a UI component that synchronizes a vertical navigation menu with scrollable content panels, ideal for advanced catalogs or complex filters.
2121

22-
### 📦 Import
23-
24-
```tsx
25-
import { DualScrollSync } from '@dorixdev/scroll-sync';
26-
```
27-
28-
### 💡 Features
22+
## 💡 Features
2923

3024
- Synchronizes the active state between navigation menu and visible content.
3125
- Enables smooth scrolling between sections.
3226
- Highlights the active menu item for better user orientation.
3327

34-
### 🔧 Props
28+
## 📦 Import
29+
30+
```tsx
31+
import { DualScrollSync } from '@dorixdev/react-dual-scroll-sync';
32+
33+
// Add styles once in your app
34+
import '@dorixdev/react-dual-scroll-sync/styles.css';
35+
```
36+
37+
## 🔧 Props
3538

3639
<ArgTypes of={DualScrollSyncStories.Default} />
3740

38-
### 🧩 Events & Callbacks
41+
## 🧩 Events & Callbacks
3942

4043
`onItemClick`: Callback triggered when a menu item is clicked, receiving the active section key as an argument. This can be used for analytics or other side effects.
4144

42-
### 🎨 Styling & Customization
45+
## 🎨 Styling & Customization
4346

4447
You can customize the styles by overriding the CSS variables defined in the package. Here’s an example of how to do that in your CSS file:
4548

@@ -58,7 +61,7 @@ You can customize the styles by overriding the CSS variables defined in the pack
5861
}
5962
```
6063

61-
### ⚙️ Best Practices & Limitations
64+
## ⚙️ Best Practices & Limitations
6265

6366
- Use `sectionKey` to uniquely identify each section for proper synchronization.
6467
- Designed for responsive mobile-first layouts but adaptable to any size.

0 commit comments

Comments
 (0)