@shohojdhara/atomix 0.3.5 → 0.3.7
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/README.md +101 -199
- package/atomix.config.ts +241 -0
- package/dist/atomix.css +260 -179
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +250 -179
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.js +69 -166
- package/dist/charts.js.map +1 -1
- package/dist/core.js +184 -263
- package/dist/core.js.map +1 -1
- package/dist/forms.js +55 -131
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +184 -263
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +1831 -1657
- package/dist/index.esm.js +4497 -4318
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4510 -4328
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/theme.d.ts +1431 -1472
- package/dist/theme.js +4175 -4138
- package/dist/theme.js.map +1 -1
- package/package.json +6 -20
- package/src/components/Accordion/Accordion.stories.tsx +50 -17
- package/src/components/AtomixGlass/AtomixGlass.tsx +128 -322
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +12 -5
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Badge/Badge.stories.tsx +91 -13
- package/src/components/Block/Block.stories.tsx +7 -23
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
- package/src/components/Button/Button.stories.tsx +141 -22
- package/src/components/Button/Button.tsx +85 -167
- package/src/components/Button/ButtonGroup.stories.tsx +315 -0
- package/src/components/Button/ButtonGroup.tsx +67 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Callout/Callout.stories.tsx +8 -6
- package/src/components/Card/Card.stories.tsx +82 -28
- package/src/components/Chart/AnimatedChart.tsx +0 -1
- package/src/components/Chart/AreaChart.tsx +0 -1
- package/src/components/Chart/BarChart.tsx +0 -1
- package/src/components/Chart/BubbleChart.tsx +0 -1
- package/src/components/Chart/CandlestickChart.tsx +0 -1
- package/src/components/Chart/Chart.stories.tsx +5 -7
- package/src/components/Chart/Chart.tsx +0 -16
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +0 -1
- package/src/components/Chart/FunnelChart.tsx +0 -1
- package/src/components/Chart/GaugeChart.tsx +0 -1
- package/src/components/Chart/HeatmapChart.tsx +0 -1
- package/src/components/Chart/LineChart.tsx +0 -1
- package/src/components/Chart/MultiAxisChart.tsx +0 -1
- package/src/components/Chart/PieChart.tsx +0 -1
- package/src/components/Chart/RadarChart.tsx +0 -1
- package/src/components/Chart/ScatterChart.tsx +0 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -1
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
- package/src/components/DataTable/DataTable.stories.tsx +23 -16
- package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
- package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
- package/src/components/Footer/Footer.stories.tsx +8 -6
- package/src/components/Footer/FooterLink.tsx +9 -2
- package/src/components/Form/Checkbox.stories.tsx +7 -0
- package/src/components/Form/Form.stories.tsx +7 -0
- package/src/components/Form/FormGroup.stories.tsx +9 -1
- package/src/components/Form/Input.stories.tsx +69 -16
- package/src/components/Form/Radio.stories.tsx +9 -1
- package/src/components/Form/Select.stories.tsx +9 -1
- package/src/components/Form/Textarea.stories.tsx +10 -2
- package/src/components/Hero/Hero.stories.tsx +7 -0
- package/src/components/List/List.stories.tsx +7 -0
- package/src/components/Messages/Messages.stories.tsx +8 -7
- package/src/components/Modal/Modal.stories.tsx +17 -6
- package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +188 -111
- package/src/components/Pagination/Pagination.tsx +83 -3
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
- package/src/components/Popover/Popover.stories.tsx +191 -115
- package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
- package/src/components/Progress/Progress.stories.tsx +79 -49
- package/src/components/Rating/Rating.stories.tsx +109 -84
- package/src/components/River/River.stories.tsx +194 -114
- package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
- package/src/components/Slider/Slider.stories.tsx +7 -0
- package/src/components/Spinner/Spinner.stories.tsx +15 -11
- package/src/components/Steps/Steps.stories.tsx +132 -98
- package/src/components/Tabs/Tabs.stories.tsx +163 -112
- package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
- package/src/components/Todo/Todo.stories.tsx +38 -12
- package/src/components/Toggle/Toggle.stories.tsx +61 -28
- package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
- package/src/components/Upload/Upload.stories.tsx +122 -84
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
- package/src/components/index.ts +1 -0
- package/src/lib/composables/useAtomixGlass.ts +9 -10
- package/src/lib/composables/useNavbar.ts +0 -10
- package/src/lib/config/loader.ts +4 -4
- package/src/lib/constants/components.ts +17 -0
- package/src/lib/hooks/useComponentCustomization.ts +1 -1
- package/src/lib/hooks/usePerformanceMonitor.ts +1 -1
- package/src/lib/hooks/useThemeTokens.ts +105 -0
- package/src/lib/theme/README.md +174 -0
- package/src/lib/theme/adapters/index.ts +31 -0
- package/src/lib/theme/adapters/themeAdapter.ts +287 -0
- package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
- package/src/lib/theme/config/configLoader.ts +95 -0
- package/src/lib/theme/config/loader.ts +37 -54
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +15 -91
- package/src/lib/theme/{constants.ts → constants/constants.ts} +1 -19
- package/src/lib/theme/constants/index.ts +8 -0
- package/src/lib/theme/core/ThemeRegistry.ts +75 -266
- package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
- package/src/lib/theme/core/composeTheme.ts +105 -0
- package/src/lib/theme/core/createTheme.ts +108 -0
- package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +12 -8
- package/src/lib/theme/core/index.ts +19 -19
- package/src/lib/theme/devtools/Comparator.tsx +346 -22
- package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
- package/src/lib/theme/devtools/Inspector.tsx +335 -51
- package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
- package/src/lib/theme/devtools/Preview.tsx +471 -221
- package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
- package/src/lib/theme/devtools/index.ts +14 -4
- package/src/lib/theme/devtools/useHistory.ts +130 -0
- package/src/lib/theme/{errors.ts → errors/errors.ts} +1 -1
- package/src/lib/theme/errors/index.ts +12 -0
- package/src/lib/theme/generators/cssFile.ts +79 -0
- package/src/lib/theme/generators/generateCSS.ts +89 -0
- package/src/lib/theme/generators/generateCSSNested.ts +130 -0
- package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
- package/src/lib/theme/generators/index.ts +25 -0
- package/src/lib/theme/i18n/rtl.ts +5 -6
- package/src/lib/theme/index.ts +149 -19
- package/src/lib/theme/runtime/ThemeApplicator.ts +53 -112
- package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +5 -5
- package/src/lib/theme/runtime/ThemeProvider.tsx +266 -282
- package/src/lib/theme/runtime/index.ts +2 -2
- package/src/lib/theme/runtime/useTheme.ts +1 -2
- package/src/lib/theme/runtime/useThemeTokens.ts +131 -0
- package/src/lib/theme/test/testTheme.ts +385 -0
- package/src/lib/theme/tokens/index.ts +12 -0
- package/src/lib/theme/tokens/tokens.ts +721 -0
- package/src/lib/theme/types.ts +6 -42
- package/src/lib/theme/utils/componentTheming.ts +132 -0
- package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
- package/src/lib/theme/utils/index.ts +11 -0
- package/src/lib/theme/utils/injectCSS.ts +90 -0
- package/src/lib/theme/utils/naming.ts +100 -0
- package/src/lib/theme/utils/themeHelpers.ts +78 -0
- package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +7 -7
- package/src/lib/theme-tools.ts +7 -8
- package/src/lib/types/components.ts +40 -130
- package/src/lib/utils/componentUtils.ts +2 -2
- package/src/lib/utils/memoryMonitor.ts +3 -3
- package/src/lib/utils/themeNaming.ts +135 -0
- package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
- package/src/styles/02-tools/_tools.button.scss +66 -79
- package/src/styles/06-components/_components.atomix-glass.scss +13 -3
- package/src/styles/06-components/_components.pagination.scss +88 -0
- package/scripts/sync-theme-config.js +0 -309
- package/src/lib/theme/composeTheme.ts +0 -370
- package/src/lib/theme/core/ThemeCache.ts +0 -283
- package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
- package/src/lib/theme/core/ThemeEngine.ts +0 -665
- package/src/lib/theme/createThemeFromConfig.ts +0 -132
- package/src/lib/theme/devtools/CLI.ts +0 -364
- package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
- package/src/lib/theme/runtime/ThemeManager.ts +0 -446
- package/src/styles/03-generic/_generated-root.css +0 -26
- package/src/themes/README.md +0 -442
- package/src/themes/themes.config.js +0 -68
- /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1627,6 +1627,31 @@ interface ButtonProps extends BaseComponentProps {
|
|
|
1627
1627
|
*/
|
|
1628
1628
|
style?: React.CSSProperties;
|
|
1629
1629
|
}
|
|
1630
|
+
/**
|
|
1631
|
+
* ButtonGroup component properties
|
|
1632
|
+
*/
|
|
1633
|
+
interface ButtonGroupProps extends BaseComponentProps {
|
|
1634
|
+
/**
|
|
1635
|
+
* ButtonGroup children (should be Button components)
|
|
1636
|
+
*/
|
|
1637
|
+
children?: ReactNode;
|
|
1638
|
+
/**
|
|
1639
|
+
* Additional CSS class names
|
|
1640
|
+
*/
|
|
1641
|
+
className?: string;
|
|
1642
|
+
/**
|
|
1643
|
+
* Inline style for the component root element
|
|
1644
|
+
*/
|
|
1645
|
+
style?: React.CSSProperties;
|
|
1646
|
+
/**
|
|
1647
|
+
* ARIA label for accessibility
|
|
1648
|
+
*/
|
|
1649
|
+
'aria-label'?: string;
|
|
1650
|
+
/**
|
|
1651
|
+
* ARIA role for the button group
|
|
1652
|
+
*/
|
|
1653
|
+
role?: string;
|
|
1654
|
+
}
|
|
1630
1655
|
/**
|
|
1631
1656
|
* Badge component properties
|
|
1632
1657
|
*/
|
|
@@ -1689,52 +1714,6 @@ interface BadgeProps extends BaseComponentProps {
|
|
|
1689
1714
|
label?: SlotProps<BadgeLabelSlotProps>;
|
|
1690
1715
|
};
|
|
1691
1716
|
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Block component properties (legacy - use BlockProps from component instead)
|
|
1694
|
-
* @deprecated Use BlockProps from '@atomix/components/Block' instead
|
|
1695
|
-
*/
|
|
1696
|
-
interface LegacyBlockProps extends BaseComponentProps {
|
|
1697
|
-
/**
|
|
1698
|
-
* The content to be rendered within the block
|
|
1699
|
-
*/
|
|
1700
|
-
children: ReactNode;
|
|
1701
|
-
/**
|
|
1702
|
-
* The HTML element to render as
|
|
1703
|
-
* @default 'section'
|
|
1704
|
-
*/
|
|
1705
|
-
as?: 'section' | 'div' | 'article' | 'aside' | 'main';
|
|
1706
|
-
/**
|
|
1707
|
-
* Spacing size for vertical padding
|
|
1708
|
-
* @default 'md'
|
|
1709
|
-
*/
|
|
1710
|
-
spacing?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
1711
|
-
/**
|
|
1712
|
-
* Container configuration
|
|
1713
|
-
*/
|
|
1714
|
-
container?: {
|
|
1715
|
-
/**
|
|
1716
|
-
* Container type for content width
|
|
1717
|
-
*/
|
|
1718
|
-
type?: 'sm' | 'md' | 'lg' | 'xl' | 'fluid';
|
|
1719
|
-
/**
|
|
1720
|
-
* Additional container classes
|
|
1721
|
-
*/
|
|
1722
|
-
className?: string;
|
|
1723
|
-
};
|
|
1724
|
-
/**
|
|
1725
|
-
* Whether to enable full-width content
|
|
1726
|
-
* @default false
|
|
1727
|
-
*/
|
|
1728
|
-
fullWidth?: boolean;
|
|
1729
|
-
/**
|
|
1730
|
-
* Background color variant
|
|
1731
|
-
*/
|
|
1732
|
-
background?: 'primary' | 'secondary' | 'tertiary' | 'invert' | 'brand' | 'error' | 'success' | 'warning' | 'info' | 'light';
|
|
1733
|
-
/**
|
|
1734
|
-
* Custom style for the block
|
|
1735
|
-
*/
|
|
1736
|
-
style?: React.CSSProperties;
|
|
1737
|
-
}
|
|
1738
1717
|
/**
|
|
1739
1718
|
* Callout component properties
|
|
1740
1719
|
*/
|
|
@@ -2068,36 +2047,6 @@ type IconWeight$1 = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
|
|
|
2068
2047
|
* Phosphor icon type - excludes internal Phosphor exports
|
|
2069
2048
|
*/
|
|
2070
2049
|
type PhosphorIconsType$1 = Exclude<keyof typeof _phosphor_icons_react, 'IconContext' | 'IconBase' | 'createIcon' | 'default' | 'SSR'>;
|
|
2071
|
-
/**
|
|
2072
|
-
* Icon component properties (legacy - use IconProps from component instead)
|
|
2073
|
-
* @deprecated Use IconProps from '@atomix/components/Icon' instead
|
|
2074
|
-
*/
|
|
2075
|
-
interface LegacyIconProps extends BaseComponentProps {
|
|
2076
|
-
/**
|
|
2077
|
-
* Icon name from Phosphor Icons
|
|
2078
|
-
*/
|
|
2079
|
-
name: PhosphorIconsType$1;
|
|
2080
|
-
/**
|
|
2081
|
-
* Icon size
|
|
2082
|
-
*/
|
|
2083
|
-
size?: IconSize$1 | number;
|
|
2084
|
-
/**
|
|
2085
|
-
* Icon weight/style
|
|
2086
|
-
*/
|
|
2087
|
-
weight?: IconWeight$1;
|
|
2088
|
-
/**
|
|
2089
|
-
* Icon color
|
|
2090
|
-
*/
|
|
2091
|
-
color?: string;
|
|
2092
|
-
/**
|
|
2093
|
-
* Alt text for accessibility
|
|
2094
|
-
*/
|
|
2095
|
-
alt?: string;
|
|
2096
|
-
/**
|
|
2097
|
-
* Custom style
|
|
2098
|
-
*/
|
|
2099
|
-
style?: React.CSSProperties;
|
|
2100
|
-
}
|
|
2101
2050
|
/**
|
|
2102
2051
|
* Navbar position options
|
|
2103
2052
|
*/
|
|
@@ -2694,6 +2643,14 @@ interface PaginationProps extends BaseComponentProps {
|
|
|
2694
2643
|
* Whether to show previous/next page buttons
|
|
2695
2644
|
*/
|
|
2696
2645
|
showPrevNextButtons?: boolean;
|
|
2646
|
+
/**
|
|
2647
|
+
* Whether to show search input for jumping to a specific page
|
|
2648
|
+
*/
|
|
2649
|
+
showSearch?: boolean;
|
|
2650
|
+
/**
|
|
2651
|
+
* Placeholder text for the search input
|
|
2652
|
+
*/
|
|
2653
|
+
searchPlaceholder?: string;
|
|
2697
2654
|
/**
|
|
2698
2655
|
* Custom class for the pagination container
|
|
2699
2656
|
*/
|
|
@@ -3555,32 +3512,6 @@ interface BreadcrumbItem$1 {
|
|
|
3555
3512
|
*/
|
|
3556
3513
|
className?: string;
|
|
3557
3514
|
}
|
|
3558
|
-
/**
|
|
3559
|
-
* Breadcrumb component properties (legacy - use BreadcrumbProps from component instead)
|
|
3560
|
-
* @deprecated Use BreadcrumbProps from '@atomix/components/Breadcrumb' instead
|
|
3561
|
-
*/
|
|
3562
|
-
interface LegacyBreadcrumbProps extends BaseComponentProps {
|
|
3563
|
-
/**
|
|
3564
|
-
* Array of breadcrumb items
|
|
3565
|
-
*/
|
|
3566
|
-
items: BreadcrumbItem$1[];
|
|
3567
|
-
/**
|
|
3568
|
-
* Custom divider character or element
|
|
3569
|
-
*/
|
|
3570
|
-
divider?: ReactNode;
|
|
3571
|
-
/**
|
|
3572
|
-
* Aria label for the navigation
|
|
3573
|
-
*/
|
|
3574
|
-
ariaLabel?: string;
|
|
3575
|
-
/**
|
|
3576
|
-
* Optional custom link component
|
|
3577
|
-
*/
|
|
3578
|
-
LinkComponent?: React.ElementType;
|
|
3579
|
-
/**
|
|
3580
|
-
* Custom style for the breadcrumb
|
|
3581
|
-
*/
|
|
3582
|
-
style?: React.CSSProperties;
|
|
3583
|
-
}
|
|
3584
3515
|
/**
|
|
3585
3516
|
* Breadcrumb options interface (for vanilla JS)
|
|
3586
3517
|
*/
|
|
@@ -8275,6 +8206,7 @@ type __lib_types_AvatarSize = AvatarSize;
|
|
|
8275
8206
|
type __lib_types_BadgeProps = BadgeProps;
|
|
8276
8207
|
type __lib_types_BaseComponentProps = BaseComponentProps;
|
|
8277
8208
|
type __lib_types_BreadcrumbInstance = BreadcrumbInstance;
|
|
8209
|
+
type __lib_types_ButtonGroupProps = ButtonGroupProps;
|
|
8278
8210
|
type __lib_types_ButtonProps = ButtonProps;
|
|
8279
8211
|
type __lib_types_CalloutProps = CalloutProps;
|
|
8280
8212
|
type __lib_types_CardProps = CardProps;
|
|
@@ -8311,9 +8243,6 @@ type __lib_types_HeroProps = HeroProps;
|
|
|
8311
8243
|
type __lib_types_IconPosition = IconPosition;
|
|
8312
8244
|
type __lib_types_ImageType = ImageType;
|
|
8313
8245
|
type __lib_types_InputProps = InputProps;
|
|
8314
|
-
type __lib_types_LegacyBlockProps = LegacyBlockProps;
|
|
8315
|
-
type __lib_types_LegacyBreadcrumbProps = LegacyBreadcrumbProps;
|
|
8316
|
-
type __lib_types_LegacyIconProps = LegacyIconProps;
|
|
8317
8246
|
type __lib_types_ListProps = ListProps;
|
|
8318
8247
|
type __lib_types_MegaMenuColumnProps = MegaMenuColumnProps;
|
|
8319
8248
|
type __lib_types_MegaMenuLinkProps = MegaMenuLinkProps;
|
|
@@ -8379,7 +8308,7 @@ type __lib_types_VideoQuality = VideoQuality;
|
|
|
8379
8308
|
type __lib_types_VideoSubtitle = VideoSubtitle;
|
|
8380
8309
|
type __lib_types_listvariant = listvariant;
|
|
8381
8310
|
declare namespace __lib_types {
|
|
8382
|
-
export type { AccordionProps$1 as AccordionProps, __lib_types_AccordionState as AccordionState, __lib_types_AtomixGlassProps as AtomixGlassProps, __lib_types_AvatarGroupProps as AvatarGroupProps, __lib_types_AvatarProps as AvatarProps, __lib_types_AvatarSize as AvatarSize, __lib_types_BadgeProps as BadgeProps, __lib_types_BaseComponentProps as BaseComponentProps, __lib_types_BreadcrumbInstance as BreadcrumbInstance, BreadcrumbItem$1 as BreadcrumbItem, BreadcrumbOptions$1 as BreadcrumbOptions, __lib_types_ButtonProps as ButtonProps, __lib_types_CalloutProps as CalloutProps, __lib_types_CardProps as CardProps, ChartAxis$1 as ChartAxis, ChartConfig$1 as ChartConfig, ChartDataPoint$1 as ChartDataPoint, ChartDataset$1 as ChartDataset, ChartProps$1 as ChartProps, ChartSize$1 as ChartSize, ChartType$1 as ChartType, __lib_types_CheckboxProps as CheckboxProps, __lib_types_CodeBlockProps as CodeBlockProps, __lib_types_DataTableColumn as DataTableColumn, __lib_types_DataTableProps as DataTableProps, __lib_types_DisplacementMode as DisplacementMode, __lib_types_DropdownDividerProps as DropdownDividerProps, __lib_types_DropdownHeaderProps as DropdownHeaderProps, __lib_types_DropdownItemProps as DropdownItemProps, __lib_types_DropdownPlacement as DropdownPlacement, __lib_types_DropdownProps as DropdownProps, __lib_types_DropdownTrigger as DropdownTrigger, __lib_types_EdgePanelMode as EdgePanelMode, __lib_types_EdgePanelPosition as EdgePanelPosition, __lib_types_EdgePanelProps as EdgePanelProps, __lib_types_ElementRefs as ElementRefs, __lib_types_ElevationCardProps as ElevationCardProps, __lib_types_FooterLayout as FooterLayout, __lib_types_FooterLinkProps as FooterLinkProps, __lib_types_FooterProps as FooterProps, __lib_types_FooterSectionProps as FooterSectionProps, __lib_types_FooterSocialLinkProps as FooterSocialLinkProps, __lib_types_FormGroupProps as FormGroupProps, __lib_types_FormProps as FormProps, __lib_types_GlassContainerProps as GlassContainerProps, __lib_types_GlassMode as GlassMode, __lib_types_GlassSize as GlassSize, __lib_types_HeroAlignment as HeroAlignment, __lib_types_HeroBackgroundSlide as HeroBackgroundSlide, __lib_types_HeroBackgroundSliderConfig as HeroBackgroundSliderConfig, __lib_types_HeroProps as HeroProps, __lib_types_IconPosition as IconPosition, IconSize$1 as IconSize, IconWeight$1 as IconWeight, __lib_types_ImageType as ImageType, __lib_types_InputProps as InputProps,
|
|
8311
|
+
export type { AccordionProps$1 as AccordionProps, __lib_types_AccordionState as AccordionState, __lib_types_AtomixGlassProps as AtomixGlassProps, __lib_types_AvatarGroupProps as AvatarGroupProps, __lib_types_AvatarProps as AvatarProps, __lib_types_AvatarSize as AvatarSize, __lib_types_BadgeProps as BadgeProps, __lib_types_BaseComponentProps as BaseComponentProps, __lib_types_BreadcrumbInstance as BreadcrumbInstance, BreadcrumbItem$1 as BreadcrumbItem, BreadcrumbOptions$1 as BreadcrumbOptions, __lib_types_ButtonGroupProps as ButtonGroupProps, __lib_types_ButtonProps as ButtonProps, __lib_types_CalloutProps as CalloutProps, __lib_types_CardProps as CardProps, ChartAxis$1 as ChartAxis, ChartConfig$1 as ChartConfig, ChartDataPoint$1 as ChartDataPoint, ChartDataset$1 as ChartDataset, ChartProps$1 as ChartProps, ChartSize$1 as ChartSize, ChartType$1 as ChartType, __lib_types_CheckboxProps as CheckboxProps, __lib_types_CodeBlockProps as CodeBlockProps, __lib_types_DataTableColumn as DataTableColumn, __lib_types_DataTableProps as DataTableProps, __lib_types_DisplacementMode as DisplacementMode, __lib_types_DropdownDividerProps as DropdownDividerProps, __lib_types_DropdownHeaderProps as DropdownHeaderProps, __lib_types_DropdownItemProps as DropdownItemProps, __lib_types_DropdownPlacement as DropdownPlacement, __lib_types_DropdownProps as DropdownProps, __lib_types_DropdownTrigger as DropdownTrigger, __lib_types_EdgePanelMode as EdgePanelMode, __lib_types_EdgePanelPosition as EdgePanelPosition, __lib_types_EdgePanelProps as EdgePanelProps, __lib_types_ElementRefs as ElementRefs, __lib_types_ElevationCardProps as ElevationCardProps, __lib_types_FooterLayout as FooterLayout, __lib_types_FooterLinkProps as FooterLinkProps, __lib_types_FooterProps as FooterProps, __lib_types_FooterSectionProps as FooterSectionProps, __lib_types_FooterSocialLinkProps as FooterSocialLinkProps, __lib_types_FormGroupProps as FormGroupProps, __lib_types_FormProps as FormProps, __lib_types_GlassContainerProps as GlassContainerProps, __lib_types_GlassMode as GlassMode, __lib_types_GlassSize as GlassSize, __lib_types_HeroAlignment as HeroAlignment, __lib_types_HeroBackgroundSlide as HeroBackgroundSlide, __lib_types_HeroBackgroundSliderConfig as HeroBackgroundSliderConfig, __lib_types_HeroProps as HeroProps, __lib_types_IconPosition as IconPosition, IconSize$1 as IconSize, IconWeight$1 as IconWeight, __lib_types_ImageType as ImageType, __lib_types_InputProps as InputProps, ListGroupProps$1 as ListGroupProps, __lib_types_ListProps as ListProps, __lib_types_MegaMenuColumnProps as MegaMenuColumnProps, __lib_types_MegaMenuLinkProps as MegaMenuLinkProps, __lib_types_MegaMenuProps as MegaMenuProps, __lib_types_MenuItemProps as MenuItemProps, __lib_types_MenuProps as MenuProps, __lib_types_MessageItem as MessageItem, __lib_types_MessagesProps as MessagesProps, __lib_types_ModalProps as ModalProps, __lib_types_MousePosition as MousePosition, __lib_types_NavAlignment as NavAlignment, __lib_types_NavDropdownProps as NavDropdownProps, __lib_types_NavItemProps as NavItemProps, __lib_types_NavProps as NavProps, __lib_types_NavVariant as NavVariant, __lib_types_NavbarPosition as NavbarPosition, __lib_types_NavbarProps as NavbarProps, __lib_types_OverLightConfig as OverLightConfig, __lib_types_OverLightObjectConfig as OverLightObjectConfig, __lib_types_PaginationProps as PaginationProps, PhosphorIconsType$1 as PhosphorIconsType, __lib_types_PhotoViewerProps as PhotoViewerProps, __lib_types_PopoverProps as PopoverProps, __lib_types_PopoverTriggerProps as PopoverTriggerProps, __lib_types_ProgressProps as ProgressProps, __lib_types_RadioProps as RadioProps, __lib_types_RatingProps as RatingProps, __lib_types_SelectOption as SelectOption, __lib_types_SelectProps as SelectProps, __lib_types_SideMenuItemProps as SideMenuItemProps, __lib_types_SideMenuListProps as SideMenuListProps, __lib_types_SideMenuProps as SideMenuProps, __lib_types_Size as Size, __lib_types_SliderAutoplay as SliderAutoplay, __lib_types_SliderBreakpoint as SliderBreakpoint, __lib_types_SliderEffect as SliderEffect, __lib_types_SliderLazy as SliderLazy, __lib_types_SliderNavigation as SliderNavigation, __lib_types_SliderPagination as SliderPagination, __lib_types_SliderProps as SliderProps, __lib_types_SliderRefs as SliderRefs, __lib_types_SliderScrollbar as SliderScrollbar, __lib_types_SliderSlide as SliderSlide, __lib_types_SliderState as SliderState, __lib_types_SliderThumbs as SliderThumbs, __lib_types_SliderVirtual as SliderVirtual, __lib_types_SliderZoom as SliderZoom, __lib_types_SocialLink as SocialLink, __lib_types_SocialPlatform as SocialPlatform, __lib_types_SortConfig as SortConfig, __lib_types_SpinnerProps as SpinnerProps, __lib_types_StateModifier as StateModifier, __lib_types_TextareaProps as TextareaProps, __lib_types_ThemeColor as ThemeColor, __lib_types_ThemeName as ThemeName, __lib_types_TodoItem as TodoItem, __lib_types_TodoProps as TodoProps, __lib_types_UseCardOptions as UseCardOptions, __lib_types_UseCardReturn as UseCardReturn, __lib_types_Variant as Variant, __lib_types_VideoChapter as VideoChapter, __lib_types_VideoPlayerProps as VideoPlayerProps, __lib_types_VideoQuality as VideoQuality, __lib_types_VideoSubtitle as VideoSubtitle, __lib_types_listvariant as listvariant };
|
|
8383
8312
|
}
|
|
8384
8313
|
|
|
8385
8314
|
/**
|
|
@@ -8402,6 +8331,12 @@ declare const CLASS_PREFIX: {
|
|
|
8402
8331
|
/**
|
|
8403
8332
|
* Button-specific constants
|
|
8404
8333
|
*/
|
|
8334
|
+
declare const THEME_NAMING: {
|
|
8335
|
+
BUTTON_PREFIX: string;
|
|
8336
|
+
ICON_ELEMENT: string;
|
|
8337
|
+
LABEL_ELEMENT: string;
|
|
8338
|
+
SPINNER_ELEMENT: string;
|
|
8339
|
+
};
|
|
8405
8340
|
declare const BUTTON: {
|
|
8406
8341
|
BASE_CLASS: string;
|
|
8407
8342
|
ICON_CLASS: string;
|
|
@@ -8417,6 +8352,15 @@ declare const BUTTON: {
|
|
|
8417
8352
|
SELECTED: string;
|
|
8418
8353
|
};
|
|
8419
8354
|
};
|
|
8355
|
+
/**
|
|
8356
|
+
* ButtonGroup-specific constants
|
|
8357
|
+
*/
|
|
8358
|
+
declare const BUTTON_GROUP: {
|
|
8359
|
+
BASE_CLASS: string;
|
|
8360
|
+
CLASSES: {
|
|
8361
|
+
BASE: string;
|
|
8362
|
+
};
|
|
8363
|
+
};
|
|
8420
8364
|
/**
|
|
8421
8365
|
* Callout-specific constants
|
|
8422
8366
|
*/
|
|
@@ -10121,6 +10065,7 @@ declare const __lib_constants_BADGE: typeof BADGE;
|
|
|
10121
10065
|
declare const __lib_constants_BLOCK: typeof BLOCK;
|
|
10122
10066
|
declare const __lib_constants_BREADCRUMB: typeof BREADCRUMB;
|
|
10123
10067
|
declare const __lib_constants_BUTTON: typeof BUTTON;
|
|
10068
|
+
declare const __lib_constants_BUTTON_GROUP: typeof BUTTON_GROUP;
|
|
10124
10069
|
declare const __lib_constants_CALLOUT: typeof CALLOUT;
|
|
10125
10070
|
declare const __lib_constants_CARD: typeof CARD;
|
|
10126
10071
|
declare const __lib_constants_CHART: typeof CHART;
|
|
@@ -10162,6 +10107,7 @@ declare const __lib_constants_TAB: typeof TAB;
|
|
|
10162
10107
|
declare const __lib_constants_TESTIMONIAL: typeof TESTIMONIAL;
|
|
10163
10108
|
declare const __lib_constants_TEXTAREA: typeof TEXTAREA;
|
|
10164
10109
|
declare const __lib_constants_THEME_COLORS: typeof THEME_COLORS;
|
|
10110
|
+
declare const __lib_constants_THEME_NAMING: typeof THEME_NAMING;
|
|
10165
10111
|
declare const __lib_constants_TODO: typeof TODO;
|
|
10166
10112
|
declare const __lib_constants_TOGGLE: typeof TOGGLE;
|
|
10167
10113
|
declare const __lib_constants_TOOLTIP: typeof TOOLTIP;
|
|
@@ -10178,6 +10124,7 @@ declare namespace __lib_constants {
|
|
|
10178
10124
|
__lib_constants_BLOCK as BLOCK,
|
|
10179
10125
|
__lib_constants_BREADCRUMB as BREADCRUMB,
|
|
10180
10126
|
__lib_constants_BUTTON as BUTTON,
|
|
10127
|
+
__lib_constants_BUTTON_GROUP as BUTTON_GROUP,
|
|
10181
10128
|
__lib_constants_CALLOUT as CALLOUT,
|
|
10182
10129
|
__lib_constants_CARD as CARD,
|
|
10183
10130
|
__lib_constants_CHART as CHART,
|
|
@@ -10219,6 +10166,7 @@ declare namespace __lib_constants {
|
|
|
10219
10166
|
__lib_constants_TESTIMONIAL as TESTIMONIAL,
|
|
10220
10167
|
__lib_constants_TEXTAREA as TEXTAREA,
|
|
10221
10168
|
__lib_constants_THEME_COLORS as THEME_COLORS,
|
|
10169
|
+
__lib_constants_THEME_NAMING as THEME_NAMING,
|
|
10222
10170
|
__lib_constants_TODO as TODO,
|
|
10223
10171
|
__lib_constants_TOGGLE as TOGGLE,
|
|
10224
10172
|
__lib_constants_TOOLTIP as TOOLTIP,
|
|
@@ -10729,7 +10677,6 @@ declare function useNavDropdown(initialProps?: Partial<NavDropdownProps>): {
|
|
|
10729
10677
|
defaultProps: Partial<NavDropdownProps>;
|
|
10730
10678
|
generateDropdownMenuClass: (props: Partial<NavDropdownProps>) => string;
|
|
10731
10679
|
isInFixedBottomNavbar: () => boolean;
|
|
10732
|
-
getIconClass: (isMegaMenu?: boolean) => string;
|
|
10733
10680
|
getIconName: (isMegaMenu?: boolean) => string;
|
|
10734
10681
|
};
|
|
10735
10682
|
|
|
@@ -11491,6 +11438,23 @@ interface BlockProps extends HTMLAttributes<HTMLElement> {
|
|
|
11491
11438
|
*/
|
|
11492
11439
|
declare const Block: React__default.ForwardRefExoticComponent<BlockProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
11493
11440
|
|
|
11441
|
+
/**
|
|
11442
|
+
* ButtonGroup - A component for grouping buttons together
|
|
11443
|
+
*
|
|
11444
|
+
* Groups buttons together with proper border radius handling and spacing.
|
|
11445
|
+
* The buttons will be visually connected with shared borders.
|
|
11446
|
+
*
|
|
11447
|
+
* @example
|
|
11448
|
+
* ```tsx
|
|
11449
|
+
* <ButtonGroup>
|
|
11450
|
+
* <Button label="Left" />
|
|
11451
|
+
* <Button label="Middle" />
|
|
11452
|
+
* <Button label="Right" />
|
|
11453
|
+
* </ButtonGroup>
|
|
11454
|
+
* ```
|
|
11455
|
+
*/
|
|
11456
|
+
declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
|
|
11457
|
+
|
|
11494
11458
|
/**
|
|
11495
11459
|
* Callout component for displaying important messages, notifications, or alerts
|
|
11496
11460
|
*/
|
|
@@ -12349,1171 +12313,479 @@ declare const Upload: React__default.FC<UploadProps>;
|
|
|
12349
12313
|
declare const VideoPlayer: React__default.ForwardRefExoticComponent<VideoPlayerProps & React__default.RefAttributes<HTMLVideoElement>>;
|
|
12350
12314
|
|
|
12351
12315
|
/**
|
|
12352
|
-
*
|
|
12353
|
-
*
|
|
12354
|
-
*
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12316
|
+
* Design Tokens
|
|
12317
|
+
*
|
|
12318
|
+
* Simple flat structure for design tokens.
|
|
12319
|
+
* All tokens match the actual CSS variables used in Atomix.
|
|
12320
|
+
* Based on docs/tokes-list.md
|
|
12321
|
+
*/
|
|
12322
|
+
/**
|
|
12323
|
+
* Design tokens interface
|
|
12324
|
+
*
|
|
12325
|
+
* Flat structure - no nesting complexity.
|
|
12326
|
+
* Keys use kebab-case format matching CSS variable names (without --atomix- prefix).
|
|
12327
|
+
*/
|
|
12328
|
+
interface DesignTokens {
|
|
12329
|
+
'primary': string;
|
|
12330
|
+
'secondary': string;
|
|
12331
|
+
'success': string;
|
|
12332
|
+
'info': string;
|
|
12333
|
+
'warning': string;
|
|
12334
|
+
'error': string;
|
|
12335
|
+
'light': string;
|
|
12336
|
+
'dark': string;
|
|
12337
|
+
'primary-rgb': string;
|
|
12338
|
+
'secondary-rgb': string;
|
|
12339
|
+
'success-rgb': string;
|
|
12340
|
+
'info-rgb': string;
|
|
12341
|
+
'warning-rgb': string;
|
|
12342
|
+
'error-rgb': string;
|
|
12343
|
+
'light-rgb': string;
|
|
12344
|
+
'dark-rgb': string;
|
|
12345
|
+
'gray-1': string;
|
|
12346
|
+
'gray-2': string;
|
|
12347
|
+
'gray-3': string;
|
|
12348
|
+
'gray-4': string;
|
|
12349
|
+
'gray-5': string;
|
|
12350
|
+
'gray-6': string;
|
|
12351
|
+
'gray-7': string;
|
|
12352
|
+
'gray-8': string;
|
|
12353
|
+
'gray-9': string;
|
|
12354
|
+
'gray-10': string;
|
|
12355
|
+
'primary-1': string;
|
|
12356
|
+
'primary-2': string;
|
|
12357
|
+
'primary-3': string;
|
|
12358
|
+
'primary-4': string;
|
|
12359
|
+
'primary-5': string;
|
|
12360
|
+
'primary-6': string;
|
|
12361
|
+
'primary-7': string;
|
|
12362
|
+
'primary-8': string;
|
|
12363
|
+
'primary-9': string;
|
|
12364
|
+
'primary-10': string;
|
|
12365
|
+
'red-1': string;
|
|
12366
|
+
'red-2': string;
|
|
12367
|
+
'red-3': string;
|
|
12368
|
+
'red-4': string;
|
|
12369
|
+
'red-5': string;
|
|
12370
|
+
'red-6': string;
|
|
12371
|
+
'red-7': string;
|
|
12372
|
+
'red-8': string;
|
|
12373
|
+
'red-9': string;
|
|
12374
|
+
'red-10': string;
|
|
12375
|
+
'green-1': string;
|
|
12376
|
+
'green-2': string;
|
|
12377
|
+
'green-3': string;
|
|
12378
|
+
'green-4': string;
|
|
12379
|
+
'green-5': string;
|
|
12380
|
+
'green-6': string;
|
|
12381
|
+
'green-7': string;
|
|
12382
|
+
'green-8': string;
|
|
12383
|
+
'green-9': string;
|
|
12384
|
+
'green-10': string;
|
|
12385
|
+
'blue-1': string;
|
|
12386
|
+
'blue-2': string;
|
|
12387
|
+
'blue-3': string;
|
|
12388
|
+
'blue-4': string;
|
|
12389
|
+
'blue-5': string;
|
|
12390
|
+
'blue-6': string;
|
|
12391
|
+
'blue-7': string;
|
|
12392
|
+
'blue-8': string;
|
|
12393
|
+
'blue-9': string;
|
|
12394
|
+
'blue-10': string;
|
|
12395
|
+
'yellow-1': string;
|
|
12396
|
+
'yellow-2': string;
|
|
12397
|
+
'yellow-3': string;
|
|
12398
|
+
'yellow-4': string;
|
|
12399
|
+
'yellow-5': string;
|
|
12400
|
+
'yellow-6': string;
|
|
12401
|
+
'yellow-7': string;
|
|
12402
|
+
'yellow-8': string;
|
|
12403
|
+
'yellow-9': string;
|
|
12404
|
+
'yellow-10': string;
|
|
12405
|
+
'primary-text-emphasis': string;
|
|
12406
|
+
'secondary-text-emphasis': string;
|
|
12407
|
+
'tertiary-text-emphasis': string;
|
|
12408
|
+
'disabled-text-emphasis': string;
|
|
12409
|
+
'invert-text-emphasis': string;
|
|
12410
|
+
'brand-text-emphasis': string;
|
|
12411
|
+
'error-text-emphasis': string;
|
|
12412
|
+
'success-text-emphasis': string;
|
|
12413
|
+
'warning-text-emphasis': string;
|
|
12414
|
+
'info-text-emphasis': string;
|
|
12415
|
+
'light-text-emphasis': string;
|
|
12416
|
+
'dark-text-emphasis': string;
|
|
12417
|
+
'primary-bg-subtle': string;
|
|
12418
|
+
'secondary-bg-subtle': string;
|
|
12419
|
+
'tertiary-bg-subtle': string;
|
|
12420
|
+
'invert-bg-subtle': string;
|
|
12421
|
+
'brand-bg-subtle': string;
|
|
12422
|
+
'error-bg-subtle': string;
|
|
12423
|
+
'success-bg-subtle': string;
|
|
12424
|
+
'warning-bg-subtle': string;
|
|
12425
|
+
'info-bg-subtle': string;
|
|
12426
|
+
'light-bg-subtle': string;
|
|
12427
|
+
'dark-bg-subtle': string;
|
|
12428
|
+
'primary-border-subtle': string;
|
|
12429
|
+
'secondary-border-subtle': string;
|
|
12430
|
+
'success-border-subtle': string;
|
|
12431
|
+
'error-border-subtle': string;
|
|
12432
|
+
'warning-border-subtle': string;
|
|
12433
|
+
'info-border-subtle': string;
|
|
12434
|
+
'brand-border-subtle': string;
|
|
12435
|
+
'light-border-subtle': string;
|
|
12436
|
+
'dark-border-subtle': string;
|
|
12437
|
+
'primary-hover': string;
|
|
12438
|
+
'secondary-hover': string;
|
|
12439
|
+
'light-hover': string;
|
|
12440
|
+
'dark-hover': string;
|
|
12441
|
+
'error-hover': string;
|
|
12442
|
+
'success-hover': string;
|
|
12443
|
+
'warning-hover': string;
|
|
12444
|
+
'info-hover': string;
|
|
12445
|
+
'primary-gradient': string;
|
|
12446
|
+
'secondary-gradient': string;
|
|
12447
|
+
'light-gradient': string;
|
|
12448
|
+
'dark-gradient': string;
|
|
12449
|
+
'success-gradient': string;
|
|
12450
|
+
'info-gradient': string;
|
|
12451
|
+
'warning-gradient': string;
|
|
12452
|
+
'error-gradient': string;
|
|
12453
|
+
'gradient': string;
|
|
12454
|
+
'font-sans-serif': string;
|
|
12455
|
+
'font-monospace': string;
|
|
12456
|
+
'body-font-family': string;
|
|
12457
|
+
'body-font-size': string;
|
|
12458
|
+
'body-font-weight': string;
|
|
12459
|
+
'body-line-height': string;
|
|
12460
|
+
'body-color': string;
|
|
12461
|
+
'body-bg': string;
|
|
12462
|
+
'heading-color': string;
|
|
12463
|
+
'font-size-xl': string;
|
|
12464
|
+
'font-size-2xl': string;
|
|
12465
|
+
'display-1': string;
|
|
12466
|
+
'font-weight-light': string;
|
|
12467
|
+
'font-weight-normal': string;
|
|
12468
|
+
'font-weight-medium': string;
|
|
12469
|
+
'font-weight-semibold': string;
|
|
12470
|
+
'font-weight-bold': string;
|
|
12471
|
+
'font-weight-heavy': string;
|
|
12472
|
+
'font-weight-black': string;
|
|
12473
|
+
'line-height-base': string;
|
|
12474
|
+
'line-height-sm': string;
|
|
12475
|
+
'line-height-lg': string;
|
|
12476
|
+
'letter-spacing-h1': string;
|
|
12477
|
+
'letter-spacing-h2': string;
|
|
12478
|
+
'letter-spacing-h3': string;
|
|
12479
|
+
'letter-spacing-h4': string;
|
|
12480
|
+
'letter-spacing-h5': string;
|
|
12481
|
+
'letter-spacing-h6': string;
|
|
12482
|
+
'link-color': string;
|
|
12483
|
+
'link-color-rgb': string;
|
|
12484
|
+
'link-decoration': string;
|
|
12485
|
+
'link-hover-color': string;
|
|
12486
|
+
'link-hover-color-rgb': string;
|
|
12487
|
+
'highlight-bg': string;
|
|
12488
|
+
'code-color': string;
|
|
12489
|
+
'border-width': string;
|
|
12490
|
+
'border-style': string;
|
|
12491
|
+
'border-color': string;
|
|
12492
|
+
'border-color-translucent': string;
|
|
12493
|
+
'border-radius': string;
|
|
12494
|
+
'border-radius-sm': string;
|
|
12495
|
+
'border-radius-lg': string;
|
|
12496
|
+
'border-radius-xl': string;
|
|
12497
|
+
'border-radius-xxl': string;
|
|
12498
|
+
'border-radius-2xl': string;
|
|
12499
|
+
'border-radius-3xl': string;
|
|
12500
|
+
'border-radius-4xl': string;
|
|
12501
|
+
'border-radius-pill': string;
|
|
12502
|
+
'box-shadow': string;
|
|
12503
|
+
'box-shadow-xs': string;
|
|
12504
|
+
'box-shadow-sm': string;
|
|
12505
|
+
'box-shadow-lg': string;
|
|
12506
|
+
'box-shadow-xl': string;
|
|
12507
|
+
'box-shadow-inset': string;
|
|
12508
|
+
'focus-border-color': string;
|
|
12509
|
+
'focus-ring-width': string;
|
|
12510
|
+
'focus-ring-offset': string;
|
|
12511
|
+
'focus-ring-opacity': string;
|
|
12512
|
+
'form-valid-color': string;
|
|
12513
|
+
'form-valid-border-color': string;
|
|
12514
|
+
'form-invalid-color': string;
|
|
12515
|
+
'form-invalid-border-color': string;
|
|
12516
|
+
'spacing-0': string;
|
|
12517
|
+
'spacing-1': string;
|
|
12518
|
+
'spacing-px-6': string;
|
|
12519
|
+
'spacing-2': string;
|
|
12520
|
+
'spacing-px-10': string;
|
|
12521
|
+
'spacing-3': string;
|
|
12522
|
+
'spacing-px-14': string;
|
|
12523
|
+
'spacing-4': string;
|
|
12524
|
+
'spacing-5': string;
|
|
12525
|
+
'spacing-px-22': string;
|
|
12526
|
+
'spacing-6': string;
|
|
12527
|
+
'spacing-7': string;
|
|
12528
|
+
'spacing-px-30': string;
|
|
12529
|
+
'spacing-8': string;
|
|
12530
|
+
'spacing-9': string;
|
|
12531
|
+
'spacing-10': string;
|
|
12532
|
+
'spacing-11': string;
|
|
12533
|
+
'spacing-12': string;
|
|
12534
|
+
'spacing-14': string;
|
|
12535
|
+
'spacing-16': string;
|
|
12536
|
+
'spacing-20': string;
|
|
12537
|
+
'spacing-24': string;
|
|
12538
|
+
'spacing-28': string;
|
|
12539
|
+
'spacing-32': string;
|
|
12540
|
+
'spacing-36': string;
|
|
12541
|
+
'spacing-40': string;
|
|
12542
|
+
'spacing-44': string;
|
|
12543
|
+
'spacing-48': string;
|
|
12544
|
+
'spacing-52': string;
|
|
12545
|
+
'spacing-56': string;
|
|
12546
|
+
'spacing-60': string;
|
|
12547
|
+
'spacing-64': string;
|
|
12548
|
+
'spacing-72': string;
|
|
12549
|
+
'spacing-80': string;
|
|
12550
|
+
'spacing-90': string;
|
|
12551
|
+
'spacing-200': string;
|
|
12552
|
+
'transition-duration-fast': string;
|
|
12553
|
+
'transition-duration-base': string;
|
|
12554
|
+
'transition-duration-slow': string;
|
|
12555
|
+
'transition-duration-slower': string;
|
|
12556
|
+
'easing-base': string;
|
|
12557
|
+
'easing-ease-in-out': string;
|
|
12558
|
+
'easing-ease-out': string;
|
|
12559
|
+
'easing-ease-in': string;
|
|
12560
|
+
'easing-ease-linear': string;
|
|
12561
|
+
'transition-fast': string;
|
|
12562
|
+
'transition-base': string;
|
|
12563
|
+
'transition-slow': string;
|
|
12564
|
+
'z-n1': string;
|
|
12565
|
+
'z-0': string;
|
|
12566
|
+
'z-1': string;
|
|
12567
|
+
'z-2': string;
|
|
12568
|
+
'z-3': string;
|
|
12569
|
+
'z-4': string;
|
|
12570
|
+
'z-5': string;
|
|
12571
|
+
'z-dropdown': string;
|
|
12572
|
+
'z-sticky': string;
|
|
12573
|
+
'z-fixed': string;
|
|
12574
|
+
'z-modal': string;
|
|
12575
|
+
'z-popover': string;
|
|
12576
|
+
'z-tooltip': string;
|
|
12577
|
+
'z-drawer': string;
|
|
12578
|
+
'breakpoint-xs': string;
|
|
12579
|
+
'breakpoint-sm': string;
|
|
12580
|
+
'breakpoint-md': string;
|
|
12581
|
+
'breakpoint-lg': string;
|
|
12582
|
+
'breakpoint-xl': string;
|
|
12583
|
+
'breakpoint-xxl': string;
|
|
12584
|
+
[key: string]: string | undefined;
|
|
12448
12585
|
}
|
|
12449
|
-
|
|
12450
12586
|
/**
|
|
12451
|
-
*
|
|
12587
|
+
* Default design tokens
|
|
12452
12588
|
*
|
|
12453
|
-
*
|
|
12454
|
-
* Similar to how Tailwind loads tailwind.config.js
|
|
12589
|
+
* Based on Atomix default theme values from docs/tokes-list.md (light mode)
|
|
12455
12590
|
*/
|
|
12456
|
-
|
|
12591
|
+
declare const defaultTokens: DesignTokens;
|
|
12457
12592
|
/**
|
|
12458
|
-
*
|
|
12459
|
-
*
|
|
12460
|
-
* Attempts to load atomix.config.ts from the current working directory.
|
|
12461
|
-
* Falls back to default config if file doesn't exist.
|
|
12593
|
+
* Create tokens from defaults and overrides
|
|
12462
12594
|
*
|
|
12463
|
-
* @param
|
|
12464
|
-
* @returns
|
|
12595
|
+
* @param overrides - Partial tokens to override defaults
|
|
12596
|
+
* @returns Complete DesignTokens object
|
|
12465
12597
|
*
|
|
12466
12598
|
* @example
|
|
12467
12599
|
* ```typescript
|
|
12468
|
-
*
|
|
12469
|
-
*
|
|
12470
|
-
*
|
|
12471
|
-
*
|
|
12600
|
+
* const tokens = createTokens({
|
|
12601
|
+
* 'primary': '#7c3aed',
|
|
12602
|
+
* 'spacing-4': '1rem',
|
|
12603
|
+
* });
|
|
12472
12604
|
* ```
|
|
12473
12605
|
*/
|
|
12474
|
-
declare function
|
|
12475
|
-
|
|
12476
|
-
configPath?: string;
|
|
12477
|
-
/** Whether to throw error if config not found (default: false) */
|
|
12478
|
-
required?: boolean;
|
|
12479
|
-
}): AtomixConfig;
|
|
12606
|
+
declare function createTokens(overrides?: Partial<DesignTokens>): DesignTokens;
|
|
12607
|
+
|
|
12480
12608
|
/**
|
|
12481
|
-
*
|
|
12482
|
-
*
|
|
12483
|
-
* Finds atomix.config.ts in the project, checking common locations.
|
|
12484
|
-
* Returns null in browser environments where file system access is not available.
|
|
12485
|
-
*
|
|
12486
|
-
* This function is designed to work in Node.js environments only.
|
|
12487
|
-
* In browser builds, it will always return null without attempting to access Node.js modules.
|
|
12609
|
+
* Theme Manager Type Definitions
|
|
12488
12610
|
*
|
|
12489
|
-
*
|
|
12611
|
+
* TypeScript types and interfaces for the Atomix Design System theme management system.
|
|
12490
12612
|
*/
|
|
12491
|
-
declare function resolveConfigPath(): string | null;
|
|
12492
|
-
|
|
12493
12613
|
/**
|
|
12494
|
-
*
|
|
12495
|
-
*
|
|
12496
|
-
* Tailwind-like configuration for customizing the Atomix Design System.
|
|
12497
|
-
*
|
|
12498
|
-
* External developers can create `atomix.config.ts` in their project root
|
|
12499
|
-
* to customize design tokens, similar to Tailwind's tailwind.config.js
|
|
12500
|
-
*
|
|
12501
|
-
* @example
|
|
12502
|
-
* ```typescript
|
|
12503
|
-
* // atomix.config.ts (in your project)
|
|
12504
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
12505
|
-
*
|
|
12506
|
-
* export default defineConfig({
|
|
12507
|
-
* theme: {
|
|
12508
|
-
* extend: {
|
|
12509
|
-
* colors: {
|
|
12510
|
-
* primary: { main: '#7AFFD7' },
|
|
12511
|
-
* },
|
|
12512
|
-
* },
|
|
12513
|
-
* },
|
|
12514
|
-
* });
|
|
12515
|
-
* ```
|
|
12516
|
-
*/
|
|
12517
|
-
|
|
12518
|
-
/**
|
|
12519
|
-
* Color Scale (1-10)
|
|
12520
|
-
*/
|
|
12521
|
-
interface ColorScale {
|
|
12522
|
-
1?: string;
|
|
12523
|
-
2?: string;
|
|
12524
|
-
3?: string;
|
|
12525
|
-
4?: string;
|
|
12526
|
-
5?: string;
|
|
12527
|
-
6?: string;
|
|
12528
|
-
7?: string;
|
|
12529
|
-
8?: string;
|
|
12530
|
-
9?: string;
|
|
12531
|
-
10?: string;
|
|
12532
|
-
[key: string]: string | undefined;
|
|
12533
|
-
}
|
|
12534
|
-
/**
|
|
12535
|
-
* Palette Color Options
|
|
12536
|
-
*/
|
|
12537
|
-
interface PaletteColorOptions {
|
|
12538
|
-
main: string;
|
|
12539
|
-
light?: string;
|
|
12540
|
-
dark?: string;
|
|
12541
|
-
contrastText?: string;
|
|
12542
|
-
}
|
|
12543
|
-
/**
|
|
12544
|
-
* Design Tokens Schema (Tailwind-like)
|
|
12545
|
-
*/
|
|
12546
|
-
interface ThemeTokens {
|
|
12547
|
-
/** Color palette */
|
|
12548
|
-
colors?: Record<string, string | PaletteColorOptions | ColorScale | Record<string, string>>;
|
|
12549
|
-
/** Spacing scale */
|
|
12550
|
-
spacing?: Record<string, string>;
|
|
12551
|
-
/** Border radius scale */
|
|
12552
|
-
borderRadius?: Record<string, string>;
|
|
12553
|
-
/** Typography scale and settings */
|
|
12554
|
-
typography?: {
|
|
12555
|
-
fontFamilies?: Record<string, string>;
|
|
12556
|
-
fontSizes?: Record<string, string>;
|
|
12557
|
-
fontWeights?: Record<string, string | number>;
|
|
12558
|
-
lineHeights?: Record<string, string | number>;
|
|
12559
|
-
letterSpacings?: Record<string, string>;
|
|
12560
|
-
};
|
|
12561
|
-
/** Shadow scale */
|
|
12562
|
-
shadows?: Record<string, string>;
|
|
12563
|
-
/** Z-index scale */
|
|
12564
|
-
zIndex?: Record<string, string | number>;
|
|
12565
|
-
/** Breakpoints scale */
|
|
12566
|
-
breakpoints?: Record<string, string | number>;
|
|
12567
|
-
/** Transitions settings */
|
|
12568
|
-
transitions?: {
|
|
12569
|
-
durations?: Record<string, string>;
|
|
12570
|
-
easings?: Record<string, string>;
|
|
12571
|
-
};
|
|
12572
|
-
}
|
|
12573
|
-
/**
|
|
12574
|
-
* CSS Theme Definition
|
|
12614
|
+
* Theme metadata interface matching themes.config.js structure
|
|
12575
12615
|
*/
|
|
12576
|
-
interface
|
|
12577
|
-
|
|
12616
|
+
interface ThemeMetadata$1 {
|
|
12617
|
+
/** Display name of the theme */
|
|
12578
12618
|
name: string;
|
|
12619
|
+
/** Unique identifier/class name for the theme */
|
|
12579
12620
|
class?: string;
|
|
12621
|
+
/** Theme description */
|
|
12580
12622
|
description?: string;
|
|
12623
|
+
/** Theme author */
|
|
12581
12624
|
author?: string;
|
|
12625
|
+
/** Theme version (semver) */
|
|
12582
12626
|
version?: string;
|
|
12627
|
+
/** Theme tags for categorization */
|
|
12583
12628
|
tags?: string[];
|
|
12629
|
+
/** Whether the theme supports dark mode */
|
|
12584
12630
|
supportsDarkMode?: boolean;
|
|
12631
|
+
/** Theme status: stable, beta, experimental, deprecated */
|
|
12585
12632
|
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
12633
|
+
/** Accessibility information */
|
|
12586
12634
|
a11y?: {
|
|
12635
|
+
/** Target contrast ratio */
|
|
12587
12636
|
contrastTarget?: number;
|
|
12637
|
+
/** Supported color modes */
|
|
12588
12638
|
modes?: string[];
|
|
12589
12639
|
};
|
|
12640
|
+
/** Primary theme color (for UI display) */
|
|
12590
12641
|
color?: string;
|
|
12642
|
+
/** Theme features list */
|
|
12591
12643
|
features?: string[];
|
|
12644
|
+
/** Theme dependencies (other themes required) */
|
|
12592
12645
|
dependencies?: string[];
|
|
12593
|
-
cssPath?: string;
|
|
12594
12646
|
}
|
|
12595
12647
|
/**
|
|
12596
|
-
*
|
|
12648
|
+
* Theme change event payload
|
|
12597
12649
|
*/
|
|
12598
|
-
interface
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
contrastTarget?: number;
|
|
12610
|
-
modes?: string[];
|
|
12611
|
-
};
|
|
12612
|
-
color?: string;
|
|
12613
|
-
features?: string[];
|
|
12614
|
-
dependencies?: string[];
|
|
12615
|
-
createTheme: () => Theme;
|
|
12650
|
+
interface ThemeChangeEvent {
|
|
12651
|
+
/** Previous theme name */
|
|
12652
|
+
previousTheme: string | null;
|
|
12653
|
+
/** New theme name */
|
|
12654
|
+
currentTheme: string;
|
|
12655
|
+
/** Theme object (for JS themes) */
|
|
12656
|
+
themeObject?: Theme | null;
|
|
12657
|
+
/** Timestamp of the change */
|
|
12658
|
+
timestamp: number;
|
|
12659
|
+
/** Whether the change was from user action or system */
|
|
12660
|
+
source: 'user' | 'system' | 'storage';
|
|
12616
12661
|
}
|
|
12617
12662
|
/**
|
|
12618
|
-
* Theme
|
|
12663
|
+
* Theme load options
|
|
12619
12664
|
*/
|
|
12620
|
-
|
|
12665
|
+
interface ThemeLoadOptions {
|
|
12666
|
+
/** Force reload even if already loaded */
|
|
12667
|
+
force?: boolean;
|
|
12668
|
+
/** Preload without applying */
|
|
12669
|
+
preload?: boolean;
|
|
12670
|
+
/** Remove previous theme CSS */
|
|
12671
|
+
removePrevious?: boolean;
|
|
12672
|
+
/** Custom CSS path override */
|
|
12673
|
+
customPath?: string;
|
|
12674
|
+
/** Fallback to default theme on error */
|
|
12675
|
+
fallbackOnError?: boolean;
|
|
12676
|
+
}
|
|
12621
12677
|
/**
|
|
12622
|
-
*
|
|
12678
|
+
* Theme validation result
|
|
12623
12679
|
*/
|
|
12624
|
-
interface
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
};
|
|
12632
|
-
sass?: {
|
|
12633
|
-
style?: 'expanded' | 'compressed';
|
|
12634
|
-
sourceMap?: boolean;
|
|
12635
|
-
loadPaths?: string[];
|
|
12636
|
-
};
|
|
12680
|
+
interface ThemeValidationResult {
|
|
12681
|
+
/** Whether the theme is valid */
|
|
12682
|
+
valid: boolean;
|
|
12683
|
+
/** Validation errors */
|
|
12684
|
+
errors: string[];
|
|
12685
|
+
/** Validation warnings */
|
|
12686
|
+
warnings: string[];
|
|
12637
12687
|
}
|
|
12638
12688
|
/**
|
|
12639
|
-
*
|
|
12689
|
+
* React hook return type for useTheme
|
|
12640
12690
|
*/
|
|
12641
|
-
interface
|
|
12691
|
+
interface UseThemeReturn {
|
|
12692
|
+
/** Current theme name */
|
|
12693
|
+
theme: string;
|
|
12694
|
+
/** Current active theme object (for JS themes) */
|
|
12695
|
+
activeTheme: Theme | null;
|
|
12696
|
+
/** Function to change theme (supports string, Theme, or DesignTokens) */
|
|
12697
|
+
setTheme: (theme: string | Theme | DesignTokens | Partial<DesignTokens>, options?: ThemeLoadOptions) => Promise<void>;
|
|
12698
|
+
/** Available themes */
|
|
12699
|
+
availableThemes: ThemeMetadata$1[];
|
|
12700
|
+
/** Whether a theme is currently loading */
|
|
12701
|
+
isLoading: boolean;
|
|
12702
|
+
/** Current error, if any */
|
|
12703
|
+
error: Error | null;
|
|
12704
|
+
/** Whether a specific theme is loaded */
|
|
12705
|
+
isThemeLoaded: (themeName: string) => boolean;
|
|
12706
|
+
/** Preload a theme */
|
|
12707
|
+
preloadTheme: (themeName: string) => Promise<void>;
|
|
12708
|
+
}
|
|
12709
|
+
/**
|
|
12710
|
+
* Component-level theme override configuration
|
|
12711
|
+
*/
|
|
12712
|
+
interface ComponentThemeOverride {
|
|
12713
|
+
/** CSS variable overrides for the component */
|
|
12714
|
+
cssVars?: Record<string, string | number>;
|
|
12715
|
+
/** Default prop overrides */
|
|
12716
|
+
defaultProps?: Record<string, any>;
|
|
12717
|
+
/** Part-specific overrides */
|
|
12718
|
+
parts?: Record<string, {
|
|
12719
|
+
cssVars?: Record<string, string | number>;
|
|
12720
|
+
className?: string;
|
|
12721
|
+
}>;
|
|
12722
|
+
/** Variant overrides */
|
|
12723
|
+
variants?: Record<string, {
|
|
12724
|
+
cssVars?: Record<string, string | number>;
|
|
12725
|
+
className?: string;
|
|
12726
|
+
}>;
|
|
12727
|
+
/** Additional className for the component */
|
|
12728
|
+
className?: string;
|
|
12729
|
+
}
|
|
12730
|
+
/**
|
|
12731
|
+
* Theme component overrides for all components
|
|
12732
|
+
*/
|
|
12733
|
+
interface ThemeComponentOverrides {
|
|
12734
|
+
Button?: ComponentThemeOverride;
|
|
12735
|
+
Card?: ComponentThemeOverride;
|
|
12736
|
+
Input?: ComponentThemeOverride;
|
|
12737
|
+
Modal?: ComponentThemeOverride;
|
|
12738
|
+
Dropdown?: ComponentThemeOverride;
|
|
12739
|
+
Badge?: ComponentThemeOverride;
|
|
12740
|
+
Tabs?: ComponentThemeOverride;
|
|
12741
|
+
Progress?: ComponentThemeOverride;
|
|
12742
|
+
Tooltip?: ComponentThemeOverride;
|
|
12743
|
+
Select?: ComponentThemeOverride;
|
|
12744
|
+
Checkbox?: ComponentThemeOverride;
|
|
12745
|
+
Radio?: ComponentThemeOverride;
|
|
12746
|
+
Textarea?: ComponentThemeOverride;
|
|
12747
|
+
FormGroup?: ComponentThemeOverride;
|
|
12748
|
+
Navbar?: ComponentThemeOverride;
|
|
12749
|
+
Accordion?: ComponentThemeOverride;
|
|
12750
|
+
DataTable?: ComponentThemeOverride;
|
|
12751
|
+
Avatar?: ComponentThemeOverride;
|
|
12752
|
+
List?: ComponentThemeOverride;
|
|
12753
|
+
Popover?: ComponentThemeOverride;
|
|
12754
|
+
Messages?: ComponentThemeOverride;
|
|
12755
|
+
Callout?: ComponentThemeOverride;
|
|
12756
|
+
Spinner?: ComponentThemeOverride;
|
|
12757
|
+
[key: string]: ComponentThemeOverride | undefined;
|
|
12758
|
+
}
|
|
12759
|
+
/**
|
|
12760
|
+
* Theme provider props
|
|
12761
|
+
*/
|
|
12762
|
+
interface ThemeProviderProps {
|
|
12763
|
+
/** Child components */
|
|
12764
|
+
children: React.ReactNode;
|
|
12765
|
+
/** Default theme */
|
|
12766
|
+
defaultTheme?: string | Theme;
|
|
12767
|
+
/** Available themes */
|
|
12768
|
+
themes?: Record<string, ThemeMetadata$1>;
|
|
12769
|
+
/** Base path for theme CSS */
|
|
12642
12770
|
basePath?: string;
|
|
12771
|
+
/** CDN path for theme CSS */
|
|
12643
12772
|
cdnPath?: string | null;
|
|
12773
|
+
/** Themes to preload */
|
|
12644
12774
|
preload?: string[];
|
|
12775
|
+
/** Enable lazy loading */
|
|
12645
12776
|
lazy?: boolean;
|
|
12646
|
-
|
|
12777
|
+
/** localStorage key */
|
|
12647
12778
|
storageKey?: string;
|
|
12779
|
+
/** Data attribute name */
|
|
12648
12780
|
dataAttribute?: string;
|
|
12781
|
+
/** Enable persistence */
|
|
12649
12782
|
enablePersistence?: boolean;
|
|
12783
|
+
/** Use minified CSS */
|
|
12650
12784
|
useMinified?: boolean;
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
interface IntegrationConfig {
|
|
12656
|
-
cssVariables?: Record<string, string>;
|
|
12657
|
-
classNames?: {
|
|
12658
|
-
theme?: string;
|
|
12659
|
-
colorMode?: string;
|
|
12660
|
-
};
|
|
12661
|
-
}
|
|
12662
|
-
/**
|
|
12663
|
-
* Atomix Configuration Interface
|
|
12664
|
-
*
|
|
12665
|
-
* Tailwind-like configuration for external developers.
|
|
12666
|
-
* Focus on theme customization - build/runtime configs are internal only.
|
|
12667
|
-
*/
|
|
12668
|
-
interface AtomixConfig {
|
|
12669
|
-
/**
|
|
12670
|
-
* CSS variable prefix (default: 'atomix')
|
|
12671
|
-
*
|
|
12672
|
-
* Change this to customize all CSS variable names.
|
|
12673
|
-
* Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
|
|
12674
|
-
*/
|
|
12675
|
-
prefix?: string;
|
|
12676
|
-
/**
|
|
12677
|
-
* Theme customization (Tailwind-like)
|
|
12678
|
-
*
|
|
12679
|
-
* Use `extend` to add or override design tokens.
|
|
12680
|
-
* Use `tokens` to completely replace the default token system (advanced).
|
|
12681
|
-
*/
|
|
12682
|
-
theme?: {
|
|
12683
|
-
/**
|
|
12684
|
-
* Extend the default design tokens
|
|
12685
|
-
*
|
|
12686
|
-
* This is the recommended way to customize Atomix.
|
|
12687
|
-
* Your values will override or extend the base tokens.
|
|
12688
|
-
*/
|
|
12689
|
-
extend?: ThemeTokens;
|
|
12690
|
-
/**
|
|
12691
|
-
* Override the default tokens entirely (advanced)
|
|
12692
|
-
*
|
|
12693
|
-
* Use with caution - this replaces the entire token system.
|
|
12694
|
-
* Most users should use `extend` instead.
|
|
12695
|
-
*/
|
|
12696
|
-
tokens?: ThemeTokens;
|
|
12697
|
-
/**
|
|
12698
|
-
* Register custom themes (optional)
|
|
12699
|
-
*
|
|
12700
|
-
* Define CSS or JavaScript themes that can be loaded dynamically.
|
|
12701
|
-
*/
|
|
12702
|
-
themes?: Record<string, ThemeDefinition>;
|
|
12703
|
-
};
|
|
12704
|
-
/** @internal Build configuration (internal use only) */
|
|
12705
|
-
build?: BuildConfig;
|
|
12706
|
-
/** @internal Runtime configuration (internal use only) */
|
|
12707
|
-
runtime?: RuntimeConfig;
|
|
12708
|
-
/** @internal Integration settings (internal use only) */
|
|
12709
|
-
integration?: IntegrationConfig;
|
|
12710
|
-
/** @internal Theme dependencies mapping (internal use only) */
|
|
12711
|
-
dependencies?: Record<string, string[]>;
|
|
12712
|
-
}
|
|
12713
|
-
/**
|
|
12714
|
-
* Helper function to define Atomix configuration with type safety
|
|
12715
|
-
*
|
|
12716
|
-
* @param config - Atomix configuration object
|
|
12717
|
-
* @returns The configuration object
|
|
12718
|
-
*/
|
|
12719
|
-
/**
|
|
12720
|
-
* Helper function to define Atomix configuration with type safety
|
|
12721
|
-
*
|
|
12722
|
-
* Similar to Tailwind's defineConfig, provides autocomplete and type checking.
|
|
12723
|
-
*
|
|
12724
|
-
* @param config - Atomix configuration object
|
|
12725
|
-
* @returns The configuration object
|
|
12726
|
-
*
|
|
12727
|
-
* @example
|
|
12728
|
-
* ```typescript
|
|
12729
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
12730
|
-
*
|
|
12731
|
-
* export default defineConfig({
|
|
12732
|
-
* theme: {
|
|
12733
|
-
* extend: {
|
|
12734
|
-
* colors: {
|
|
12735
|
-
* primary: { main: '#7AFFD7' },
|
|
12736
|
-
* },
|
|
12737
|
-
* },
|
|
12738
|
-
* },
|
|
12739
|
-
* });
|
|
12740
|
-
* ```
|
|
12741
|
-
*/
|
|
12742
|
-
declare function defineConfig(config: AtomixConfig): AtomixConfig;
|
|
12743
|
-
|
|
12744
|
-
/**
|
|
12745
|
-
* Theme Configuration Types
|
|
12746
|
-
*
|
|
12747
|
-
* Type definitions for the theme configuration system
|
|
12748
|
-
*/
|
|
12749
|
-
|
|
12750
|
-
/**
|
|
12751
|
-
* Loaded and validated theme configuration
|
|
12752
|
-
*/
|
|
12753
|
-
interface LoadedThemeConfig {
|
|
12754
|
-
/** Registered themes */
|
|
12755
|
-
themes: Record<string, ThemeDefinition>;
|
|
12756
|
-
/** Build configuration */
|
|
12757
|
-
build: BuildConfig;
|
|
12758
|
-
/** Runtime configuration */
|
|
12759
|
-
runtime: RuntimeConfig;
|
|
12760
|
-
/** Integration settings */
|
|
12761
|
-
integration: IntegrationConfig;
|
|
12762
|
-
/** Theme dependencies mapping */
|
|
12763
|
-
dependencies: Record<string, string[]>;
|
|
12764
|
-
/** Whether config was validated */
|
|
12765
|
-
validated: boolean;
|
|
12766
|
-
/** Validation errors (if any) */
|
|
12767
|
-
errors?: string[];
|
|
12768
|
-
/** Validation warnings (if any) */
|
|
12769
|
-
warnings?: string[];
|
|
12770
|
-
/** Internal tokens (for generator) */
|
|
12771
|
-
__tokens?: any;
|
|
12772
|
-
/** Internal extensions (for generator) */
|
|
12773
|
-
__extend?: any;
|
|
12774
|
-
}
|
|
12775
|
-
|
|
12776
|
-
/**
|
|
12777
|
-
* Theme Registry
|
|
12778
|
-
*
|
|
12779
|
-
* Central registry for all themes with discovery and dependency management
|
|
12780
|
-
*/
|
|
12781
|
-
|
|
12782
|
-
/**
|
|
12783
|
-
* Registry entry
|
|
12784
|
-
*/
|
|
12785
|
-
interface RegistryEntry {
|
|
12786
|
-
/** Theme ID */
|
|
12787
|
-
id: string;
|
|
12788
|
-
/** Theme definition from config */
|
|
12789
|
-
definition: ThemeDefinition;
|
|
12790
|
-
/** Resolved theme object (for JS themes) */
|
|
12791
|
-
theme?: Theme;
|
|
12792
|
-
/** Whether theme is loaded */
|
|
12793
|
-
loaded: boolean;
|
|
12794
|
-
/** Loading promise (if currently loading) */
|
|
12795
|
-
loading?: Promise<Theme | void>;
|
|
12796
|
-
/** Dependencies */
|
|
12797
|
-
dependencies: string[];
|
|
12798
|
-
/** Dependent themes (themes that depend on this one) */
|
|
12799
|
-
dependents: string[];
|
|
12800
|
-
}
|
|
12801
|
-
/**
|
|
12802
|
-
* Theme Registry
|
|
12803
|
-
*
|
|
12804
|
-
* Manages theme registration, discovery, and dependency resolution
|
|
12805
|
-
*/
|
|
12806
|
-
declare class ThemeRegistry {
|
|
12807
|
-
private entries;
|
|
12808
|
-
private config;
|
|
12809
|
-
private initialized;
|
|
12810
|
-
/**
|
|
12811
|
-
* Initialize registry from config
|
|
12812
|
-
*/
|
|
12813
|
-
initialize(config?: LoadedThemeConfig): Promise<void>;
|
|
12814
|
-
/**
|
|
12815
|
-
* Register a theme
|
|
12816
|
-
*/
|
|
12817
|
-
register(themeId: string, definition: ThemeDefinition): void;
|
|
12818
|
-
/**
|
|
12819
|
-
* Get theme entry
|
|
12820
|
-
*/
|
|
12821
|
-
get(themeId: string): RegistryEntry | undefined;
|
|
12822
|
-
/**
|
|
12823
|
-
* Check if theme exists
|
|
12824
|
-
*/
|
|
12825
|
-
has(themeId: string): boolean;
|
|
12826
|
-
/**
|
|
12827
|
-
* Get all theme IDs
|
|
12828
|
-
*/
|
|
12829
|
-
getAllIds(): string[];
|
|
12830
|
-
/**
|
|
12831
|
-
* Get all theme metadata
|
|
12832
|
-
*/
|
|
12833
|
-
getAllMetadata(): ThemeMetadata[];
|
|
12834
|
-
/**
|
|
12835
|
-
* Get theme definition
|
|
12836
|
-
*/
|
|
12837
|
-
getDefinition(themeId: string): ThemeDefinition | undefined;
|
|
12838
|
-
/**
|
|
12839
|
-
* Get theme object (for JS themes)
|
|
12840
|
-
*/
|
|
12841
|
-
getTheme(themeId: string): Theme | undefined;
|
|
12842
|
-
/**
|
|
12843
|
-
* Set theme object (for JS themes)
|
|
12844
|
-
*/
|
|
12845
|
-
setTheme(themeId: string, theme: Theme): void;
|
|
12846
|
-
/**
|
|
12847
|
-
* Get dependencies for a theme
|
|
12848
|
-
*/
|
|
12849
|
-
getDependencies(themeId: string): string[];
|
|
12850
|
-
/**
|
|
12851
|
-
* Get dependents for a theme (themes that depend on this one)
|
|
12852
|
-
*/
|
|
12853
|
-
getDependents(themeId: string): string[];
|
|
12854
|
-
/**
|
|
12855
|
-
* Resolve all dependencies in correct order
|
|
12856
|
-
*/
|
|
12857
|
-
resolveDependencyOrder(themeId: string): string[];
|
|
12858
|
-
/**
|
|
12859
|
-
* Resolve dependencies and build dependency graph
|
|
12860
|
-
*/
|
|
12861
|
-
private resolveDependencies;
|
|
12862
|
-
/**
|
|
12863
|
-
* Validate all themes
|
|
12864
|
-
*/
|
|
12865
|
-
validate(): {
|
|
12866
|
-
valid: boolean;
|
|
12867
|
-
errors: string[];
|
|
12868
|
-
};
|
|
12869
|
-
/**
|
|
12870
|
-
* Clear registry
|
|
12871
|
-
*/
|
|
12872
|
-
clear(): void;
|
|
12873
|
-
}
|
|
12874
|
-
|
|
12875
|
-
/**
|
|
12876
|
-
* Theme Cache
|
|
12877
|
-
*
|
|
12878
|
-
* Performance caching layer for loaded themes (CSS and JS)
|
|
12879
|
-
*/
|
|
12880
|
-
|
|
12881
|
-
/**
|
|
12882
|
-
* Cache entry for CSS theme
|
|
12883
|
-
*/
|
|
12884
|
-
interface CSSCacheEntry {
|
|
12885
|
-
type: 'css' | 'js';
|
|
12886
|
-
themeId: string;
|
|
12887
|
-
cssContent?: string;
|
|
12888
|
-
loaded: boolean;
|
|
12889
|
-
loading: Promise<void> | null;
|
|
12890
|
-
timestamp: number;
|
|
12891
|
-
}
|
|
12892
|
-
/**
|
|
12893
|
-
* Cache entry for JS theme
|
|
12894
|
-
*/
|
|
12895
|
-
interface JSCacheEntry {
|
|
12896
|
-
type: 'js';
|
|
12897
|
-
themeId: string;
|
|
12898
|
-
theme: Theme;
|
|
12899
|
-
loaded: boolean;
|
|
12900
|
-
timestamp: number;
|
|
12901
|
-
}
|
|
12902
|
-
/**
|
|
12903
|
-
* Theme cache configuration
|
|
12904
|
-
*/
|
|
12905
|
-
interface CacheConfig {
|
|
12906
|
-
/** Maximum cache size (number of themes) */
|
|
12907
|
-
maxSize?: number;
|
|
12908
|
-
/** Cache TTL in milliseconds (0 = no expiration) */
|
|
12909
|
-
ttl?: number;
|
|
12910
|
-
/** Enable cache */
|
|
12911
|
-
enabled?: boolean;
|
|
12912
|
-
}
|
|
12913
|
-
/**
|
|
12914
|
-
* Theme Cache
|
|
12915
|
-
*
|
|
12916
|
-
* Manages caching of loaded themes for performance optimization
|
|
12917
|
-
*/
|
|
12918
|
-
declare class ThemeCache {
|
|
12919
|
-
private cache;
|
|
12920
|
-
private config;
|
|
12921
|
-
private accessOrder;
|
|
12922
|
-
constructor(config?: CacheConfig);
|
|
12923
|
-
/**
|
|
12924
|
-
* Get cached CSS theme
|
|
12925
|
-
*/
|
|
12926
|
-
getCSS(themeId: string): CSSCacheEntry | null;
|
|
12927
|
-
/**
|
|
12928
|
-
* Get cached JS theme
|
|
12929
|
-
*/
|
|
12930
|
-
getJS(themeId: string): JSCacheEntry | null;
|
|
12931
|
-
/**
|
|
12932
|
-
* Set CSS theme cache entry
|
|
12933
|
-
*/
|
|
12934
|
-
setCSS(themeId: string, entry: Partial<CSSCacheEntry>): void;
|
|
12935
|
-
/**
|
|
12936
|
-
* Set JS theme cache entry
|
|
12937
|
-
*/
|
|
12938
|
-
setJS(themeId: string, theme: Theme): void;
|
|
12939
|
-
/**
|
|
12940
|
-
* Check if theme is cached
|
|
12941
|
-
*/
|
|
12942
|
-
has(themeId: string): boolean;
|
|
12943
|
-
/**
|
|
12944
|
-
* Remove theme from cache
|
|
12945
|
-
*/
|
|
12946
|
-
delete(themeId: string): boolean;
|
|
12947
|
-
/**
|
|
12948
|
-
* Clear all cache
|
|
12949
|
-
*/
|
|
12950
|
-
clear(): void;
|
|
12951
|
-
/**
|
|
12952
|
-
* Get cache statistics
|
|
12953
|
-
*/
|
|
12954
|
-
getStats(): {
|
|
12955
|
-
size: number;
|
|
12956
|
-
maxSize: number;
|
|
12957
|
-
cssThemes: number;
|
|
12958
|
-
jsThemes: number;
|
|
12959
|
-
};
|
|
12960
|
-
/**
|
|
12961
|
-
* Update access order for LRU
|
|
12962
|
-
*/
|
|
12963
|
-
private updateAccessOrder;
|
|
12964
|
-
/**
|
|
12965
|
-
* Remove from access order
|
|
12966
|
-
*/
|
|
12967
|
-
private removeFromAccessOrder;
|
|
12968
|
-
/**
|
|
12969
|
-
* Evict least recently used entries if cache is full
|
|
12970
|
-
*/
|
|
12971
|
-
private evictIfNeeded;
|
|
12972
|
-
}
|
|
12973
|
-
|
|
12974
|
-
/**
|
|
12975
|
-
* Theme Engine
|
|
12976
|
-
*
|
|
12977
|
-
* Core engine for unified CSS and JS theme support
|
|
12978
|
-
*/
|
|
12979
|
-
|
|
12980
|
-
/**
|
|
12981
|
-
* Theme change event
|
|
12982
|
-
*/
|
|
12983
|
-
interface ThemeChangeEvent$1 {
|
|
12984
|
-
/** Previous theme ID */
|
|
12985
|
-
previousTheme: string | null;
|
|
12986
|
-
/** Current theme ID */
|
|
12987
|
-
currentTheme: string;
|
|
12988
|
-
/** Theme object (for JS themes) */
|
|
12989
|
-
themeObject?: Theme | null;
|
|
12990
|
-
/** Timestamp */
|
|
12991
|
-
timestamp: number;
|
|
12992
|
-
/** Source of change */
|
|
12993
|
-
source: 'user' | 'system' | 'storage';
|
|
12994
|
-
}
|
|
12995
|
-
/**
|
|
12996
|
-
* Theme load options
|
|
12997
|
-
*/
|
|
12998
|
-
interface ThemeLoadOptions$1 {
|
|
12999
|
-
/** Force reload even if already loaded */
|
|
13000
|
-
force?: boolean;
|
|
13001
|
-
/** Preload without applying */
|
|
13002
|
-
preload?: boolean;
|
|
13003
|
-
/** Remove previous theme CSS */
|
|
13004
|
-
removePrevious?: boolean;
|
|
13005
|
-
/** Custom CSS path override */
|
|
13006
|
-
customPath?: string;
|
|
13007
|
-
/** Fallback to default theme on error */
|
|
13008
|
-
fallbackOnError?: boolean;
|
|
13009
|
-
}
|
|
13010
|
-
/**
|
|
13011
|
-
* Theme revert event
|
|
13012
|
-
*/
|
|
13013
|
-
interface ThemeRevertEvent {
|
|
13014
|
-
/** Theme ID that was attempted */
|
|
13015
|
-
attemptedTheme: string;
|
|
13016
|
-
/** Theme ID that was reverted to (null if no previous theme) */
|
|
13017
|
-
revertedToTheme: string | null;
|
|
13018
|
-
/** Error that caused the revert */
|
|
13019
|
-
error: Error;
|
|
13020
|
-
/** Timestamp */
|
|
13021
|
-
timestamp: number;
|
|
13022
|
-
}
|
|
13023
|
-
/**
|
|
13024
|
-
* Event listener types
|
|
13025
|
-
*/
|
|
13026
|
-
type ThemeChangeListener = (event: ThemeChangeEvent$1) => void;
|
|
13027
|
-
type ThemeLoadListener = (themeId: string) => void;
|
|
13028
|
-
type ThemeErrorListener = (error: Error, themeId: string) => void;
|
|
13029
|
-
type ThemeRevertListener = (event: ThemeRevertEvent) => void;
|
|
13030
|
-
/**
|
|
13031
|
-
* Theme Engine Configuration
|
|
13032
|
-
*/
|
|
13033
|
-
interface ThemeEngineConfig {
|
|
13034
|
-
/** Base path for CSS themes */
|
|
13035
|
-
basePath?: string;
|
|
13036
|
-
/** CDN path for CSS themes */
|
|
13037
|
-
cdnPath?: string | null;
|
|
13038
|
-
/** Use minified CSS */
|
|
13039
|
-
useMinified?: boolean;
|
|
13040
|
-
/** Data attribute name */
|
|
13041
|
-
dataAttribute?: string;
|
|
13042
|
-
/** Enable caching */
|
|
13043
|
-
enableCache?: boolean;
|
|
13044
|
-
/** Cache configuration */
|
|
13045
|
-
cacheConfig?: {
|
|
13046
|
-
maxSize?: number;
|
|
13047
|
-
ttl?: number;
|
|
13048
|
-
};
|
|
13049
|
-
/** Custom style ID for JS theme CSS injection */
|
|
13050
|
-
styleId?: string;
|
|
13051
|
-
}
|
|
13052
|
-
/**
|
|
13053
|
-
* Theme Engine
|
|
13054
|
-
*
|
|
13055
|
-
* Unified engine for managing CSS and JS themes
|
|
13056
|
-
*/
|
|
13057
|
-
declare class ThemeEngine {
|
|
13058
|
-
private registry;
|
|
13059
|
-
private cache;
|
|
13060
|
-
private validator;
|
|
13061
|
-
private config;
|
|
13062
|
-
private currentTheme;
|
|
13063
|
-
private activeTheme;
|
|
13064
|
-
private loadedThemes;
|
|
13065
|
-
private loadingThemes;
|
|
13066
|
-
private failedThemes;
|
|
13067
|
-
private changeListeners;
|
|
13068
|
-
private loadListeners;
|
|
13069
|
-
private errorListeners;
|
|
13070
|
-
private revertListeners;
|
|
13071
|
-
private logger;
|
|
13072
|
-
constructor(config?: ThemeEngineConfig);
|
|
13073
|
-
/**
|
|
13074
|
-
* Initialize engine with theme registry
|
|
13075
|
-
*/
|
|
13076
|
-
initialize(): Promise<void>;
|
|
13077
|
-
/**
|
|
13078
|
-
* Get current theme ID
|
|
13079
|
-
*/
|
|
13080
|
-
getCurrentTheme(): string | null;
|
|
13081
|
-
/**
|
|
13082
|
-
* Get active theme object
|
|
13083
|
-
*/
|
|
13084
|
-
getActiveTheme(): Theme | null;
|
|
13085
|
-
/**
|
|
13086
|
-
* Check if theme is loaded
|
|
13087
|
-
*/
|
|
13088
|
-
isThemeLoaded(themeId: string): boolean;
|
|
13089
|
-
/**
|
|
13090
|
-
* Load and apply theme
|
|
13091
|
-
*/
|
|
13092
|
-
setTheme(themeId: string | Theme, options?: ThemeLoadOptions$1): Promise<void>;
|
|
13093
|
-
/**
|
|
13094
|
-
* Load theme (CSS or JS)
|
|
13095
|
-
*/
|
|
13096
|
-
private loadTheme;
|
|
13097
|
-
/**
|
|
13098
|
-
* Load CSS theme
|
|
13099
|
-
*/
|
|
13100
|
-
private loadCSSTheme;
|
|
13101
|
-
/**
|
|
13102
|
-
* Load JS theme
|
|
13103
|
-
*/
|
|
13104
|
-
private loadJSTheme;
|
|
13105
|
-
/**
|
|
13106
|
-
* Apply theme (set as active)
|
|
13107
|
-
*/
|
|
13108
|
-
private applyTheme;
|
|
13109
|
-
/**
|
|
13110
|
-
* Apply CSS theme
|
|
13111
|
-
*/
|
|
13112
|
-
private applyCSSTheme;
|
|
13113
|
-
/**
|
|
13114
|
-
* Apply JS theme
|
|
13115
|
-
*/
|
|
13116
|
-
private applyJSTheme;
|
|
13117
|
-
/**
|
|
13118
|
-
* Remove theme
|
|
13119
|
-
*/
|
|
13120
|
-
private removeTheme;
|
|
13121
|
-
/**
|
|
13122
|
-
* Preload theme
|
|
13123
|
-
*/
|
|
13124
|
-
preloadTheme(themeId: string): Promise<void>;
|
|
13125
|
-
/**
|
|
13126
|
-
* Get registry
|
|
13127
|
-
*/
|
|
13128
|
-
getRegistry(): ThemeRegistry;
|
|
13129
|
-
/**
|
|
13130
|
-
* Get cache
|
|
13131
|
-
*/
|
|
13132
|
-
getCache(): ThemeCache;
|
|
13133
|
-
/**
|
|
13134
|
-
* Clear failed theme tracking (allows retry of previously failed themes)
|
|
13135
|
-
*/
|
|
13136
|
-
clearFailedThemes(): void;
|
|
13137
|
-
/**
|
|
13138
|
-
* Clear specific failed theme (allows retry of a specific theme)
|
|
13139
|
-
*/
|
|
13140
|
-
clearFailedTheme(themeId: string): void;
|
|
13141
|
-
/**
|
|
13142
|
-
* Check if theme has failed to load
|
|
13143
|
-
*/
|
|
13144
|
-
hasFailedTheme(themeId: string): boolean;
|
|
13145
|
-
/**
|
|
13146
|
-
* Add change listener
|
|
13147
|
-
*/
|
|
13148
|
-
on(event: 'change', listener: ThemeChangeListener): void;
|
|
13149
|
-
on(event: 'load', listener: ThemeLoadListener): void;
|
|
13150
|
-
on(event: 'error', listener: ThemeErrorListener): void;
|
|
13151
|
-
on(event: 'revert', listener: ThemeRevertListener): void;
|
|
13152
|
-
/**
|
|
13153
|
-
* Remove listener
|
|
13154
|
-
*/
|
|
13155
|
-
off(event: 'change', listener: ThemeChangeListener): void;
|
|
13156
|
-
off(event: 'load', listener: ThemeLoadListener): void;
|
|
13157
|
-
off(event: 'error', listener: ThemeErrorListener): void;
|
|
13158
|
-
off(event: 'revert', listener: ThemeRevertListener): void;
|
|
13159
|
-
/**
|
|
13160
|
-
* Emit change event
|
|
13161
|
-
*/
|
|
13162
|
-
private emitChange;
|
|
13163
|
-
/**
|
|
13164
|
-
* Emit load event
|
|
13165
|
-
*/
|
|
13166
|
-
private emitLoad;
|
|
13167
|
-
/**
|
|
13168
|
-
* Emit error event
|
|
13169
|
-
* Emits error to listeners (error emission is controlled at call site)
|
|
13170
|
-
*/
|
|
13171
|
-
private emitError;
|
|
13172
|
-
/**
|
|
13173
|
-
* Emit revert event
|
|
13174
|
-
*/
|
|
13175
|
-
private emitRevert;
|
|
13176
|
-
}
|
|
13177
|
-
|
|
13178
|
-
/**
|
|
13179
|
-
* Theme Manager
|
|
13180
|
-
*
|
|
13181
|
-
* Core theme management class for the Atomix Design System.
|
|
13182
|
-
* Rewritten to use the new ThemeEngine architecture.
|
|
13183
|
-
* Handles theme loading, switching, persistence, and events.
|
|
13184
|
-
* Supports both CSS-based themes and JavaScript-based themes.
|
|
13185
|
-
*/
|
|
13186
|
-
|
|
13187
|
-
/**
|
|
13188
|
-
* ThemeManager class
|
|
13189
|
-
*
|
|
13190
|
-
* Manages theme loading, switching, and persistence for Atomix Design System.
|
|
13191
|
-
* Uses the new ThemeEngine architecture for unified CSS/JS theme support.
|
|
13192
|
-
*
|
|
13193
|
-
* @example
|
|
13194
|
-
* ```typescript
|
|
13195
|
-
* const themeManager = new ThemeManager({
|
|
13196
|
-
* // No defaultTheme - uses built-in styles
|
|
13197
|
-
* });
|
|
13198
|
-
*
|
|
13199
|
-
* await themeManager.setTheme('my-custom-theme');
|
|
13200
|
-
* ```
|
|
13201
|
-
*/
|
|
13202
|
-
declare class ThemeManager {
|
|
13203
|
-
private engine;
|
|
13204
|
-
private config;
|
|
13205
|
-
private currentTheme;
|
|
13206
|
-
private activeTheme;
|
|
13207
|
-
private eventListeners;
|
|
13208
|
-
private storageAdapter;
|
|
13209
|
-
private initialized;
|
|
13210
|
-
private rtlManager?;
|
|
13211
|
-
private logger;
|
|
13212
|
-
/**
|
|
13213
|
-
* Create a new ThemeManager instance
|
|
13214
|
-
*
|
|
13215
|
-
* @param config - Theme manager configuration
|
|
13216
|
-
*/
|
|
13217
|
-
constructor(config: ThemeManagerConfig);
|
|
13218
|
-
/**
|
|
13219
|
-
* Initialize the theme manager
|
|
13220
|
-
*/
|
|
13221
|
-
private initialize;
|
|
13222
|
-
/**
|
|
13223
|
-
* Get default theme
|
|
13224
|
-
*/
|
|
13225
|
-
private getDefaultTheme;
|
|
13226
|
-
/**
|
|
13227
|
-
* Set theme
|
|
13228
|
-
*/
|
|
13229
|
-
setTheme(theme: string | Theme, options?: ThemeLoadOptions): Promise<void>;
|
|
13230
|
-
/**
|
|
13231
|
-
* Get current theme
|
|
13232
|
-
*/
|
|
13233
|
-
getTheme(): string;
|
|
13234
|
-
/**
|
|
13235
|
-
* Get active theme object (for JS themes)
|
|
13236
|
-
*/
|
|
13237
|
-
getActiveTheme(): Theme | null;
|
|
13238
|
-
/**
|
|
13239
|
-
* Get available themes
|
|
13240
|
-
*/
|
|
13241
|
-
getAvailableThemes(): ThemeMetadata[];
|
|
13242
|
-
/**
|
|
13243
|
-
* Check if theme is loaded
|
|
13244
|
-
*/
|
|
13245
|
-
isThemeLoaded(themeName: string): boolean;
|
|
13246
|
-
/**
|
|
13247
|
-
* Preload theme
|
|
13248
|
-
*/
|
|
13249
|
-
preloadTheme(themeName: string): Promise<void>;
|
|
13250
|
-
/**
|
|
13251
|
-
* Add event listener
|
|
13252
|
-
*/
|
|
13253
|
-
on(event: 'themeChange', callback: ThemeChangeCallback): void;
|
|
13254
|
-
on(event: 'themeLoad', callback: ThemeLoadCallback): void;
|
|
13255
|
-
on(event: 'themeError', callback: ThemeErrorCallback): void;
|
|
13256
|
-
/**
|
|
13257
|
-
* Remove event listener
|
|
13258
|
-
*/
|
|
13259
|
-
off(event: 'themeChange', callback: ThemeChangeCallback): void;
|
|
13260
|
-
off(event: 'themeLoad', callback: ThemeLoadCallback): void;
|
|
13261
|
-
off(event: 'themeError', callback: ThemeErrorCallback): void;
|
|
13262
|
-
/**
|
|
13263
|
-
* Emit theme change event
|
|
13264
|
-
*/
|
|
13265
|
-
private emitThemeChange;
|
|
13266
|
-
/**
|
|
13267
|
-
* Emit theme load event
|
|
13268
|
-
*/
|
|
13269
|
-
private emitThemeLoad;
|
|
13270
|
-
/**
|
|
13271
|
-
* Emit theme error event
|
|
13272
|
-
*/
|
|
13273
|
-
private emitThemeError;
|
|
13274
|
-
/**
|
|
13275
|
-
* Get engine instance (for advanced usage)
|
|
13276
|
-
*/
|
|
13277
|
-
getEngine(): ThemeEngine;
|
|
13278
|
-
/**
|
|
13279
|
-
* Get RTL manager
|
|
13280
|
-
*/
|
|
13281
|
-
getRTLManager(): RTLManager | undefined;
|
|
13282
|
-
/**
|
|
13283
|
-
* Set RTL direction
|
|
13284
|
-
*/
|
|
13285
|
-
setDirection(direction: 'ltr' | 'rtl'): void;
|
|
13286
|
-
/**
|
|
13287
|
-
* Get current direction
|
|
13288
|
-
*/
|
|
13289
|
-
getDirection(): 'ltr' | 'rtl';
|
|
13290
|
-
/**
|
|
13291
|
-
* Destroy theme manager
|
|
13292
|
-
*/
|
|
13293
|
-
destroy(): void;
|
|
13294
|
-
}
|
|
13295
|
-
|
|
13296
|
-
/**
|
|
13297
|
-
* Theme metadata interface matching themes.config.js structure
|
|
13298
|
-
*/
|
|
13299
|
-
interface ThemeMetadata {
|
|
13300
|
-
/** Display name of the theme */
|
|
13301
|
-
name: string;
|
|
13302
|
-
/** Unique identifier/class name for the theme */
|
|
13303
|
-
class?: string;
|
|
13304
|
-
/** Theme description */
|
|
13305
|
-
description?: string;
|
|
13306
|
-
/** Theme author */
|
|
13307
|
-
author?: string;
|
|
13308
|
-
/** Theme version (semver) */
|
|
13309
|
-
version?: string;
|
|
13310
|
-
/** Theme tags for categorization */
|
|
13311
|
-
tags?: string[];
|
|
13312
|
-
/** Whether the theme supports dark mode */
|
|
13313
|
-
supportsDarkMode?: boolean;
|
|
13314
|
-
/** Theme status: stable, beta, experimental, deprecated */
|
|
13315
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
13316
|
-
/** Accessibility information */
|
|
13317
|
-
a11y?: {
|
|
13318
|
-
/** Target contrast ratio */
|
|
13319
|
-
contrastTarget?: number;
|
|
13320
|
-
/** Supported color modes */
|
|
13321
|
-
modes?: string[];
|
|
13322
|
-
};
|
|
13323
|
-
/** Primary theme color (for UI display) */
|
|
13324
|
-
color?: string;
|
|
13325
|
-
/** Theme features list */
|
|
13326
|
-
features?: string[];
|
|
13327
|
-
/** Theme dependencies (other themes required) */
|
|
13328
|
-
dependencies?: string[];
|
|
13329
|
-
}
|
|
13330
|
-
/**
|
|
13331
|
-
* Theme manager configuration options
|
|
13332
|
-
*/
|
|
13333
|
-
interface ThemeManagerConfig {
|
|
13334
|
-
/** Available themes metadata */
|
|
13335
|
-
themes: Record<string, ThemeMetadata>;
|
|
13336
|
-
/** Default theme to use */
|
|
13337
|
-
defaultTheme?: string | Theme;
|
|
13338
|
-
/** Base path for theme CSS files */
|
|
13339
|
-
basePath?: string;
|
|
13340
|
-
/** CDN path for theme CSS files (optional) */
|
|
13341
|
-
cdnPath?: string | null;
|
|
13342
|
-
/** Themes to preload on initialization */
|
|
13343
|
-
preload?: string[];
|
|
13344
|
-
/** Enable lazy loading of themes */
|
|
13345
|
-
lazy?: boolean;
|
|
13346
|
-
/** localStorage key for persistence */
|
|
13347
|
-
storageKey?: string;
|
|
13348
|
-
/** Data attribute name for theme */
|
|
13349
|
-
dataAttribute?: string;
|
|
13350
|
-
/** Enable persistence */
|
|
13351
|
-
enablePersistence?: boolean;
|
|
13352
|
-
/** Custom CSS file extension */
|
|
13353
|
-
cssExtension?: string;
|
|
13354
|
-
/** Use minified CSS files */
|
|
13355
|
-
useMinified?: boolean;
|
|
13356
|
-
/** Callback when theme changes */
|
|
13357
|
-
onThemeChange?: (theme: string | Theme) => void;
|
|
13358
|
-
/** Callback when theme load fails */
|
|
13359
|
-
onError?: (error: Error, themeName: string) => void;
|
|
13360
|
-
/** RTL configuration */
|
|
13361
|
-
rtl?: RTLConfig;
|
|
13362
|
-
}
|
|
13363
|
-
/**
|
|
13364
|
-
* Theme change event payload
|
|
13365
|
-
*/
|
|
13366
|
-
interface ThemeChangeEvent {
|
|
13367
|
-
/** Previous theme name */
|
|
13368
|
-
previousTheme: string | null;
|
|
13369
|
-
/** New theme name */
|
|
13370
|
-
currentTheme: string;
|
|
13371
|
-
/** Theme object (for JS themes) */
|
|
13372
|
-
themeObject?: Theme | null;
|
|
13373
|
-
/** Timestamp of the change */
|
|
13374
|
-
timestamp: number;
|
|
13375
|
-
/** Whether the change was from user action or system */
|
|
13376
|
-
source: 'user' | 'system' | 'storage';
|
|
13377
|
-
}
|
|
13378
|
-
/**
|
|
13379
|
-
* Theme load options
|
|
13380
|
-
*/
|
|
13381
|
-
interface ThemeLoadOptions {
|
|
13382
|
-
/** Force reload even if already loaded */
|
|
13383
|
-
force?: boolean;
|
|
13384
|
-
/** Preload without applying */
|
|
13385
|
-
preload?: boolean;
|
|
13386
|
-
/** Remove previous theme CSS */
|
|
13387
|
-
removePrevious?: boolean;
|
|
13388
|
-
/** Custom CSS path override */
|
|
13389
|
-
customPath?: string;
|
|
13390
|
-
/** Fallback to default theme on error */
|
|
13391
|
-
fallbackOnError?: boolean;
|
|
13392
|
-
}
|
|
13393
|
-
/**
|
|
13394
|
-
* Theme validation result
|
|
13395
|
-
*/
|
|
13396
|
-
interface ThemeValidationResult {
|
|
13397
|
-
/** Whether the theme is valid */
|
|
13398
|
-
valid: boolean;
|
|
13399
|
-
/** Validation errors */
|
|
13400
|
-
errors: string[];
|
|
13401
|
-
/** Validation warnings */
|
|
13402
|
-
warnings: string[];
|
|
13403
|
-
}
|
|
13404
|
-
/**
|
|
13405
|
-
* Theme change callback function
|
|
13406
|
-
*/
|
|
13407
|
-
type ThemeChangeCallback = (event: ThemeChangeEvent) => void;
|
|
13408
|
-
/**
|
|
13409
|
-
* Theme load callback function
|
|
13410
|
-
*/
|
|
13411
|
-
type ThemeLoadCallback = (themeName: string) => void;
|
|
13412
|
-
/**
|
|
13413
|
-
* Theme error callback function
|
|
13414
|
-
*/
|
|
13415
|
-
type ThemeErrorCallback = (error: Error, themeName: string) => void;
|
|
13416
|
-
/**
|
|
13417
|
-
* React hook return type for useTheme
|
|
13418
|
-
*/
|
|
13419
|
-
interface UseThemeReturn {
|
|
13420
|
-
/** Current theme name */
|
|
13421
|
-
theme: string;
|
|
13422
|
-
/** Current active theme object (for JS themes) */
|
|
13423
|
-
activeTheme: Theme | null;
|
|
13424
|
-
/** Function to change theme */
|
|
13425
|
-
setTheme: (theme: string | Theme, options?: ThemeLoadOptions) => Promise<void>;
|
|
13426
|
-
/** Available themes */
|
|
13427
|
-
availableThemes: ThemeMetadata[];
|
|
13428
|
-
/** Whether a theme is currently loading */
|
|
13429
|
-
isLoading: boolean;
|
|
13430
|
-
/** Current error, if any */
|
|
13431
|
-
error: Error | null;
|
|
13432
|
-
/** Whether a specific theme is loaded */
|
|
13433
|
-
isThemeLoaded: (themeName: string) => boolean;
|
|
13434
|
-
/** Preload a theme */
|
|
13435
|
-
preloadTheme: (themeName: string) => Promise<void>;
|
|
13436
|
-
}
|
|
13437
|
-
/**
|
|
13438
|
-
* Component-level theme override configuration
|
|
13439
|
-
*/
|
|
13440
|
-
interface ComponentThemeOverride {
|
|
13441
|
-
/** CSS variable overrides for the component */
|
|
13442
|
-
cssVars?: Record<string, string | number>;
|
|
13443
|
-
/** Default prop overrides */
|
|
13444
|
-
defaultProps?: Record<string, any>;
|
|
13445
|
-
/** Part-specific overrides */
|
|
13446
|
-
parts?: Record<string, {
|
|
13447
|
-
cssVars?: Record<string, string | number>;
|
|
13448
|
-
className?: string;
|
|
13449
|
-
}>;
|
|
13450
|
-
/** Variant overrides */
|
|
13451
|
-
variants?: Record<string, {
|
|
13452
|
-
cssVars?: Record<string, string | number>;
|
|
13453
|
-
className?: string;
|
|
13454
|
-
}>;
|
|
13455
|
-
/** Additional className for the component */
|
|
13456
|
-
className?: string;
|
|
13457
|
-
}
|
|
13458
|
-
/**
|
|
13459
|
-
* Theme component overrides for all components
|
|
13460
|
-
*/
|
|
13461
|
-
interface ThemeComponentOverrides {
|
|
13462
|
-
Button?: ComponentThemeOverride;
|
|
13463
|
-
Card?: ComponentThemeOverride;
|
|
13464
|
-
Input?: ComponentThemeOverride;
|
|
13465
|
-
Modal?: ComponentThemeOverride;
|
|
13466
|
-
Dropdown?: ComponentThemeOverride;
|
|
13467
|
-
Badge?: ComponentThemeOverride;
|
|
13468
|
-
Tabs?: ComponentThemeOverride;
|
|
13469
|
-
Progress?: ComponentThemeOverride;
|
|
13470
|
-
Tooltip?: ComponentThemeOverride;
|
|
13471
|
-
Select?: ComponentThemeOverride;
|
|
13472
|
-
Checkbox?: ComponentThemeOverride;
|
|
13473
|
-
Radio?: ComponentThemeOverride;
|
|
13474
|
-
Textarea?: ComponentThemeOverride;
|
|
13475
|
-
FormGroup?: ComponentThemeOverride;
|
|
13476
|
-
Navbar?: ComponentThemeOverride;
|
|
13477
|
-
Accordion?: ComponentThemeOverride;
|
|
13478
|
-
DataTable?: ComponentThemeOverride;
|
|
13479
|
-
Avatar?: ComponentThemeOverride;
|
|
13480
|
-
List?: ComponentThemeOverride;
|
|
13481
|
-
Popover?: ComponentThemeOverride;
|
|
13482
|
-
Messages?: ComponentThemeOverride;
|
|
13483
|
-
Callout?: ComponentThemeOverride;
|
|
13484
|
-
Spinner?: ComponentThemeOverride;
|
|
13485
|
-
[key: string]: ComponentThemeOverride | undefined;
|
|
13486
|
-
}
|
|
13487
|
-
/**
|
|
13488
|
-
* Theme provider props
|
|
13489
|
-
*/
|
|
13490
|
-
interface ThemeProviderProps {
|
|
13491
|
-
/** Child components */
|
|
13492
|
-
children: React.ReactNode;
|
|
13493
|
-
/** Default theme */
|
|
13494
|
-
defaultTheme?: string | Theme;
|
|
13495
|
-
/** Available themes */
|
|
13496
|
-
themes?: Record<string, ThemeMetadata>;
|
|
13497
|
-
/** Base path for theme CSS */
|
|
13498
|
-
basePath?: string;
|
|
13499
|
-
/** CDN path for theme CSS */
|
|
13500
|
-
cdnPath?: string | null;
|
|
13501
|
-
/** Themes to preload */
|
|
13502
|
-
preload?: string[];
|
|
13503
|
-
/** Enable lazy loading */
|
|
13504
|
-
lazy?: boolean;
|
|
13505
|
-
/** localStorage key */
|
|
13506
|
-
storageKey?: string;
|
|
13507
|
-
/** Data attribute name */
|
|
13508
|
-
dataAttribute?: string;
|
|
13509
|
-
/** Enable persistence */
|
|
13510
|
-
enablePersistence?: boolean;
|
|
13511
|
-
/** Use minified CSS */
|
|
13512
|
-
useMinified?: boolean;
|
|
13513
|
-
/** Callback when theme changes */
|
|
13514
|
-
onThemeChange?: (theme: string | Theme) => void;
|
|
13515
|
-
/** Callback on error */
|
|
13516
|
-
onError?: (error: Error, themeName: string) => void;
|
|
12785
|
+
/** Callback when theme changes */
|
|
12786
|
+
onThemeChange?: (theme: string | Theme | DesignTokens) => void;
|
|
12787
|
+
/** Callback on error */
|
|
12788
|
+
onError?: (error: Error, themeName: string) => void;
|
|
13517
12789
|
}
|
|
13518
12790
|
/**
|
|
13519
12791
|
* Theme context value
|
|
@@ -13523,10 +12795,10 @@ interface ThemeContextValue {
|
|
|
13523
12795
|
theme: string;
|
|
13524
12796
|
/** Current active theme object (for JS themes) */
|
|
13525
12797
|
activeTheme: Theme | null;
|
|
13526
|
-
/** Set theme function */
|
|
13527
|
-
setTheme: (theme: string | Theme
|
|
12798
|
+
/** Set theme function (supports string, Theme, or DesignTokens) */
|
|
12799
|
+
setTheme: (theme: string | Theme | DesignTokens | Partial<DesignTokens>, options?: ThemeLoadOptions) => Promise<void>;
|
|
13528
12800
|
/** Available themes */
|
|
13529
|
-
availableThemes: ThemeMetadata[];
|
|
12801
|
+
availableThemes: ThemeMetadata$1[];
|
|
13530
12802
|
/** Loading state */
|
|
13531
12803
|
isLoading: boolean;
|
|
13532
12804
|
/** Error state */
|
|
@@ -13535,8 +12807,6 @@ interface ThemeContextValue {
|
|
|
13535
12807
|
isThemeLoaded: (themeName: string) => boolean;
|
|
13536
12808
|
/** Preload theme */
|
|
13537
12809
|
preloadTheme: (themeName: string) => Promise<void>;
|
|
13538
|
-
/** Theme manager instance */
|
|
13539
|
-
themeManager: ThemeManager;
|
|
13540
12810
|
}
|
|
13541
12811
|
/**
|
|
13542
12812
|
* Color palette configuration for a single color
|
|
@@ -13755,7 +13025,7 @@ interface ThemeCustomProperties {
|
|
|
13755
13025
|
* Theme configuration options for createTheme
|
|
13756
13026
|
* Extends ThemeMetadata to support both CSS and JS theme properties
|
|
13757
13027
|
*/
|
|
13758
|
-
interface ThemeOptions extends Partial<ThemeMetadata> {
|
|
13028
|
+
interface ThemeOptions extends Partial<ThemeMetadata$1> {
|
|
13759
13029
|
/** Color palette configuration */
|
|
13760
13030
|
palette?: PaletteOptions;
|
|
13761
13031
|
/** Typography configuration */
|
|
@@ -13779,7 +13049,7 @@ interface ThemeOptions extends Partial<ThemeMetadata> {
|
|
|
13779
13049
|
* Complete theme object with computed values
|
|
13780
13050
|
* Generated by createTheme function
|
|
13781
13051
|
*/
|
|
13782
|
-
interface Theme extends ThemeMetadata {
|
|
13052
|
+
interface Theme extends ThemeMetadata$1 {
|
|
13783
13053
|
/** Color palette with computed values */
|
|
13784
13054
|
palette: {
|
|
13785
13055
|
primary: PaletteColor;
|
|
@@ -13846,30 +13116,392 @@ interface Theme extends ThemeMetadata {
|
|
|
13846
13116
|
}
|
|
13847
13117
|
|
|
13848
13118
|
/**
|
|
13849
|
-
*
|
|
13119
|
+
* CSS Variable Generator
|
|
13120
|
+
*
|
|
13121
|
+
* Generates CSS custom properties from design tokens.
|
|
13122
|
+
*/
|
|
13123
|
+
|
|
13124
|
+
/**
|
|
13125
|
+
* Options for CSS variable generation
|
|
13126
|
+
*/
|
|
13127
|
+
interface GenerateCSSVariablesOptions {
|
|
13128
|
+
/** CSS selector for the variables (default: ':root') */
|
|
13129
|
+
selector?: string;
|
|
13130
|
+
/** Prefix for CSS variables (default: 'atomix') */
|
|
13131
|
+
prefix?: string;
|
|
13132
|
+
}
|
|
13133
|
+
/**
|
|
13134
|
+
* Generate CSS variables from tokens
|
|
13135
|
+
*
|
|
13136
|
+
* Converts flat token object to CSS custom properties.
|
|
13137
|
+
*
|
|
13138
|
+
* @param tokens - Design tokens object
|
|
13139
|
+
* @param options - Generation options
|
|
13140
|
+
* @returns CSS string with custom properties
|
|
13141
|
+
*
|
|
13142
|
+
* @example
|
|
13143
|
+
* ```typescript
|
|
13144
|
+
* const tokens = {
|
|
13145
|
+
* 'primary': '#7c3aed',
|
|
13146
|
+
* 'spacing-4': '1rem',
|
|
13147
|
+
* };
|
|
13148
|
+
*
|
|
13149
|
+
* const css = generateCSSVariables(tokens);
|
|
13150
|
+
* // Returns: ":root {\n --atomix-primary: #7c3aed;\n --atomix-spacing-4: 1rem;\n}"
|
|
13151
|
+
* ```
|
|
13152
|
+
*/
|
|
13153
|
+
declare function generateCSSVariables(tokens: DesignTokens, options?: GenerateCSSVariablesOptions): string;
|
|
13154
|
+
/**
|
|
13155
|
+
* Generate CSS variables with custom selector
|
|
13156
|
+
*
|
|
13157
|
+
* Useful for theme-specific selectors like `[data-theme="dark"]`
|
|
13850
13158
|
*
|
|
13851
|
-
*
|
|
13852
|
-
*
|
|
13159
|
+
* @param tokens - Design tokens object
|
|
13160
|
+
* @param selector - CSS selector (e.g., '[data-theme="dark"]')
|
|
13161
|
+
* @param prefix - CSS variable prefix
|
|
13162
|
+
* @returns CSS string
|
|
13163
|
+
*
|
|
13164
|
+
* @example
|
|
13165
|
+
* ```typescript
|
|
13166
|
+
* const css = generateCSSVariablesForSelector(
|
|
13167
|
+
* tokens,
|
|
13168
|
+
* '[data-theme="dark"]',
|
|
13169
|
+
* 'atomix'
|
|
13170
|
+
* );
|
|
13171
|
+
* ```
|
|
13172
|
+
*/
|
|
13173
|
+
declare function generateCSSVariablesForSelector(tokens: DesignTokens, selector: string, prefix?: string): string;
|
|
13174
|
+
|
|
13175
|
+
/**
|
|
13176
|
+
* Core Theme Functions
|
|
13177
|
+
*
|
|
13178
|
+
* Simplified theme system that handles both DesignTokens and Theme objects.
|
|
13179
|
+
* Config-first approach: loads from atomix.config.ts when no input is provided.
|
|
13180
|
+
* Config file is required for automatic loading.
|
|
13853
13181
|
*/
|
|
13854
13182
|
|
|
13855
13183
|
/**
|
|
13856
|
-
*
|
|
13184
|
+
* Create theme CSS from tokens or Theme object
|
|
13857
13185
|
*
|
|
13858
|
-
*
|
|
13859
|
-
*
|
|
13186
|
+
* **Config-First Approach**: If no input is provided, loads from `atomix.config.ts`.
|
|
13187
|
+
* Config file is required for automatic loading.
|
|
13188
|
+
*
|
|
13189
|
+
* @param input - DesignTokens (partial), Theme object, or undefined (loads from config)
|
|
13190
|
+
* @param options - CSS generation options (prefix is automatically read from config if not provided)
|
|
13191
|
+
* @returns CSS string with custom properties
|
|
13192
|
+
* @throws Error if config loading fails when no input is provided
|
|
13860
13193
|
*
|
|
13861
13194
|
* @example
|
|
13862
|
-
* ```
|
|
13863
|
-
*
|
|
13195
|
+
* ```typescript
|
|
13196
|
+
* // Loads from atomix.config.ts (config file required)
|
|
13197
|
+
* const css = createTheme();
|
|
13198
|
+
*
|
|
13199
|
+
* // Using DesignTokens
|
|
13200
|
+
* const css = createTheme({
|
|
13201
|
+
* 'primary': '#7c3aed',
|
|
13202
|
+
* 'spacing-4': '1rem',
|
|
13203
|
+
* });
|
|
13204
|
+
*
|
|
13205
|
+
* // Using Theme object
|
|
13206
|
+
* const theme = createThemeObject({ palette: { primary: { main: '#7c3aed' } } });
|
|
13207
|
+
* const css = createTheme(theme);
|
|
13208
|
+
*
|
|
13209
|
+
* // With custom options
|
|
13210
|
+
* const css = createTheme(undefined, { prefix: 'myapp', selector: ':root' });
|
|
13211
|
+
* ```
|
|
13212
|
+
*/
|
|
13213
|
+
declare function createTheme(input?: Partial<DesignTokens> | Theme, options?: GenerateCSSVariablesOptions): string;
|
|
13214
|
+
|
|
13215
|
+
/**
|
|
13216
|
+
* createThemeObject - Create a theme object with computed values
|
|
13217
|
+
*
|
|
13218
|
+
* Similar to Material-UI's createTheme, this function accepts theme configuration
|
|
13219
|
+
* options and returns a complete theme object with computed values.
|
|
13220
|
+
*
|
|
13221
|
+
* NOTE: For most use cases, use the simple theme system's `createTheme` instead,
|
|
13222
|
+
* which generates CSS from DesignTokens. This function is for advanced use cases
|
|
13223
|
+
* that need the full Theme object structure.
|
|
13224
|
+
*
|
|
13225
|
+
* @example
|
|
13226
|
+
* ```typescript
|
|
13227
|
+
* const theme = createThemeObject({
|
|
13228
|
+
* palette: {
|
|
13229
|
+
* primary: { main: '#7AFFD7' },
|
|
13230
|
+
* secondary: { main: '#FF5733' },
|
|
13231
|
+
* },
|
|
13232
|
+
* typography: {
|
|
13233
|
+
* fontFamily: 'Inter, sans-serif',
|
|
13234
|
+
* },
|
|
13235
|
+
* });
|
|
13236
|
+
* ```
|
|
13237
|
+
*/
|
|
13238
|
+
|
|
13239
|
+
/**
|
|
13240
|
+
* Create a theme object with computed values
|
|
13241
|
+
*
|
|
13242
|
+
* @param options - Theme configuration options
|
|
13243
|
+
* @returns Complete theme object
|
|
13244
|
+
*/
|
|
13245
|
+
declare function createThemeObject(...options: ThemeOptions[]): Theme;
|
|
13246
|
+
|
|
13247
|
+
/**
|
|
13248
|
+
* Theme Composition Utilities
|
|
13249
|
+
*
|
|
13250
|
+
* Simplified utilities for composing, merging, and extending themes.
|
|
13251
|
+
*/
|
|
13252
|
+
|
|
13253
|
+
/**
|
|
13254
|
+
* Deep merge multiple objects
|
|
13255
|
+
* Later objects override earlier ones
|
|
13256
|
+
*/
|
|
13257
|
+
declare function deepMerge<T extends Record<string, unknown>>(...objects: Partial<T>[]): T;
|
|
13258
|
+
/**
|
|
13259
|
+
* Merge multiple theme options into a single theme options object
|
|
13260
|
+
*
|
|
13261
|
+
* @param themes - Theme options to merge
|
|
13262
|
+
* @returns Merged theme options
|
|
13263
|
+
*
|
|
13264
|
+
* @example
|
|
13265
|
+
* ```typescript
|
|
13266
|
+
* const baseTheme = { palette: { primary: { main: '#000' } } };
|
|
13267
|
+
* const customTheme = { palette: { secondary: { main: '#fff' } } };
|
|
13268
|
+
* const merged = mergeTheme(baseTheme, customTheme);
|
|
13269
|
+
* ```
|
|
13270
|
+
*/
|
|
13271
|
+
declare function mergeTheme(...themes: ThemeOptions[]): ThemeOptions;
|
|
13272
|
+
/**
|
|
13273
|
+
* Extend an existing theme with new options
|
|
13274
|
+
*
|
|
13275
|
+
* @param baseTheme - Base theme to extend (can be Theme or ThemeOptions)
|
|
13276
|
+
* @param extension - Theme options to extend with
|
|
13277
|
+
* @returns New theme with extended options
|
|
13278
|
+
*
|
|
13279
|
+
* @example
|
|
13280
|
+
* ```typescript
|
|
13281
|
+
* const base = createTheme({ palette: { primary: { main: '#000' } } });
|
|
13282
|
+
* const extended = extendTheme(base, {
|
|
13283
|
+
* palette: { secondary: { main: '#fff' } }
|
|
13284
|
+
* });
|
|
13285
|
+
* ```
|
|
13286
|
+
*/
|
|
13287
|
+
declare function extendTheme(baseTheme: Theme | ThemeOptions, extension: ThemeOptions): Theme;
|
|
13288
|
+
|
|
13289
|
+
/**
|
|
13290
|
+
* Theme Metadata interface
|
|
13291
|
+
*/
|
|
13292
|
+
interface ThemeMetadata {
|
|
13293
|
+
name: string;
|
|
13294
|
+
class: string;
|
|
13295
|
+
description?: string;
|
|
13296
|
+
version?: string;
|
|
13297
|
+
[key: string]: any;
|
|
13298
|
+
}
|
|
13299
|
+
/**
|
|
13300
|
+
* Theme Registry type - a record of theme IDs to metadata
|
|
13301
|
+
*/
|
|
13302
|
+
type ThemeRegistry = Record<string, ThemeMetadata>;
|
|
13303
|
+
/**
|
|
13304
|
+
* Create a new theme registry
|
|
13305
|
+
*/
|
|
13306
|
+
declare function createThemeRegistry(): ThemeRegistry;
|
|
13307
|
+
/**
|
|
13308
|
+
* Register a theme
|
|
13309
|
+
* @param registry - Theme registry object
|
|
13310
|
+
* @param id - Theme identifier
|
|
13311
|
+
* @param metadata - Theme metadata
|
|
13312
|
+
*/
|
|
13313
|
+
declare function registerTheme(registry: ThemeRegistry, id: string, metadata: ThemeMetadata): void;
|
|
13314
|
+
/**
|
|
13315
|
+
* Unregister a theme
|
|
13316
|
+
* @param registry - Theme registry object
|
|
13317
|
+
* @param id - Theme identifier
|
|
13318
|
+
*/
|
|
13319
|
+
declare function unregisterTheme(registry: ThemeRegistry, id: string): boolean;
|
|
13320
|
+
/**
|
|
13321
|
+
* Check if a theme is registered
|
|
13322
|
+
* @param registry - Theme registry object
|
|
13323
|
+
* @param id - Theme identifier
|
|
13324
|
+
*/
|
|
13325
|
+
declare function hasTheme(registry: ThemeRegistry, id: string): boolean;
|
|
13326
|
+
/**
|
|
13327
|
+
* Get theme metadata
|
|
13328
|
+
* @param registry - Theme registry object
|
|
13329
|
+
* @param id - Theme identifier
|
|
13330
|
+
*/
|
|
13331
|
+
declare function getTheme(registry: ThemeRegistry, id: string): ThemeMetadata | undefined;
|
|
13332
|
+
/**
|
|
13333
|
+
* Get all registered theme metadata
|
|
13334
|
+
* @param registry - Theme registry object
|
|
13335
|
+
*/
|
|
13336
|
+
declare function getAllThemes(registry: ThemeRegistry): ThemeMetadata[];
|
|
13337
|
+
/**
|
|
13338
|
+
* Get all registered theme IDs
|
|
13339
|
+
* @param registry - Theme registry object
|
|
13340
|
+
*/
|
|
13341
|
+
declare function getThemeIds(registry: ThemeRegistry): string[];
|
|
13342
|
+
/**
|
|
13343
|
+
* Clear all registered themes
|
|
13344
|
+
* @param registry - Theme registry object
|
|
13345
|
+
*/
|
|
13346
|
+
declare function clearThemes(registry: ThemeRegistry): void;
|
|
13347
|
+
/**
|
|
13348
|
+
* Get the number of registered themes
|
|
13349
|
+
* @param registry - Theme registry object
|
|
13350
|
+
*/
|
|
13351
|
+
declare function getThemeCount(registry: ThemeRegistry): number;
|
|
13352
|
+
|
|
13353
|
+
/**
|
|
13354
|
+
* Naming Utilities
|
|
13355
|
+
*
|
|
13356
|
+
* Provides consistent naming conventions across the theme system
|
|
13357
|
+
*/
|
|
13358
|
+
interface NamingOptions {
|
|
13359
|
+
prefix?: string;
|
|
13360
|
+
component?: string;
|
|
13361
|
+
variant?: string;
|
|
13362
|
+
state?: string;
|
|
13363
|
+
}
|
|
13364
|
+
/**
|
|
13365
|
+
* Generate consistent CSS class names following BEM methodology
|
|
13366
|
+
*/
|
|
13367
|
+
declare function generateClassName(block: string, element?: string, modifiers?: Record<string, boolean | string>): string;
|
|
13368
|
+
/**
|
|
13369
|
+
* Generate consistent CSS variable names
|
|
13370
|
+
*/
|
|
13371
|
+
declare function generateCSSVariableName(property: string, options?: NamingOptions): string;
|
|
13372
|
+
/**
|
|
13373
|
+
* Normalize theme tokens to consistent naming convention
|
|
13374
|
+
*/
|
|
13375
|
+
declare function normalizeThemeTokens(tokens: Record<string, any>): Record<string, any>;
|
|
13376
|
+
/**
|
|
13377
|
+
* Convert camelCase to kebab-case for CSS custom properties
|
|
13378
|
+
*/
|
|
13379
|
+
declare function camelToKebab(str: string): string;
|
|
13380
|
+
/**
|
|
13381
|
+
* Convert theme property to CSS variable name
|
|
13382
|
+
*/
|
|
13383
|
+
declare function themePropertyToCSSVar(propertyPath: string, prefix?: string): string;
|
|
13384
|
+
|
|
13385
|
+
/**
|
|
13386
|
+
* Component Theming Utilities
|
|
13387
|
+
*
|
|
13388
|
+
* Provides consistent patterns for applying theme values to components
|
|
13389
|
+
*/
|
|
13390
|
+
|
|
13391
|
+
interface ComponentThemeOptions {
|
|
13392
|
+
component: string;
|
|
13393
|
+
variant?: string;
|
|
13394
|
+
size?: string;
|
|
13395
|
+
theme: Theme;
|
|
13396
|
+
}
|
|
13397
|
+
/**
|
|
13398
|
+
* Get a theme value for a specific component using CSS variables
|
|
13399
|
+
* This ensures all components access theme values consistently
|
|
13400
|
+
*/
|
|
13401
|
+
declare function getComponentThemeValue(component: string, property: string, variant?: string, size?: string): string;
|
|
13402
|
+
/**
|
|
13403
|
+
* Generate component-specific CSS variables from theme
|
|
13404
|
+
*/
|
|
13405
|
+
declare function generateComponentCSSVars(component: string, theme: Theme, variant?: string, size?: string): Record<string, string>;
|
|
13406
|
+
/**
|
|
13407
|
+
* Apply consistent theme to component style object
|
|
13408
|
+
*/
|
|
13409
|
+
declare function applyComponentTheme(component: string, style?: React.CSSProperties, variant?: string, size?: string, theme?: Theme): React.CSSProperties;
|
|
13410
|
+
/**
|
|
13411
|
+
* Create a hook for consistent component theming
|
|
13412
|
+
*/
|
|
13413
|
+
declare function useComponentTheme(component: string, variant?: string, size?: string, theme?: Theme): (property: string) => string;
|
|
13414
|
+
|
|
13415
|
+
/**
|
|
13416
|
+
* CSS Injection Utilities
|
|
13417
|
+
*
|
|
13418
|
+
* Inject CSS into HTML head via <style> element.
|
|
13419
|
+
*/
|
|
13420
|
+
/**
|
|
13421
|
+
* Inject CSS into HTML head via <style> element
|
|
13422
|
+
*
|
|
13423
|
+
* Creates or updates a style element in the document head.
|
|
13424
|
+
* If an element with the same ID exists, it will be updated.
|
|
13425
|
+
*
|
|
13426
|
+
* @param css - CSS string to inject
|
|
13427
|
+
* @param id - Style element ID (default: 'atomix-theme')
|
|
13428
|
+
*
|
|
13429
|
+
* @example
|
|
13430
|
+
* ```typescript
|
|
13431
|
+
* const css = ':root { --atomix-color-primary: #7AFFD7; }';
|
|
13432
|
+
* injectCSS(css);
|
|
13433
|
+
*
|
|
13434
|
+
* // With custom ID
|
|
13435
|
+
* injectCSS(css, 'my-custom-theme');
|
|
13436
|
+
* ```
|
|
13437
|
+
*/
|
|
13438
|
+
declare function injectCSS(css: string, id?: string): void;
|
|
13439
|
+
/**
|
|
13440
|
+
* Remove injected CSS from DOM
|
|
13441
|
+
*
|
|
13442
|
+
* Removes the style element with the given ID from the document head.
|
|
13443
|
+
*
|
|
13444
|
+
* @param id - Style element ID to remove (default: 'atomix-theme')
|
|
13445
|
+
*
|
|
13446
|
+
* @example
|
|
13447
|
+
* ```typescript
|
|
13448
|
+
* removeCSS(); // Removes default 'atomix-theme'
|
|
13449
|
+
* removeCSS('my-custom-theme'); // Removes custom ID
|
|
13450
|
+
* ```
|
|
13451
|
+
*/
|
|
13452
|
+
declare function removeCSS(id?: string): void;
|
|
13453
|
+
/**
|
|
13454
|
+
* Check if CSS is already injected
|
|
13455
|
+
*
|
|
13456
|
+
* @param id - Style element ID to check (default: 'atomix-theme')
|
|
13457
|
+
* @returns True if style element exists
|
|
13458
|
+
*/
|
|
13459
|
+
declare function isCSSInjected(id?: string): boolean;
|
|
13460
|
+
|
|
13461
|
+
/**
|
|
13462
|
+
* Theme Configuration Loader
|
|
13463
|
+
*
|
|
13464
|
+
* Provides functions to load theme configurations from atomix.config.ts
|
|
13465
|
+
* Includes both sync and async versions, with automatic fallbacks
|
|
13466
|
+
*/
|
|
13467
|
+
|
|
13468
|
+
/**
|
|
13469
|
+
* Load theme from config file (synchronous, Node.js only)
|
|
13470
|
+
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
13471
|
+
* @returns DesignTokens from theme configuration
|
|
13472
|
+
* @throws Error if config loading is not available in browser environment
|
|
13473
|
+
*/
|
|
13474
|
+
declare function loadThemeFromConfigSync(options?: {
|
|
13475
|
+
configPath?: string;
|
|
13476
|
+
required?: boolean;
|
|
13477
|
+
}): DesignTokens;
|
|
13478
|
+
/**
|
|
13479
|
+
* Load theme from config file (asynchronous)
|
|
13480
|
+
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
13481
|
+
* @returns Promise resolving to DesignTokens from theme configuration
|
|
13482
|
+
*/
|
|
13483
|
+
declare function loadThemeFromConfig(options?: {
|
|
13484
|
+
configPath?: string;
|
|
13485
|
+
required?: boolean;
|
|
13486
|
+
}): Promise<DesignTokens>;
|
|
13487
|
+
|
|
13488
|
+
/**
|
|
13489
|
+
* Theme Provider
|
|
13490
|
+
*
|
|
13491
|
+
* React context provider for theme management with separated concerns
|
|
13492
|
+
* Updated to use the new simplified theme system
|
|
13493
|
+
*/
|
|
13494
|
+
|
|
13495
|
+
/**
|
|
13496
|
+
* Theme Provider
|
|
13497
|
+
*
|
|
13498
|
+
* React context provider for theme management with separated concerns.
|
|
13499
|
+
* Simplified version focusing on core functionality:
|
|
13500
|
+
* - String-based themes (CSS files)
|
|
13501
|
+
* - JS Theme objects
|
|
13502
|
+
* - Persistence via localStorage
|
|
13864
13503
|
*
|
|
13865
|
-
*
|
|
13866
|
-
* return (
|
|
13867
|
-
* <ThemeProvider>
|
|
13868
|
-
* <YourApp />
|
|
13869
|
-
* </ThemeProvider>
|
|
13870
|
-
* );
|
|
13871
|
-
* }
|
|
13872
|
-
* ```
|
|
13504
|
+
* Falls back to 'default' theme if no configuration is found.
|
|
13873
13505
|
*/
|
|
13874
13506
|
declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
13875
13507
|
|
|
@@ -13877,7 +13509,6 @@ declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
|
13877
13509
|
* useTheme Hook
|
|
13878
13510
|
*
|
|
13879
13511
|
* React hook for accessing theme context
|
|
13880
|
-
* Updated to work with new ThemeEngine architecture
|
|
13881
13512
|
*/
|
|
13882
13513
|
|
|
13883
13514
|
/**
|
|
@@ -13903,6 +13534,39 @@ declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
|
13903
13534
|
*/
|
|
13904
13535
|
declare function useTheme(): UseThemeReturn;
|
|
13905
13536
|
|
|
13537
|
+
/**
|
|
13538
|
+
* Standardized hook for accessing theme tokens in components
|
|
13539
|
+
*
|
|
13540
|
+
* Provides consistent access to theme values across all components
|
|
13541
|
+
* using either CSS custom properties or theme object values.
|
|
13542
|
+
*/
|
|
13543
|
+
type ThemeTokens$1 = {
|
|
13544
|
+
theme: string;
|
|
13545
|
+
activeTheme: Theme | null;
|
|
13546
|
+
getToken: (tokenName: string, fallback?: string) => string;
|
|
13547
|
+
getThemeValue: (path: string, fallback?: any) => any;
|
|
13548
|
+
colors: {
|
|
13549
|
+
primary: string;
|
|
13550
|
+
secondary: string;
|
|
13551
|
+
error: string;
|
|
13552
|
+
success: string;
|
|
13553
|
+
warning: string;
|
|
13554
|
+
info: string;
|
|
13555
|
+
light: string;
|
|
13556
|
+
dark: string;
|
|
13557
|
+
};
|
|
13558
|
+
spacing: Record<string, string>;
|
|
13559
|
+
borderRadius: Record<string, string>;
|
|
13560
|
+
typography: {
|
|
13561
|
+
fontFamily: Record<string, string>;
|
|
13562
|
+
fontSize: Record<string, string>;
|
|
13563
|
+
fontWeight: Record<string, string>;
|
|
13564
|
+
};
|
|
13565
|
+
shadows: Record<string, string>;
|
|
13566
|
+
transitions: Record<string, string>;
|
|
13567
|
+
};
|
|
13568
|
+
declare function useThemeTokens(): ThemeTokens$1;
|
|
13569
|
+
|
|
13906
13570
|
/**
|
|
13907
13571
|
* Theme context with default values
|
|
13908
13572
|
*/
|
|
@@ -13957,597 +13621,1106 @@ declare class ThemeErrorBoundary extends Component<ThemeErrorBoundaryProps, Them
|
|
|
13957
13621
|
}
|
|
13958
13622
|
|
|
13959
13623
|
/**
|
|
13960
|
-
*
|
|
13624
|
+
* Theme Applicator
|
|
13961
13625
|
*
|
|
13962
|
-
*
|
|
13963
|
-
*
|
|
13626
|
+
* Applies theme configurations to the DOM, including CSS variables,
|
|
13627
|
+
* component overrides, typography, spacing, and color palettes.
|
|
13964
13628
|
*
|
|
13965
|
-
*
|
|
13966
|
-
* ```typescript
|
|
13967
|
-
* const theme = createTheme({
|
|
13968
|
-
* palette: {
|
|
13969
|
-
* primary: { main: '#7AFFD7' },
|
|
13970
|
-
* secondary: { main: '#FF5733' },
|
|
13971
|
-
* },
|
|
13972
|
-
* typography: {
|
|
13973
|
-
* fontFamily: 'Inter, sans-serif',
|
|
13974
|
-
* },
|
|
13975
|
-
* });
|
|
13976
|
-
* ```
|
|
13629
|
+
* Uses the unified theme system for CSS generation and injection.
|
|
13977
13630
|
*/
|
|
13978
13631
|
|
|
13979
13632
|
/**
|
|
13980
|
-
*
|
|
13633
|
+
* Theme applicator class for runtime theme application
|
|
13981
13634
|
*
|
|
13982
|
-
*
|
|
13983
|
-
|
|
13635
|
+
* Uses the unified theme system for efficient CSS variable generation and injection.
|
|
13636
|
+
*/
|
|
13637
|
+
declare class ThemeApplicator {
|
|
13638
|
+
private root;
|
|
13639
|
+
private styleId;
|
|
13640
|
+
constructor(root?: HTMLElement);
|
|
13641
|
+
/**
|
|
13642
|
+
* Apply a complete theme configuration
|
|
13643
|
+
*
|
|
13644
|
+
* Uses the unified theme system to convert Theme to DesignTokens and inject CSS.
|
|
13645
|
+
* Automatically respects atomix.config.ts when using DesignTokens.
|
|
13646
|
+
*/
|
|
13647
|
+
applyTheme(theme: Theme | DesignTokens): void;
|
|
13648
|
+
/**
|
|
13649
|
+
* Apply DesignTokens using unified theme system
|
|
13650
|
+
*
|
|
13651
|
+
* Uses createTheme() which automatically loads from atomix.config.ts
|
|
13652
|
+
* if no tokens are provided, ensuring config is always respected.
|
|
13653
|
+
*/
|
|
13654
|
+
private applyDesignTokens;
|
|
13655
|
+
/**
|
|
13656
|
+
* Check if object is DesignTokens
|
|
13657
|
+
*/
|
|
13658
|
+
private isDesignTokens;
|
|
13659
|
+
/**
|
|
13660
|
+
* Apply global CSS variables (for component overrides)
|
|
13661
|
+
*/
|
|
13662
|
+
private applyGlobalCSSVars;
|
|
13663
|
+
/**
|
|
13664
|
+
* Apply component-level overrides
|
|
13665
|
+
*/
|
|
13666
|
+
private applyComponentOverrides;
|
|
13667
|
+
/**
|
|
13668
|
+
* Apply override for a specific component
|
|
13669
|
+
*/
|
|
13670
|
+
private applyComponentOverride;
|
|
13671
|
+
/**
|
|
13672
|
+
* Clear all applied CSS variables
|
|
13673
|
+
*/
|
|
13674
|
+
private clearAppliedVars;
|
|
13675
|
+
/**
|
|
13676
|
+
* Remove theme application
|
|
13677
|
+
*/
|
|
13678
|
+
removeTheme(): void;
|
|
13679
|
+
/**
|
|
13680
|
+
* Update specific CSS variables without clearing all
|
|
13681
|
+
*/
|
|
13682
|
+
updateCSSVars(vars: Record<string, string | number>): void;
|
|
13683
|
+
}
|
|
13684
|
+
/**
|
|
13685
|
+
* Get or create global theme applicator
|
|
13984
13686
|
*/
|
|
13985
|
-
declare function
|
|
13687
|
+
declare function getThemeApplicator(): ThemeApplicator;
|
|
13688
|
+
/**
|
|
13689
|
+
* Apply theme using global applicator
|
|
13690
|
+
*/
|
|
13691
|
+
declare function applyTheme(theme: Theme | DesignTokens): void;
|
|
13986
13692
|
|
|
13987
13693
|
/**
|
|
13988
|
-
*
|
|
13989
|
-
*
|
|
13990
|
-
* This function converts atomix.config.ts format to a theme object
|
|
13991
|
-
* that can be used with ThemeProvider.
|
|
13694
|
+
* Theme Preview Component
|
|
13992
13695
|
*
|
|
13993
|
-
*
|
|
13994
|
-
*
|
|
13696
|
+
* React component for previewing themes in development
|
|
13697
|
+
* Enhanced with interactive components, viewport controls, and dark mode toggle
|
|
13698
|
+
*/
|
|
13699
|
+
|
|
13700
|
+
/**
|
|
13701
|
+
* Theme preview props
|
|
13702
|
+
*/
|
|
13703
|
+
interface ThemePreviewProps {
|
|
13704
|
+
/** Theme to preview */
|
|
13705
|
+
theme: Theme;
|
|
13706
|
+
/** Show theme details */
|
|
13707
|
+
showDetails?: boolean;
|
|
13708
|
+
/** Show color palette */
|
|
13709
|
+
showPalette?: boolean;
|
|
13710
|
+
/** Show typography */
|
|
13711
|
+
showTypography?: boolean;
|
|
13712
|
+
/** Show spacing */
|
|
13713
|
+
showSpacing?: boolean;
|
|
13714
|
+
/** Custom components to render */
|
|
13715
|
+
children?: React__default.ReactNode;
|
|
13716
|
+
/** CSS class name */
|
|
13717
|
+
className?: string;
|
|
13718
|
+
/** Inline styles */
|
|
13719
|
+
style?: React__default.CSSProperties;
|
|
13720
|
+
}
|
|
13721
|
+
/**
|
|
13722
|
+
* Theme Preview Component
|
|
13995
13723
|
*
|
|
13996
|
-
*
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
13724
|
+
* Renders a preview of a theme with sample components
|
|
13725
|
+
*/
|
|
13726
|
+
declare const ThemePreview: React__default.FC<ThemePreviewProps>;
|
|
13727
|
+
|
|
13728
|
+
/**
|
|
13729
|
+
* Theme Inspector Component
|
|
14000
13730
|
*
|
|
14001
|
-
*
|
|
14002
|
-
*
|
|
13731
|
+
* React component for inspecting and debugging themes
|
|
13732
|
+
* Enhanced with search/filter and copy path functionality
|
|
14003
13733
|
*/
|
|
14004
|
-
declare function createThemeFromConfig(config: AtomixConfig): Theme;
|
|
14005
13734
|
|
|
14006
13735
|
/**
|
|
14007
|
-
* Theme
|
|
13736
|
+
* Theme inspector props
|
|
13737
|
+
*/
|
|
13738
|
+
interface ThemeInspectorProps {
|
|
13739
|
+
/** Theme to inspect */
|
|
13740
|
+
theme: Theme;
|
|
13741
|
+
/** Show validation results */
|
|
13742
|
+
showValidation?: boolean;
|
|
13743
|
+
/** Show CSS variables */
|
|
13744
|
+
showCSSVariables?: boolean;
|
|
13745
|
+
/** Show theme structure */
|
|
13746
|
+
showStructure?: boolean;
|
|
13747
|
+
/** CSS class name */
|
|
13748
|
+
className?: string;
|
|
13749
|
+
/** Inline styles */
|
|
13750
|
+
style?: React__default.CSSProperties;
|
|
13751
|
+
}
|
|
13752
|
+
/**
|
|
13753
|
+
* Theme Inspector Component
|
|
14008
13754
|
*
|
|
14009
|
-
*
|
|
13755
|
+
* Provides detailed inspection and debugging information for themes
|
|
14010
13756
|
*/
|
|
13757
|
+
declare const ThemeInspector: React__default.FC<ThemeInspectorProps>;
|
|
14011
13758
|
|
|
14012
13759
|
/**
|
|
14013
|
-
*
|
|
13760
|
+
* Theme Comparator Component
|
|
13761
|
+
*
|
|
13762
|
+
* React component for comparing two themes side-by-side
|
|
13763
|
+
* Enhanced with search/filter and improved visual diff styling
|
|
14014
13764
|
*/
|
|
14015
|
-
|
|
13765
|
+
|
|
14016
13766
|
/**
|
|
14017
|
-
*
|
|
13767
|
+
* Theme comparator props
|
|
14018
13768
|
*/
|
|
14019
|
-
|
|
13769
|
+
interface ThemeComparatorProps {
|
|
13770
|
+
/** First theme to compare */
|
|
13771
|
+
themeA: Theme;
|
|
13772
|
+
/** Second theme to compare */
|
|
13773
|
+
themeB: Theme;
|
|
13774
|
+
/** Show only differences */
|
|
13775
|
+
showOnlyDifferences?: boolean;
|
|
13776
|
+
/** CSS class name */
|
|
13777
|
+
className?: string;
|
|
13778
|
+
/** Inline styles */
|
|
13779
|
+
style?: React__default.CSSProperties;
|
|
13780
|
+
}
|
|
14020
13781
|
/**
|
|
14021
|
-
*
|
|
13782
|
+
* Theme Comparator Component
|
|
13783
|
+
*
|
|
13784
|
+
* Compares two themes and highlights differences
|
|
14022
13785
|
*/
|
|
14023
|
-
declare
|
|
14024
|
-
|
|
14025
|
-
errors: string[];
|
|
14026
|
-
};
|
|
13786
|
+
declare const ThemeComparator: React__default.FC<ThemeComparatorProps>;
|
|
13787
|
+
|
|
14027
13788
|
/**
|
|
14028
|
-
*
|
|
13789
|
+
* Theme Live Editor Component
|
|
13790
|
+
*
|
|
13791
|
+
* React component for live editing themes in development
|
|
13792
|
+
* Enhanced with undo/redo, keyboard shortcuts, resizable layout, and better color pickers
|
|
14029
13793
|
*/
|
|
14030
|
-
|
|
13794
|
+
|
|
14031
13795
|
/**
|
|
14032
|
-
*
|
|
13796
|
+
* Live editor props
|
|
14033
13797
|
*/
|
|
14034
|
-
|
|
13798
|
+
interface ThemeLiveEditorProps {
|
|
13799
|
+
/** Initial theme */
|
|
13800
|
+
initialTheme: Theme;
|
|
13801
|
+
/** Callback when theme changes */
|
|
13802
|
+
onChange?: (theme: Theme) => void;
|
|
13803
|
+
/** CSS class name */
|
|
13804
|
+
className?: string;
|
|
13805
|
+
/** Inline styles */
|
|
13806
|
+
style?: React__default.CSSProperties;
|
|
13807
|
+
}
|
|
14035
13808
|
/**
|
|
14036
|
-
*
|
|
13809
|
+
* Theme Live Editor Component
|
|
13810
|
+
*
|
|
13811
|
+
* Allows live editing of theme properties with instant preview
|
|
14037
13812
|
*/
|
|
14038
|
-
declare
|
|
13813
|
+
declare const ThemeLiveEditor: React__default.FC<ThemeLiveEditorProps>;
|
|
14039
13814
|
|
|
14040
13815
|
/**
|
|
14041
|
-
* Theme
|
|
13816
|
+
* Theme Validator
|
|
14042
13817
|
*
|
|
14043
|
-
*
|
|
13818
|
+
* Runtime theme validation including color contrast and accessibility checks
|
|
14044
13819
|
*/
|
|
13820
|
+
|
|
14045
13821
|
/**
|
|
14046
|
-
*
|
|
13822
|
+
* Validation result
|
|
14047
13823
|
*/
|
|
14048
|
-
interface
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
13824
|
+
interface ValidationResult {
|
|
13825
|
+
/** Whether theme is valid */
|
|
13826
|
+
valid: boolean;
|
|
13827
|
+
/** Validation errors */
|
|
13828
|
+
errors: string[];
|
|
13829
|
+
/** Validation warnings */
|
|
13830
|
+
warnings: string[];
|
|
13831
|
+
/** Accessibility issues */
|
|
13832
|
+
a11yIssues: A11yIssue[];
|
|
13833
|
+
}
|
|
13834
|
+
/**
|
|
13835
|
+
* Accessibility issue
|
|
13836
|
+
*/
|
|
13837
|
+
interface A11yIssue {
|
|
13838
|
+
/** Issue type */
|
|
13839
|
+
type: 'contrast' | 'color' | 'missing';
|
|
13840
|
+
/** Severity */
|
|
13841
|
+
severity: 'error' | 'warning';
|
|
13842
|
+
/** Issue message */
|
|
13843
|
+
message: string;
|
|
13844
|
+
/** Affected property */
|
|
13845
|
+
property?: string;
|
|
13846
|
+
/** Current value */
|
|
13847
|
+
value?: string;
|
|
13848
|
+
/** Recommended value */
|
|
13849
|
+
recommended?: string;
|
|
14053
13850
|
}
|
|
14054
13851
|
/**
|
|
14055
|
-
* Theme
|
|
13852
|
+
* Theme Validator
|
|
14056
13853
|
*
|
|
14057
|
-
*
|
|
13854
|
+
* Validates themes for correctness and accessibility
|
|
14058
13855
|
*/
|
|
14059
|
-
declare class
|
|
14060
|
-
|
|
14061
|
-
|
|
13856
|
+
declare class ThemeValidator {
|
|
13857
|
+
/**
|
|
13858
|
+
* Validate theme
|
|
13859
|
+
*/
|
|
13860
|
+
validate(theme: Theme, metadata?: ThemeMetadata$1): ValidationResult;
|
|
14062
13861
|
/**
|
|
14063
|
-
*
|
|
13862
|
+
* Validate palette
|
|
14064
13863
|
*/
|
|
14065
|
-
private
|
|
13864
|
+
private validatePalette;
|
|
14066
13865
|
/**
|
|
14067
|
-
*
|
|
13866
|
+
* Validate typography
|
|
14068
13867
|
*/
|
|
14069
|
-
|
|
13868
|
+
private validateTypography;
|
|
14070
13869
|
/**
|
|
14071
|
-
*
|
|
13870
|
+
* Validate spacing
|
|
14072
13871
|
*/
|
|
14073
|
-
|
|
13872
|
+
private validateSpacing;
|
|
14074
13873
|
/**
|
|
14075
|
-
*
|
|
13874
|
+
* Validate breakpoints
|
|
14076
13875
|
*/
|
|
14077
|
-
private
|
|
13876
|
+
private validateBreakpoints;
|
|
14078
13877
|
/**
|
|
14079
|
-
*
|
|
13878
|
+
* Check color contrast ratio
|
|
14080
13879
|
*/
|
|
14081
|
-
private
|
|
13880
|
+
private checkContrast;
|
|
14082
13881
|
/**
|
|
14083
|
-
*
|
|
13882
|
+
* Check if color is valid
|
|
14084
13883
|
*/
|
|
14085
|
-
private
|
|
13884
|
+
private isValidColor;
|
|
14086
13885
|
/**
|
|
14087
|
-
*
|
|
13886
|
+
* Validate transitions
|
|
14088
13887
|
*/
|
|
14089
|
-
private
|
|
13888
|
+
private validateTransitions;
|
|
14090
13889
|
/**
|
|
14091
|
-
*
|
|
13890
|
+
* Validate z-index
|
|
14092
13891
|
*/
|
|
14093
|
-
private
|
|
13892
|
+
private validateZIndex;
|
|
14094
13893
|
/**
|
|
14095
|
-
*
|
|
13894
|
+
* Validate border radius
|
|
14096
13895
|
*/
|
|
14097
|
-
private
|
|
13896
|
+
private validateBorderRadius;
|
|
14098
13897
|
/**
|
|
14099
|
-
*
|
|
13898
|
+
* Validate custom properties
|
|
14100
13899
|
*/
|
|
14101
|
-
private
|
|
13900
|
+
private validateCustom;
|
|
13901
|
+
}
|
|
13902
|
+
|
|
13903
|
+
/**
|
|
13904
|
+
* useHistory Hook
|
|
13905
|
+
*
|
|
13906
|
+
* React hook for managing undo/redo history
|
|
13907
|
+
*/
|
|
13908
|
+
interface UseHistoryOptions {
|
|
13909
|
+
/** Maximum number of history entries (default: 50) */
|
|
13910
|
+
maxHistorySize?: number;
|
|
13911
|
+
/** Initial state */
|
|
13912
|
+
initialState?: any;
|
|
13913
|
+
}
|
|
13914
|
+
interface UseHistoryReturn<T> {
|
|
13915
|
+
/** Current state */
|
|
13916
|
+
state: T;
|
|
13917
|
+
/** Update state and add to history */
|
|
13918
|
+
setState: (newState: T) => void;
|
|
13919
|
+
/** Undo last change */
|
|
13920
|
+
undo: () => void;
|
|
13921
|
+
/** Redo last undone change */
|
|
13922
|
+
redo: () => void;
|
|
13923
|
+
/** Check if undo is available */
|
|
13924
|
+
canUndo: boolean;
|
|
13925
|
+
/** Check if redo is available */
|
|
13926
|
+
canRedo: boolean;
|
|
13927
|
+
/** Clear history */
|
|
13928
|
+
clearHistory: () => void;
|
|
13929
|
+
/** Get history statistics */
|
|
13930
|
+
getHistoryStats: () => {
|
|
13931
|
+
currentIndex: number;
|
|
13932
|
+
totalEntries: number;
|
|
13933
|
+
};
|
|
13934
|
+
}
|
|
13935
|
+
/**
|
|
13936
|
+
* useHistory hook
|
|
13937
|
+
*
|
|
13938
|
+
* Provides undo/redo functionality for state management
|
|
13939
|
+
*
|
|
13940
|
+
* @example
|
|
13941
|
+
* ```tsx
|
|
13942
|
+
* const { state, setState, undo, redo, canUndo, canRedo } = useHistory({
|
|
13943
|
+
* initialState: theme,
|
|
13944
|
+
* maxHistorySize: 50
|
|
13945
|
+
* });
|
|
13946
|
+
* ```
|
|
13947
|
+
*/
|
|
13948
|
+
declare function useHistory<T>(options?: UseHistoryOptions): UseHistoryReturn<T>;
|
|
13949
|
+
|
|
13950
|
+
/**
|
|
13951
|
+
* Theme Adapter
|
|
13952
|
+
*
|
|
13953
|
+
* Converts between Theme objects and DesignTokens.
|
|
13954
|
+
*/
|
|
13955
|
+
|
|
13956
|
+
/**
|
|
13957
|
+
* Convert Theme object to DesignTokens
|
|
13958
|
+
*
|
|
13959
|
+
* Extracts values from a Theme object and converts them to flat DesignTokens format.
|
|
13960
|
+
*
|
|
13961
|
+
* @param theme - Theme object to convert
|
|
13962
|
+
* @returns Partial DesignTokens object
|
|
13963
|
+
*
|
|
13964
|
+
* @example
|
|
13965
|
+
* ```typescript
|
|
13966
|
+
* const theme = createTheme({ palette: { primary: { main: '#7c3aed' } } });
|
|
13967
|
+
* const tokens = themeToDesignTokens(theme);
|
|
13968
|
+
* // Returns: { 'primary': '#7c3aed', ... }
|
|
13969
|
+
* ```
|
|
13970
|
+
*/
|
|
13971
|
+
declare function themeToDesignTokens(theme: Theme): Partial<DesignTokens>;
|
|
13972
|
+
/**
|
|
13973
|
+
* Convert DesignTokens to Theme-compatible CSS variables
|
|
13974
|
+
*
|
|
13975
|
+
* @param tokens - DesignTokens object
|
|
13976
|
+
* @returns CSS variables object compatible with Theme.cssVars
|
|
13977
|
+
*/
|
|
13978
|
+
declare function designTokensToCSSVars(tokens: Partial<DesignTokens>): Record<string, string>;
|
|
13979
|
+
/**
|
|
13980
|
+
* Create DesignTokens from Theme with defaults
|
|
13981
|
+
*
|
|
13982
|
+
* Converts a Theme to DesignTokens and merges with default tokens.
|
|
13983
|
+
*
|
|
13984
|
+
* @param theme - Theme object to convert
|
|
13985
|
+
* @returns Complete DesignTokens object
|
|
13986
|
+
*/
|
|
13987
|
+
declare function createDesignTokensFromTheme(theme: Theme): DesignTokens;
|
|
13988
|
+
/**
|
|
13989
|
+
* Create a minimal Theme object from DesignTokens
|
|
13990
|
+
*
|
|
13991
|
+
* @param tokens - DesignTokens to convert
|
|
13992
|
+
* @returns Minimal Theme object with cssVars populated
|
|
13993
|
+
*/
|
|
13994
|
+
declare function designTokensToTheme(tokens: Partial<DesignTokens>): Partial<Theme>;
|
|
13995
|
+
|
|
13996
|
+
/**
|
|
13997
|
+
* CSS Variable Mapper
|
|
13998
|
+
*
|
|
13999
|
+
* Utilities for generating and managing CSS custom properties from SCSS tokens
|
|
14000
|
+
* and component configurations.
|
|
14001
|
+
*/
|
|
14002
|
+
/**
|
|
14003
|
+
* Configuration for generating CSS variables for a component
|
|
14004
|
+
*/
|
|
14005
|
+
interface CSSVariableConfig {
|
|
14006
|
+
/** Component name (e.g., 'button', 'card') */
|
|
14007
|
+
component: string;
|
|
14008
|
+
/** Base properties for the component */
|
|
14009
|
+
properties: Record<string, string | number>;
|
|
14010
|
+
/** Part-specific properties (e.g., icon, label) */
|
|
14011
|
+
parts?: Record<string, Record<string, string | number>>;
|
|
14012
|
+
/** State-specific properties (e.g., hover, active, disabled) */
|
|
14013
|
+
states?: Record<string, Record<string, string | number>>;
|
|
14014
|
+
/** Variant-specific properties (e.g., primary, secondary) */
|
|
14015
|
+
variants?: Record<string, Record<string, string | number>>;
|
|
14016
|
+
}
|
|
14017
|
+
/**
|
|
14018
|
+
* CSS variable naming options
|
|
14019
|
+
*/
|
|
14020
|
+
interface CSSVariableNamingOptions {
|
|
14021
|
+
/** Prefix for all variables (default: 'atomix') */
|
|
14022
|
+
prefix?: string;
|
|
14023
|
+
/** Separator between parts (default: '-') */
|
|
14024
|
+
separator?: string;
|
|
14025
|
+
/** Whether to include component name in variable (default: true) */
|
|
14026
|
+
includeComponent?: boolean;
|
|
14102
14027
|
}
|
|
14103
14028
|
/**
|
|
14104
|
-
*
|
|
14029
|
+
* Map SCSS tokens to CSS custom properties
|
|
14030
|
+
*
|
|
14031
|
+
* @example
|
|
14032
|
+
* const tokens = { '$primary-color': '#7AFFD7', '$spacing-md': '16px' }
|
|
14033
|
+
* const vars = mapSCSSTokensToCSSVars(tokens)
|
|
14034
|
+
* // Returns: { '--primary-color': '#7AFFD7', '--spacing-md': '16px' }
|
|
14105
14035
|
*/
|
|
14106
|
-
declare function
|
|
14036
|
+
declare function mapSCSSTokensToCSSVars(tokens: Record<string, any>, options?: CSSVariableNamingOptions): Record<string, string>;
|
|
14107
14037
|
/**
|
|
14108
|
-
*
|
|
14038
|
+
* Apply CSS variables to an element
|
|
14039
|
+
*
|
|
14040
|
+
* @param element - Target element (defaults to document.documentElement)
|
|
14041
|
+
* @param vars - CSS variables to apply
|
|
14109
14042
|
*/
|
|
14110
|
-
declare function
|
|
14111
|
-
|
|
14043
|
+
declare function applyCSSVariables(vars: Record<string, string | number>, element?: HTMLElement): void;
|
|
14112
14044
|
/**
|
|
14113
|
-
*
|
|
14045
|
+
* Remove CSS variables from an element
|
|
14114
14046
|
*
|
|
14115
|
-
*
|
|
14047
|
+
* @param varNames - Variable names to remove
|
|
14048
|
+
* @param element - Target element (defaults to document.documentElement)
|
|
14116
14049
|
*/
|
|
14117
|
-
|
|
14050
|
+
declare function removeCSSVariables(varNames: string[], element?: HTMLElement): void;
|
|
14118
14051
|
/**
|
|
14119
|
-
*
|
|
14052
|
+
* Get CSS variable value from an element
|
|
14053
|
+
*
|
|
14054
|
+
* @param varName - Variable name to get
|
|
14055
|
+
* @param element - Target element (defaults to document.documentElement)
|
|
14056
|
+
* @returns Variable value or null if not found
|
|
14120
14057
|
*/
|
|
14121
|
-
|
|
14122
|
-
/** Theme to preview */
|
|
14123
|
-
theme: Theme;
|
|
14124
|
-
/** Show theme details */
|
|
14125
|
-
showDetails?: boolean;
|
|
14126
|
-
/** Show color palette */
|
|
14127
|
-
showPalette?: boolean;
|
|
14128
|
-
/** Show typography */
|
|
14129
|
-
showTypography?: boolean;
|
|
14130
|
-
/** Show spacing */
|
|
14131
|
-
showSpacing?: boolean;
|
|
14132
|
-
/** Custom components to render */
|
|
14133
|
-
children?: React__default.ReactNode;
|
|
14134
|
-
/** CSS class name */
|
|
14135
|
-
className?: string;
|
|
14136
|
-
/** Inline styles */
|
|
14137
|
-
style?: React__default.CSSProperties;
|
|
14138
|
-
}
|
|
14058
|
+
declare function getCSSVariable(varName: string, element?: HTMLElement): string | null;
|
|
14139
14059
|
/**
|
|
14140
|
-
*
|
|
14060
|
+
* Convert CSS variable object to inline style object
|
|
14141
14061
|
*
|
|
14142
|
-
*
|
|
14062
|
+
* @example
|
|
14063
|
+
* const vars = { '--atomix-button-bg': '#000' }
|
|
14064
|
+
* const style = cssVarsToStyle(vars)
|
|
14065
|
+
* // Returns: { '--atomix-button-bg': '#000' } as React.CSSProperties
|
|
14143
14066
|
*/
|
|
14144
|
-
declare
|
|
14145
|
-
|
|
14067
|
+
declare function cssVarsToStyle(vars: Record<string, string | number>): React.CSSProperties;
|
|
14146
14068
|
/**
|
|
14147
|
-
*
|
|
14148
|
-
*
|
|
14149
|
-
* React component for inspecting and debugging themes
|
|
14069
|
+
* Merge multiple CSS variable objects
|
|
14070
|
+
* Later objects override earlier ones
|
|
14150
14071
|
*/
|
|
14151
|
-
|
|
14072
|
+
declare function mergeCSSVars(...varObjects: Array<Record<string, string | number> | undefined>): Record<string, string | number>;
|
|
14152
14073
|
/**
|
|
14153
|
-
*
|
|
14074
|
+
* Validate CSS variable name format
|
|
14154
14075
|
*/
|
|
14155
|
-
|
|
14156
|
-
/** Theme to inspect */
|
|
14157
|
-
theme: Theme;
|
|
14158
|
-
/** Show validation results */
|
|
14159
|
-
showValidation?: boolean;
|
|
14160
|
-
/** Show CSS variables */
|
|
14161
|
-
showCSSVariables?: boolean;
|
|
14162
|
-
/** Show theme structure */
|
|
14163
|
-
showStructure?: boolean;
|
|
14164
|
-
/** CSS class name */
|
|
14165
|
-
className?: string;
|
|
14166
|
-
/** Inline styles */
|
|
14167
|
-
style?: React__default.CSSProperties;
|
|
14168
|
-
}
|
|
14076
|
+
declare function isValidCSSVariableName(name: string): boolean;
|
|
14169
14077
|
/**
|
|
14170
|
-
*
|
|
14078
|
+
* Extract component name from CSS variable name
|
|
14171
14079
|
*
|
|
14172
|
-
*
|
|
14080
|
+
* @example
|
|
14081
|
+
* extractComponentName('--atomix-button-bg')
|
|
14082
|
+
* // Returns: 'button'
|
|
14173
14083
|
*/
|
|
14174
|
-
declare
|
|
14084
|
+
declare function extractComponentName(varName: string, prefix?: string): string | null;
|
|
14175
14085
|
|
|
14176
14086
|
/**
|
|
14177
|
-
* Theme
|
|
14087
|
+
* Theme Helper Functions
|
|
14178
14088
|
*
|
|
14179
|
-
*
|
|
14089
|
+
* Utility functions for working with themes and DesignTokens
|
|
14180
14090
|
*/
|
|
14181
14091
|
|
|
14182
14092
|
/**
|
|
14183
|
-
*
|
|
14093
|
+
* Get DesignTokens from current theme
|
|
14094
|
+
*
|
|
14095
|
+
* Converts a Theme object to DesignTokens. Useful when you need to
|
|
14096
|
+
* work with DesignTokens but have a Theme object.
|
|
14097
|
+
*
|
|
14098
|
+
* @param theme - Theme object to convert
|
|
14099
|
+
* @returns DesignTokens object
|
|
14100
|
+
*
|
|
14101
|
+
* @example
|
|
14102
|
+
* ```typescript
|
|
14103
|
+
* // If you have a Theme object, convert it to DesignTokens
|
|
14104
|
+
* const tokens = getDesignTokensFromTheme(theme);
|
|
14105
|
+
* // Now you can use tokens with unified theme system
|
|
14106
|
+
* const css = createTheme(tokens);
|
|
14107
|
+
* ```
|
|
14184
14108
|
*/
|
|
14185
|
-
|
|
14186
|
-
/** First theme to compare */
|
|
14187
|
-
themeA: Theme;
|
|
14188
|
-
/** Second theme to compare */
|
|
14189
|
-
themeB: Theme;
|
|
14190
|
-
/** Show only differences */
|
|
14191
|
-
showOnlyDifferences?: boolean;
|
|
14192
|
-
/** CSS class name */
|
|
14193
|
-
className?: string;
|
|
14194
|
-
/** Inline styles */
|
|
14195
|
-
style?: React__default.CSSProperties;
|
|
14196
|
-
}
|
|
14109
|
+
declare function getDesignTokensFromTheme(theme: Theme | null): DesignTokens | null;
|
|
14197
14110
|
/**
|
|
14198
|
-
*
|
|
14111
|
+
* Check if a value is DesignTokens
|
|
14199
14112
|
*
|
|
14200
|
-
*
|
|
14113
|
+
* Type guard to check if an object is DesignTokens format.
|
|
14114
|
+
*
|
|
14115
|
+
* @param value - Value to check
|
|
14116
|
+
* @returns True if value is DesignTokens
|
|
14201
14117
|
*/
|
|
14202
|
-
declare
|
|
14203
|
-
|
|
14118
|
+
declare function isDesignTokens(value: unknown): value is DesignTokens;
|
|
14204
14119
|
/**
|
|
14205
|
-
*
|
|
14120
|
+
* Check if a value is a Theme object
|
|
14206
14121
|
*
|
|
14207
|
-
*
|
|
14122
|
+
* Type guard to check if an object is a Theme.
|
|
14123
|
+
*
|
|
14124
|
+
* @param value - Value to check
|
|
14125
|
+
* @returns True if value is Theme
|
|
14208
14126
|
*/
|
|
14127
|
+
declare function isThemeObject(value: unknown): value is Theme;
|
|
14209
14128
|
|
|
14210
14129
|
/**
|
|
14211
|
-
*
|
|
14212
|
-
*/
|
|
14213
|
-
interface ThemeLiveEditorProps {
|
|
14214
|
-
/** Initial theme */
|
|
14215
|
-
initialTheme: Theme;
|
|
14216
|
-
/** Callback when theme changes */
|
|
14217
|
-
onChange?: (theme: Theme) => void;
|
|
14218
|
-
/** CSS class name */
|
|
14219
|
-
className?: string;
|
|
14220
|
-
/** Inline styles */
|
|
14221
|
-
style?: React__default.CSSProperties;
|
|
14222
|
-
}
|
|
14223
|
-
/**
|
|
14224
|
-
* Theme Live Editor Component
|
|
14130
|
+
* RTL (Right-to-Left) Support Utilities
|
|
14225
14131
|
*
|
|
14226
|
-
*
|
|
14132
|
+
* Provides utilities for managing RTL text direction in themes
|
|
14227
14133
|
*/
|
|
14228
|
-
declare const ThemeLiveEditor: React__default.FC<ThemeLiveEditorProps>;
|
|
14229
|
-
|
|
14230
14134
|
/**
|
|
14231
|
-
*
|
|
14232
|
-
*
|
|
14233
|
-
* Applies theme configurations to the DOM, including CSS variables,
|
|
14234
|
-
* component overrides, typography, spacing, and color palettes.
|
|
14135
|
+
* RTL configuration options
|
|
14235
14136
|
*/
|
|
14236
|
-
|
|
14137
|
+
interface RTLConfig {
|
|
14138
|
+
/** Enable RTL mode */
|
|
14139
|
+
enabled: boolean;
|
|
14140
|
+
/** Current direction ('ltr' | 'rtl') */
|
|
14141
|
+
direction: 'ltr' | 'rtl';
|
|
14142
|
+
/** Data attribute name for direction */
|
|
14143
|
+
dataAttribute?: string;
|
|
14144
|
+
/** Auto-detect from locale */
|
|
14145
|
+
autoDetect?: boolean;
|
|
14146
|
+
/** Locale code (e.g., 'ar', 'he', 'fa') */
|
|
14147
|
+
locale?: string;
|
|
14148
|
+
}
|
|
14237
14149
|
/**
|
|
14238
|
-
*
|
|
14150
|
+
* RTL Manager
|
|
14151
|
+
*
|
|
14152
|
+
* Manages RTL text direction for the theme system
|
|
14239
14153
|
*/
|
|
14240
|
-
declare class
|
|
14241
|
-
private
|
|
14242
|
-
private
|
|
14243
|
-
constructor(
|
|
14154
|
+
declare class RTLManager {
|
|
14155
|
+
private config;
|
|
14156
|
+
private listeners;
|
|
14157
|
+
constructor(config?: Partial<RTLConfig>);
|
|
14244
14158
|
/**
|
|
14245
|
-
*
|
|
14159
|
+
* Detect locale from browser
|
|
14246
14160
|
*/
|
|
14247
|
-
|
|
14161
|
+
private detectLocale;
|
|
14248
14162
|
/**
|
|
14249
|
-
*
|
|
14163
|
+
* Check if locale is RTL
|
|
14250
14164
|
*/
|
|
14251
|
-
|
|
14165
|
+
isRTLLocale(locale: string): boolean;
|
|
14252
14166
|
/**
|
|
14253
|
-
*
|
|
14167
|
+
* Get current direction
|
|
14254
14168
|
*/
|
|
14255
|
-
|
|
14169
|
+
getDirection(): 'ltr' | 'rtl';
|
|
14256
14170
|
/**
|
|
14257
|
-
*
|
|
14171
|
+
* Check if RTL is enabled
|
|
14258
14172
|
*/
|
|
14259
|
-
|
|
14173
|
+
isEnabled(): boolean;
|
|
14260
14174
|
/**
|
|
14261
|
-
*
|
|
14175
|
+
* Set direction
|
|
14262
14176
|
*/
|
|
14263
|
-
|
|
14177
|
+
setDirection(direction: 'ltr' | 'rtl'): void;
|
|
14264
14178
|
/**
|
|
14265
|
-
*
|
|
14179
|
+
* Toggle direction
|
|
14266
14180
|
*/
|
|
14267
|
-
|
|
14181
|
+
toggleDirection(): 'ltr' | 'rtl';
|
|
14268
14182
|
/**
|
|
14269
|
-
*
|
|
14183
|
+
* Enable RTL
|
|
14270
14184
|
*/
|
|
14271
|
-
|
|
14185
|
+
enable(): void;
|
|
14272
14186
|
/**
|
|
14273
|
-
*
|
|
14187
|
+
* Disable RTL
|
|
14274
14188
|
*/
|
|
14275
|
-
|
|
14189
|
+
disable(): void;
|
|
14276
14190
|
/**
|
|
14277
|
-
*
|
|
14191
|
+
* Set locale and auto-adjust direction
|
|
14278
14192
|
*/
|
|
14279
|
-
|
|
14193
|
+
setLocale(locale: string): void;
|
|
14280
14194
|
/**
|
|
14281
|
-
*
|
|
14195
|
+
* Get current locale
|
|
14282
14196
|
*/
|
|
14283
|
-
|
|
14197
|
+
getLocale(): string | undefined;
|
|
14284
14198
|
/**
|
|
14285
|
-
*
|
|
14199
|
+
* Apply direction to DOM
|
|
14286
14200
|
*/
|
|
14287
|
-
|
|
14201
|
+
private applyDirection;
|
|
14202
|
+
/**
|
|
14203
|
+
* Add direction change listener
|
|
14204
|
+
*/
|
|
14205
|
+
onDirectionChange(callback: (direction: 'ltr' | 'rtl') => void): () => void;
|
|
14206
|
+
/**
|
|
14207
|
+
* Notify listeners of direction change
|
|
14208
|
+
*/
|
|
14209
|
+
private notifyListeners;
|
|
14210
|
+
/**
|
|
14211
|
+
* Get RTL-aware value
|
|
14212
|
+
*
|
|
14213
|
+
* Returns different values based on direction
|
|
14214
|
+
*/
|
|
14215
|
+
getValue<T>(ltrValue: T, rtlValue: T): T;
|
|
14216
|
+
/**
|
|
14217
|
+
* Get RTL-aware CSS property
|
|
14218
|
+
*
|
|
14219
|
+
* Returns appropriate CSS property based on direction
|
|
14220
|
+
*/
|
|
14221
|
+
getCSSProperty(property: string): string;
|
|
14222
|
+
/**
|
|
14223
|
+
* Destroy RTL manager
|
|
14224
|
+
*/
|
|
14225
|
+
destroy(): void;
|
|
14226
|
+
}
|
|
14227
|
+
|
|
14228
|
+
/**
|
|
14229
|
+
* Theme System Exports
|
|
14230
|
+
*
|
|
14231
|
+
* Unified theme system - handles both DesignTokens and Theme objects.
|
|
14232
|
+
*
|
|
14233
|
+
* @example
|
|
14234
|
+
* ```typescript
|
|
14235
|
+
* import { createTheme, injectTheme } from '@shohojdhara/atomix/theme';
|
|
14236
|
+
*
|
|
14237
|
+
* // Using DesignTokens (recommended - flat structure)
|
|
14238
|
+
* const css = createTheme({ 'primary': '#7AFFD7', 'spacing-4': '1rem' });
|
|
14239
|
+
* injectTheme(css);
|
|
14240
|
+
*
|
|
14241
|
+
* // Or use with ThemeProvider
|
|
14242
|
+
* import { ThemeProvider } from '@shohojdhara/atomix/theme';
|
|
14243
|
+
* const tokens = { 'primary': '#7c3aed' };
|
|
14244
|
+
* <ThemeProvider defaultTheme={tokens}>...</ThemeProvider>
|
|
14245
|
+
* ```
|
|
14246
|
+
*/
|
|
14247
|
+
|
|
14248
|
+
/**
|
|
14249
|
+
* Inject theme CSS into DOM
|
|
14250
|
+
*/
|
|
14251
|
+
declare function injectTheme(css: string, id?: string): void;
|
|
14252
|
+
/**
|
|
14253
|
+
* Remove theme from DOM
|
|
14254
|
+
*/
|
|
14255
|
+
declare function removeTheme(id?: string): void;
|
|
14256
|
+
/**
|
|
14257
|
+
* Save theme to CSS file
|
|
14258
|
+
*/
|
|
14259
|
+
declare function saveTheme(css: string, filePath: string): Promise<void>;
|
|
14260
|
+
|
|
14261
|
+
type themeImport_A11yIssue = A11yIssue;
|
|
14262
|
+
type themeImport_CSSVariableConfig = CSSVariableConfig;
|
|
14263
|
+
type themeImport_CSSVariableNamingOptions = CSSVariableNamingOptions;
|
|
14264
|
+
type themeImport_ComponentThemeOptions = ComponentThemeOptions;
|
|
14265
|
+
type themeImport_ComponentThemeOverride = ComponentThemeOverride;
|
|
14266
|
+
type themeImport_DesignTokens = DesignTokens;
|
|
14267
|
+
type themeImport_GenerateCSSVariablesOptions = GenerateCSSVariablesOptions;
|
|
14268
|
+
type themeImport_NamingOptions = NamingOptions;
|
|
14269
|
+
type themeImport_RTLConfig = RTLConfig;
|
|
14270
|
+
type themeImport_RTLManager = RTLManager;
|
|
14271
|
+
declare const themeImport_RTLManager: typeof RTLManager;
|
|
14272
|
+
type themeImport_Theme = Theme;
|
|
14273
|
+
type themeImport_ThemeApplicator = ThemeApplicator;
|
|
14274
|
+
declare const themeImport_ThemeApplicator: typeof ThemeApplicator;
|
|
14275
|
+
type themeImport_ThemeChangeEvent = ThemeChangeEvent;
|
|
14276
|
+
declare const themeImport_ThemeComparator: typeof ThemeComparator;
|
|
14277
|
+
type themeImport_ThemeComparatorProps = ThemeComparatorProps;
|
|
14278
|
+
type themeImport_ThemeComponentOverrides = ThemeComponentOverrides;
|
|
14279
|
+
declare const themeImport_ThemeContext: typeof ThemeContext;
|
|
14280
|
+
type themeImport_ThemeContextValue = ThemeContextValue;
|
|
14281
|
+
type themeImport_ThemeErrorBoundary = ThemeErrorBoundary;
|
|
14282
|
+
declare const themeImport_ThemeErrorBoundary: typeof ThemeErrorBoundary;
|
|
14283
|
+
type themeImport_ThemeErrorBoundaryProps = ThemeErrorBoundaryProps;
|
|
14284
|
+
declare const themeImport_ThemeInspector: typeof ThemeInspector;
|
|
14285
|
+
type themeImport_ThemeInspectorProps = ThemeInspectorProps;
|
|
14286
|
+
declare const themeImport_ThemeLiveEditor: typeof ThemeLiveEditor;
|
|
14287
|
+
type themeImport_ThemeLiveEditorProps = ThemeLiveEditorProps;
|
|
14288
|
+
type themeImport_ThemeLoadOptions = ThemeLoadOptions;
|
|
14289
|
+
declare const themeImport_ThemePreview: typeof ThemePreview;
|
|
14290
|
+
type themeImport_ThemePreviewProps = ThemePreviewProps;
|
|
14291
|
+
declare const themeImport_ThemeProvider: typeof ThemeProvider;
|
|
14292
|
+
type themeImport_ThemeProviderProps = ThemeProviderProps;
|
|
14293
|
+
type themeImport_ThemeValidationResult = ThemeValidationResult;
|
|
14294
|
+
type themeImport_ThemeValidator = ThemeValidator;
|
|
14295
|
+
declare const themeImport_ThemeValidator: typeof ThemeValidator;
|
|
14296
|
+
type themeImport_UseHistoryOptions = UseHistoryOptions;
|
|
14297
|
+
type themeImport_UseHistoryReturn<T> = UseHistoryReturn<T>;
|
|
14298
|
+
type themeImport_UseThemeReturn = UseThemeReturn;
|
|
14299
|
+
type themeImport_ValidationResult = ValidationResult;
|
|
14300
|
+
declare const themeImport_applyCSSVariables: typeof applyCSSVariables;
|
|
14301
|
+
declare const themeImport_applyComponentTheme: typeof applyComponentTheme;
|
|
14302
|
+
declare const themeImport_applyTheme: typeof applyTheme;
|
|
14303
|
+
declare const themeImport_camelToKebab: typeof camelToKebab;
|
|
14304
|
+
declare const themeImport_clearThemes: typeof clearThemes;
|
|
14305
|
+
declare const themeImport_createDesignTokensFromTheme: typeof createDesignTokensFromTheme;
|
|
14306
|
+
declare const themeImport_createTheme: typeof createTheme;
|
|
14307
|
+
declare const themeImport_createThemeObject: typeof createThemeObject;
|
|
14308
|
+
declare const themeImport_createThemeRegistry: typeof createThemeRegistry;
|
|
14309
|
+
declare const themeImport_createTokens: typeof createTokens;
|
|
14310
|
+
declare const themeImport_cssVarsToStyle: typeof cssVarsToStyle;
|
|
14311
|
+
declare const themeImport_deepMerge: typeof deepMerge;
|
|
14312
|
+
declare const themeImport_defaultTokens: typeof defaultTokens;
|
|
14313
|
+
declare const themeImport_designTokensToCSSVars: typeof designTokensToCSSVars;
|
|
14314
|
+
declare const themeImport_designTokensToTheme: typeof designTokensToTheme;
|
|
14315
|
+
declare const themeImport_extendTheme: typeof extendTheme;
|
|
14316
|
+
declare const themeImport_extractComponentName: typeof extractComponentName;
|
|
14317
|
+
declare const themeImport_generateCSSVariableName: typeof generateCSSVariableName;
|
|
14318
|
+
declare const themeImport_generateCSSVariables: typeof generateCSSVariables;
|
|
14319
|
+
declare const themeImport_generateCSSVariablesForSelector: typeof generateCSSVariablesForSelector;
|
|
14320
|
+
declare const themeImport_generateClassName: typeof generateClassName;
|
|
14321
|
+
declare const themeImport_generateComponentCSSVars: typeof generateComponentCSSVars;
|
|
14322
|
+
declare const themeImport_getAllThemes: typeof getAllThemes;
|
|
14323
|
+
declare const themeImport_getCSSVariable: typeof getCSSVariable;
|
|
14324
|
+
declare const themeImport_getComponentThemeValue: typeof getComponentThemeValue;
|
|
14325
|
+
declare const themeImport_getDesignTokensFromTheme: typeof getDesignTokensFromTheme;
|
|
14326
|
+
declare const themeImport_getTheme: typeof getTheme;
|
|
14327
|
+
declare const themeImport_getThemeApplicator: typeof getThemeApplicator;
|
|
14328
|
+
declare const themeImport_getThemeCount: typeof getThemeCount;
|
|
14329
|
+
declare const themeImport_getThemeIds: typeof getThemeIds;
|
|
14330
|
+
declare const themeImport_hasTheme: typeof hasTheme;
|
|
14331
|
+
declare const themeImport_injectCSS: typeof injectCSS;
|
|
14332
|
+
declare const themeImport_injectTheme: typeof injectTheme;
|
|
14333
|
+
declare const themeImport_isCSSInjected: typeof isCSSInjected;
|
|
14334
|
+
declare const themeImport_isDesignTokens: typeof isDesignTokens;
|
|
14335
|
+
declare const themeImport_isThemeObject: typeof isThemeObject;
|
|
14336
|
+
declare const themeImport_isValidCSSVariableName: typeof isValidCSSVariableName;
|
|
14337
|
+
declare const themeImport_loadThemeFromConfig: typeof loadThemeFromConfig;
|
|
14338
|
+
declare const themeImport_loadThemeFromConfigSync: typeof loadThemeFromConfigSync;
|
|
14339
|
+
declare const themeImport_mapSCSSTokensToCSSVars: typeof mapSCSSTokensToCSSVars;
|
|
14340
|
+
declare const themeImport_mergeCSSVars: typeof mergeCSSVars;
|
|
14341
|
+
declare const themeImport_mergeTheme: typeof mergeTheme;
|
|
14342
|
+
declare const themeImport_normalizeThemeTokens: typeof normalizeThemeTokens;
|
|
14343
|
+
declare const themeImport_registerTheme: typeof registerTheme;
|
|
14344
|
+
declare const themeImport_removeCSS: typeof removeCSS;
|
|
14345
|
+
declare const themeImport_removeCSSVariables: typeof removeCSSVariables;
|
|
14346
|
+
declare const themeImport_removeTheme: typeof removeTheme;
|
|
14347
|
+
declare const themeImport_saveTheme: typeof saveTheme;
|
|
14348
|
+
declare const themeImport_themePropertyToCSSVar: typeof themePropertyToCSSVar;
|
|
14349
|
+
declare const themeImport_themeToDesignTokens: typeof themeToDesignTokens;
|
|
14350
|
+
declare const themeImport_unregisterTheme: typeof unregisterTheme;
|
|
14351
|
+
declare const themeImport_useComponentTheme: typeof useComponentTheme;
|
|
14352
|
+
declare const themeImport_useHistory: typeof useHistory;
|
|
14353
|
+
declare const themeImport_useTheme: typeof useTheme;
|
|
14354
|
+
declare const themeImport_useThemeTokens: typeof useThemeTokens;
|
|
14355
|
+
declare namespace themeImport {
|
|
14356
|
+
export { themeImport_RTLManager as RTLManager, themeImport_ThemeApplicator as ThemeApplicator, themeImport_ThemeComparator as ThemeComparator, themeImport_ThemeContext as ThemeContext, themeImport_ThemeErrorBoundary as ThemeErrorBoundary, themeImport_ThemeInspector as ThemeInspector, themeImport_ThemeLiveEditor as ThemeLiveEditor, themeImport_ThemePreview as ThemePreview, themeImport_ThemeProvider as ThemeProvider, themeImport_ThemeValidator as ThemeValidator, themeImport_applyCSSVariables as applyCSSVariables, themeImport_applyComponentTheme as applyComponentTheme, themeImport_applyTheme as applyTheme, themeImport_camelToKebab as camelToKebab, themeImport_clearThemes as clearThemes, themeImport_createDesignTokensFromTheme as createDesignTokensFromTheme, themeImport_createTheme as createTheme, themeImport_createThemeObject as createThemeObject, themeImport_createThemeRegistry as createThemeRegistry, themeImport_createTokens as createTokens, themeImport_cssVarsToStyle as cssVarsToStyle, themeImport_deepMerge as deepMerge, themeImport_defaultTokens as defaultTokens, themeImport_designTokensToCSSVars as designTokensToCSSVars, themeImport_designTokensToTheme as designTokensToTheme, themeImport_extendTheme as extendTheme, themeImport_extractComponentName as extractComponentName, themeImport_generateCSSVariableName as generateCSSVariableName, themeImport_generateCSSVariables as generateCSSVariables, themeImport_generateCSSVariablesForSelector as generateCSSVariablesForSelector, themeImport_generateClassName as generateClassName, themeImport_generateComponentCSSVars as generateComponentCSSVars, themeImport_getAllThemes as getAllThemes, themeImport_getCSSVariable as getCSSVariable, themeImport_getComponentThemeValue as getComponentThemeValue, themeImport_getDesignTokensFromTheme as getDesignTokensFromTheme, themeImport_getTheme as getTheme, themeImport_getThemeApplicator as getThemeApplicator, themeImport_getThemeCount as getThemeCount, themeImport_getThemeIds as getThemeIds, themeImport_hasTheme as hasTheme, themeImport_injectCSS as injectCSS, themeImport_injectTheme as injectTheme, themeImport_isCSSInjected as isCSSInjected, themeImport_isDesignTokens as isDesignTokens, themeImport_isThemeObject as isThemeObject, themeImport_isValidCSSVariableName as isValidCSSVariableName, themeImport_loadThemeFromConfig as loadThemeFromConfig, themeImport_loadThemeFromConfigSync as loadThemeFromConfigSync, themeImport_mapSCSSTokensToCSSVars as mapSCSSTokensToCSSVars, themeImport_mergeCSSVars as mergeCSSVars, themeImport_mergeTheme as mergeTheme, themeImport_normalizeThemeTokens as normalizeThemeTokens, themeImport_registerTheme as registerTheme, themeImport_removeCSS as removeCSS, themeImport_removeCSSVariables as removeCSSVariables, themeImport_removeTheme as removeTheme, themeImport_saveTheme as saveTheme, themeImport_themePropertyToCSSVar as themePropertyToCSSVar, themeImport_themeToDesignTokens as themeToDesignTokens, themeImport_unregisterTheme as unregisterTheme, themeImport_useComponentTheme as useComponentTheme, themeImport_useHistory as useHistory, themeImport_useTheme as useTheme, themeImport_useThemeTokens as useThemeTokens };
|
|
14357
|
+
export type { themeImport_A11yIssue as A11yIssue, themeImport_CSSVariableConfig as CSSVariableConfig, themeImport_CSSVariableNamingOptions as CSSVariableNamingOptions, themeImport_ComponentThemeOptions as ComponentThemeOptions, themeImport_ComponentThemeOverride as ComponentThemeOverride, themeImport_DesignTokens as DesignTokens, themeImport_GenerateCSSVariablesOptions as GenerateCSSVariablesOptions, themeImport_NamingOptions as NamingOptions, themeImport_RTLConfig as RTLConfig, themeImport_Theme as Theme, themeImport_ThemeChangeEvent as ThemeChangeEvent, themeImport_ThemeComparatorProps as ThemeComparatorProps, themeImport_ThemeComponentOverrides as ThemeComponentOverrides, themeImport_ThemeContextValue as ThemeContextValue, themeImport_ThemeErrorBoundaryProps as ThemeErrorBoundaryProps, themeImport_ThemeInspectorProps as ThemeInspectorProps, themeImport_ThemeLiveEditorProps as ThemeLiveEditorProps, themeImport_ThemeLoadOptions as ThemeLoadOptions, themeImport_ThemePreviewProps as ThemePreviewProps, themeImport_ThemeProviderProps as ThemeProviderProps, themeImport_ThemeValidationResult as ThemeValidationResult, themeImport_UseHistoryOptions as UseHistoryOptions, themeImport_UseHistoryReturn as UseHistoryReturn, themeImport_UseThemeReturn as UseThemeReturn, themeImport_ValidationResult as ValidationResult };
|
|
14288
14358
|
}
|
|
14359
|
+
|
|
14289
14360
|
/**
|
|
14290
|
-
*
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
* Apply theme using global applicator
|
|
14295
|
-
*/
|
|
14296
|
-
declare function applyTheme(theme: Theme): void;
|
|
14297
|
-
/**
|
|
14298
|
-
* Remove theme using global applicator
|
|
14361
|
+
* Component Customization Hook
|
|
14362
|
+
*
|
|
14363
|
+
* Merges theme-level component overrides with component-level props
|
|
14364
|
+
* for comprehensive customization support.
|
|
14299
14365
|
*/
|
|
14300
|
-
declare function removeTheme(): void;
|
|
14301
14366
|
|
|
14302
14367
|
/**
|
|
14303
|
-
*
|
|
14304
|
-
*
|
|
14305
|
-
* Utilities for generating and managing CSS custom properties from SCSS tokens
|
|
14306
|
-
* and component configurations.
|
|
14368
|
+
* Component names that support customization
|
|
14307
14369
|
*/
|
|
14370
|
+
type ComponentName = keyof ComponentPartsMap;
|
|
14308
14371
|
/**
|
|
14309
|
-
*
|
|
14372
|
+
* Props for a customizable component
|
|
14310
14373
|
*/
|
|
14311
|
-
interface
|
|
14312
|
-
/**
|
|
14313
|
-
|
|
14314
|
-
/**
|
|
14315
|
-
|
|
14316
|
-
/**
|
|
14317
|
-
|
|
14318
|
-
/**
|
|
14319
|
-
|
|
14320
|
-
/** Variant-specific properties (e.g., primary, secondary) */
|
|
14321
|
-
variants?: Record<string, Record<string, string | number>>;
|
|
14374
|
+
interface CustomizableComponentProps<T extends ComponentName> {
|
|
14375
|
+
/** CSS variable overrides */
|
|
14376
|
+
cssVars?: T extends keyof ComponentCSSVariables ? Partial<Record<ComponentCSSVariables[T], string | number>> : Record<string, string | number>;
|
|
14377
|
+
/** Part-based styling */
|
|
14378
|
+
parts?: ComponentPartsMap[T];
|
|
14379
|
+
/** Additional className */
|
|
14380
|
+
className?: string;
|
|
14381
|
+
/** Inline styles */
|
|
14382
|
+
style?: React.CSSProperties;
|
|
14322
14383
|
}
|
|
14323
14384
|
/**
|
|
14324
|
-
*
|
|
14385
|
+
* Result of component customization
|
|
14325
14386
|
*/
|
|
14326
|
-
interface
|
|
14327
|
-
/**
|
|
14328
|
-
|
|
14329
|
-
/**
|
|
14330
|
-
|
|
14331
|
-
/**
|
|
14332
|
-
|
|
14387
|
+
interface ComponentCustomization<T extends ComponentName> {
|
|
14388
|
+
/** Merged CSS variables */
|
|
14389
|
+
cssVars: Record<string, string | number>;
|
|
14390
|
+
/** Merged part styles */
|
|
14391
|
+
parts: ComponentPartsMap[T];
|
|
14392
|
+
/** Merged className */
|
|
14393
|
+
className: string;
|
|
14394
|
+
/** Merged inline styles */
|
|
14395
|
+
style: React.CSSProperties;
|
|
14396
|
+
/** CSS variable style object for inline application */
|
|
14397
|
+
cssVarStyle: React.CSSProperties;
|
|
14333
14398
|
}
|
|
14334
14399
|
/**
|
|
14335
|
-
*
|
|
14400
|
+
* Hook to merge theme overrides with component props
|
|
14336
14401
|
*
|
|
14337
14402
|
* @example
|
|
14338
|
-
*
|
|
14339
|
-
*
|
|
14403
|
+
* function Button(props: ButtonProps) {
|
|
14404
|
+
* const customization = useComponentCustomization('Button', props);
|
|
14405
|
+
*
|
|
14406
|
+
* return (
|
|
14407
|
+
* <button
|
|
14408
|
+
* className={customization.className}
|
|
14409
|
+
* style={customization.style}
|
|
14410
|
+
* >
|
|
14411
|
+
* {props.children}
|
|
14412
|
+
* </button>
|
|
14413
|
+
* );
|
|
14414
|
+
* }
|
|
14340
14415
|
*/
|
|
14341
|
-
declare function
|
|
14416
|
+
declare function useComponentCustomization<T extends ComponentName>(component: T, props: CustomizableComponentProps<T>): ComponentCustomization<T>;
|
|
14342
14417
|
/**
|
|
14343
|
-
*
|
|
14344
|
-
*
|
|
14345
|
-
* @example
|
|
14346
|
-
* const vars = generateComponentCSSVars({
|
|
14347
|
-
* component: 'button',
|
|
14348
|
-
* properties: { bg: '#000', color: '#fff' }
|
|
14349
|
-
* })
|
|
14350
|
-
* // Returns: { '--atomix-button-bg': '#000', '--atomix-button-color': '#fff' }
|
|
14418
|
+
* Hook to get default props from theme
|
|
14351
14419
|
*/
|
|
14352
|
-
declare function
|
|
14420
|
+
declare function useComponentDefaultProps<T extends ComponentName>(component: T): Record<string, any>;
|
|
14353
14421
|
/**
|
|
14354
|
-
*
|
|
14355
|
-
*
|
|
14356
|
-
* @example
|
|
14357
|
-
* const tokens = { '$primary-color': '#7AFFD7', '$spacing-md': '16px' }
|
|
14358
|
-
* const vars = mapSCSSTokensToCSSVars(tokens)
|
|
14359
|
-
* // Returns: { '--primary-color': '#7AFFD7', '--spacing-md': '16px' }
|
|
14422
|
+
* Hook to merge default props with provided props
|
|
14360
14423
|
*/
|
|
14361
|
-
declare function
|
|
14424
|
+
declare function useMergedProps<T extends Record<string, any>>(defaultProps: T, props: Partial<T>): T;
|
|
14362
14425
|
/**
|
|
14363
|
-
*
|
|
14426
|
+
* Utility to apply CSS variables to style object
|
|
14427
|
+
*/
|
|
14428
|
+
declare function applyCSSVarsToStyle(cssVars: Record<string, string | number>, baseStyle?: React.CSSProperties): React.CSSProperties;
|
|
14429
|
+
|
|
14430
|
+
/**
|
|
14431
|
+
* Atomix Config Loader
|
|
14364
14432
|
*
|
|
14365
|
-
*
|
|
14366
|
-
*
|
|
14433
|
+
* Helper functions to load atomix.config.ts from external projects.
|
|
14434
|
+
* Similar to how Tailwind loads tailwind.config.js
|
|
14367
14435
|
*/
|
|
14368
|
-
|
|
14436
|
+
|
|
14369
14437
|
/**
|
|
14370
|
-
*
|
|
14438
|
+
* Load Atomix configuration from project root
|
|
14371
14439
|
*
|
|
14372
|
-
*
|
|
14373
|
-
*
|
|
14440
|
+
* Attempts to load atomix.config.ts from the current working directory.
|
|
14441
|
+
* Falls back to default config if file doesn't exist.
|
|
14442
|
+
*
|
|
14443
|
+
* @param options - Loader options
|
|
14444
|
+
* @returns Loaded configuration or default
|
|
14445
|
+
*
|
|
14446
|
+
* @example
|
|
14447
|
+
* ```typescript
|
|
14448
|
+
* import { loadAtomixConfig } from '@shohojdhara/atomix/config';
|
|
14449
|
+
* import { createTheme } from '@shohojdhara/atomix/theme';
|
|
14450
|
+
*
|
|
14451
|
+
* const config = loadAtomixConfig();
|
|
14452
|
+
* const theme = createTheme(config.theme?.tokens || {});
|
|
14453
|
+
* ```
|
|
14374
14454
|
*/
|
|
14375
|
-
declare function
|
|
14455
|
+
declare function loadAtomixConfig(options?: {
|
|
14456
|
+
/** Custom config path (default: 'atomix.config.ts') */
|
|
14457
|
+
configPath?: string;
|
|
14458
|
+
/** Whether to throw error if config not found (default: false) */
|
|
14459
|
+
required?: boolean;
|
|
14460
|
+
}): AtomixConfig;
|
|
14376
14461
|
/**
|
|
14377
|
-
*
|
|
14462
|
+
* Resolve config path
|
|
14378
14463
|
*
|
|
14379
|
-
*
|
|
14380
|
-
*
|
|
14381
|
-
*
|
|
14464
|
+
* Finds atomix.config.ts in the project, checking common locations.
|
|
14465
|
+
* Returns null in browser environments where file system access is not available.
|
|
14466
|
+
*
|
|
14467
|
+
* This function is designed to work in Node.js environments only.
|
|
14468
|
+
* In browser builds, it will always return null without attempting to access Node.js modules.
|
|
14469
|
+
*
|
|
14470
|
+
* @internal This function uses Node.js modules and should not be called in browser environments.
|
|
14382
14471
|
*/
|
|
14383
|
-
declare function
|
|
14472
|
+
declare function resolveConfigPath(): string | null;
|
|
14473
|
+
|
|
14384
14474
|
/**
|
|
14385
|
-
*
|
|
14475
|
+
* Atomix Configuration System
|
|
14476
|
+
*
|
|
14477
|
+
* Tailwind-like configuration for customizing the Atomix Design System.
|
|
14478
|
+
*
|
|
14479
|
+
* External developers can create `atomix.config.ts` in their project root
|
|
14480
|
+
* to customize design tokens, similar to Tailwind's tailwind.config.js
|
|
14386
14481
|
*
|
|
14387
14482
|
* @example
|
|
14388
|
-
*
|
|
14389
|
-
*
|
|
14390
|
-
*
|
|
14483
|
+
* ```typescript
|
|
14484
|
+
* // atomix.config.ts (in your project)
|
|
14485
|
+
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
14486
|
+
*
|
|
14487
|
+
* export default defineConfig({
|
|
14488
|
+
* theme: {
|
|
14489
|
+
* extend: {
|
|
14490
|
+
* colors: {
|
|
14491
|
+
* primary: { main: '#7AFFD7' },
|
|
14492
|
+
* },
|
|
14493
|
+
* },
|
|
14494
|
+
* },
|
|
14495
|
+
* });
|
|
14496
|
+
* ```
|
|
14391
14497
|
*/
|
|
14392
|
-
|
|
14498
|
+
|
|
14393
14499
|
/**
|
|
14394
|
-
*
|
|
14395
|
-
* Later objects override earlier ones
|
|
14500
|
+
* Color Scale (1-10)
|
|
14396
14501
|
*/
|
|
14397
|
-
|
|
14502
|
+
interface ColorScale {
|
|
14503
|
+
1?: string;
|
|
14504
|
+
2?: string;
|
|
14505
|
+
3?: string;
|
|
14506
|
+
4?: string;
|
|
14507
|
+
5?: string;
|
|
14508
|
+
6?: string;
|
|
14509
|
+
7?: string;
|
|
14510
|
+
8?: string;
|
|
14511
|
+
9?: string;
|
|
14512
|
+
10?: string;
|
|
14513
|
+
[key: string]: string | undefined;
|
|
14514
|
+
}
|
|
14398
14515
|
/**
|
|
14399
|
-
*
|
|
14516
|
+
* Palette Color Options
|
|
14400
14517
|
*/
|
|
14401
|
-
|
|
14518
|
+
interface PaletteColorOptions {
|
|
14519
|
+
main: string;
|
|
14520
|
+
light?: string;
|
|
14521
|
+
dark?: string;
|
|
14522
|
+
contrastText?: string;
|
|
14523
|
+
}
|
|
14524
|
+
/**
|
|
14525
|
+
* Design Tokens Schema (Tailwind-like)
|
|
14526
|
+
*/
|
|
14527
|
+
interface ThemeTokens {
|
|
14528
|
+
/** Color palette */
|
|
14529
|
+
colors?: Record<string, string | PaletteColorOptions | ColorScale | Record<string, string>>;
|
|
14530
|
+
/** Spacing scale */
|
|
14531
|
+
spacing?: Record<string, string>;
|
|
14532
|
+
/** Border radius scale */
|
|
14533
|
+
borderRadius?: Record<string, string>;
|
|
14534
|
+
/** Typography scale and settings */
|
|
14535
|
+
typography?: {
|
|
14536
|
+
fontFamilies?: Record<string, string>;
|
|
14537
|
+
fontSizes?: Record<string, string>;
|
|
14538
|
+
fontWeights?: Record<string, string | number>;
|
|
14539
|
+
lineHeights?: Record<string, string | number>;
|
|
14540
|
+
letterSpacings?: Record<string, string>;
|
|
14541
|
+
};
|
|
14542
|
+
/** Shadow scale */
|
|
14543
|
+
shadows?: Record<string, string>;
|
|
14544
|
+
/** Z-index scale */
|
|
14545
|
+
zIndex?: Record<string, string | number>;
|
|
14546
|
+
/** Breakpoints scale */
|
|
14547
|
+
breakpoints?: Record<string, string | number>;
|
|
14548
|
+
/** Transitions settings */
|
|
14549
|
+
transitions?: {
|
|
14550
|
+
durations?: Record<string, string>;
|
|
14551
|
+
easings?: Record<string, string>;
|
|
14552
|
+
};
|
|
14553
|
+
}
|
|
14402
14554
|
/**
|
|
14403
|
-
*
|
|
14404
|
-
*
|
|
14405
|
-
* @example
|
|
14406
|
-
* extractComponentName('--atomix-button-bg')
|
|
14407
|
-
* // Returns: 'button'
|
|
14555
|
+
* CSS Theme Definition
|
|
14408
14556
|
*/
|
|
14409
|
-
|
|
14410
|
-
|
|
14557
|
+
interface CSSThemeDefinition {
|
|
14558
|
+
type: 'css';
|
|
14559
|
+
name: string;
|
|
14560
|
+
class?: string;
|
|
14561
|
+
description?: string;
|
|
14562
|
+
author?: string;
|
|
14563
|
+
version?: string;
|
|
14564
|
+
tags?: string[];
|
|
14565
|
+
supportsDarkMode?: boolean;
|
|
14566
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
14567
|
+
a11y?: {
|
|
14568
|
+
contrastTarget?: number;
|
|
14569
|
+
modes?: string[];
|
|
14570
|
+
};
|
|
14571
|
+
color?: string;
|
|
14572
|
+
features?: string[];
|
|
14573
|
+
dependencies?: string[];
|
|
14574
|
+
cssPath?: string;
|
|
14575
|
+
}
|
|
14411
14576
|
/**
|
|
14412
|
-
* Theme
|
|
14413
|
-
*
|
|
14414
|
-
* Central export point for all theme-related functionality
|
|
14577
|
+
* JavaScript Theme Definition
|
|
14415
14578
|
*/
|
|
14416
|
-
|
|
14417
|
-
type
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
type themeImport_ThemeContextValue = ThemeContextValue;
|
|
14435
|
-
type themeImport_ThemeErrorBoundary = ThemeErrorBoundary;
|
|
14436
|
-
declare const themeImport_ThemeErrorBoundary: typeof ThemeErrorBoundary;
|
|
14437
|
-
type themeImport_ThemeErrorBoundaryProps = ThemeErrorBoundaryProps;
|
|
14438
|
-
declare const themeImport_ThemeInspector: typeof ThemeInspector;
|
|
14439
|
-
type themeImport_ThemeInspectorProps = ThemeInspectorProps;
|
|
14440
|
-
declare const themeImport_ThemeLiveEditor: typeof ThemeLiveEditor;
|
|
14441
|
-
type themeImport_ThemeLiveEditorProps = ThemeLiveEditorProps;
|
|
14442
|
-
type themeImport_ThemeLoadOptions = ThemeLoadOptions;
|
|
14443
|
-
type themeImport_ThemeManager = ThemeManager;
|
|
14444
|
-
declare const themeImport_ThemeManager: typeof ThemeManager;
|
|
14445
|
-
type themeImport_ThemeManagerConfig = ThemeManagerConfig;
|
|
14446
|
-
type themeImport_ThemeMetadata = ThemeMetadata;
|
|
14447
|
-
declare const themeImport_ThemePreview: typeof ThemePreview;
|
|
14448
|
-
type themeImport_ThemePreviewProps = ThemePreviewProps;
|
|
14449
|
-
declare const themeImport_ThemeProvider: typeof ThemeProvider;
|
|
14450
|
-
type themeImport_ThemeProviderProps = ThemeProviderProps;
|
|
14451
|
-
type themeImport_ThemeValidationResult = ThemeValidationResult;
|
|
14452
|
-
type themeImport_UseThemeReturn = UseThemeReturn;
|
|
14453
|
-
declare const themeImport_applyCSSVariables: typeof applyCSSVariables;
|
|
14454
|
-
declare const themeImport_applyTheme: typeof applyTheme;
|
|
14455
|
-
declare const themeImport_createCLI: typeof createCLI;
|
|
14456
|
-
declare const themeImport_createDarkVariant: typeof createDarkVariant;
|
|
14457
|
-
declare const themeImport_createTheme: typeof createTheme;
|
|
14458
|
-
declare const themeImport_createThemeFromConfig: typeof createThemeFromConfig;
|
|
14459
|
-
declare const themeImport_cssVarsToStyle: typeof cssVarsToStyle;
|
|
14460
|
-
declare const themeImport_exportTheme: typeof exportTheme;
|
|
14461
|
-
declare const themeImport_extractComponentName: typeof extractComponentName;
|
|
14462
|
-
declare const themeImport_generateCSSVariableName: typeof generateCSSVariableName;
|
|
14463
|
-
declare const themeImport_generateComponentCSSVars: typeof generateComponentCSSVars;
|
|
14464
|
-
declare const themeImport_getCSSVariable: typeof getCSSVariable;
|
|
14465
|
-
declare const themeImport_getThemeApplicator: typeof getThemeApplicator;
|
|
14466
|
-
declare const themeImport_importTheme: typeof importTheme;
|
|
14467
|
-
declare const themeImport_isValidCSSVariableName: typeof isValidCSSVariableName;
|
|
14468
|
-
declare const themeImport_mapSCSSTokensToCSSVars: typeof mapSCSSTokensToCSSVars;
|
|
14469
|
-
declare const themeImport_mergeCSSVars: typeof mergeCSSVars;
|
|
14470
|
-
declare const themeImport_quickTheme: typeof quickTheme;
|
|
14471
|
-
declare const themeImport_removeCSSVariables: typeof removeCSSVariables;
|
|
14472
|
-
declare const themeImport_removeTheme: typeof removeTheme;
|
|
14473
|
-
declare const themeImport_runCLI: typeof runCLI;
|
|
14474
|
-
declare const themeImport_themeToCSS: typeof themeToCSS;
|
|
14475
|
-
declare const themeImport_useTheme: typeof useTheme;
|
|
14476
|
-
declare const themeImport_validateTheme: typeof validateTheme;
|
|
14477
|
-
declare namespace themeImport {
|
|
14478
|
-
export { themeImport_RTLManager as RTLManager, themeImport_ThemeApplicator as ThemeApplicator, themeImport_ThemeCLI as ThemeCLI, themeImport_ThemeComparator as ThemeComparator, themeImport_ThemeContext as ThemeContext, themeImport_ThemeErrorBoundary as ThemeErrorBoundary, themeImport_ThemeInspector as ThemeInspector, themeImport_ThemeLiveEditor as ThemeLiveEditor, themeImport_ThemeManager as ThemeManager, themeImport_ThemePreview as ThemePreview, themeImport_ThemeProvider as ThemeProvider, themeImport_applyCSSVariables as applyCSSVariables, themeImport_applyTheme as applyTheme, themeImport_createCLI as createCLI, themeImport_createDarkVariant as createDarkVariant, themeImport_createTheme as createTheme, themeImport_createThemeFromConfig as createThemeFromConfig, themeImport_cssVarsToStyle as cssVarsToStyle, themeImport_exportTheme as exportTheme, themeImport_extractComponentName as extractComponentName, themeImport_generateCSSVariableName as generateCSSVariableName, themeImport_generateComponentCSSVars as generateComponentCSSVars, themeImport_getCSSVariable as getCSSVariable, themeImport_getThemeApplicator as getThemeApplicator, themeImport_importTheme as importTheme, themeImport_isValidCSSVariableName as isValidCSSVariableName, themeImport_mapSCSSTokensToCSSVars as mapSCSSTokensToCSSVars, themeImport_mergeCSSVars as mergeCSSVars, themeImport_quickTheme as quickTheme, themeImport_removeCSSVariables as removeCSSVariables, themeImport_removeTheme as removeTheme, themeImport_runCLI as runCLI, themeImport_themeToCSS as themeToCSS, themeImport_useTheme as useTheme, themeImport_validateTheme as validateTheme };
|
|
14479
|
-
export type { themeImport_CLICommand as CLICommand, themeImport_CSSVariableConfig as CSSVariableConfig, themeImport_CSSVariableNamingOptions as CSSVariableNamingOptions, themeImport_ComponentThemeOverride as ComponentThemeOverride, themeImport_RTLConfig as RTLConfig, themeImport_Theme as Theme, themeImport_ThemeChangeEvent as ThemeChangeEvent, themeImport_ThemeComparatorProps as ThemeComparatorProps, themeImport_ThemeComponentOverrides as ThemeComponentOverrides, themeImport_ThemeContextValue as ThemeContextValue, themeImport_ThemeErrorBoundaryProps as ThemeErrorBoundaryProps, themeImport_ThemeInspectorProps as ThemeInspectorProps, themeImport_ThemeLiveEditorProps as ThemeLiveEditorProps, themeImport_ThemeLoadOptions as ThemeLoadOptions, themeImport_ThemeManagerConfig as ThemeManagerConfig, themeImport_ThemeMetadata as ThemeMetadata, themeImport_ThemePreviewProps as ThemePreviewProps, themeImport_ThemeProviderProps as ThemeProviderProps, themeImport_ThemeValidationResult as ThemeValidationResult, themeImport_UseThemeReturn as UseThemeReturn };
|
|
14579
|
+
interface JSThemeDefinition {
|
|
14580
|
+
type: 'js';
|
|
14581
|
+
name: string;
|
|
14582
|
+
class?: string;
|
|
14583
|
+
description?: string;
|
|
14584
|
+
author?: string;
|
|
14585
|
+
version?: string;
|
|
14586
|
+
tags?: string[];
|
|
14587
|
+
supportsDarkMode?: boolean;
|
|
14588
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
14589
|
+
a11y?: {
|
|
14590
|
+
contrastTarget?: number;
|
|
14591
|
+
modes?: string[];
|
|
14592
|
+
};
|
|
14593
|
+
color?: string;
|
|
14594
|
+
features?: string[];
|
|
14595
|
+
dependencies?: string[];
|
|
14596
|
+
createTheme: () => Theme;
|
|
14480
14597
|
}
|
|
14481
|
-
|
|
14482
14598
|
/**
|
|
14483
|
-
*
|
|
14484
|
-
*
|
|
14485
|
-
* Merges theme-level component overrides with component-level props
|
|
14486
|
-
* for comprehensive customization support.
|
|
14599
|
+
* Theme Definition (CSS or JS)
|
|
14487
14600
|
*/
|
|
14488
|
-
|
|
14601
|
+
type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
|
|
14489
14602
|
/**
|
|
14490
|
-
*
|
|
14603
|
+
* Build configuration (migrated from theme.config.ts)
|
|
14491
14604
|
*/
|
|
14492
|
-
|
|
14605
|
+
interface BuildConfig {
|
|
14606
|
+
output?: {
|
|
14607
|
+
directory?: string;
|
|
14608
|
+
formats?: {
|
|
14609
|
+
expanded?: string;
|
|
14610
|
+
compressed?: string;
|
|
14611
|
+
};
|
|
14612
|
+
};
|
|
14613
|
+
sass?: {
|
|
14614
|
+
style?: 'expanded' | 'compressed';
|
|
14615
|
+
sourceMap?: boolean;
|
|
14616
|
+
loadPaths?: string[];
|
|
14617
|
+
};
|
|
14618
|
+
}
|
|
14493
14619
|
/**
|
|
14494
|
-
*
|
|
14620
|
+
* Runtime configuration (migrated from theme.config.ts)
|
|
14495
14621
|
*/
|
|
14496
|
-
interface
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14622
|
+
interface RuntimeConfig {
|
|
14623
|
+
basePath?: string;
|
|
14624
|
+
cdnPath?: string | null;
|
|
14625
|
+
preload?: string[];
|
|
14626
|
+
lazy?: boolean;
|
|
14627
|
+
defaultTheme?: string;
|
|
14628
|
+
storageKey?: string;
|
|
14629
|
+
dataAttribute?: string;
|
|
14630
|
+
enablePersistence?: boolean;
|
|
14631
|
+
useMinified?: boolean;
|
|
14505
14632
|
}
|
|
14506
14633
|
/**
|
|
14507
|
-
*
|
|
14634
|
+
* Integration settings (migrated from theme.config.ts)
|
|
14508
14635
|
*/
|
|
14509
|
-
interface
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
className: string;
|
|
14516
|
-
/** Merged inline styles */
|
|
14517
|
-
style: React.CSSProperties;
|
|
14518
|
-
/** CSS variable style object for inline application */
|
|
14519
|
-
cssVarStyle: React.CSSProperties;
|
|
14636
|
+
interface IntegrationConfig {
|
|
14637
|
+
cssVariables?: Record<string, string>;
|
|
14638
|
+
classNames?: {
|
|
14639
|
+
theme?: string;
|
|
14640
|
+
colorMode?: string;
|
|
14641
|
+
};
|
|
14520
14642
|
}
|
|
14521
14643
|
/**
|
|
14522
|
-
*
|
|
14523
|
-
*
|
|
14524
|
-
* @example
|
|
14525
|
-
* function Button(props: ButtonProps) {
|
|
14526
|
-
* const customization = useComponentCustomization('Button', props);
|
|
14644
|
+
* Atomix Configuration Interface
|
|
14527
14645
|
*
|
|
14528
|
-
*
|
|
14529
|
-
*
|
|
14530
|
-
* className={customization.className}
|
|
14531
|
-
* style={customization.style}
|
|
14532
|
-
* >
|
|
14533
|
-
* {props.children}
|
|
14534
|
-
* </button>
|
|
14535
|
-
* );
|
|
14536
|
-
* }
|
|
14537
|
-
*/
|
|
14538
|
-
declare function useComponentCustomization<T extends ComponentName>(component: T, props: CustomizableComponentProps<T>): ComponentCustomization<T>;
|
|
14539
|
-
/**
|
|
14540
|
-
* Hook to get default props from theme
|
|
14646
|
+
* Tailwind-like configuration for external developers.
|
|
14647
|
+
* Focus on theme customization - build/runtime configs are internal only.
|
|
14541
14648
|
*/
|
|
14542
|
-
|
|
14649
|
+
interface AtomixConfig {
|
|
14650
|
+
/**
|
|
14651
|
+
* CSS variable prefix (default: 'atomix')
|
|
14652
|
+
*
|
|
14653
|
+
* Change this to customize all CSS variable names.
|
|
14654
|
+
* Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
|
|
14655
|
+
*/
|
|
14656
|
+
prefix?: string;
|
|
14657
|
+
/**
|
|
14658
|
+
* Theme customization (Tailwind-like)
|
|
14659
|
+
*
|
|
14660
|
+
* Use `extend` to add or override design tokens.
|
|
14661
|
+
* Use `tokens` to completely replace the default token system (advanced).
|
|
14662
|
+
*/
|
|
14663
|
+
theme?: {
|
|
14664
|
+
/**
|
|
14665
|
+
* Extend the default design tokens
|
|
14666
|
+
*
|
|
14667
|
+
* This is the recommended way to customize Atomix.
|
|
14668
|
+
* Your values will override or extend the base tokens.
|
|
14669
|
+
*/
|
|
14670
|
+
extend?: ThemeTokens;
|
|
14671
|
+
/**
|
|
14672
|
+
* Override the default tokens entirely (advanced)
|
|
14673
|
+
*
|
|
14674
|
+
* Use with caution - this replaces the entire token system.
|
|
14675
|
+
* Most users should use `extend` instead.
|
|
14676
|
+
*/
|
|
14677
|
+
tokens?: ThemeTokens;
|
|
14678
|
+
/**
|
|
14679
|
+
* Register custom themes (optional)
|
|
14680
|
+
*
|
|
14681
|
+
* Define CSS or JavaScript themes that can be loaded dynamically.
|
|
14682
|
+
*/
|
|
14683
|
+
themes?: Record<string, ThemeDefinition>;
|
|
14684
|
+
};
|
|
14685
|
+
/** @internal Build configuration (internal use only) */
|
|
14686
|
+
build?: BuildConfig;
|
|
14687
|
+
/** @internal Runtime configuration (internal use only) */
|
|
14688
|
+
runtime?: RuntimeConfig;
|
|
14689
|
+
/** @internal Integration settings (internal use only) */
|
|
14690
|
+
integration?: IntegrationConfig;
|
|
14691
|
+
/** @internal Theme dependencies mapping (internal use only) */
|
|
14692
|
+
dependencies?: Record<string, string[]>;
|
|
14693
|
+
}
|
|
14543
14694
|
/**
|
|
14544
|
-
*
|
|
14695
|
+
* Helper function to define Atomix configuration with type safety
|
|
14696
|
+
*
|
|
14697
|
+
* @param config - Atomix configuration object
|
|
14698
|
+
* @returns The configuration object
|
|
14545
14699
|
*/
|
|
14546
|
-
declare function useMergedProps<T extends Record<string, any>>(defaultProps: T, props: Partial<T>): T;
|
|
14547
14700
|
/**
|
|
14548
|
-
*
|
|
14701
|
+
* Helper function to define Atomix configuration with type safety
|
|
14702
|
+
*
|
|
14703
|
+
* Similar to Tailwind's defineConfig, provides autocomplete and type checking.
|
|
14704
|
+
*
|
|
14705
|
+
* @param config - Atomix configuration object
|
|
14706
|
+
* @returns The configuration object
|
|
14707
|
+
*
|
|
14708
|
+
* @example
|
|
14709
|
+
* ```typescript
|
|
14710
|
+
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
14711
|
+
*
|
|
14712
|
+
* export default defineConfig({
|
|
14713
|
+
* theme: {
|
|
14714
|
+
* extend: {
|
|
14715
|
+
* colors: {
|
|
14716
|
+
* primary: { main: '#7AFFD7' },
|
|
14717
|
+
* },
|
|
14718
|
+
* },
|
|
14719
|
+
* },
|
|
14720
|
+
* });
|
|
14721
|
+
* ```
|
|
14549
14722
|
*/
|
|
14550
|
-
declare function
|
|
14723
|
+
declare function defineConfig(config: AtomixConfig): AtomixConfig;
|
|
14551
14724
|
|
|
14552
14725
|
declare const composables: typeof __lib_composables;
|
|
14553
14726
|
declare const utils: typeof __lib_utils;
|
|
@@ -14845,6 +15018,7 @@ declare const atomix: {
|
|
|
14845
15018
|
Block: React$1.ForwardRefExoticComponent<BlockProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
14846
15019
|
Breadcrumb: React$1.FC<BreadcrumbProps>;
|
|
14847
15020
|
Button: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<Omit<ButtonProps & ButtonAsProp, "ref"> & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>>;
|
|
15021
|
+
ButtonGroup: React$1.FC<ButtonGroupProps>;
|
|
14848
15022
|
Callout: React$1.FC<CalloutProps>;
|
|
14849
15023
|
Card: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement | HTMLAnchorElement>>>;
|
|
14850
15024
|
ElevationCard: React$1.FC<ElevationCardProps>;
|
|
@@ -14935,5 +15109,5 @@ declare const atomix: {
|
|
|
14935
15109
|
VideoPlayer: React$1.ForwardRefExoticComponent<VideoPlayerProps & React$1.RefAttributes<HTMLVideoElement>>;
|
|
14936
15110
|
};
|
|
14937
15111
|
|
|
14938
|
-
export { ACCORDION, ATOMIX_GLASS, AVATAR, AVATAR_GROUP, Accordion, AnimatedChart, AreaChart, AtomixGlass, AtomixLogo, Avatar, AvatarGroup, BADGE, BADGE_CSS_VARS, BLOCK, BREADCRUMB, BUTTON, BUTTON_CSS_VARS, Badge, BarChart, Block, Breadcrumb, BubbleChart, Button, CALLOUT, CARD, CARD_CSS_VARS, CHART, CHECKBOX_CSS_VARS, CLASS_PREFIX, CODE_SNIPPET, COMPONENT_CSS_VARS, COUNTDOWN, Callout, CandlestickChart, Card, Chart, ChartRenderer, Checkbox, ColorModeToggle, Container, Countdown, DATA_TABLE_CLASSES, DATA_TABLE_SELECTORS, DATEPICKER, DEFAULT_ATOMIX_FONTS, DOTS, DROPDOWN, DROPDOWN_CSS_VARS, DataTable, DatePicker, DonutChart, Dropdown, EDGE_PANEL, EdgePanel, ElevationCard, FOOTER, FORM, FORM_GROUP, Footer, FooterLink, FooterSection, FooterSocialLink, Form, FormGroup, FunnelChart, GLASS_CONTAINER, GaugeChart, Grid, GridCol, HERO, HeatmapChart, Hero, INPUT, INPUT_CSS_VARS, Icon, Input, LIST, LIST_GROUP, LineChart, List, ListGroup, MESSAGES, MODAL, MODAL_CSS_VARS, MasonryGrid, MasonryGridItem, MegaMenu, MegaMenuColumn, MegaMenuLink, Menu, MenuDivider, MenuItem, Messages, Modal, MultiAxisChart, NAV, NAVBAR, Nav, NavDropdown, NavItem, Navbar, PAGINATION_DEFAULTS, PHOTOVIEWER, POPOVER, PROGRESS, PROGRESS_CSS_VARS, Pagination, PhotoViewer, PieChart, Popover, ProductReview, Progress, RADIO, RADIO_CSS_VARS, RATING, RIVER, RTLManager, RadarChart, Radio, Rating, River, Row, SECTION_INTRO, SELECT, SIDE_MENU, SIZES, SLIDER, SPINNER, STEPS, ScatterChart, SectionIntro, Select, SideMenu, SideMenuItem, SideMenuList, Slider, Spinner, Steps, TAB, TABS_CSS_VARS, TESTIMONIAL, TEXTAREA, THEME_COLORS, TODO, TOGGLE, TOOLTIP, TOOLTIP_CSS_VARS, Tabs, Testimonial, Textarea, ThemeApplicator,
|
|
14939
|
-
export type { AccordionParts, AccordionProps$1 as AccordionProps, AccordionState, AnimatedChartProps, AreaChartProps, AtomixConfig, AtomixGlassProps, AtomixLogoProps, AvatarGroupProps, AvatarParts, AvatarProps, AvatarSize, BadgeCSSVariable, BadgeParts, BadgeProps, BarChartOptions, BarChartProps, BarDimensions, BaseComponentProps, BlockProps, BreadcrumbInstance, BreadcrumbItem$1 as BreadcrumbItem, BreadcrumbOptions$1 as BreadcrumbOptions, BreadcrumbProps, BubbleChartProps, BubbleDataPoint, BuildConfig, ButtonCSSVariable, ButtonIconSlotProps, ButtonLabelSlotProps, ButtonParts, ButtonProps, ButtonRootSlotProps, ButtonSpinnerSlotProps,
|
|
15112
|
+
export { ACCORDION, ATOMIX_GLASS, AVATAR, AVATAR_GROUP, Accordion, AnimatedChart, AreaChart, AtomixGlass, AtomixLogo, Avatar, AvatarGroup, BADGE, BADGE_CSS_VARS, BLOCK, BREADCRUMB, BUTTON, BUTTON_CSS_VARS, BUTTON_GROUP, Badge, BarChart, Block, Breadcrumb, BubbleChart, Button, ButtonGroup, CALLOUT, CARD, CARD_CSS_VARS, CHART, CHECKBOX_CSS_VARS, CLASS_PREFIX, CODE_SNIPPET, COMPONENT_CSS_VARS, COUNTDOWN, Callout, CandlestickChart, Card, Chart, ChartRenderer, Checkbox, ColorModeToggle, Container, Countdown, DATA_TABLE_CLASSES, DATA_TABLE_SELECTORS, DATEPICKER, DEFAULT_ATOMIX_FONTS, DOTS, DROPDOWN, DROPDOWN_CSS_VARS, DataTable, DatePicker, DonutChart, Dropdown, EDGE_PANEL, EdgePanel, ElevationCard, FOOTER, FORM, FORM_GROUP, Footer, FooterLink, FooterSection, FooterSocialLink, Form, FormGroup, FunnelChart, GLASS_CONTAINER, GaugeChart, Grid, GridCol, HERO, HeatmapChart, Hero, INPUT, INPUT_CSS_VARS, Icon, Input, LIST, LIST_GROUP, LineChart, List, ListGroup, MESSAGES, MODAL, MODAL_CSS_VARS, MasonryGrid, MasonryGridItem, MegaMenu, MegaMenuColumn, MegaMenuLink, Menu, MenuDivider, MenuItem, Messages, Modal, MultiAxisChart, NAV, NAVBAR, Nav, NavDropdown, NavItem, Navbar, PAGINATION_DEFAULTS, PHOTOVIEWER, POPOVER, PROGRESS, PROGRESS_CSS_VARS, Pagination, PhotoViewer, PieChart, Popover, ProductReview, Progress, RADIO, RADIO_CSS_VARS, RATING, RIVER, RTLManager, RadarChart, Radio, Rating, River, Row, SECTION_INTRO, SELECT, SIDE_MENU, SIZES, SLIDER, SPINNER, STEPS, ScatterChart, SectionIntro, Select, SideMenu, SideMenuItem, SideMenuList, Slider, Spinner, Steps, TAB, TABS_CSS_VARS, TESTIMONIAL, TEXTAREA, THEME_COLORS, THEME_NAMING, TODO, TOGGLE, TOOLTIP, TOOLTIP_CSS_VARS, Tabs, Testimonial, Textarea, ThemeApplicator, ThemeComparator, ThemeContext, ThemeErrorBoundary, ThemeInspector, ThemeLiveEditor, ThemePreview, ThemeProvider, ThemeValidator, Todo, Toggle, Tooltip, TreemapChart, UPLOAD, Upload, VIDEO_PLAYER, VideoPlayer, WaterfallChart, applyCSSVariables, applyCSSVarsToStyle, applyComponentTheme, applyPartStyles, applyTheme, camelToKebab, clearThemes, composables, constants, createCSSVarStyle, createDebugAttrs, createDesignTokensFromTheme, createFontPreloadLink, createPartProps, createSlotComponent, createSlotProps, createTheme, createThemeObject, createThemeRegistry, createTokens, cssVarsToStyle, deepMerge, atomix as default, defaultTokens, defineConfig, designTokensToCSSVars, designTokensToTheme, extendTheme, extractComponentName, extractYouTubeId, generateCSSVariableName, generateCSSVariables, generateCSSVariablesForSelector, generateClassName, generateComponentCSSVars, generateFontPreloadTags, generateUUID, getAllThemes, getCSSVariable, getComponentCSSVars, getComponentThemeValue, getDesignTokensFromTheme, getPartStyles, getTheme, getThemeApplicator, getThemeCount, getThemeIds, hasCustomization, hasTheme, injectCSS, injectTheme, isCSSInjected, isDesignTokens, isSlot, isThemeObject, isValidCSSVariableName, isYouTubeUrl, loadAtomixConfig, loadThemeFromConfig, loadThemeFromConfigSync, mapSCSSTokensToCSSVars, mergeCSSVars, mergeClassNames, mergeComponentProps, mergePartStyles, mergeSlots, mergeTheme, normalizeThemeTokens, preloadFonts, registerTheme, removeCSS, removeCSSVariables, removeTheme, renderSlot, resolveConfigPath, saveTheme, sliderConstants, theme, themePropertyToCSSVar, themeToDesignTokens, types, unregisterTheme, useAccordion, useAtomixGlass, useBadge, useBarChart, useBlock, useBreadcrumb, useButton, useCard, useChartData, useChartInteraction, useChartScale, useCheckbox, useComponentCustomization, useComponentDefaultProps, useComponentTheme, useDataTable, useEdgePanel, useForm, useFormGroup, useGlassContainer, useHero, useHistory, useInput, useLineChart, useMergedProps, useModal, useNav, useNavDropdown, useNavItem, useNavbar, usePagination, usePieChart, useRadio, useRiver, useSelect, useSideMenu, useSideMenuItem, useSlider, useSlot, useSpinner, useTextarea, useTheme, useThemeTokens, useTodo, utils };
|
|
15113
|
+
export type { A11yIssue, AccordionParts, AccordionProps$1 as AccordionProps, AccordionState, AnimatedChartProps, AreaChartProps, AtomixConfig, AtomixGlassProps, AtomixLogoProps, AvatarGroupProps, AvatarParts, AvatarProps, AvatarSize, BadgeCSSVariable, BadgeParts, BadgeProps, BarChartOptions, BarChartProps, BarDimensions, BaseComponentProps, BlockProps, BreadcrumbInstance, BreadcrumbItem$1 as BreadcrumbItem, BreadcrumbOptions$1 as BreadcrumbOptions, BreadcrumbProps, BubbleChartProps, BubbleDataPoint, BuildConfig, ButtonCSSVariable, ButtonGroupProps, ButtonIconSlotProps, ButtonLabelSlotProps, ButtonParts, ButtonProps, ButtonRootSlotProps, ButtonSpinnerSlotProps, CSSThemeDefinition, CSSVariableConfig, CSSVariableNamingOptions, CalloutProps, CandlestickChartProps, CandlestickDataPoint, CardBodySlotProps, CardCSSVariable, CardFooterSlotProps, CardHeaderSlotProps, CardParts, CardProps, CardRootSlotProps, ChartAxis$1 as ChartAxis, ChartConfig$1 as ChartConfig, ChartDataPoint$1 as ChartDataPoint, ChartDataset$1 as ChartDataset, ChartProps$1 as ChartProps, ChartSize$1 as ChartSize, ChartType$1 as ChartType, CheckboxCSSVariable, CheckboxParts, CheckboxProps, CodeBlockProps, ColorModeToggleProps, ColorScale, ComponentCSSVariables, ComponentCustomization, ComponentName, ComponentParts, ComponentPartsMap, ComponentThemeOptions, ComponentThemeOverride, ContainerProps, CountdownProps, CustomizableComponentProps, DataTableColumn, DataTableParts, DataTableProps, DatePickerProps, DesignTokens, DisplacementMode, DonutChartProps, DropdownCSSVariable, DropdownDividerProps, DropdownHeaderProps, DropdownItemProps, DropdownMenuSlotProps, DropdownParts, DropdownPlacement, DropdownProps, DropdownRootSlotProps, DropdownToggleSlotProps, DropdownTrigger, EdgePanelMode, EdgePanelPosition, EdgePanelProps, ElementRefs, ElevationCardProps, FontPreloadConfig, FooterLayout, FooterLinkProps, FooterProps, FooterSectionProps, FooterSocialLinkProps, FormGroupParts, FormGroupProps, FormProps, FunnelChartProps, FunnelDataPoint, GaugeChartProps, GenerateCSSVariablesOptions, GlassContainerProps, GlassMode, GlassSize, GridColProps, GridProps, HeatmapChartProps, HeatmapDataPoint, HeroAlignment, HeroBackgroundSlide, HeroBackgroundSliderConfig, HeroProps, IconPosition, IconProps, IconSize$1 as IconSize, IconWeight$1 as IconWeight, ImageType, InputCSSVariable, InputElementSlotProps, InputParts, InputProps, InputRootSlotProps, IntegrationConfig, JSThemeDefinition, LineChartOptions, LineChartProps, ListGroupProps$1 as ListGroupProps, ListParts, ListProps, MasonryGridItemProps, MasonryGridProps, MegaMenuColumnProps, MegaMenuLinkProps, MegaMenuProps, MenuDividerProps, MenuItemProps, MenuProps, MergePropsOptions, MessageItem, MessagesProps, ModalBackdropSlotProps, ModalCSSVariable, ModalContentSlotProps, ModalDialogSlotProps, ModalParts, ModalProps, ModalRootSlotProps, MousePosition, MultiAxisChartProps, NamingOptions, NavAlignment, NavDropdownProps, NavItemProps, NavProps, NavVariant, NavbarParts, NavbarPosition, NavbarProps, OverLightConfig, OverLightObjectConfig, PaginationProps, PaletteColorOptions, PartStyleProps, PhosphorIconsType$1 as PhosphorIconsType, PhotoViewerProps, PieChartOptions, PieChartProps, PieSlice, PopoverProps, PopoverTriggerProps, ProductReviewProps, ProgressCSSVariable, ProgressParts, ProgressProps, RTLConfig, RadarChartProps, RadioCSSVariable, RadioParts, RadioProps, RatingProps, RiverContentColumn, RiverProps, RowProps, RuntimeConfig, ScatterChartProps, ScatterDataPoint, SectionIntroProps, SelectOption, SelectParts, SelectProps, SideMenuItemProps, SideMenuListProps, SideMenuProps, Size, SliderAutoplay, SliderBreakpoint, SliderEffect, SliderLazy, SliderNavigation, SliderPagination, SliderProps, SliderRefs, SliderScrollbar, SliderSlide, SliderState, SliderThumbs, SliderVirtual, SliderZoom, SlotProps, SocialLink, SocialPlatform, SortConfig, SpinnerProps, StateModifier, StepsProps, TabsCSSVariable, TabsParts, TabsProps, TestimonialProps, TextareaParts, TextareaProps, Theme, ThemeChangeEvent, ThemeColor, ThemeComparatorProps, ThemeComponentOverrides, ThemeContextValue, ThemeDefinition, ThemeErrorBoundaryProps, ThemeInspectorProps, ThemeLiveEditorProps, ThemeLoadOptions, ThemeName, ThemePreviewProps, ThemeProviderProps, ThemeTokens, ThemeValidationResult, TodoItem, TodoProps, ToggleProps, TooltipCSSVariable, TooltipParts, TooltipProps, TreemapChartProps, TreemapDataPoint, TreemapNode, UploadProps, UseBlockOptions, UseBlockReturn, UseCardOptions, UseCardReturn, UseDataTableProps, UseDataTableReturn, UseHistoryOptions, UseHistoryReturn, UseModalProps, UseModalReturn, UseSliderOptions, UseSliderReturn, UseThemeReturn, ValidationResult, Variant, VideoChapter, VideoPlayerProps, VideoQuality, VideoSubtitle, WaterfallChartProps, WaterfallDataPoint, listvariant };
|