@shohojdhara/atomix 0.3.15 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-tools/index.d.ts +31 -30
- package/build-tools/package.json +4 -21
- package/dist/atomix.css +20234 -2027
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +76 -2
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/index.d.ts +31 -30
- package/dist/build-tools/package.json +4 -21
- package/dist/charts.js +4 -5
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +87 -10
- package/dist/core.js +673 -480
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +15 -3
- package/dist/forms.js +530 -97
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +5 -6
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +644 -277
- package/dist/index.esm.js +1948 -1347
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3333 -2728
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js.map +1 -1
- package/dist/theme.d.ts +9 -9
- package/dist/theme.js.map +1 -1
- package/package.json +2 -2
- package/scripts/atomix-cli.js +10 -1
- package/scripts/cli/__tests__/utils.test.js +6 -2
- package/scripts/cli/migration-tools.js +2 -2
- package/scripts/cli/theme-bridge.js +7 -9
- package/scripts/cli/utils.js +2 -1
- package/src/components/Accordion/Accordion.stories.tsx +72 -23
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +219 -96
- package/src/components/Accordion/AccordionCompound.test.tsx +70 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/glass-utils.ts +4 -3
- package/src/components/AtomixGlass/shader-utils.ts +128 -52
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +45 -62
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +20 -9
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +14 -4
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +9 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +173 -65
- package/src/components/Breadcrumb/BreadcrumbCompound.test.tsx +84 -0
- package/src/components/Button/Button.stories.tsx +13 -22
- package/src/components/Button/Button.test.tsx +97 -81
- package/src/components/Button/Button.tsx +46 -14
- package/src/components/Button/ButtonGroup.stories.tsx +37 -32
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +166 -918
- package/src/components/Callout/Callout.tsx +196 -84
- package/src/components/Callout/CalloutCompound.test.tsx +72 -0
- package/src/components/Card/Card.stories.tsx +67 -36
- package/src/components/Card/Card.tsx +30 -14
- package/src/components/Chart/AreaChart.tsx +1 -1
- package/src/components/Chart/CandlestickChart.tsx +23 -16
- package/src/components/Chart/Chart.stories.tsx +4 -9
- package/src/components/Chart/Chart.tsx +40 -44
- package/src/components/Chart/ChartRenderer.tsx +39 -12
- package/src/components/Chart/ChartToolbar.tsx +21 -5
- package/src/components/Chart/DonutChart.tsx +1 -1
- package/src/components/Chart/FunnelChart.tsx +4 -1
- package/src/components/Chart/GaugeChart.tsx +3 -1
- package/src/components/Chart/HeatmapChart.tsx +50 -37
- package/src/components/Chart/LineChart.tsx +3 -2
- package/src/components/Chart/MultiAxisChart.tsx +24 -16
- package/src/components/Chart/RadarChart.tsx +19 -17
- package/src/components/Chart/ScatterChart.tsx +29 -21
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -2
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +7 -7
- package/src/components/DataTable/DataTable.stories.tsx +43 -38
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +32 -47
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +425 -298
- package/src/components/Dropdown/DropdownCompound.test.tsx +64 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
- package/src/components/EdgePanel/EdgePanel.tsx +163 -113
- package/src/components/EdgePanel/EdgePanelCompound.test.tsx +53 -0
- package/src/components/Footer/Footer.stories.tsx +21 -16
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.test.tsx +49 -49
- package/src/components/Form/Checkbox.tsx +108 -100
- package/src/components/Form/Form.stories.tsx +2 -10
- package/src/components/Form/Input.stories.tsx +22 -39
- package/src/components/Form/Input.test.tsx +38 -44
- package/src/components/Form/Radio.stories.tsx +6 -12
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.stories.tsx +23 -0
- package/src/components/Form/Select.test.tsx +99 -0
- package/src/components/Form/Select.tsx +239 -186
- package/src/components/Form/SelectOption.tsx +88 -0
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +93 -23
- package/src/components/Hero/Hero.test.tsx +142 -0
- package/src/components/Hero/Hero.tsx +343 -58
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.test.tsx +62 -0
- package/src/components/List/List.tsx +32 -25
- package/src/components/List/ListItem.tsx +20 -0
- package/src/components/Modal/Modal.stories.tsx +67 -2
- package/src/components/Modal/Modal.tsx +208 -125
- package/src/components/Modal/ModalCompound.test.tsx +94 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
- package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
- package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
- package/src/components/Pagination/Pagination.stories.tsx +7 -4
- package/src/components/Pagination/Pagination.tsx +199 -202
- package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
- package/src/components/Popover/Popover.stories.tsx +99 -192
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +35 -44
- package/src/components/River/River.stories.tsx +2 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +71 -71
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +3 -1
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +8 -6
- package/src/components/Steps/Steps.tsx +124 -21
- package/src/components/Steps/StepsCompound.test.tsx +81 -0
- package/src/components/Tabs/Tabs.stories.tsx +12 -9
- package/src/components/Tabs/Tabs.tsx +230 -75
- package/src/components/Tabs/TabsCompound.test.tsx +64 -0
- package/src/components/Toggle/Toggle.stories.tsx +27 -13
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +24 -20
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +129 -127
- package/src/components/Upload/Upload.tsx +287 -283
- package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
- package/src/components/index.ts +13 -2
- package/src/layouts/Grid/Grid.stories.tsx +9 -3
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
- package/src/lib/__tests__/theme-tools.test.ts +32 -6
- package/src/lib/composables/index.ts +0 -4
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +102 -60
- package/src/lib/composables/useChartExport.ts +1 -1
- package/src/lib/composables/useDataTable.ts +29 -17
- package/src/lib/composables/useHero.ts +58 -14
- package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
- package/src/lib/composables/useInput.ts +10 -8
- package/src/lib/composables/useSideMenu.ts +6 -5
- package/src/lib/composables/useTooltip.ts +1 -2
- package/src/lib/composables/useVideoPlayer.ts +44 -35
- package/src/lib/config/index.ts +154 -154
- package/src/lib/constants/cssVariables.ts +29 -29
- package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
- package/src/lib/hooks/index.ts +1 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -17
- package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
- package/src/lib/patterns/__tests__/slots.test.ts +1 -1
- package/src/lib/patterns/index.ts +1 -1
- package/src/lib/patterns/slots.tsx +8 -13
- package/src/lib/storybook/InteractiveDemo.tsx +13 -18
- package/src/lib/storybook/PreviewContainer.tsx +1 -1
- package/src/lib/storybook/VariantsGrid.tsx +3 -7
- package/src/lib/storybook/index.ts +1 -1
- package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
- package/src/lib/theme/adapters/index.ts +3 -9
- package/src/lib/theme/adapters/themeAdapter.ts +41 -26
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +10 -5
- package/src/lib/theme/constants/constants.ts +2 -2
- package/src/lib/theme/constants/index.ts +1 -2
- package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
- package/src/lib/theme/core/composeTheme.ts +32 -26
- package/src/lib/theme/core/createTheme.ts +1 -1
- package/src/lib/theme/core/createThemeObject.ts +308 -301
- package/src/lib/theme/core/index.ts +3 -3
- package/src/lib/theme/devtools/CLI.ts +105 -111
- package/src/lib/theme/devtools/Comparator.tsx +50 -32
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
- package/src/lib/theme/devtools/Inspector.tsx +75 -60
- package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
- package/src/lib/theme/devtools/Preview.tsx +150 -106
- package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
- package/src/lib/theme/devtools/index.ts +3 -9
- package/src/lib/theme/devtools/useHistory.ts +23 -21
- package/src/lib/theme/errors/errors.ts +12 -11
- package/src/lib/theme/errors/index.ts +2 -7
- package/src/lib/theme/generators/generateCSS.ts +9 -13
- package/src/lib/theme/generators/generateCSSNested.ts +1 -6
- package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/i18n/index.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +13 -13
- package/src/lib/theme/index.ts +7 -16
- package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
- package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
- package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
- package/src/lib/theme/runtime/index.ts +2 -5
- package/src/lib/theme/runtime/useTheme.ts +18 -18
- package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
- package/src/lib/theme/test/testTheme.ts +15 -16
- package/src/lib/theme/tokens/index.ts +2 -7
- package/src/lib/theme/tokens/tokens.ts +25 -24
- package/src/lib/theme/types.ts +428 -411
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
- package/src/lib/theme/utils/componentTheming.ts +18 -18
- package/src/lib/theme/utils/domUtils.ts +277 -289
- package/src/lib/theme/utils/index.ts +1 -2
- package/src/lib/theme/utils/injectCSS.ts +10 -14
- package/src/lib/theme/utils/naming.ts +20 -16
- package/src/lib/theme/utils/themeHelpers.ts +10 -12
- package/src/lib/theme/utils/themeUtils.ts +85 -86
- package/src/lib/theme/utils/themeValidation.ts +82 -33
- package/src/lib/theme-tools.ts +8 -6
- package/src/lib/types/components.ts +180 -73
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/componentUtils.test.ts +57 -2
- package/src/lib/utils/__tests__/csv.test.ts +1 -1
- package/src/lib/utils/__tests__/themeNaming.test.ts +117 -0
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +3 -1
- package/src/lib/utils/dataTableExport.ts +1 -5
- package/src/lib/utils/fontPreloader.ts +10 -19
- package/src/lib/utils/icons.ts +4 -1
- package/src/lib/utils/index.ts +2 -6
- package/src/lib/utils/memoryMonitor.ts +10 -8
- package/src/lib/utils/themeNaming.ts +3 -3
- package/src/styles/01-settings/_index.scss +0 -1
- package/src/styles/01-settings/_settings.colors.scss +8 -8
- package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/01-settings/_settings.spacing.scss +3 -4
- package/src/styles/01-settings/_settings.tooltip.scss +1 -1
- package/src/styles/01-settings/_settings.typography.scss +1 -1
- package/src/styles/02-tools/_tools.breakpoints.scss +1 -1
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +36 -24
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.atomix-glass.scss +13 -9
- package/src/styles/06-components/_components.button.scss +16 -4
- package/src/styles/06-components/_components.callout.scss +27 -21
- package/src/styles/06-components/_components.card.scss +5 -14
- package/src/styles/06-components/_components.chart.scss +22 -19
- package/src/styles/06-components/_components.checkbox.scss +3 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
- package/src/styles/06-components/_components.edge-panel.scss +9 -2
- package/src/styles/06-components/_components.footer.scss +1 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -5
- package/src/styles/06-components/_components.toggle.scss +18 -0
- package/src/styles/06-components/_index.scss +1 -1
- package/src/styles/06-components/old.chart.styles.scss +0 -2
- package/src/styles/99-utilities/_utilities.border.scss +69 -27
- package/src/styles/99-utilities/_utilities.display.scss +1 -1
- package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
- package/src/styles/99-utilities/_utilities.position.scss +16 -9
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
- package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
- package/src/styles/99-utilities/_utilities.text-gradient.scss +30 -30
- package/src/styles/99-utilities/_utilities.text.scss +67 -47
|
@@ -81,7 +81,10 @@ const ScatterChart = memo(
|
|
|
81
81
|
onClick={() => handlers.onDataPointClick?.(point, datasetIndex, pointIndex)}
|
|
82
82
|
onMouseEnter={e => {
|
|
83
83
|
if (scatterOptions.enableHoverEffects) {
|
|
84
|
-
const newRadius = Math.max(
|
|
84
|
+
const newRadius = Math.max(
|
|
85
|
+
0,
|
|
86
|
+
(point.size || scatterOptions.pointRadius || 4) * 1.5
|
|
87
|
+
);
|
|
85
88
|
e.currentTarget.setAttribute('r', String(newRadius));
|
|
86
89
|
}
|
|
87
90
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -96,7 +99,10 @@ const ScatterChart = memo(
|
|
|
96
99
|
}}
|
|
97
100
|
onMouseLeave={e => {
|
|
98
101
|
if (scatterOptions.enableHoverEffects) {
|
|
99
|
-
const originalRadius = Math.max(
|
|
102
|
+
const originalRadius = Math.max(
|
|
103
|
+
0,
|
|
104
|
+
point.size || scatterOptions.pointRadius || 4
|
|
105
|
+
);
|
|
100
106
|
e.currentTarget.setAttribute('r', String(originalRadius));
|
|
101
107
|
}
|
|
102
108
|
handlers.onPointLeave();
|
|
@@ -104,13 +110,13 @@ const ScatterChart = memo(
|
|
|
104
110
|
/>
|
|
105
111
|
{scatterOptions.showLabels && point.label && (
|
|
106
112
|
<text x={x} y={y - 10} textAnchor="middle" className="c-chart__scatter-label">
|
|
107
|
-
{String(point.label).replace(/[<>&"']/g,
|
|
113
|
+
{String(point.label).replace(/[<>&"']/g, char => {
|
|
108
114
|
const entities: Record<string, string> = {
|
|
109
115
|
'<': '<',
|
|
110
116
|
'>': '>',
|
|
111
117
|
'&': '&',
|
|
112
118
|
'"': '"',
|
|
113
|
-
"'": '''
|
|
119
|
+
"'": ''',
|
|
114
120
|
};
|
|
115
121
|
return entities[char] || char;
|
|
116
122
|
})}
|
|
@@ -124,23 +130,25 @@ const ScatterChart = memo(
|
|
|
124
130
|
return (
|
|
125
131
|
<>
|
|
126
132
|
{points}
|
|
127
|
-
{showTooltips &&
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
renderedDatasets[hoveredPoint.datasetIndex]?.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
133
|
+
{showTooltips &&
|
|
134
|
+
hoveredPoint &&
|
|
135
|
+
renderedDatasets[hoveredPoint.datasetIndex]?.data?.[hoveredPoint.pointIndex] && (
|
|
136
|
+
<ChartTooltip
|
|
137
|
+
dataPoint={
|
|
138
|
+
renderedDatasets[hoveredPoint.datasetIndex]!.data![hoveredPoint.pointIndex]!
|
|
139
|
+
}
|
|
140
|
+
datasetLabel={renderedDatasets[hoveredPoint.datasetIndex]?.label}
|
|
141
|
+
datasetColor={
|
|
142
|
+
renderedDatasets[hoveredPoint.datasetIndex]?.color ||
|
|
143
|
+
colors[hoveredPoint.datasetIndex]
|
|
144
|
+
}
|
|
145
|
+
position={{
|
|
146
|
+
x: hoveredPoint.clientX,
|
|
147
|
+
y: hoveredPoint.clientY,
|
|
148
|
+
}}
|
|
149
|
+
visible={true}
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
144
152
|
</>
|
|
145
153
|
);
|
|
146
154
|
};
|
|
@@ -228,7 +228,11 @@ export const WithCallback: Story = {
|
|
|
228
228
|
const [lastChanged, setLastChanged] = useState<string>('');
|
|
229
229
|
return (
|
|
230
230
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', alignItems: 'center' }}>
|
|
231
|
-
<ColorModeToggle
|
|
231
|
+
<ColorModeToggle
|
|
232
|
+
onChange={mode =>
|
|
233
|
+
setLastChanged(`Mode changed to ${mode} at ${new Date().toLocaleTimeString()}`)
|
|
234
|
+
}
|
|
235
|
+
/>
|
|
232
236
|
{lastChanged && <p>Last changed: {lastChanged}</p>}
|
|
233
237
|
</div>
|
|
234
238
|
);
|
|
@@ -240,4 +244,4 @@ export const WithCallback: Story = {
|
|
|
240
244
|
},
|
|
241
245
|
},
|
|
242
246
|
},
|
|
243
|
-
};
|
|
247
|
+
};
|
|
@@ -157,13 +157,25 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({
|
|
|
157
157
|
const title = showTooltip ? `Switch to ${nextMode} mode` : undefined;
|
|
158
158
|
|
|
159
159
|
const defaultLightIcon = (
|
|
160
|
-
<svg
|
|
160
|
+
<svg
|
|
161
|
+
viewBox="0 0 24 24"
|
|
162
|
+
width={iconSize}
|
|
163
|
+
height={iconSize}
|
|
164
|
+
fill="currentColor"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
>
|
|
161
167
|
<path d="M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z" />
|
|
162
168
|
</svg>
|
|
163
169
|
);
|
|
164
170
|
|
|
165
171
|
const defaultDarkIcon = (
|
|
166
|
-
<svg
|
|
172
|
+
<svg
|
|
173
|
+
viewBox="0 0 24 24"
|
|
174
|
+
width={iconSize}
|
|
175
|
+
height={iconSize}
|
|
176
|
+
fill="currentColor"
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
>
|
|
167
179
|
<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41.39.39 1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41.39.39 1.03.39 1.41 0l1.06-1.06z" />
|
|
168
180
|
</svg>
|
|
169
181
|
);
|
|
@@ -179,7 +191,7 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({
|
|
|
179
191
|
title={title}
|
|
180
192
|
style={style}
|
|
181
193
|
>
|
|
182
|
-
{colorMode === 'light' ?
|
|
194
|
+
{colorMode === 'light' ? lightIcon || defaultLightIcon : darkIcon || defaultDarkIcon}
|
|
183
195
|
</button>
|
|
184
196
|
);
|
|
185
197
|
};
|
|
@@ -66,8 +66,8 @@ The Countdown component displays a countdown timer to a specified target date. I
|
|
|
66
66
|
},
|
|
67
67
|
tags: ['autodocs'],
|
|
68
68
|
argTypes: {
|
|
69
|
-
target: {
|
|
70
|
-
control: 'date',
|
|
69
|
+
target: {
|
|
70
|
+
control: 'date',
|
|
71
71
|
description: 'Target date/time for the countdown',
|
|
72
72
|
table: {
|
|
73
73
|
type: { summary: 'Date | number | string' },
|
|
@@ -82,16 +82,16 @@ The Countdown component displays a countdown timer to a specified target date. I
|
|
|
82
82
|
defaultValue: { summary: "['days', 'hours', 'minutes', 'seconds']" },
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
|
-
separator: {
|
|
86
|
-
control: 'text',
|
|
85
|
+
separator: {
|
|
86
|
+
control: 'text',
|
|
87
87
|
description: 'Separator string',
|
|
88
88
|
table: {
|
|
89
89
|
type: { summary: 'string' },
|
|
90
90
|
defaultValue: { summary: ':' },
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
|
-
focused: {
|
|
94
|
-
control: 'boolean',
|
|
93
|
+
focused: {
|
|
94
|
+
control: 'boolean',
|
|
95
95
|
description: 'Focused style',
|
|
96
96
|
table: {
|
|
97
97
|
type: { summary: 'boolean' },
|
|
@@ -150,4 +150,4 @@ export const CustomSeparator: Story = {
|
|
|
150
150
|
},
|
|
151
151
|
},
|
|
152
152
|
},
|
|
153
|
-
};
|
|
153
|
+
};
|
|
@@ -83,88 +83,88 @@ DataTable provides a powerful and flexible way to display structured data in row
|
|
|
83
83
|
},
|
|
84
84
|
tags: ['autodocs'],
|
|
85
85
|
argTypes: {
|
|
86
|
-
data: {
|
|
87
|
-
control: 'object',
|
|
86
|
+
data: {
|
|
87
|
+
control: 'object',
|
|
88
88
|
description: 'Array of data objects to display',
|
|
89
89
|
table: {
|
|
90
90
|
type: { summary: 'T[]' },
|
|
91
91
|
defaultValue: { summary: '[]' },
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
|
-
columns: {
|
|
95
|
-
control: 'object',
|
|
94
|
+
columns: {
|
|
95
|
+
control: 'object',
|
|
96
96
|
description: 'Column definitions for the table',
|
|
97
97
|
table: {
|
|
98
98
|
type: { summary: 'DataTableColumn[]' },
|
|
99
99
|
defaultValue: { summary: '[]' },
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
|
-
sortable: {
|
|
103
|
-
control: 'boolean',
|
|
102
|
+
sortable: {
|
|
103
|
+
control: 'boolean',
|
|
104
104
|
description: 'Whether columns are sortable',
|
|
105
105
|
table: {
|
|
106
106
|
type: { summary: 'boolean' },
|
|
107
107
|
defaultValue: { summary: 'false' },
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
-
filterable: {
|
|
111
|
-
control: 'boolean',
|
|
110
|
+
filterable: {
|
|
111
|
+
control: 'boolean',
|
|
112
112
|
description: 'Whether the table is filterable',
|
|
113
113
|
table: {
|
|
114
114
|
type: { summary: 'boolean' },
|
|
115
115
|
defaultValue: { summary: 'false' },
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
|
-
paginated: {
|
|
119
|
-
control: 'boolean',
|
|
118
|
+
paginated: {
|
|
119
|
+
control: 'boolean',
|
|
120
120
|
description: 'Whether to enable pagination',
|
|
121
121
|
table: {
|
|
122
122
|
type: { summary: 'boolean' },
|
|
123
123
|
defaultValue: { summary: 'false' },
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
|
-
pageSize: {
|
|
127
|
-
control: 'number',
|
|
126
|
+
pageSize: {
|
|
127
|
+
control: 'number',
|
|
128
128
|
description: 'Number of rows per page',
|
|
129
129
|
table: {
|
|
130
130
|
type: { summary: 'number' },
|
|
131
131
|
defaultValue: { summary: '10' },
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
|
-
striped: {
|
|
135
|
-
control: 'boolean',
|
|
134
|
+
striped: {
|
|
135
|
+
control: 'boolean',
|
|
136
136
|
description: 'Whether to apply striped row styling',
|
|
137
137
|
table: {
|
|
138
138
|
type: { summary: 'boolean' },
|
|
139
139
|
defaultValue: { summary: 'false' },
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
|
-
bordered: {
|
|
143
|
-
control: 'boolean',
|
|
142
|
+
bordered: {
|
|
143
|
+
control: 'boolean',
|
|
144
144
|
description: 'Whether to show table borders',
|
|
145
145
|
table: {
|
|
146
146
|
type: { summary: 'boolean' },
|
|
147
147
|
defaultValue: { summary: 'false' },
|
|
148
148
|
},
|
|
149
149
|
},
|
|
150
|
-
dense: {
|
|
151
|
-
control: 'boolean',
|
|
150
|
+
dense: {
|
|
151
|
+
control: 'boolean',
|
|
152
152
|
description: 'Whether to use dense row spacing',
|
|
153
153
|
table: {
|
|
154
154
|
type: { summary: 'boolean' },
|
|
155
155
|
defaultValue: { summary: 'false' },
|
|
156
156
|
},
|
|
157
157
|
},
|
|
158
|
-
loading: {
|
|
159
|
-
control: 'boolean',
|
|
158
|
+
loading: {
|
|
159
|
+
control: 'boolean',
|
|
160
160
|
description: 'Whether the table is in loading state',
|
|
161
161
|
table: {
|
|
162
162
|
type: { summary: 'boolean' },
|
|
163
163
|
defaultValue: { summary: 'false' },
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
|
-
emptyMessage: {
|
|
167
|
-
control: 'text',
|
|
166
|
+
emptyMessage: {
|
|
167
|
+
control: 'text',
|
|
168
168
|
description: 'Message to display when table is empty',
|
|
169
169
|
table: {
|
|
170
170
|
type: { summary: 'string' },
|
|
@@ -361,7 +361,8 @@ export const WithColumnFilters: Story = {
|
|
|
361
361
|
parameters: {
|
|
362
362
|
docs: {
|
|
363
363
|
description: {
|
|
364
|
-
story:
|
|
364
|
+
story:
|
|
365
|
+
'DataTable with column-specific filters. Each filterable column has its own filter input.',
|
|
365
366
|
},
|
|
366
367
|
},
|
|
367
368
|
},
|
|
@@ -372,7 +373,7 @@ export const WithColumnFilters: Story = {
|
|
|
372
373
|
// ========================================
|
|
373
374
|
|
|
374
375
|
export const WithRowSelectionSingle: Story = {
|
|
375
|
-
render:
|
|
376
|
+
render: args => {
|
|
376
377
|
const [selectedRow, setSelectedRow] = useState<any>(null);
|
|
377
378
|
|
|
378
379
|
return (
|
|
@@ -382,14 +383,12 @@ export const WithRowSelectionSingle: Story = {
|
|
|
382
383
|
data={args.data || users}
|
|
383
384
|
columns={args.columns || columns}
|
|
384
385
|
selectionMode="single"
|
|
385
|
-
onSelectionChange={
|
|
386
|
+
onSelectionChange={rows => setSelectedRow(rows[0] || null)}
|
|
386
387
|
/>
|
|
387
388
|
{selectedRow && (
|
|
388
389
|
<div className="u-mt-4 u-p-4 u-bg-gray-100 u-rounded u-text-sm">
|
|
389
390
|
<strong>Selected:</strong>
|
|
390
|
-
<pre className="u-mt-2 u-text-xs">
|
|
391
|
-
{JSON.stringify(selectedRow, null, 2)}
|
|
392
|
-
</pre>
|
|
391
|
+
<pre className="u-mt-2 u-text-xs">{JSON.stringify(selectedRow, null, 2)}</pre>
|
|
393
392
|
</div>
|
|
394
393
|
)}
|
|
395
394
|
</div>
|
|
@@ -410,7 +409,7 @@ export const WithRowSelectionSingle: Story = {
|
|
|
410
409
|
};
|
|
411
410
|
|
|
412
411
|
export const WithRowSelectionMultiple: Story = {
|
|
413
|
-
render:
|
|
412
|
+
render: args => {
|
|
414
413
|
const [selectedRows, setSelectedRows] = useState<any[]>([]);
|
|
415
414
|
|
|
416
415
|
return (
|
|
@@ -426,7 +425,11 @@ export const WithRowSelectionMultiple: Story = {
|
|
|
426
425
|
<div className="u-mt-4 u-p-4 u-bg-gray-100 u-rounded u-text-sm">
|
|
427
426
|
<strong>Selected: {selectedRows.length} row(s)</strong>
|
|
428
427
|
<pre className="u-mt-2 u-text-xs">
|
|
429
|
-
{JSON.stringify(
|
|
428
|
+
{JSON.stringify(
|
|
429
|
+
selectedRows.map(r => r.name),
|
|
430
|
+
null,
|
|
431
|
+
2
|
|
432
|
+
)}
|
|
430
433
|
</pre>
|
|
431
434
|
</div>
|
|
432
435
|
)}
|
|
@@ -452,7 +455,7 @@ export const WithRowSelectionMultiple: Story = {
|
|
|
452
455
|
// ========================================
|
|
453
456
|
|
|
454
457
|
export const WithInteractiveRows: Story = {
|
|
455
|
-
render:
|
|
458
|
+
render: args => {
|
|
456
459
|
const [selectedUser, setSelectedUser] = useState<any>(null);
|
|
457
460
|
|
|
458
461
|
const handleRowClick = (row: any) => {
|
|
@@ -461,11 +464,11 @@ export const WithInteractiveRows: Story = {
|
|
|
461
464
|
|
|
462
465
|
return (
|
|
463
466
|
<div>
|
|
464
|
-
<DataTable
|
|
465
|
-
{...args}
|
|
467
|
+
<DataTable
|
|
468
|
+
{...args}
|
|
466
469
|
data={args.data || users}
|
|
467
470
|
columns={args.columns || columns}
|
|
468
|
-
onRowClick={handleRowClick}
|
|
471
|
+
onRowClick={handleRowClick}
|
|
469
472
|
/>
|
|
470
473
|
{selectedUser && (
|
|
471
474
|
<div className="u-mt-4 u-p-4 u-border u-border-gray-300 u-rounded u-bg-white">
|
|
@@ -570,7 +573,8 @@ export const WithColumnVisibilityToggle: Story = {
|
|
|
570
573
|
parameters: {
|
|
571
574
|
docs: {
|
|
572
575
|
description: {
|
|
573
|
-
story:
|
|
576
|
+
story:
|
|
577
|
+
'DataTable with column visibility toggle. Use the Columns button to show/hide columns.',
|
|
574
578
|
},
|
|
575
579
|
},
|
|
576
580
|
},
|
|
@@ -642,7 +646,7 @@ export const CompleteFeatures: Story = {
|
|
|
642
646
|
};
|
|
643
647
|
|
|
644
648
|
export const AllAdvancedFeatures: Story = {
|
|
645
|
-
render:
|
|
649
|
+
render: args => {
|
|
646
650
|
const [selectedRows, setSelectedRows] = useState<any[]>([]);
|
|
647
651
|
|
|
648
652
|
return (
|
|
@@ -652,7 +656,7 @@ export const AllAdvancedFeatures: Story = {
|
|
|
652
656
|
data={args.data || largeDataSet}
|
|
653
657
|
columns={args.columns || columns}
|
|
654
658
|
selectionMode="multiple"
|
|
655
|
-
onSelectionChange={
|
|
659
|
+
onSelectionChange={rows => setSelectedRows(rows)}
|
|
656
660
|
/>
|
|
657
661
|
{selectedRows.length > 0 && (
|
|
658
662
|
<div className="u-mt-4 u-p-4 u-bg-gray-100 u-rounded">
|
|
@@ -686,7 +690,8 @@ export const AllAdvancedFeatures: Story = {
|
|
|
686
690
|
parameters: {
|
|
687
691
|
docs: {
|
|
688
692
|
description: {
|
|
689
|
-
story:
|
|
693
|
+
story:
|
|
694
|
+
'DataTable with all advanced features enabled: selection, filtering, resizing, reordering, visibility toggle, export, and sticky headers.',
|
|
690
695
|
},
|
|
691
696
|
},
|
|
692
697
|
},
|