@shohojdhara/atomix 0.3.14 → 0.4.0
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/CHANGELOG.md +20 -0
- package/build-tools/EXAMPLES.md +372 -0
- package/build-tools/README.md +242 -0
- package/build-tools/__tests__/error-handler.test.js +230 -0
- package/build-tools/__tests__/index.test.js +141 -0
- package/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/build-tools/__tests__/utils.test.js +161 -0
- package/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/build-tools/error-handler.js +308 -0
- package/build-tools/index.d.ts +44 -0
- package/build-tools/index.js +88 -0
- package/build-tools/package.json +50 -0
- package/build-tools/rollup-plugin.js +236 -0
- package/build-tools/types.d.ts +163 -0
- package/build-tools/utils.js +203 -0
- package/build-tools/vite-plugin.js +161 -0
- package/build-tools/webpack-loader.js +123 -0
- package/dist/atomix.css +21044 -2618
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +77 -3
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/EXAMPLES.md +372 -0
- package/dist/build-tools/README.md +242 -0
- package/dist/build-tools/__tests__/error-handler.test.js +230 -0
- package/dist/build-tools/__tests__/index.test.js +141 -0
- package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/dist/build-tools/__tests__/utils.test.js +161 -0
- package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/dist/build-tools/error-handler.js +308 -0
- package/dist/build-tools/index.d.ts +44 -0
- package/dist/build-tools/index.js +88 -0
- package/dist/build-tools/package.json +50 -0
- package/dist/build-tools/rollup-plugin.js +236 -0
- package/dist/build-tools/types.d.ts +163 -0
- package/dist/build-tools/utils.js +203 -0
- package/dist/build-tools/vite-plugin.js +161 -0
- package/dist/build-tools/webpack-loader.js +123 -0
- package/dist/charts.d.ts +1 -1
- package/dist/charts.js +86 -57
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +136 -112
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +2 -5
- package/dist/forms.js +140 -128
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +136 -112
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +152 -78
- package/dist/index.esm.js +346 -340
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +359 -353
- 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 +23 -8
- package/scripts/atomix-cli.js +170 -73
- package/scripts/cli/__tests__/README.md +81 -0
- package/scripts/cli/__tests__/basic.test.js +115 -0
- package/scripts/cli/__tests__/component-generator.test.js +332 -0
- package/scripts/cli/__tests__/integration.test.js +327 -0
- package/scripts/cli/__tests__/test-setup.js +133 -0
- package/scripts/cli/__tests__/token-manager.test.js +251 -0
- package/scripts/cli/__tests__/utils.test.js +161 -0
- package/scripts/cli/component-generator.js +253 -299
- package/scripts/cli/dependency-checker.js +355 -0
- package/scripts/cli/interactive-init.js +46 -5
- package/scripts/cli/template-manager.js +0 -2
- package/scripts/cli/templates/common-templates.js +636 -0
- package/scripts/cli/templates/composable-templates.js +148 -126
- package/scripts/cli/templates/index.js +23 -16
- package/scripts/cli/templates/project-templates.js +151 -23
- package/scripts/cli/templates/react-templates.js +280 -210
- package/scripts/cli/templates/scss-templates.js +90 -91
- package/scripts/cli/templates/testing-templates.js +206 -27
- package/scripts/cli/templates/testing-utils.js +278 -0
- package/scripts/cli/templates/types-templates.js +70 -56
- package/scripts/cli/theme-bridge.js +8 -2
- package/scripts/cli/token-manager.js +318 -206
- package/scripts/cli/utils.js +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +358 -850
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +99 -94
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
- package/src/components/AtomixGlass/glass-utils.ts +6 -5
- package/src/components/AtomixGlass/shader-utils.ts +133 -52
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -36
- package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
- package/src/components/Avatar/Avatar.stories.tsx +195 -0
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +122 -352
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +30 -11
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +142 -23
- package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
- package/src/components/Button/Button.stories.tsx +454 -1126
- package/src/components/Button/Button.test.tsx +123 -0
- package/src/components/Button/Button.tsx +88 -60
- package/src/components/Button/ButtonGroup.stories.tsx +376 -215
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +316 -568
- package/src/components/Card/Card.stories.tsx +292 -81
- 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 +153 -16
- 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 +152 -66
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +114 -7
- package/src/components/DataTable/DataTable.stories.tsx +349 -144
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +310 -1066
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +153 -36
- package/src/components/Dropdown/Dropdown.tsx +313 -299
- package/src/components/EdgePanel/EdgePanel.stories.tsx +221 -25
- package/src/components/EdgePanel/EdgePanel.tsx +1 -3
- package/src/components/Footer/Footer.stories.tsx +396 -327
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.stories.tsx +140 -6
- package/src/components/Form/Checkbox.test.tsx +63 -0
- package/src/components/Form/Checkbox.tsx +122 -78
- package/src/components/Form/Form.stories.tsx +110 -19
- package/src/components/Form/FormGroup.stories.tsx +127 -4
- 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 +146 -17
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.stories.tsx +140 -8
- package/src/components/Form/Select.tsx +184 -182
- package/src/components/Form/Textarea.stories.tsx +149 -6
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +372 -38
- package/src/components/Hero/Hero.tsx +201 -55
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.stories.tsx +141 -3
- package/src/components/List/List.tsx +19 -23
- package/src/components/Modal/Modal.stories.tsx +183 -43
- package/src/components/Modal/Modal.tsx +130 -127
- 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 +354 -97
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +160 -7
- package/src/components/River/River.stories.tsx +3 -2
- package/src/components/SectionIntro/SectionIntro.stories.tsx +239 -47
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +104 -8
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +173 -42
- package/src/components/Tabs/Tabs.stories.tsx +141 -12
- package/src/components/Tabs/Tabs.tsx +74 -72
- package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
- package/src/components/Todo/Todo.stories.tsx +198 -9
- package/src/components/Toggle/Toggle.stories.tsx +137 -36
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +194 -100
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +241 -150
- 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/README.md +2 -2
- package/src/lib/__tests__/theme-tools.test.ts +219 -0
- package/src/lib/composables/index.ts +2 -2
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +126 -97
- package/src/lib/composables/useChartExport.ts +3 -8
- package/src/lib/composables/useDataTable.ts +72 -43
- 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/components.ts +9 -32
- 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 +107 -105
- 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 +172 -71
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +45 -0
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +19 -0
- package/src/lib/utils/dataTableExport.ts +2 -15
- 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 +2 -2
- package/src/styles/01-settings/_index.scss +1 -1
- package/src/styles/01-settings/_settings.accordion.scss +28 -7
- package/src/styles/01-settings/_settings.colors.scss +11 -11
- 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 +4 -4
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +38 -12
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.accordion.scss +56 -14
- 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 +25 -17
- 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/_index.scss +2 -0
- 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 +2 -0
- 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 +45 -0
- package/src/styles/99-utilities/_utilities.text.scss +67 -46
- package/themes/dark-complementary/README.md +98 -0
- package/themes/dark-complementary/index.scss +158 -0
- package/themes/default-light/README.md +81 -0
- package/themes/default-light/index.scss +154 -0
- package/themes/high-contrast/README.md +105 -0
- package/themes/high-contrast/index.scss +172 -0
- package/themes/test-theme/README.md +38 -0
- package/themes/test-theme/index.scss +47 -0
- package/scripts/cli/templates-original-backup.js +0 -1655
- package/scripts/cli/templates_backup.js +0 -684
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
- package/src/lib/composables/useButton.ts +0 -93
- package/src/lib/composables/useCheckbox.ts +0 -70
|
@@ -164,7 +164,8 @@ const MultiAxisChart = memo(
|
|
|
164
164
|
}: ChartRenderContentParams) => {
|
|
165
165
|
if (!datasets.length) return null;
|
|
166
166
|
|
|
167
|
-
const effectiveShowTooltips =
|
|
167
|
+
const effectiveShowTooltips =
|
|
168
|
+
toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? showTooltips ?? true;
|
|
168
169
|
const effectiveShowGrid = toolbarState?.showGrid ?? true; // Grid visibility from toolbar
|
|
169
170
|
|
|
170
171
|
const padding = 60;
|
|
@@ -221,19 +222,19 @@ const MultiAxisChart = memo(
|
|
|
221
222
|
|
|
222
223
|
// Draw grid lines
|
|
223
224
|
if (effectiveShowGrid) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
225
|
+
for (let i = 0; i <= 5; i++) {
|
|
226
|
+
const y = padding + (i / 5) * chartHeight;
|
|
227
|
+
elements.push(
|
|
228
|
+
<line
|
|
229
|
+
key={`grid-${i}`}
|
|
230
|
+
x1={padding}
|
|
231
|
+
y1={y}
|
|
232
|
+
x2={padding + chartWidth}
|
|
233
|
+
y2={y}
|
|
234
|
+
className="c-chart__grid"
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
// Draw datasets
|
|
@@ -253,7 +254,7 @@ const MultiAxisChart = memo(
|
|
|
253
254
|
// Generate line path
|
|
254
255
|
let linePath = '';
|
|
255
256
|
if (points.length > 0) {
|
|
256
|
-
linePath = `M ${points.map(
|
|
257
|
+
linePath = `M ${points.map(p => `${p.x},${p.y}`).join(' L ')}`;
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
// Draw area under line
|
|
@@ -338,7 +339,14 @@ const MultiAxisChart = memo(
|
|
|
338
339
|
|
|
339
340
|
elements.push(
|
|
340
341
|
<g key={`legend-${index}`}>
|
|
341
|
-
<rect
|
|
342
|
+
<rect
|
|
343
|
+
x={legendX}
|
|
344
|
+
y={legendY}
|
|
345
|
+
width="12"
|
|
346
|
+
height="12"
|
|
347
|
+
fill={color}
|
|
348
|
+
className="c-chart__legend-item-color"
|
|
349
|
+
/>
|
|
342
350
|
<text x={legendX + 16} y={legendY + 10} className="c-chart__legend-item-text">
|
|
343
351
|
{dataset.label}
|
|
344
352
|
</text>
|
|
@@ -282,23 +282,25 @@ const RadarChart = memo(
|
|
|
282
282
|
{dataPaths}
|
|
283
283
|
{axisLabels}
|
|
284
284
|
</g>
|
|
285
|
-
{showTooltips &&
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
renderedDatasets[hoveredPoint.datasetIndex]?.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
285
|
+
{showTooltips &&
|
|
286
|
+
hoveredPoint &&
|
|
287
|
+
renderedDatasets[hoveredPoint.datasetIndex]?.data?.[hoveredPoint.pointIndex] && (
|
|
288
|
+
<ChartTooltip
|
|
289
|
+
dataPoint={
|
|
290
|
+
renderedDatasets[hoveredPoint.datasetIndex]!.data![hoveredPoint.pointIndex]!
|
|
291
|
+
}
|
|
292
|
+
datasetLabel={renderedDatasets[hoveredPoint.datasetIndex]?.label}
|
|
293
|
+
datasetColor={
|
|
294
|
+
renderedDatasets[hoveredPoint.datasetIndex]?.color ||
|
|
295
|
+
colors[hoveredPoint.datasetIndex]
|
|
296
|
+
}
|
|
297
|
+
position={{
|
|
298
|
+
x: hoveredPoint.clientX,
|
|
299
|
+
y: hoveredPoint.clientY,
|
|
300
|
+
}}
|
|
301
|
+
visible={true}
|
|
302
|
+
/>
|
|
303
|
+
)}
|
|
302
304
|
</>
|
|
303
305
|
);
|
|
304
306
|
};
|
|
@@ -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
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
2
3
|
import { useState } from 'react';
|
|
3
4
|
import { ColorModeToggle, type ColorMode } from './ColorModeToggle';
|
|
4
5
|
import { Moon, Sun } from '@phosphor-icons/react';
|
|
@@ -10,33 +11,132 @@ const meta = {
|
|
|
10
11
|
layout: 'centered',
|
|
11
12
|
docs: {
|
|
12
13
|
description: {
|
|
13
|
-
component:
|
|
14
|
-
|
|
14
|
+
component: `
|
|
15
|
+
# ColorModeToggle
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The ColorModeToggle component provides a user-friendly switch for toggling between light and dark color modes. It automatically detects system preferences, persists user choices, and provides visual feedback. Essential for applications supporting theme customization and accessibility preferences.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- Automatic detection of system preference
|
|
24
|
+
- Local storage persistence
|
|
25
|
+
- Multiple size options
|
|
26
|
+
- Customizable icons
|
|
27
|
+
- Accessible design
|
|
28
|
+
- Controlled/uncontrolled modes
|
|
29
|
+
|
|
30
|
+
## Accessibility
|
|
31
|
+
|
|
32
|
+
- Keyboard support: Toggle can be activated using Space or Enter keys
|
|
33
|
+
- Screen reader: Announces current mode and change events
|
|
34
|
+
- ARIA support: Proper roles and properties for assistive technologies
|
|
35
|
+
- Focus management: Maintains visible focus indicator
|
|
36
|
+
|
|
37
|
+
## Usage Examples
|
|
38
|
+
|
|
39
|
+
### Basic Usage
|
|
40
|
+
|
|
41
|
+
\`\`\`tsx
|
|
42
|
+
<ColorModeToggle />
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
### Controlled Mode
|
|
46
|
+
|
|
47
|
+
\`\`\`tsx
|
|
48
|
+
<ColorModeToggle value={mode} onChange={setMode} />
|
|
49
|
+
\`\`\`
|
|
50
|
+
|
|
51
|
+
## API Reference
|
|
52
|
+
|
|
53
|
+
### Props
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Default | Description |
|
|
56
|
+
| ---- | ---- | ------- | ----------- |
|
|
57
|
+
| size | 'sm' \\| 'md' \\| 'lg' | 'md' | Size variant of the toggle |
|
|
58
|
+
| disabled | boolean | false | Whether the toggle is disabled |
|
|
59
|
+
| showTooltip | boolean | false | Whether to show tooltip on hover |
|
|
60
|
+
| disableStorage | boolean | false | Whether to disable localStorage persistence |
|
|
61
|
+
| disableSystemPreference | boolean | false | Whether to disable system preference detection |
|
|
62
|
+
| value | 'light' \\| 'dark' \\| 'system' | - | Controlled value of the toggle |
|
|
63
|
+
| onChange | (mode: ColorMode) => void | - | Callback when mode changes |
|
|
64
|
+
| lightIcon | ReactNode | Default sun icon | Custom icon for light mode |
|
|
65
|
+
| darkIcon | ReactNode | Default moon icon | Custom icon for dark mode |
|
|
66
|
+
`,
|
|
15
67
|
},
|
|
16
68
|
},
|
|
17
69
|
},
|
|
18
70
|
tags: ['autodocs'],
|
|
19
71
|
argTypes: {
|
|
20
72
|
size: {
|
|
21
|
-
control: 'select',
|
|
73
|
+
control: { type: 'select' },
|
|
22
74
|
options: ['sm', 'md', 'lg'],
|
|
23
75
|
description: 'Size variant',
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: '"sm" | "md" | "lg"' },
|
|
78
|
+
defaultValue: { summary: 'md' },
|
|
79
|
+
},
|
|
24
80
|
},
|
|
25
81
|
disabled: {
|
|
26
82
|
control: 'boolean',
|
|
27
83
|
description: 'Disable the toggle',
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: 'boolean' },
|
|
86
|
+
defaultValue: { summary: false },
|
|
87
|
+
},
|
|
28
88
|
},
|
|
29
89
|
showTooltip: {
|
|
30
90
|
control: 'boolean',
|
|
31
91
|
description: 'Show tooltip on hover',
|
|
92
|
+
table: {
|
|
93
|
+
type: { summary: 'boolean' },
|
|
94
|
+
defaultValue: { summary: false },
|
|
95
|
+
},
|
|
32
96
|
},
|
|
33
97
|
disableStorage: {
|
|
34
98
|
control: 'boolean',
|
|
35
99
|
description: 'Disable localStorage persistence',
|
|
100
|
+
table: {
|
|
101
|
+
type: { summary: 'boolean' },
|
|
102
|
+
defaultValue: { summary: false },
|
|
103
|
+
},
|
|
36
104
|
},
|
|
37
105
|
disableSystemPreference: {
|
|
38
106
|
control: 'boolean',
|
|
39
107
|
description: 'Disable system preference detection',
|
|
108
|
+
table: {
|
|
109
|
+
type: { summary: 'boolean' },
|
|
110
|
+
defaultValue: { summary: false },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
value: {
|
|
114
|
+
control: { type: 'radio', options: ['light', 'dark', 'system'] },
|
|
115
|
+
description: 'Controlled value of the toggle',
|
|
116
|
+
table: {
|
|
117
|
+
type: { summary: '"light" | "dark" | "system"' },
|
|
118
|
+
defaultValue: { summary: '-' },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
onChange: {
|
|
122
|
+
action: 'mode changed',
|
|
123
|
+
description: 'Callback when mode changes',
|
|
124
|
+
},
|
|
125
|
+
lightIcon: {
|
|
126
|
+
control: 'object',
|
|
127
|
+
description: 'Custom icon for light mode',
|
|
128
|
+
table: {
|
|
129
|
+
type: { summary: 'ReactNode' },
|
|
130
|
+
defaultValue: { summary: 'Default sun icon' },
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
darkIcon: {
|
|
134
|
+
control: 'object',
|
|
135
|
+
description: 'Custom icon for dark mode',
|
|
136
|
+
table: {
|
|
137
|
+
type: { summary: 'ReactNode' },
|
|
138
|
+
defaultValue: { summary: 'Default moon icon' },
|
|
139
|
+
},
|
|
40
140
|
},
|
|
41
141
|
},
|
|
42
142
|
} satisfies Meta<typeof ColorModeToggle>;
|
|
@@ -44,13 +144,18 @@ const meta = {
|
|
|
44
144
|
export default meta;
|
|
45
145
|
type Story = StoryObj<typeof meta>;
|
|
46
146
|
|
|
47
|
-
|
|
48
|
-
export const Default: Story = {
|
|
147
|
+
export const BasicUsage: Story = {
|
|
49
148
|
args: {},
|
|
149
|
+
parameters: {
|
|
150
|
+
docs: {
|
|
151
|
+
description: {
|
|
152
|
+
story: 'Default Color Mode Toggle with automatic system preference detection.',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
50
156
|
};
|
|
51
157
|
|
|
52
|
-
|
|
53
|
-
export const Sizes: Story = {
|
|
158
|
+
export const AllSizes: Story = {
|
|
54
159
|
render: () => (
|
|
55
160
|
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
|
56
161
|
<ColorModeToggle size="sm" />
|
|
@@ -58,17 +163,29 @@ export const Sizes: Story = {
|
|
|
58
163
|
<ColorModeToggle size="lg" />
|
|
59
164
|
</div>
|
|
60
165
|
),
|
|
166
|
+
parameters: {
|
|
167
|
+
docs: {
|
|
168
|
+
description: {
|
|
169
|
+
story: 'Color Mode Toggle in all available sizes.',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
61
173
|
};
|
|
62
174
|
|
|
63
|
-
|
|
64
|
-
export const Disabled: Story = {
|
|
175
|
+
export const DisabledState: Story = {
|
|
65
176
|
args: {
|
|
66
177
|
disabled: true,
|
|
67
178
|
},
|
|
179
|
+
parameters: {
|
|
180
|
+
docs: {
|
|
181
|
+
description: {
|
|
182
|
+
story: 'Disabled state of the Color Mode Toggle.',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
68
186
|
};
|
|
69
187
|
|
|
70
|
-
|
|
71
|
-
export const Controlled: Story = {
|
|
188
|
+
export const ControlledMode: Story = {
|
|
72
189
|
render: () => {
|
|
73
190
|
const [mode, setMode] = useState<ColorMode>('light');
|
|
74
191
|
return (
|
|
@@ -81,9 +198,15 @@ export const Controlled: Story = {
|
|
|
81
198
|
</div>
|
|
82
199
|
);
|
|
83
200
|
},
|
|
201
|
+
parameters: {
|
|
202
|
+
docs: {
|
|
203
|
+
description: {
|
|
204
|
+
story: 'Controlled mode example with external state management.',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
84
208
|
};
|
|
85
209
|
|
|
86
|
-
// Custom Icons
|
|
87
210
|
export const CustomIcons: Story = {
|
|
88
211
|
render: () => (
|
|
89
212
|
<ColorModeToggle
|
|
@@ -91,71 +214,34 @@ export const CustomIcons: Story = {
|
|
|
91
214
|
darkIcon={<Sun size={24} weight="fill" />}
|
|
92
215
|
/>
|
|
93
216
|
),
|
|
217
|
+
parameters: {
|
|
218
|
+
docs: {
|
|
219
|
+
description: {
|
|
220
|
+
story: 'Color Mode Toggle with custom icons.',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
94
224
|
};
|
|
95
225
|
|
|
96
|
-
// With Callback
|
|
97
226
|
export const WithCallback: Story = {
|
|
98
227
|
render: () => {
|
|
99
228
|
const [lastChanged, setLastChanged] = useState<string>('');
|
|
100
229
|
return (
|
|
101
230
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', alignItems: 'center' }}>
|
|
102
231
|
<ColorModeToggle
|
|
103
|
-
onChange={
|
|
232
|
+
onChange={mode =>
|
|
233
|
+
setLastChanged(`Mode changed to ${mode} at ${new Date().toLocaleTimeString()}`)
|
|
234
|
+
}
|
|
104
235
|
/>
|
|
105
|
-
{lastChanged && <p
|
|
236
|
+
{lastChanged && <p>Last changed: {lastChanged}</p>}
|
|
106
237
|
</div>
|
|
107
238
|
);
|
|
108
239
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
dataAttribute: 'data-theme',
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// Without Storage
|
|
120
|
-
export const WithoutStorage: Story = {
|
|
121
|
-
args: {
|
|
122
|
-
disableStorage: true,
|
|
240
|
+
parameters: {
|
|
241
|
+
docs: {
|
|
242
|
+
description: {
|
|
243
|
+
story: 'Color Mode Toggle with change callback.',
|
|
244
|
+
},
|
|
245
|
+
},
|
|
123
246
|
},
|
|
124
247
|
};
|
|
125
|
-
|
|
126
|
-
// Example Usage in Header
|
|
127
|
-
export const InHeader: Story = {
|
|
128
|
-
render: () => (
|
|
129
|
-
<div
|
|
130
|
-
className="u-p-5 u-shadow u-flex u-justify-between u-items-center"
|
|
131
|
-
style={{ width: '400px', borderRadius: '8px' }}
|
|
132
|
-
>
|
|
133
|
-
<span style={{ fontWeight: 600 }}>Toggle Theme</span>
|
|
134
|
-
<ColorModeToggle />
|
|
135
|
-
</div>
|
|
136
|
-
),
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// Multiple Toggles
|
|
140
|
-
export const MultipleToggles: Story = {
|
|
141
|
-
render: () => (
|
|
142
|
-
<div style={{ display: 'flex', gap: '2rem' }}>
|
|
143
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5rem', alignItems: 'center' }}>
|
|
144
|
-
<ColorModeToggle size="sm" />
|
|
145
|
-
<span style={{ fontSize: '0.75rem' }}>Small</span>
|
|
146
|
-
</div>
|
|
147
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5rem', alignItems: 'center' }}>
|
|
148
|
-
<ColorModeToggle size="md" />
|
|
149
|
-
<span style={{ fontSize: '0.75rem' }}>Medium</span>
|
|
150
|
-
</div>
|
|
151
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5rem', alignItems: 'center' }}>
|
|
152
|
-
<ColorModeToggle size="lg" />
|
|
153
|
-
<span style={{ fontSize: '0.75rem' }}>Large</span>
|
|
154
|
-
</div>
|
|
155
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.5rem', alignItems: 'center' }}>
|
|
156
|
-
<ColorModeToggle disabled />
|
|
157
|
-
<span style={{ fontSize: '0.75rem' }}>Disabled</span>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
),
|
|
161
|
-
};
|
|
@@ -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
|
};
|