@shohojdhara/atomix 0.3.6 → 0.3.8
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 +3 -3
- package/dist/atomix.css +77 -0
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +77 -0
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.js +50 -142
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +179 -274
- package/dist/core.js.map +1 -1
- package/dist/forms.js +50 -142
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +179 -274
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +1255 -1226
- package/dist/index.esm.js +2806 -2958
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3113 -3269
- 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 +313 -667
- package/dist/theme.js +1818 -2589
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +128 -356
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +1 -1
- package/src/components/Button/Button.tsx +85 -167
- package/src/components/DataTable/DataTable.stories.tsx +238 -0
- package/src/components/DataTable/DataTable.test.tsx +450 -0
- package/src/components/DataTable/DataTable.tsx +384 -61
- package/src/components/DatePicker/DatePicker.tsx +29 -38
- package/src/components/Upload/Upload.tsx +539 -40
- package/src/lib/composables/useAtomixGlass.ts +7 -7
- package/src/lib/composables/useDataTable.ts +355 -15
- package/src/lib/composables/useDatePicker.ts +19 -0
- package/src/lib/config/loader.ts +2 -3
- package/src/lib/constants/components.ts +17 -0
- package/src/lib/hooks/usePerformanceMonitor.ts +1 -1
- package/src/lib/theme/adapters/cssVariableMapper.ts +29 -14
- package/src/lib/theme/adapters/index.ts +1 -4
- package/src/lib/theme/config/configLoader.ts +82 -223
- package/src/lib/theme/config/loader.ts +15 -21
- package/src/lib/theme/constants/constants.ts +1 -1
- package/src/lib/theme/core/ThemeRegistry.ts +75 -279
- package/src/lib/theme/core/composeTheme.ts +30 -88
- package/src/lib/theme/core/createTheme.ts +88 -51
- package/src/lib/theme/core/createThemeObject.ts +2 -2
- package/src/lib/theme/core/index.ts +15 -2
- package/src/lib/theme/errors/errors.ts +1 -1
- package/src/lib/theme/generators/generateCSSNested.ts +131 -0
- package/src/lib/theme/generators/generateCSSVariables.ts +24 -16
- package/src/lib/theme/generators/index.ts +6 -0
- package/src/lib/theme/index.ts +45 -27
- package/src/lib/theme/runtime/ThemeApplicator.ts +6 -109
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +1 -1
- package/src/lib/theme/runtime/ThemeProvider.tsx +393 -544
- package/src/lib/theme/runtime/index.ts +1 -0
- package/src/lib/theme/runtime/useTheme.ts +1 -1
- package/src/lib/theme/runtime/useThemeTokens.ts +122 -0
- package/src/lib/theme/test/testTheme.ts +2 -1
- package/src/lib/theme/types.ts +14 -14
- package/src/lib/theme/utils/componentTheming.ts +140 -0
- package/src/lib/theme/utils/domUtils.ts +57 -15
- package/src/lib/theme/utils/injectCSS.ts +0 -1
- package/src/lib/theme/utils/naming.ts +100 -0
- package/src/lib/theme/utils/themeHelpers.ts +1 -39
- package/src/lib/theme/utils/themeUtils.ts +1 -170
- package/src/lib/types/components.ts +145 -0
- package/src/lib/utils/componentUtils.ts +1 -1
- package/src/lib/utils/dataTableExport.ts +143 -0
- package/src/lib/utils/memoryMonitor.ts +3 -3
- package/src/lib/utils/themeNaming.ts +135 -0
- package/src/styles/06-components/_components.data-table.scss +95 -0
package/dist/index.d.ts
CHANGED
|
@@ -2539,6 +2539,41 @@ interface DataTableColumn {
|
|
|
2539
2539
|
* Width of the column (CSS value)
|
|
2540
2540
|
*/
|
|
2541
2541
|
width?: string;
|
|
2542
|
+
/**
|
|
2543
|
+
* Minimum width for resizable columns (CSS value)
|
|
2544
|
+
*/
|
|
2545
|
+
minWidth?: string;
|
|
2546
|
+
/**
|
|
2547
|
+
* Maximum width for resizable columns (CSS value)
|
|
2548
|
+
*/
|
|
2549
|
+
maxWidth?: string;
|
|
2550
|
+
/**
|
|
2551
|
+
* Whether the column is resizable
|
|
2552
|
+
*/
|
|
2553
|
+
resizable?: boolean;
|
|
2554
|
+
/**
|
|
2555
|
+
* Whether the column is visible by default
|
|
2556
|
+
*/
|
|
2557
|
+
visible?: boolean;
|
|
2558
|
+
/**
|
|
2559
|
+
* Whether the column can be reordered
|
|
2560
|
+
*/
|
|
2561
|
+
reorderable?: boolean;
|
|
2562
|
+
/**
|
|
2563
|
+
* Custom filter function for column-specific filtering
|
|
2564
|
+
*/
|
|
2565
|
+
filterFunction?: (value: any, filterValue: string) => boolean;
|
|
2566
|
+
/**
|
|
2567
|
+
* Filter type for column-specific filtering
|
|
2568
|
+
*/
|
|
2569
|
+
filterType?: 'text' | 'select' | 'date' | 'number' | 'custom';
|
|
2570
|
+
/**
|
|
2571
|
+
* Options for select-type filters
|
|
2572
|
+
*/
|
|
2573
|
+
filterOptions?: Array<{
|
|
2574
|
+
label: string;
|
|
2575
|
+
value: any;
|
|
2576
|
+
}>;
|
|
2542
2577
|
}
|
|
2543
2578
|
/**
|
|
2544
2579
|
* Sort configuration
|
|
@@ -2553,6 +2588,14 @@ interface SortConfig {
|
|
|
2553
2588
|
*/
|
|
2554
2589
|
direction: 'asc' | 'desc';
|
|
2555
2590
|
}
|
|
2591
|
+
/**
|
|
2592
|
+
* Row selection mode
|
|
2593
|
+
*/
|
|
2594
|
+
type SelectionMode = 'single' | 'multiple' | 'none';
|
|
2595
|
+
/**
|
|
2596
|
+
* Export format
|
|
2597
|
+
*/
|
|
2598
|
+
type ExportFormat = 'csv' | 'excel' | 'json';
|
|
2556
2599
|
/**
|
|
2557
2600
|
* DataTable component properties
|
|
2558
2601
|
*/
|
|
@@ -2614,6 +2657,82 @@ interface DataTableProps extends BaseComponentProps {
|
|
|
2614
2657
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
2615
2658
|
*/
|
|
2616
2659
|
glass?: AtomixGlassProps | boolean;
|
|
2660
|
+
/**
|
|
2661
|
+
* Row selection mode ('single', 'multiple', or 'none')
|
|
2662
|
+
*/
|
|
2663
|
+
selectionMode?: SelectionMode;
|
|
2664
|
+
/**
|
|
2665
|
+
* Selected row IDs (for controlled selection)
|
|
2666
|
+
*/
|
|
2667
|
+
selectedRowIds?: (string | number)[];
|
|
2668
|
+
/**
|
|
2669
|
+
* Callback when selection changes
|
|
2670
|
+
*/
|
|
2671
|
+
onSelectionChange?: (selectedRows: any[], selectedIds: (string | number)[]) => void;
|
|
2672
|
+
/**
|
|
2673
|
+
* Key to use as unique identifier for rows (defaults to 'id')
|
|
2674
|
+
*/
|
|
2675
|
+
rowKey?: string | ((row: any) => string | number);
|
|
2676
|
+
/**
|
|
2677
|
+
* Whether columns are resizable
|
|
2678
|
+
*/
|
|
2679
|
+
resizable?: boolean;
|
|
2680
|
+
/**
|
|
2681
|
+
* Whether columns can be reordered
|
|
2682
|
+
*/
|
|
2683
|
+
reorderable?: boolean;
|
|
2684
|
+
/**
|
|
2685
|
+
* Callback when column order changes
|
|
2686
|
+
*/
|
|
2687
|
+
onColumnReorder?: (columnKeys: string[]) => void;
|
|
2688
|
+
/**
|
|
2689
|
+
* Whether to show column visibility toggle
|
|
2690
|
+
*/
|
|
2691
|
+
showColumnVisibility?: boolean;
|
|
2692
|
+
/**
|
|
2693
|
+
* Callback when column visibility changes
|
|
2694
|
+
*/
|
|
2695
|
+
onColumnVisibilityChange?: (visibleColumns: string[]) => void;
|
|
2696
|
+
/**
|
|
2697
|
+
* Whether to enable sticky headers
|
|
2698
|
+
*/
|
|
2699
|
+
stickyHeader?: boolean;
|
|
2700
|
+
/**
|
|
2701
|
+
* Offset from top for sticky headers (CSS value)
|
|
2702
|
+
*/
|
|
2703
|
+
stickyHeaderOffset?: string;
|
|
2704
|
+
/**
|
|
2705
|
+
* Whether to enable virtual scrolling for large datasets
|
|
2706
|
+
*/
|
|
2707
|
+
virtualScrolling?: boolean;
|
|
2708
|
+
/**
|
|
2709
|
+
* Estimated row height for virtual scrolling (in pixels)
|
|
2710
|
+
*/
|
|
2711
|
+
estimatedRowHeight?: number;
|
|
2712
|
+
/**
|
|
2713
|
+
* Number of rows to render outside visible area (overscan)
|
|
2714
|
+
*/
|
|
2715
|
+
overscan?: number;
|
|
2716
|
+
/**
|
|
2717
|
+
* Whether to enable export functionality
|
|
2718
|
+
*/
|
|
2719
|
+
exportable?: boolean;
|
|
2720
|
+
/**
|
|
2721
|
+
* Export formats available
|
|
2722
|
+
*/
|
|
2723
|
+
exportFormats?: ExportFormat[];
|
|
2724
|
+
/**
|
|
2725
|
+
* Custom export filename
|
|
2726
|
+
*/
|
|
2727
|
+
exportFilename?: string;
|
|
2728
|
+
/**
|
|
2729
|
+
* Callback for custom export logic
|
|
2730
|
+
*/
|
|
2731
|
+
onExport?: (format: ExportFormat, data: any[]) => void;
|
|
2732
|
+
/**
|
|
2733
|
+
* Whether to show column-specific filters
|
|
2734
|
+
*/
|
|
2735
|
+
columnFilters?: boolean;
|
|
2617
2736
|
}
|
|
2618
2737
|
/**
|
|
2619
2738
|
* Pagination component properties
|
|
@@ -8226,6 +8345,7 @@ type __lib_types_EdgePanelPosition = EdgePanelPosition;
|
|
|
8226
8345
|
type __lib_types_EdgePanelProps = EdgePanelProps;
|
|
8227
8346
|
type __lib_types_ElementRefs = ElementRefs;
|
|
8228
8347
|
type __lib_types_ElevationCardProps = ElevationCardProps;
|
|
8348
|
+
type __lib_types_ExportFormat = ExportFormat;
|
|
8229
8349
|
type __lib_types_FooterLayout = FooterLayout;
|
|
8230
8350
|
type __lib_types_FooterLinkProps = FooterLinkProps;
|
|
8231
8351
|
type __lib_types_FooterProps = FooterProps;
|
|
@@ -8271,6 +8391,7 @@ type __lib_types_RadioProps = RadioProps;
|
|
|
8271
8391
|
type __lib_types_RatingProps = RatingProps;
|
|
8272
8392
|
type __lib_types_SelectOption = SelectOption;
|
|
8273
8393
|
type __lib_types_SelectProps = SelectProps;
|
|
8394
|
+
type __lib_types_SelectionMode = SelectionMode;
|
|
8274
8395
|
type __lib_types_SideMenuItemProps = SideMenuItemProps;
|
|
8275
8396
|
type __lib_types_SideMenuListProps = SideMenuListProps;
|
|
8276
8397
|
type __lib_types_SideMenuProps = SideMenuProps;
|
|
@@ -8308,7 +8429,7 @@ type __lib_types_VideoQuality = VideoQuality;
|
|
|
8308
8429
|
type __lib_types_VideoSubtitle = VideoSubtitle;
|
|
8309
8430
|
type __lib_types_listvariant = listvariant;
|
|
8310
8431
|
declare namespace __lib_types {
|
|
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 };
|
|
8432
|
+
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_ExportFormat as ExportFormat, __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_SelectionMode as SelectionMode, __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 };
|
|
8312
8433
|
}
|
|
8313
8434
|
|
|
8314
8435
|
/**
|
|
@@ -8331,6 +8452,12 @@ declare const CLASS_PREFIX: {
|
|
|
8331
8452
|
/**
|
|
8332
8453
|
* Button-specific constants
|
|
8333
8454
|
*/
|
|
8455
|
+
declare const THEME_NAMING: {
|
|
8456
|
+
BUTTON_PREFIX: string;
|
|
8457
|
+
ICON_ELEMENT: string;
|
|
8458
|
+
LABEL_ELEMENT: string;
|
|
8459
|
+
SPINNER_ELEMENT: string;
|
|
8460
|
+
};
|
|
8334
8461
|
declare const BUTTON: {
|
|
8335
8462
|
BASE_CLASS: string;
|
|
8336
8463
|
ICON_CLASS: string;
|
|
@@ -8900,21 +9027,31 @@ declare const DATA_TABLE_CLASSES: {
|
|
|
8900
9027
|
header: string;
|
|
8901
9028
|
headerCell: string;
|
|
8902
9029
|
headerContent: string;
|
|
9030
|
+
headerActions: string;
|
|
8903
9031
|
sortable: string;
|
|
8904
9032
|
sortIcon: string;
|
|
8905
9033
|
row: string;
|
|
9034
|
+
rowSelected: string;
|
|
8906
9035
|
cell: string;
|
|
9036
|
+
selectionCell: string;
|
|
8907
9037
|
loadingCell: string;
|
|
8908
9038
|
loadingIndicator: string;
|
|
8909
9039
|
emptyCell: string;
|
|
8910
9040
|
toolbar: string;
|
|
9041
|
+
toolbarLeft: string;
|
|
9042
|
+
toolbarRight: string;
|
|
8911
9043
|
search: string;
|
|
8912
9044
|
searchInput: string;
|
|
9045
|
+
columnFilter: string;
|
|
8913
9046
|
pagination: string;
|
|
8914
9047
|
striped: string;
|
|
8915
9048
|
bordered: string;
|
|
8916
9049
|
dense: string;
|
|
8917
9050
|
loading: string;
|
|
9051
|
+
stickyHeader: string;
|
|
9052
|
+
dragging: string;
|
|
9053
|
+
dragOver: string;
|
|
9054
|
+
resizeHandle: string;
|
|
8918
9055
|
open: string;
|
|
8919
9056
|
};
|
|
8920
9057
|
/**
|
|
@@ -10101,6 +10238,7 @@ declare const __lib_constants_TAB: typeof TAB;
|
|
|
10101
10238
|
declare const __lib_constants_TESTIMONIAL: typeof TESTIMONIAL;
|
|
10102
10239
|
declare const __lib_constants_TEXTAREA: typeof TEXTAREA;
|
|
10103
10240
|
declare const __lib_constants_THEME_COLORS: typeof THEME_COLORS;
|
|
10241
|
+
declare const __lib_constants_THEME_NAMING: typeof THEME_NAMING;
|
|
10104
10242
|
declare const __lib_constants_TODO: typeof TODO;
|
|
10105
10243
|
declare const __lib_constants_TOGGLE: typeof TOGGLE;
|
|
10106
10244
|
declare const __lib_constants_TOOLTIP: typeof TOOLTIP;
|
|
@@ -10159,6 +10297,7 @@ declare namespace __lib_constants {
|
|
|
10159
10297
|
__lib_constants_TESTIMONIAL as TESTIMONIAL,
|
|
10160
10298
|
__lib_constants_TEXTAREA as TEXTAREA,
|
|
10161
10299
|
__lib_constants_THEME_COLORS as THEME_COLORS,
|
|
10300
|
+
__lib_constants_THEME_NAMING as THEME_NAMING,
|
|
10162
10301
|
__lib_constants_TODO as TODO,
|
|
10163
10302
|
__lib_constants_TOGGLE as TOGGLE,
|
|
10164
10303
|
__lib_constants_TOOLTIP as TOOLTIP,
|
|
@@ -11002,6 +11141,38 @@ interface UseDataTableProps {
|
|
|
11002
11141
|
* Initial sort configuration
|
|
11003
11142
|
*/
|
|
11004
11143
|
initialSortConfig?: SortConfig;
|
|
11144
|
+
/**
|
|
11145
|
+
* Row selection mode
|
|
11146
|
+
*/
|
|
11147
|
+
selectionMode?: SelectionMode;
|
|
11148
|
+
/**
|
|
11149
|
+
* Selected row IDs (controlled)
|
|
11150
|
+
*/
|
|
11151
|
+
selectedRowIds?: (string | number)[];
|
|
11152
|
+
/**
|
|
11153
|
+
* Callback when selection changes
|
|
11154
|
+
*/
|
|
11155
|
+
onSelectionChange?: (selectedRows: any[], selectedIds: (string | number)[]) => void;
|
|
11156
|
+
/**
|
|
11157
|
+
* Key to use as unique identifier for rows
|
|
11158
|
+
*/
|
|
11159
|
+
rowKey?: string | ((row: any) => string | number);
|
|
11160
|
+
/**
|
|
11161
|
+
* Column-specific filters
|
|
11162
|
+
*/
|
|
11163
|
+
columnFilters?: boolean;
|
|
11164
|
+
/**
|
|
11165
|
+
* Whether columns can be reordered
|
|
11166
|
+
*/
|
|
11167
|
+
reorderable?: boolean;
|
|
11168
|
+
/**
|
|
11169
|
+
* Callback when column order changes
|
|
11170
|
+
*/
|
|
11171
|
+
onColumnReorder?: (columnKeys: string[]) => void;
|
|
11172
|
+
/**
|
|
11173
|
+
* Callback when column visibility changes
|
|
11174
|
+
*/
|
|
11175
|
+
onColumnVisibilityChange?: (visibleColumns: string[]) => void;
|
|
11005
11176
|
}
|
|
11006
11177
|
interface UseDataTableReturn {
|
|
11007
11178
|
/**
|
|
@@ -11032,11 +11203,63 @@ interface UseDataTableReturn {
|
|
|
11032
11203
|
* Handle search input
|
|
11033
11204
|
*/
|
|
11034
11205
|
handleSearch: (query: string) => void;
|
|
11206
|
+
/**
|
|
11207
|
+
* Selected row IDs
|
|
11208
|
+
*/
|
|
11209
|
+
selectedRowIds: (string | number)[];
|
|
11210
|
+
/**
|
|
11211
|
+
* Selected rows data
|
|
11212
|
+
*/
|
|
11213
|
+
selectedRows: any[];
|
|
11214
|
+
/**
|
|
11215
|
+
* Handle row selection
|
|
11216
|
+
*/
|
|
11217
|
+
handleRowSelect: (rowId: string | number, selected: boolean) => void;
|
|
11218
|
+
/**
|
|
11219
|
+
* Handle select all
|
|
11220
|
+
*/
|
|
11221
|
+
handleSelectAll: (selected: boolean) => void;
|
|
11222
|
+
/**
|
|
11223
|
+
* Whether all rows are selected
|
|
11224
|
+
*/
|
|
11225
|
+
isAllSelected: boolean;
|
|
11226
|
+
/**
|
|
11227
|
+
* Whether some rows are selected
|
|
11228
|
+
*/
|
|
11229
|
+
isIndeterminate: boolean;
|
|
11230
|
+
/**
|
|
11231
|
+
* Column order
|
|
11232
|
+
*/
|
|
11233
|
+
columnOrder: string[];
|
|
11234
|
+
/**
|
|
11235
|
+
* Visible columns
|
|
11236
|
+
*/
|
|
11237
|
+
visibleColumns: DataTableColumn[];
|
|
11238
|
+
/**
|
|
11239
|
+
* Column visibility map
|
|
11240
|
+
*/
|
|
11241
|
+
columnVisibility: Record<string, boolean>;
|
|
11242
|
+
/**
|
|
11243
|
+
* Handle column visibility toggle
|
|
11244
|
+
*/
|
|
11245
|
+
handleColumnVisibilityToggle: (columnKey: string) => void;
|
|
11246
|
+
/**
|
|
11247
|
+
* Column-specific filter values
|
|
11248
|
+
*/
|
|
11249
|
+
columnFilterValues: Record<string, string>;
|
|
11250
|
+
/**
|
|
11251
|
+
* Handle column filter change
|
|
11252
|
+
*/
|
|
11253
|
+
handleColumnFilterChange: (columnKey: string, value: string) => void;
|
|
11254
|
+
/**
|
|
11255
|
+
* Clear all column filters
|
|
11256
|
+
*/
|
|
11257
|
+
clearColumnFilters: () => void;
|
|
11035
11258
|
}
|
|
11036
11259
|
/**
|
|
11037
11260
|
* Hook for managing DataTable state and behavior
|
|
11038
11261
|
*/
|
|
11039
|
-
declare function useDataTable({ data, columns, sortable, paginated, pageSize, onSort, initialSortConfig, }: UseDataTableProps): UseDataTableReturn;
|
|
11262
|
+
declare function useDataTable({ data, columns, sortable, paginated, pageSize, onSort, initialSortConfig, selectionMode, selectedRowIds: controlledSelectedRowIds, onSelectionChange, rowKey, columnFilters, reorderable, onColumnReorder, onColumnVisibilityChange, }: UseDataTableProps): UseDataTableReturn;
|
|
11040
11263
|
|
|
11041
11264
|
interface UseModalProps {
|
|
11042
11265
|
/**
|
|
@@ -11510,7 +11733,7 @@ interface CountdownProps {
|
|
|
11510
11733
|
declare const Countdown: React__default.FC<CountdownProps>;
|
|
11511
11734
|
|
|
11512
11735
|
/**
|
|
11513
|
-
* DataTable - A flexible and accessible data table component
|
|
11736
|
+
* DataTable - A flexible and accessible data table component with advanced features
|
|
11514
11737
|
*
|
|
11515
11738
|
* @example
|
|
11516
11739
|
* ```tsx
|
|
@@ -11518,6 +11741,7 @@ declare const Countdown: React__default.FC<CountdownProps>;
|
|
|
11518
11741
|
* data={users}
|
|
11519
11742
|
* columns={columns}
|
|
11520
11743
|
* sortable={true}
|
|
11744
|
+
* selectionMode="multiple"
|
|
11521
11745
|
* onRowClick={handleRowClick}
|
|
11522
11746
|
* />
|
|
11523
11747
|
* ```
|
|
@@ -12269,6 +12493,38 @@ interface UploadProps {
|
|
|
12269
12493
|
* Icon component or class name
|
|
12270
12494
|
*/
|
|
12271
12495
|
icon?: React__default.ReactNode;
|
|
12496
|
+
/**
|
|
12497
|
+
* Upload endpoint URL. If not provided, upload will be simulated.
|
|
12498
|
+
*/
|
|
12499
|
+
uploadEndpoint?: string;
|
|
12500
|
+
/**
|
|
12501
|
+
* HTTP method for upload request
|
|
12502
|
+
*/
|
|
12503
|
+
uploadMethod?: 'POST' | 'PUT' | 'PATCH';
|
|
12504
|
+
/**
|
|
12505
|
+
* Additional headers to include in upload request
|
|
12506
|
+
*/
|
|
12507
|
+
uploadHeaders?: Record<string, string>;
|
|
12508
|
+
/**
|
|
12509
|
+
* Additional form data fields to include in upload
|
|
12510
|
+
*/
|
|
12511
|
+
uploadData?: Record<string, string>;
|
|
12512
|
+
/**
|
|
12513
|
+
* Chunk size in MB for chunked uploads (0 = no chunking)
|
|
12514
|
+
*/
|
|
12515
|
+
chunkSizeInMB?: number;
|
|
12516
|
+
/**
|
|
12517
|
+
* Maximum number of retry attempts for failed uploads
|
|
12518
|
+
*/
|
|
12519
|
+
maxRetries?: number;
|
|
12520
|
+
/**
|
|
12521
|
+
* Delay in milliseconds between retry attempts
|
|
12522
|
+
*/
|
|
12523
|
+
retryDelay?: number;
|
|
12524
|
+
/**
|
|
12525
|
+
* Whether to automatically upload files after selection
|
|
12526
|
+
*/
|
|
12527
|
+
autoUpload?: boolean;
|
|
12272
12528
|
/**
|
|
12273
12529
|
* Called when files are selected
|
|
12274
12530
|
*/
|
|
@@ -12280,11 +12536,15 @@ interface UploadProps {
|
|
|
12280
12536
|
/**
|
|
12281
12537
|
* Called when file upload is complete
|
|
12282
12538
|
*/
|
|
12283
|
-
onFileUploadComplete?: (file: File) => void;
|
|
12539
|
+
onFileUploadComplete?: (file: File, response?: any) => void;
|
|
12284
12540
|
/**
|
|
12285
12541
|
* Called on file upload errors
|
|
12286
12542
|
*/
|
|
12287
12543
|
onFileUploadError?: (file: File, error: string) => void;
|
|
12544
|
+
/**
|
|
12545
|
+
* Called when upload is cancelled
|
|
12546
|
+
*/
|
|
12547
|
+
onUploadCancel?: (file: File) => void;
|
|
12288
12548
|
/**
|
|
12289
12549
|
* Additional CSS class
|
|
12290
12550
|
*/
|
|
@@ -12598,106 +12858,303 @@ declare const defaultTokens: DesignTokens;
|
|
|
12598
12858
|
declare function createTokens(overrides?: Partial<DesignTokens>): DesignTokens;
|
|
12599
12859
|
|
|
12600
12860
|
/**
|
|
12601
|
-
*
|
|
12861
|
+
* CSS Variable Generator
|
|
12602
12862
|
*
|
|
12603
|
-
*
|
|
12604
|
-
*/
|
|
12605
|
-
/**
|
|
12606
|
-
* Theme metadata interface matching themes.config.js structure
|
|
12863
|
+
* Generates CSS custom properties from design tokens.
|
|
12607
12864
|
*/
|
|
12608
|
-
|
|
12609
|
-
/** Display name of the theme */
|
|
12610
|
-
name: string;
|
|
12611
|
-
/** Unique identifier/class name for the theme */
|
|
12612
|
-
class?: string;
|
|
12613
|
-
/** Theme description */
|
|
12614
|
-
description?: string;
|
|
12615
|
-
/** Theme author */
|
|
12616
|
-
author?: string;
|
|
12617
|
-
/** Theme version (semver) */
|
|
12618
|
-
version?: string;
|
|
12619
|
-
/** Theme tags for categorization */
|
|
12620
|
-
tags?: string[];
|
|
12621
|
-
/** Whether the theme supports dark mode */
|
|
12622
|
-
supportsDarkMode?: boolean;
|
|
12623
|
-
/** Theme status: stable, beta, experimental, deprecated */
|
|
12624
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
12625
|
-
/** Accessibility information */
|
|
12626
|
-
a11y?: {
|
|
12627
|
-
/** Target contrast ratio */
|
|
12628
|
-
contrastTarget?: number;
|
|
12629
|
-
/** Supported color modes */
|
|
12630
|
-
modes?: string[];
|
|
12631
|
-
};
|
|
12632
|
-
/** Primary theme color (for UI display) */
|
|
12633
|
-
color?: string;
|
|
12634
|
-
/** Theme features list */
|
|
12635
|
-
features?: string[];
|
|
12636
|
-
/** Theme dependencies (other themes required) */
|
|
12637
|
-
dependencies?: string[];
|
|
12638
|
-
}
|
|
12865
|
+
|
|
12639
12866
|
/**
|
|
12640
|
-
*
|
|
12867
|
+
* Options for CSS variable generation
|
|
12641
12868
|
*/
|
|
12642
|
-
interface
|
|
12643
|
-
/**
|
|
12644
|
-
|
|
12645
|
-
/**
|
|
12646
|
-
|
|
12647
|
-
/** Theme object (for JS themes) */
|
|
12648
|
-
themeObject?: Theme | null;
|
|
12649
|
-
/** Timestamp of the change */
|
|
12650
|
-
timestamp: number;
|
|
12651
|
-
/** Whether the change was from user action or system */
|
|
12652
|
-
source: 'user' | 'system' | 'storage';
|
|
12869
|
+
interface GenerateCSSVariablesOptions {
|
|
12870
|
+
/** CSS selector for the variables (default: ':root') */
|
|
12871
|
+
selector?: string;
|
|
12872
|
+
/** Prefix for CSS variables (default: 'atomix') */
|
|
12873
|
+
prefix?: string;
|
|
12653
12874
|
}
|
|
12654
12875
|
/**
|
|
12655
|
-
*
|
|
12876
|
+
* Generate CSS variables from tokens
|
|
12877
|
+
*
|
|
12878
|
+
* Converts flat token object to CSS custom properties.
|
|
12879
|
+
*
|
|
12880
|
+
* @param tokens - Design tokens object
|
|
12881
|
+
* @param options - Generation options
|
|
12882
|
+
* @returns CSS string with custom properties
|
|
12883
|
+
*
|
|
12884
|
+
* @example
|
|
12885
|
+
* ```typescript
|
|
12886
|
+
* const tokens = {
|
|
12887
|
+
* 'primary': '#7c3aed',
|
|
12888
|
+
* 'spacing-4': '1rem',
|
|
12889
|
+
* };
|
|
12890
|
+
*
|
|
12891
|
+
* const css = generateCSSVariables(tokens);
|
|
12892
|
+
* // Returns: ":root {\n --atomix-primary: #7c3aed;\n --atomix-spacing-4: 1rem;\n}"
|
|
12893
|
+
* ```
|
|
12656
12894
|
*/
|
|
12657
|
-
|
|
12658
|
-
/** Force reload even if already loaded */
|
|
12659
|
-
force?: boolean;
|
|
12660
|
-
/** Preload without applying */
|
|
12661
|
-
preload?: boolean;
|
|
12662
|
-
/** Remove previous theme CSS */
|
|
12663
|
-
removePrevious?: boolean;
|
|
12664
|
-
/** Custom CSS path override */
|
|
12665
|
-
customPath?: string;
|
|
12666
|
-
/** Fallback to default theme on error */
|
|
12667
|
-
fallbackOnError?: boolean;
|
|
12668
|
-
}
|
|
12895
|
+
declare function generateCSSVariables(tokens: DesignTokens, options?: GenerateCSSVariablesOptions): string;
|
|
12669
12896
|
/**
|
|
12670
|
-
*
|
|
12897
|
+
* Generate CSS variables with custom selector
|
|
12898
|
+
*
|
|
12899
|
+
* Useful for theme-specific selectors like `[data-theme="dark"]`
|
|
12900
|
+
*
|
|
12901
|
+
* @param tokens - Design tokens object
|
|
12902
|
+
* @param selector - CSS selector (e.g., '[data-theme="dark"]')
|
|
12903
|
+
* @param prefix - CSS variable prefix
|
|
12904
|
+
* @returns CSS string
|
|
12905
|
+
*
|
|
12906
|
+
* @example
|
|
12907
|
+
* ```typescript
|
|
12908
|
+
* const css = generateCSSVariablesForSelector(
|
|
12909
|
+
* tokens,
|
|
12910
|
+
* '[data-theme="dark"]',
|
|
12911
|
+
* 'atomix'
|
|
12912
|
+
* );
|
|
12913
|
+
* ```
|
|
12671
12914
|
*/
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
valid: boolean;
|
|
12675
|
-
/** Validation errors */
|
|
12676
|
-
errors: string[];
|
|
12677
|
-
/** Validation warnings */
|
|
12678
|
-
warnings: string[];
|
|
12679
|
-
}
|
|
12915
|
+
declare function generateCSSVariablesForSelector(tokens: DesignTokens, selector: string, prefix?: string): string;
|
|
12916
|
+
|
|
12680
12917
|
/**
|
|
12681
|
-
*
|
|
12918
|
+
* Core Theme Functions
|
|
12919
|
+
*
|
|
12920
|
+
* Simplified theme system using DesignTokens only.
|
|
12921
|
+
* Config-first approach: loads from atomix.config.ts when no input is provided.
|
|
12682
12922
|
*/
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12923
|
+
|
|
12924
|
+
/**
|
|
12925
|
+
* Create theme CSS from DesignTokens
|
|
12926
|
+
*
|
|
12927
|
+
* **Config-First Approach**: If no input is provided, loads from `atomix.config.ts`.
|
|
12928
|
+
*
|
|
12929
|
+
* @param input - DesignTokens (partial) or undefined (loads from config)
|
|
12930
|
+
* @param options - CSS generation options (prefix is automatically read from config if not provided)
|
|
12931
|
+
* @returns CSS string with custom properties
|
|
12932
|
+
* @throws Error if config loading fails when no input is provided
|
|
12933
|
+
*
|
|
12934
|
+
* @example
|
|
12935
|
+
* ```typescript
|
|
12936
|
+
* // Loads from atomix.config.ts
|
|
12937
|
+
* const css = createTheme();
|
|
12938
|
+
*
|
|
12939
|
+
* // Using DesignTokens
|
|
12940
|
+
* const css = createTheme({
|
|
12941
|
+
* 'primary': '#7c3aed',
|
|
12942
|
+
* 'spacing-4': '1rem',
|
|
12943
|
+
* });
|
|
12944
|
+
*
|
|
12945
|
+
* // With custom options
|
|
12946
|
+
* const css = createTheme(undefined, { prefix: 'myapp', selector: ':root' });
|
|
12947
|
+
* ```
|
|
12948
|
+
*/
|
|
12949
|
+
declare function createTheme(input?: Partial<DesignTokens>, options?: GenerateCSSVariablesOptions): string;
|
|
12950
|
+
|
|
12951
|
+
/**
|
|
12952
|
+
* Theme Composition Utilities
|
|
12953
|
+
*
|
|
12954
|
+
* Simplified utilities for composing and merging DesignTokens.
|
|
12955
|
+
*/
|
|
12956
|
+
/**
|
|
12957
|
+
* Deep merge multiple objects
|
|
12958
|
+
* Later objects override earlier ones
|
|
12959
|
+
*/
|
|
12960
|
+
declare function deepMerge<T extends Record<string, unknown>>(...objects: Partial<T>[]): T;
|
|
12961
|
+
|
|
12962
|
+
/**
|
|
12963
|
+
* Merge multiple DesignTokens objects into a single DesignTokens object
|
|
12964
|
+
*
|
|
12965
|
+
* @param tokens - DesignTokens objects to merge
|
|
12966
|
+
* @returns Merged DesignTokens object
|
|
12967
|
+
*
|
|
12968
|
+
* @example
|
|
12969
|
+
* ```typescript
|
|
12970
|
+
* const baseTokens = { 'primary': '#000', 'spacing-4': '1rem' };
|
|
12971
|
+
* const customTokens = { 'secondary': '#fff', 'spacing-4': '1.5rem' };
|
|
12972
|
+
* const merged = mergeTheme(baseTokens, customTokens);
|
|
12973
|
+
* // Returns: { 'primary': '#000', 'secondary': '#fff', 'spacing-4': '1.5rem' }
|
|
12974
|
+
* ```
|
|
12975
|
+
*/
|
|
12976
|
+
declare function mergeTheme(...tokens: Partial<DesignTokens>[]): Partial<DesignTokens>;
|
|
12977
|
+
/**
|
|
12978
|
+
* Extend DesignTokens with additional tokens
|
|
12979
|
+
*
|
|
12980
|
+
* @param baseTokens - Base DesignTokens to extend
|
|
12981
|
+
* @param extension - Additional DesignTokens to merge
|
|
12982
|
+
* @returns Extended DesignTokens object
|
|
12983
|
+
*
|
|
12984
|
+
* @example
|
|
12985
|
+
* ```typescript
|
|
12986
|
+
* const base = { 'primary': '#000' };
|
|
12987
|
+
* const extended = extendTheme(base, { 'secondary': '#fff' });
|
|
12988
|
+
* // Returns: { 'primary': '#000', 'secondary': '#fff' }
|
|
12989
|
+
* ```
|
|
12990
|
+
*/
|
|
12991
|
+
declare function extendTheme(baseTokens: Partial<DesignTokens>, extension: Partial<DesignTokens>): Partial<DesignTokens>;
|
|
12992
|
+
|
|
12993
|
+
/**
|
|
12994
|
+
* Theme Metadata interface
|
|
12995
|
+
*/
|
|
12996
|
+
interface ThemeMetadata$1 {
|
|
12997
|
+
name: string;
|
|
12998
|
+
class: string;
|
|
12999
|
+
description?: string;
|
|
13000
|
+
version?: string;
|
|
13001
|
+
[key: string]: any;
|
|
13002
|
+
}
|
|
13003
|
+
/**
|
|
13004
|
+
* Theme Registry type - a record of theme IDs to metadata
|
|
13005
|
+
*/
|
|
13006
|
+
type ThemeRegistry = Record<string, ThemeMetadata$1>;
|
|
13007
|
+
/**
|
|
13008
|
+
* Create a new theme registry
|
|
13009
|
+
*/
|
|
13010
|
+
declare function createThemeRegistry(): ThemeRegistry;
|
|
13011
|
+
/**
|
|
13012
|
+
* Register a theme
|
|
13013
|
+
* @param registry - Theme registry object
|
|
13014
|
+
* @param id - Theme identifier
|
|
13015
|
+
* @param metadata - Theme metadata
|
|
13016
|
+
*/
|
|
13017
|
+
declare function registerTheme(registry: ThemeRegistry, id: string, metadata: ThemeMetadata$1): void;
|
|
13018
|
+
/**
|
|
13019
|
+
* Unregister a theme
|
|
13020
|
+
* @param registry - Theme registry object
|
|
13021
|
+
* @param id - Theme identifier
|
|
13022
|
+
*/
|
|
13023
|
+
declare function unregisterTheme(registry: ThemeRegistry, id: string): boolean;
|
|
13024
|
+
/**
|
|
13025
|
+
* Check if a theme is registered
|
|
13026
|
+
* @param registry - Theme registry object
|
|
13027
|
+
* @param id - Theme identifier
|
|
13028
|
+
*/
|
|
13029
|
+
declare function hasTheme(registry: ThemeRegistry, id: string): boolean;
|
|
13030
|
+
/**
|
|
13031
|
+
* Get theme metadata
|
|
13032
|
+
* @param registry - Theme registry object
|
|
13033
|
+
* @param id - Theme identifier
|
|
13034
|
+
*/
|
|
13035
|
+
declare function getTheme(registry: ThemeRegistry, id: string): ThemeMetadata$1 | undefined;
|
|
13036
|
+
/**
|
|
13037
|
+
* Get all registered theme metadata
|
|
13038
|
+
* @param registry - Theme registry object
|
|
13039
|
+
*/
|
|
13040
|
+
declare function getAllThemes(registry: ThemeRegistry): ThemeMetadata$1[];
|
|
13041
|
+
/**
|
|
13042
|
+
* Get all registered theme IDs
|
|
13043
|
+
* @param registry - Theme registry object
|
|
13044
|
+
*/
|
|
13045
|
+
declare function getThemeIds(registry: ThemeRegistry): string[];
|
|
13046
|
+
/**
|
|
13047
|
+
* Clear all registered themes
|
|
13048
|
+
* @param registry - Theme registry object
|
|
13049
|
+
*/
|
|
13050
|
+
declare function clearThemes(registry: ThemeRegistry): void;
|
|
13051
|
+
/**
|
|
13052
|
+
* Get the number of registered themes
|
|
13053
|
+
* @param registry - Theme registry object
|
|
13054
|
+
*/
|
|
13055
|
+
declare function getThemeCount(registry: ThemeRegistry): number;
|
|
13056
|
+
|
|
13057
|
+
/**
|
|
13058
|
+
* Theme Manager Type Definitions
|
|
13059
|
+
*
|
|
13060
|
+
* TypeScript types and interfaces for the Atomix Design System theme management system.
|
|
13061
|
+
*/
|
|
13062
|
+
/**
|
|
13063
|
+
* Theme metadata interface matching themes.config.js structure
|
|
13064
|
+
*/
|
|
13065
|
+
interface ThemeMetadata {
|
|
13066
|
+
/** Display name of the theme */
|
|
13067
|
+
name: string;
|
|
13068
|
+
/** Unique identifier/class name for the theme */
|
|
13069
|
+
class?: string;
|
|
13070
|
+
/** Theme description */
|
|
13071
|
+
description?: string;
|
|
13072
|
+
/** Theme author */
|
|
13073
|
+
author?: string;
|
|
13074
|
+
/** Theme version (semver) */
|
|
13075
|
+
version?: string;
|
|
13076
|
+
/** Theme tags for categorization */
|
|
13077
|
+
tags?: string[];
|
|
13078
|
+
/** Whether the theme supports dark mode */
|
|
13079
|
+
supportsDarkMode?: boolean;
|
|
13080
|
+
/** Theme status: stable, beta, experimental, deprecated */
|
|
13081
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
13082
|
+
/** Accessibility information */
|
|
13083
|
+
a11y?: {
|
|
13084
|
+
/** Target contrast ratio */
|
|
13085
|
+
contrastTarget?: number;
|
|
13086
|
+
/** Supported color modes */
|
|
13087
|
+
modes?: string[];
|
|
13088
|
+
};
|
|
13089
|
+
/** Primary theme color (for UI display) */
|
|
13090
|
+
color?: string;
|
|
13091
|
+
/** Theme features list */
|
|
13092
|
+
features?: string[];
|
|
13093
|
+
/** Theme dependencies (other themes required) */
|
|
13094
|
+
dependencies?: string[];
|
|
13095
|
+
}
|
|
13096
|
+
/**
|
|
13097
|
+
* Theme change event payload
|
|
13098
|
+
*/
|
|
13099
|
+
interface ThemeChangeEvent {
|
|
13100
|
+
/** Previous theme name */
|
|
13101
|
+
previousTheme: string | null;
|
|
13102
|
+
/** New theme name */
|
|
13103
|
+
currentTheme: string;
|
|
13104
|
+
/** DesignTokens if using tokens-based theme */
|
|
13105
|
+
tokens?: DesignTokens | null;
|
|
13106
|
+
/** Timestamp of the change */
|
|
13107
|
+
timestamp: number;
|
|
13108
|
+
/** Whether the change was from user action or system */
|
|
13109
|
+
source: 'user' | 'system' | 'storage';
|
|
13110
|
+
}
|
|
13111
|
+
/**
|
|
13112
|
+
* Theme load options
|
|
13113
|
+
*/
|
|
13114
|
+
interface ThemeLoadOptions {
|
|
13115
|
+
/** Force reload even if already loaded */
|
|
13116
|
+
force?: boolean;
|
|
13117
|
+
/** Preload without applying */
|
|
13118
|
+
preload?: boolean;
|
|
13119
|
+
/** Remove previous theme CSS */
|
|
13120
|
+
removePrevious?: boolean;
|
|
13121
|
+
/** Custom CSS path override */
|
|
13122
|
+
customPath?: string;
|
|
13123
|
+
/** Fallback to default theme on error */
|
|
13124
|
+
fallbackOnError?: boolean;
|
|
13125
|
+
}
|
|
13126
|
+
/**
|
|
13127
|
+
* Theme validation result
|
|
13128
|
+
*/
|
|
13129
|
+
interface ThemeValidationResult {
|
|
13130
|
+
/** Whether the theme is valid */
|
|
13131
|
+
valid: boolean;
|
|
13132
|
+
/** Validation errors */
|
|
13133
|
+
errors: string[];
|
|
13134
|
+
/** Validation warnings */
|
|
13135
|
+
warnings: string[];
|
|
13136
|
+
}
|
|
13137
|
+
/**
|
|
13138
|
+
* React hook return type for useTheme
|
|
13139
|
+
*/
|
|
13140
|
+
interface UseThemeReturn {
|
|
13141
|
+
/** Current theme name */
|
|
13142
|
+
theme: string;
|
|
13143
|
+
/** Current active DesignTokens (if using tokens-based theme) */
|
|
13144
|
+
activeTokens: DesignTokens | null;
|
|
13145
|
+
/** Function to change theme (supports string or DesignTokens) */
|
|
13146
|
+
setTheme: (theme: string | DesignTokens | Partial<DesignTokens>, options?: ThemeLoadOptions) => Promise<void>;
|
|
13147
|
+
/** Available themes */
|
|
13148
|
+
availableThemes: ThemeMetadata[];
|
|
13149
|
+
/** Whether a theme is currently loading */
|
|
13150
|
+
isLoading: boolean;
|
|
13151
|
+
/** Current error, if any */
|
|
13152
|
+
error: Error | null;
|
|
13153
|
+
/** Whether a specific theme is loaded */
|
|
13154
|
+
isThemeLoaded: (themeName: string) => boolean;
|
|
13155
|
+
/** Preload a theme */
|
|
13156
|
+
preloadTheme: (themeName: string) => Promise<void>;
|
|
13157
|
+
}
|
|
12701
13158
|
/**
|
|
12702
13159
|
* Component-level theme override configuration
|
|
12703
13160
|
*/
|
|
@@ -12754,8 +13211,8 @@ interface ThemeComponentOverrides {
|
|
|
12754
13211
|
interface ThemeProviderProps {
|
|
12755
13212
|
/** Child components */
|
|
12756
13213
|
children: React.ReactNode;
|
|
12757
|
-
/** Default theme */
|
|
12758
|
-
defaultTheme?: string |
|
|
13214
|
+
/** Default theme (string name or DesignTokens) */
|
|
13215
|
+
defaultTheme?: string | DesignTokens | Partial<DesignTokens>;
|
|
12759
13216
|
/** Available themes */
|
|
12760
13217
|
themes?: Record<string, ThemeMetadata>;
|
|
12761
13218
|
/** Base path for theme CSS */
|
|
@@ -12775,7 +13232,7 @@ interface ThemeProviderProps {
|
|
|
12775
13232
|
/** Use minified CSS */
|
|
12776
13233
|
useMinified?: boolean;
|
|
12777
13234
|
/** Callback when theme changes */
|
|
12778
|
-
onThemeChange?: (theme: string |
|
|
13235
|
+
onThemeChange?: (theme: string | DesignTokens) => void;
|
|
12779
13236
|
/** Callback on error */
|
|
12780
13237
|
onError?: (error: Error, themeName: string) => void;
|
|
12781
13238
|
}
|
|
@@ -12785,10 +13242,10 @@ interface ThemeProviderProps {
|
|
|
12785
13242
|
interface ThemeContextValue {
|
|
12786
13243
|
/** Current theme name */
|
|
12787
13244
|
theme: string;
|
|
12788
|
-
/** Current active
|
|
12789
|
-
|
|
12790
|
-
/** Set theme function (supports string
|
|
12791
|
-
setTheme: (theme: string |
|
|
13245
|
+
/** Current active DesignTokens (if using tokens-based theme) */
|
|
13246
|
+
activeTokens: DesignTokens | null;
|
|
13247
|
+
/** Set theme function (supports string or DesignTokens) */
|
|
13248
|
+
setTheme: (theme: string | DesignTokens | Partial<DesignTokens>, options?: ThemeLoadOptions) => Promise<void>;
|
|
12792
13249
|
/** Available themes */
|
|
12793
13250
|
availableThemes: ThemeMetadata[];
|
|
12794
13251
|
/** Loading state */
|
|
@@ -12813,36 +13270,6 @@ interface PaletteColor {
|
|
|
12813
13270
|
/** Contrast text color (auto-generated if not provided) */
|
|
12814
13271
|
contrastText?: string;
|
|
12815
13272
|
}
|
|
12816
|
-
/**
|
|
12817
|
-
* Palette configuration options for createTheme
|
|
12818
|
-
*/
|
|
12819
|
-
interface PaletteOptions {
|
|
12820
|
-
/** Primary color configuration */
|
|
12821
|
-
primary?: Partial<PaletteColor> | string;
|
|
12822
|
-
/** Secondary color configuration */
|
|
12823
|
-
secondary?: Partial<PaletteColor> | string;
|
|
12824
|
-
/** Error color configuration */
|
|
12825
|
-
error?: Partial<PaletteColor> | string;
|
|
12826
|
-
/** Warning color configuration */
|
|
12827
|
-
warning?: Partial<PaletteColor> | string;
|
|
12828
|
-
/** Info color configuration */
|
|
12829
|
-
info?: Partial<PaletteColor> | string;
|
|
12830
|
-
/** Success color configuration */
|
|
12831
|
-
success?: Partial<PaletteColor> | string;
|
|
12832
|
-
/** Background colors */
|
|
12833
|
-
background?: {
|
|
12834
|
-
default?: string;
|
|
12835
|
-
subtle?: string;
|
|
12836
|
-
};
|
|
12837
|
-
/** Text colors */
|
|
12838
|
-
text?: {
|
|
12839
|
-
primary?: string;
|
|
12840
|
-
secondary?: string;
|
|
12841
|
-
disabled?: string;
|
|
12842
|
-
};
|
|
12843
|
-
/** Additional custom colors */
|
|
12844
|
-
[key: string]: any;
|
|
12845
|
-
}
|
|
12846
13273
|
/**
|
|
12847
13274
|
* Typography configuration options for createTheme
|
|
12848
13275
|
*/
|
|
@@ -12912,10 +13339,6 @@ interface TypographyOptions {
|
|
|
12912
13339
|
* Spacing function type
|
|
12913
13340
|
*/
|
|
12914
13341
|
type SpacingFunction = (...values: number[]) => string;
|
|
12915
|
-
/**
|
|
12916
|
-
* Spacing configuration options for createTheme
|
|
12917
|
-
*/
|
|
12918
|
-
type SpacingOptions = number | number[] | SpacingFunction;
|
|
12919
13342
|
/**
|
|
12920
13343
|
* Breakpoint values configuration
|
|
12921
13344
|
*/
|
|
@@ -12927,15 +13350,6 @@ interface BreakpointValues {
|
|
|
12927
13350
|
xl?: number;
|
|
12928
13351
|
[key: string]: number | undefined;
|
|
12929
13352
|
}
|
|
12930
|
-
/**
|
|
12931
|
-
* Breakpoints configuration options for createTheme
|
|
12932
|
-
*/
|
|
12933
|
-
interface BreakpointsOptions {
|
|
12934
|
-
/** Breakpoint values in pixels */
|
|
12935
|
-
values?: BreakpointValues;
|
|
12936
|
-
/** Unit for breakpoints (default: 'px') */
|
|
12937
|
-
unit?: string;
|
|
12938
|
-
}
|
|
12939
13353
|
/**
|
|
12940
13354
|
* Shadow configuration
|
|
12941
13355
|
*/
|
|
@@ -13013,30 +13427,6 @@ interface BorderRadiusOptions {
|
|
|
13013
13427
|
interface ThemeCustomProperties {
|
|
13014
13428
|
[key: string]: any;
|
|
13015
13429
|
}
|
|
13016
|
-
/**
|
|
13017
|
-
* Theme configuration options for createTheme
|
|
13018
|
-
* Extends ThemeMetadata to support both CSS and JS theme properties
|
|
13019
|
-
*/
|
|
13020
|
-
interface ThemeOptions extends Partial<ThemeMetadata> {
|
|
13021
|
-
/** Color palette configuration */
|
|
13022
|
-
palette?: PaletteOptions;
|
|
13023
|
-
/** Typography configuration */
|
|
13024
|
-
typography?: TypographyOptions;
|
|
13025
|
-
/** Spacing configuration */
|
|
13026
|
-
spacing?: SpacingOptions;
|
|
13027
|
-
/** Breakpoints configuration */
|
|
13028
|
-
breakpoints?: BreakpointsOptions;
|
|
13029
|
-
/** Shadow configuration */
|
|
13030
|
-
shadows?: ShadowOptions;
|
|
13031
|
-
/** Transition configuration */
|
|
13032
|
-
transitions?: TransitionOptions;
|
|
13033
|
-
/** Z-index configuration */
|
|
13034
|
-
zIndex?: ZIndexOptions;
|
|
13035
|
-
/** Border radius configuration */
|
|
13036
|
-
borderRadius?: BorderRadiusOptions;
|
|
13037
|
-
/** Custom properties */
|
|
13038
|
-
custom?: ThemeCustomProperties;
|
|
13039
|
-
}
|
|
13040
13430
|
/**
|
|
13041
13431
|
* Complete theme object with computed values
|
|
13042
13432
|
* Generated by createTheme function
|
|
@@ -13108,1126 +13498,540 @@ interface Theme extends ThemeMetadata {
|
|
|
13108
13498
|
}
|
|
13109
13499
|
|
|
13110
13500
|
/**
|
|
13111
|
-
*
|
|
13501
|
+
* Naming Utilities
|
|
13112
13502
|
*
|
|
13113
|
-
*
|
|
13503
|
+
* Provides consistent naming conventions across the theme system
|
|
13504
|
+
*/
|
|
13505
|
+
interface NamingOptions {
|
|
13506
|
+
prefix?: string;
|
|
13507
|
+
component?: string;
|
|
13508
|
+
variant?: string;
|
|
13509
|
+
state?: string;
|
|
13510
|
+
}
|
|
13511
|
+
/**
|
|
13512
|
+
* Generate consistent CSS class names following BEM methodology
|
|
13513
|
+
*/
|
|
13514
|
+
declare function generateClassName(block: string, element?: string, modifiers?: Record<string, boolean | string>): string;
|
|
13515
|
+
/**
|
|
13516
|
+
* Generate consistent CSS variable names
|
|
13517
|
+
*/
|
|
13518
|
+
declare function generateCSSVariableName(property: string, options?: NamingOptions): string;
|
|
13519
|
+
/**
|
|
13520
|
+
* Normalize theme tokens to consistent naming convention
|
|
13114
13521
|
*/
|
|
13522
|
+
declare function normalizeThemeTokens(tokens: Record<string, any>): Record<string, any>;
|
|
13523
|
+
/**
|
|
13524
|
+
* Convert camelCase to kebab-case for CSS custom properties
|
|
13525
|
+
*/
|
|
13526
|
+
declare function camelToKebab(str: string): string;
|
|
13527
|
+
/**
|
|
13528
|
+
* Convert theme property to CSS variable name
|
|
13529
|
+
*/
|
|
13530
|
+
declare function themePropertyToCSSVar(propertyPath: string, prefix?: string): string;
|
|
13115
13531
|
|
|
13116
13532
|
/**
|
|
13117
|
-
*
|
|
13533
|
+
* Component Theming Utilities
|
|
13534
|
+
*
|
|
13535
|
+
* Provides consistent patterns for applying theme values to components
|
|
13536
|
+
* using DesignTokens and CSS variables
|
|
13118
13537
|
*/
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13538
|
+
|
|
13539
|
+
interface ComponentThemeOptions {
|
|
13540
|
+
component: string;
|
|
13541
|
+
variant?: string;
|
|
13542
|
+
size?: string;
|
|
13543
|
+
tokens?: Partial<DesignTokens>;
|
|
13124
13544
|
}
|
|
13125
13545
|
/**
|
|
13126
|
-
*
|
|
13546
|
+
* Get a theme value for a specific component using CSS variables
|
|
13547
|
+
* This ensures all components access theme values consistently
|
|
13548
|
+
*/
|
|
13549
|
+
declare function getComponentThemeValue(component: string, property: string, variant?: string, size?: string): string;
|
|
13550
|
+
/**
|
|
13551
|
+
* Generate component-specific CSS variables from DesignTokens
|
|
13552
|
+
*/
|
|
13553
|
+
declare function generateComponentCSSVars(component: string, tokens?: Partial<DesignTokens>, variant?: string, size?: string): Record<string, string>;
|
|
13554
|
+
/**
|
|
13555
|
+
* Apply consistent theme to component style object using DesignTokens
|
|
13556
|
+
*/
|
|
13557
|
+
declare function applyComponentTheme(component: string, style?: React.CSSProperties, variant?: string, size?: string, tokens?: Partial<DesignTokens>): React.CSSProperties;
|
|
13558
|
+
/**
|
|
13559
|
+
* Create a hook for consistent component theming
|
|
13560
|
+
*/
|
|
13561
|
+
declare function useComponentTheme(component: string, variant?: string, size?: string, tokens?: Partial<DesignTokens>): (property: string) => string;
|
|
13562
|
+
|
|
13563
|
+
/**
|
|
13564
|
+
* CSS Injection Utilities
|
|
13127
13565
|
*
|
|
13128
|
-
*
|
|
13566
|
+
* Inject CSS into HTML head via <style> element.
|
|
13567
|
+
*/
|
|
13568
|
+
/**
|
|
13569
|
+
* Inject CSS into HTML head via <style> element
|
|
13129
13570
|
*
|
|
13130
|
-
*
|
|
13131
|
-
*
|
|
13132
|
-
*
|
|
13571
|
+
* Creates or updates a style element in the document head.
|
|
13572
|
+
* If an element with the same ID exists, it will be updated.
|
|
13573
|
+
*
|
|
13574
|
+
* @param css - CSS string to inject
|
|
13575
|
+
* @param id - Style element ID (default: 'atomix-theme')
|
|
13133
13576
|
*
|
|
13134
13577
|
* @example
|
|
13135
13578
|
* ```typescript
|
|
13136
|
-
* const
|
|
13137
|
-
*
|
|
13138
|
-
* 'spacing-4': '1rem',
|
|
13139
|
-
* };
|
|
13579
|
+
* const css = ':root { --atomix-color-primary: #7AFFD7; }';
|
|
13580
|
+
* injectCSS(css);
|
|
13140
13581
|
*
|
|
13141
|
-
*
|
|
13142
|
-
*
|
|
13582
|
+
* // With custom ID
|
|
13583
|
+
* injectCSS(css, 'my-custom-theme');
|
|
13143
13584
|
* ```
|
|
13144
13585
|
*/
|
|
13145
|
-
declare function
|
|
13586
|
+
declare function injectCSS(css: string, id?: string): void;
|
|
13146
13587
|
/**
|
|
13147
|
-
*
|
|
13588
|
+
* Remove injected CSS from DOM
|
|
13148
13589
|
*
|
|
13149
|
-
*
|
|
13590
|
+
* Removes the style element with the given ID from the document head.
|
|
13150
13591
|
*
|
|
13151
|
-
* @param
|
|
13152
|
-
* @param selector - CSS selector (e.g., '[data-theme="dark"]')
|
|
13153
|
-
* @param prefix - CSS variable prefix
|
|
13154
|
-
* @returns CSS string
|
|
13592
|
+
* @param id - Style element ID to remove (default: 'atomix-theme')
|
|
13155
13593
|
*
|
|
13156
13594
|
* @example
|
|
13157
13595
|
* ```typescript
|
|
13158
|
-
*
|
|
13159
|
-
*
|
|
13160
|
-
* '[data-theme="dark"]',
|
|
13161
|
-
* 'atomix'
|
|
13162
|
-
* );
|
|
13596
|
+
* removeCSS(); // Removes default 'atomix-theme'
|
|
13597
|
+
* removeCSS('my-custom-theme'); // Removes custom ID
|
|
13163
13598
|
* ```
|
|
13164
13599
|
*/
|
|
13165
|
-
declare function
|
|
13166
|
-
|
|
13600
|
+
declare function removeCSS(id?: string): void;
|
|
13167
13601
|
/**
|
|
13168
|
-
*
|
|
13602
|
+
* Check if CSS is already injected
|
|
13169
13603
|
*
|
|
13170
|
-
*
|
|
13171
|
-
*
|
|
13172
|
-
* Config file is required for automatic loading.
|
|
13604
|
+
* @param id - Style element ID to check (default: 'atomix-theme')
|
|
13605
|
+
* @returns True if style element exists
|
|
13173
13606
|
*/
|
|
13607
|
+
declare function isCSSInjected(id?: string): boolean;
|
|
13174
13608
|
|
|
13175
13609
|
/**
|
|
13176
|
-
*
|
|
13177
|
-
*
|
|
13178
|
-
* **Config-First Approach**: If no input is provided, loads from `atomix.config.ts`.
|
|
13179
|
-
* Config file is required for automatic loading.
|
|
13180
|
-
*
|
|
13181
|
-
* @param input - DesignTokens (partial), Theme object, or undefined (loads from config)
|
|
13182
|
-
* @param options - CSS generation options (prefix is automatically read from config if not provided)
|
|
13183
|
-
* @returns CSS string with custom properties
|
|
13184
|
-
* @throws Error if config loading fails when no input is provided
|
|
13185
|
-
*
|
|
13186
|
-
* @example
|
|
13187
|
-
* ```typescript
|
|
13188
|
-
* // Loads from atomix.config.ts (config file required)
|
|
13189
|
-
* const css = createTheme();
|
|
13190
|
-
*
|
|
13191
|
-
* // Using DesignTokens
|
|
13192
|
-
* const css = createTheme({
|
|
13193
|
-
* 'primary': '#7c3aed',
|
|
13194
|
-
* 'spacing-4': '1rem',
|
|
13195
|
-
* });
|
|
13196
|
-
*
|
|
13197
|
-
* // Using Theme object
|
|
13198
|
-
* const theme = createThemeObject({ palette: { primary: { main: '#7c3aed' } } });
|
|
13199
|
-
* const css = createTheme(theme);
|
|
13610
|
+
* Theme Configuration Loader
|
|
13200
13611
|
*
|
|
13201
|
-
*
|
|
13202
|
-
*
|
|
13203
|
-
* ```
|
|
13612
|
+
* Provides functions to load theme configurations from atomix.config.ts
|
|
13613
|
+
* Includes both sync and async versions, with automatic fallbacks
|
|
13204
13614
|
*/
|
|
13205
|
-
declare function createTheme(input?: Partial<DesignTokens> | Theme, options?: GenerateCSSVariablesOptions): string;
|
|
13206
13615
|
|
|
13207
13616
|
/**
|
|
13208
|
-
*
|
|
13209
|
-
*
|
|
13210
|
-
*
|
|
13211
|
-
*
|
|
13212
|
-
*
|
|
13213
|
-
* NOTE: For most use cases, use the simple theme system's `createTheme` instead,
|
|
13214
|
-
* which generates CSS from DesignTokens. This function is for advanced use cases
|
|
13215
|
-
* that need the full Theme object structure.
|
|
13216
|
-
*
|
|
13217
|
-
* @example
|
|
13218
|
-
* ```typescript
|
|
13219
|
-
* const theme = createThemeObject({
|
|
13220
|
-
* palette: {
|
|
13221
|
-
* primary: { main: '#7AFFD7' },
|
|
13222
|
-
* secondary: { main: '#FF5733' },
|
|
13223
|
-
* },
|
|
13224
|
-
* typography: {
|
|
13225
|
-
* fontFamily: 'Inter, sans-serif',
|
|
13226
|
-
* },
|
|
13227
|
-
* });
|
|
13228
|
-
* ```
|
|
13617
|
+
* Load theme from config file (synchronous, Node.js only)
|
|
13618
|
+
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
13619
|
+
* @returns DesignTokens from theme configuration
|
|
13620
|
+
* @throws Error if config loading is not available in browser environment
|
|
13229
13621
|
*/
|
|
13230
|
-
|
|
13622
|
+
declare function loadThemeFromConfigSync(options?: {
|
|
13623
|
+
configPath?: string;
|
|
13624
|
+
required?: boolean;
|
|
13625
|
+
}): DesignTokens;
|
|
13231
13626
|
/**
|
|
13232
|
-
*
|
|
13233
|
-
*
|
|
13234
|
-
* @
|
|
13235
|
-
* @returns Complete theme object
|
|
13627
|
+
* Load theme from config file (asynchronous)
|
|
13628
|
+
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
13629
|
+
* @returns Promise resolving to DesignTokens from theme configuration
|
|
13236
13630
|
*/
|
|
13237
|
-
declare function
|
|
13631
|
+
declare function loadThemeFromConfig(options?: {
|
|
13632
|
+
configPath?: string;
|
|
13633
|
+
required?: boolean;
|
|
13634
|
+
}): Promise<DesignTokens>;
|
|
13238
13635
|
|
|
13239
13636
|
/**
|
|
13240
|
-
* Theme
|
|
13637
|
+
* Theme Provider
|
|
13241
13638
|
*
|
|
13242
|
-
*
|
|
13639
|
+
* React context provider for theme management with separated concerns
|
|
13640
|
+
* Updated to use the new simplified theme system
|
|
13243
13641
|
*/
|
|
13244
13642
|
|
|
13245
13643
|
/**
|
|
13246
|
-
*
|
|
13247
|
-
* Later objects override earlier ones
|
|
13248
|
-
*/
|
|
13249
|
-
declare function deepMerge<T extends Record<string, any>>(...objects: Partial<T>[]): T;
|
|
13250
|
-
/**
|
|
13251
|
-
* Merge multiple theme options into a single theme options object
|
|
13252
|
-
*
|
|
13253
|
-
* @param themes - Theme options to merge
|
|
13254
|
-
* @returns Merged theme options
|
|
13255
|
-
*
|
|
13256
|
-
* @example
|
|
13257
|
-
* ```typescript
|
|
13258
|
-
* const baseTheme = { palette: { primary: { main: '#000' } } };
|
|
13259
|
-
* const customTheme = { palette: { secondary: { main: '#fff' } } };
|
|
13260
|
-
* const merged = mergeTheme(baseTheme, customTheme);
|
|
13261
|
-
* ```
|
|
13262
|
-
*/
|
|
13263
|
-
declare function mergeTheme(...themes: ThemeOptions[]): ThemeOptions;
|
|
13264
|
-
/**
|
|
13265
|
-
* Extend an existing theme with new options
|
|
13644
|
+
* Theme Provider
|
|
13266
13645
|
*
|
|
13267
|
-
*
|
|
13268
|
-
*
|
|
13269
|
-
*
|
|
13646
|
+
* React context provider for theme management with separated concerns.
|
|
13647
|
+
* Simplified version focusing on core functionality:
|
|
13648
|
+
* - String-based themes (CSS files)
|
|
13649
|
+
* - DesignTokens (dynamic themes)
|
|
13650
|
+
* - Persistence via localStorage
|
|
13270
13651
|
*
|
|
13271
|
-
*
|
|
13272
|
-
* ```typescript
|
|
13273
|
-
* const base = createTheme({ palette: { primary: { main: '#000' } } });
|
|
13274
|
-
* const extended = extendTheme(base, {
|
|
13275
|
-
* palette: { secondary: { main: '#fff' } }
|
|
13276
|
-
* });
|
|
13277
|
-
* ```
|
|
13652
|
+
* Falls back to 'default' theme if no configuration is found.
|
|
13278
13653
|
*/
|
|
13279
|
-
declare
|
|
13654
|
+
declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
13280
13655
|
|
|
13281
13656
|
/**
|
|
13282
|
-
*
|
|
13657
|
+
* useTheme Hook
|
|
13283
13658
|
*
|
|
13284
|
-
*
|
|
13285
|
-
* Similar to how Tailwind loads tailwind.config.js
|
|
13659
|
+
* React hook for accessing theme context
|
|
13286
13660
|
*/
|
|
13287
13661
|
|
|
13288
13662
|
/**
|
|
13289
|
-
*
|
|
13290
|
-
*
|
|
13291
|
-
* Attempts to load atomix.config.ts from the current working directory.
|
|
13292
|
-
* Falls back to default config if file doesn't exist.
|
|
13663
|
+
* useTheme hook
|
|
13293
13664
|
*
|
|
13294
|
-
*
|
|
13295
|
-
* @returns Loaded configuration or default
|
|
13665
|
+
* Access theme context and theme management functions
|
|
13296
13666
|
*
|
|
13297
13667
|
* @example
|
|
13298
|
-
* ```
|
|
13299
|
-
*
|
|
13300
|
-
*
|
|
13668
|
+
* ```tsx
|
|
13669
|
+
* function MyComponent() {
|
|
13670
|
+
* const { theme, setTheme, availableThemes } = useTheme();
|
|
13301
13671
|
*
|
|
13302
|
-
*
|
|
13303
|
-
*
|
|
13672
|
+
* return (
|
|
13673
|
+
* <div>
|
|
13674
|
+
* <p>Current theme: {theme}</p>
|
|
13675
|
+
* <button onClick={() => setTheme('dark-theme')}>
|
|
13676
|
+
* Switch to Dark
|
|
13677
|
+
* </button>
|
|
13678
|
+
* </div>
|
|
13679
|
+
* );
|
|
13680
|
+
* }
|
|
13304
13681
|
* ```
|
|
13305
13682
|
*/
|
|
13306
|
-
declare function
|
|
13307
|
-
|
|
13308
|
-
configPath?: string;
|
|
13309
|
-
/** Whether to throw error if config not found (default: false) */
|
|
13310
|
-
required?: boolean;
|
|
13311
|
-
}): AtomixConfig;
|
|
13683
|
+
declare function useTheme(): UseThemeReturn;
|
|
13684
|
+
|
|
13312
13685
|
/**
|
|
13313
|
-
*
|
|
13686
|
+
* Standardized hook for accessing theme tokens in components
|
|
13314
13687
|
*
|
|
13315
|
-
*
|
|
13316
|
-
*
|
|
13317
|
-
*
|
|
13318
|
-
* This function is designed to work in Node.js environments only.
|
|
13319
|
-
* In browser builds, it will always return null without attempting to access Node.js modules.
|
|
13320
|
-
*
|
|
13321
|
-
* @internal This function uses Node.js modules and should not be called in browser environments.
|
|
13688
|
+
* Provides consistent access to theme values using CSS custom properties
|
|
13689
|
+
* and DesignTokens.
|
|
13322
13690
|
*/
|
|
13323
|
-
|
|
13691
|
+
type ThemeTokens$1 = {
|
|
13692
|
+
theme: string;
|
|
13693
|
+
activeTokens: DesignTokens | null;
|
|
13694
|
+
getToken: (tokenName: string, fallback?: string) => string;
|
|
13695
|
+
colors: {
|
|
13696
|
+
primary: string;
|
|
13697
|
+
secondary: string;
|
|
13698
|
+
error: string;
|
|
13699
|
+
success: string;
|
|
13700
|
+
warning: string;
|
|
13701
|
+
info: string;
|
|
13702
|
+
light: string;
|
|
13703
|
+
dark: string;
|
|
13704
|
+
};
|
|
13705
|
+
spacing: Record<string, string>;
|
|
13706
|
+
borderRadius: Record<string, string>;
|
|
13707
|
+
typography: {
|
|
13708
|
+
fontFamily: Record<string, string>;
|
|
13709
|
+
fontSize: Record<string, string>;
|
|
13710
|
+
fontWeight: Record<string, string>;
|
|
13711
|
+
};
|
|
13712
|
+
shadows: Record<string, string>;
|
|
13713
|
+
transitions: Record<string, string>;
|
|
13714
|
+
};
|
|
13715
|
+
declare function useThemeTokens(): ThemeTokens$1;
|
|
13324
13716
|
|
|
13325
13717
|
/**
|
|
13326
|
-
*
|
|
13327
|
-
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
*
|
|
13332
|
-
*
|
|
13333
|
-
* @example
|
|
13334
|
-
* ```typescript
|
|
13335
|
-
* // atomix.config.ts (in your project)
|
|
13336
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
13718
|
+
* Theme context with default values
|
|
13719
|
+
*/
|
|
13720
|
+
declare const ThemeContext: React$1.Context<ThemeContextValue | null>;
|
|
13721
|
+
|
|
13722
|
+
/**
|
|
13723
|
+
* Theme Error Boundary
|
|
13337
13724
|
*
|
|
13338
|
-
*
|
|
13339
|
-
*
|
|
13340
|
-
* extend: {
|
|
13341
|
-
* colors: {
|
|
13342
|
-
* primary: { main: '#7AFFD7' },
|
|
13343
|
-
* },
|
|
13344
|
-
* },
|
|
13345
|
-
* },
|
|
13346
|
-
* });
|
|
13347
|
-
* ```
|
|
13725
|
+
* React error boundary for catching and handling theme-related errors.
|
|
13726
|
+
* Prevents the entire app from crashing when theme errors occur.
|
|
13348
13727
|
*/
|
|
13349
13728
|
|
|
13350
13729
|
/**
|
|
13351
|
-
*
|
|
13730
|
+
* Error boundary state
|
|
13352
13731
|
*/
|
|
13353
|
-
interface
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
7?: string;
|
|
13361
|
-
8?: string;
|
|
13362
|
-
9?: string;
|
|
13363
|
-
10?: string;
|
|
13364
|
-
[key: string]: string | undefined;
|
|
13732
|
+
interface ThemeErrorBoundaryState {
|
|
13733
|
+
/** Whether an error has occurred */
|
|
13734
|
+
hasError: boolean;
|
|
13735
|
+
/** The error that occurred */
|
|
13736
|
+
error: Error | null;
|
|
13737
|
+
/** Error information */
|
|
13738
|
+
errorInfo: ErrorInfo | null;
|
|
13365
13739
|
}
|
|
13366
13740
|
/**
|
|
13367
|
-
*
|
|
13741
|
+
* Error boundary props
|
|
13368
13742
|
*/
|
|
13369
|
-
interface
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13743
|
+
interface ThemeErrorBoundaryProps {
|
|
13744
|
+
/** Child components */
|
|
13745
|
+
children: ReactNode;
|
|
13746
|
+
/** Fallback UI to render when error occurs */
|
|
13747
|
+
fallback?: (error: Error, errorInfo: ErrorInfo) => ReactNode;
|
|
13748
|
+
/** Callback when error occurs */
|
|
13749
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
13750
|
+
/** Whether to reset error on children change */
|
|
13751
|
+
resetOnPropsChange?: boolean;
|
|
13752
|
+
/** Custom error message */
|
|
13753
|
+
errorMessage?: string;
|
|
13374
13754
|
}
|
|
13375
13755
|
/**
|
|
13376
|
-
*
|
|
13756
|
+
* Theme Error Boundary Component
|
|
13757
|
+
*
|
|
13758
|
+
* Catches errors in the theme system and displays a fallback UI
|
|
13759
|
+
* instead of crashing the entire application.
|
|
13377
13760
|
*/
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
/** Typography scale and settings */
|
|
13386
|
-
typography?: {
|
|
13387
|
-
fontFamilies?: Record<string, string>;
|
|
13388
|
-
fontSizes?: Record<string, string>;
|
|
13389
|
-
fontWeights?: Record<string, string | number>;
|
|
13390
|
-
lineHeights?: Record<string, string | number>;
|
|
13391
|
-
letterSpacings?: Record<string, string>;
|
|
13392
|
-
};
|
|
13393
|
-
/** Shadow scale */
|
|
13394
|
-
shadows?: Record<string, string>;
|
|
13395
|
-
/** Z-index scale */
|
|
13396
|
-
zIndex?: Record<string, string | number>;
|
|
13397
|
-
/** Breakpoints scale */
|
|
13398
|
-
breakpoints?: Record<string, string | number>;
|
|
13399
|
-
/** Transitions settings */
|
|
13400
|
-
transitions?: {
|
|
13401
|
-
durations?: Record<string, string>;
|
|
13402
|
-
easings?: Record<string, string>;
|
|
13403
|
-
};
|
|
13761
|
+
declare class ThemeErrorBoundary extends Component<ThemeErrorBoundaryProps, ThemeErrorBoundaryState> {
|
|
13762
|
+
private logger;
|
|
13763
|
+
constructor(props: ThemeErrorBoundaryProps);
|
|
13764
|
+
static getDerivedStateFromError(error: Error): Partial<ThemeErrorBoundaryState>;
|
|
13765
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
13766
|
+
componentDidUpdate(prevProps: ThemeErrorBoundaryProps): void;
|
|
13767
|
+
render(): ReactNode;
|
|
13404
13768
|
}
|
|
13769
|
+
|
|
13405
13770
|
/**
|
|
13406
|
-
*
|
|
13771
|
+
* Theme Applicator
|
|
13772
|
+
*
|
|
13773
|
+
* Applies theme configurations to the DOM, including CSS variables,
|
|
13774
|
+
* component overrides, typography, spacing, and color palettes.
|
|
13775
|
+
*
|
|
13776
|
+
* Uses the unified theme system for CSS generation and injection.
|
|
13407
13777
|
*/
|
|
13408
|
-
|
|
13409
|
-
type: 'css';
|
|
13410
|
-
name: string;
|
|
13411
|
-
class?: string;
|
|
13412
|
-
description?: string;
|
|
13413
|
-
author?: string;
|
|
13414
|
-
version?: string;
|
|
13415
|
-
tags?: string[];
|
|
13416
|
-
supportsDarkMode?: boolean;
|
|
13417
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
13418
|
-
a11y?: {
|
|
13419
|
-
contrastTarget?: number;
|
|
13420
|
-
modes?: string[];
|
|
13421
|
-
};
|
|
13422
|
-
color?: string;
|
|
13423
|
-
features?: string[];
|
|
13424
|
-
dependencies?: string[];
|
|
13425
|
-
cssPath?: string;
|
|
13426
|
-
}
|
|
13778
|
+
|
|
13427
13779
|
/**
|
|
13428
|
-
*
|
|
13780
|
+
* Theme applicator class for runtime theme application
|
|
13781
|
+
*
|
|
13782
|
+
* Uses the unified theme system for efficient CSS variable generation and injection.
|
|
13429
13783
|
*/
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
description?: string;
|
|
13435
|
-
author?: string;
|
|
13436
|
-
version?: string;
|
|
13437
|
-
tags?: string[];
|
|
13438
|
-
supportsDarkMode?: boolean;
|
|
13439
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
13440
|
-
a11y?: {
|
|
13441
|
-
contrastTarget?: number;
|
|
13442
|
-
modes?: string[];
|
|
13443
|
-
};
|
|
13444
|
-
color?: string;
|
|
13445
|
-
features?: string[];
|
|
13446
|
-
dependencies?: string[];
|
|
13447
|
-
createTheme: () => Theme;
|
|
13448
|
-
}
|
|
13449
|
-
/**
|
|
13450
|
-
* Theme Definition (CSS or JS)
|
|
13451
|
-
*/
|
|
13452
|
-
type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
|
|
13453
|
-
/**
|
|
13454
|
-
* Build configuration (migrated from theme.config.ts)
|
|
13455
|
-
*/
|
|
13456
|
-
interface BuildConfig {
|
|
13457
|
-
output?: {
|
|
13458
|
-
directory?: string;
|
|
13459
|
-
formats?: {
|
|
13460
|
-
expanded?: string;
|
|
13461
|
-
compressed?: string;
|
|
13462
|
-
};
|
|
13463
|
-
};
|
|
13464
|
-
sass?: {
|
|
13465
|
-
style?: 'expanded' | 'compressed';
|
|
13466
|
-
sourceMap?: boolean;
|
|
13467
|
-
loadPaths?: string[];
|
|
13468
|
-
};
|
|
13469
|
-
}
|
|
13470
|
-
/**
|
|
13471
|
-
* Runtime configuration (migrated from theme.config.ts)
|
|
13472
|
-
*/
|
|
13473
|
-
interface RuntimeConfig {
|
|
13474
|
-
basePath?: string;
|
|
13475
|
-
cdnPath?: string | null;
|
|
13476
|
-
preload?: string[];
|
|
13477
|
-
lazy?: boolean;
|
|
13478
|
-
defaultTheme?: string;
|
|
13479
|
-
storageKey?: string;
|
|
13480
|
-
dataAttribute?: string;
|
|
13481
|
-
enablePersistence?: boolean;
|
|
13482
|
-
useMinified?: boolean;
|
|
13483
|
-
}
|
|
13484
|
-
/**
|
|
13485
|
-
* Integration settings (migrated from theme.config.ts)
|
|
13486
|
-
*/
|
|
13487
|
-
interface IntegrationConfig {
|
|
13488
|
-
cssVariables?: Record<string, string>;
|
|
13489
|
-
classNames?: {
|
|
13490
|
-
theme?: string;
|
|
13491
|
-
colorMode?: string;
|
|
13492
|
-
};
|
|
13493
|
-
}
|
|
13494
|
-
/**
|
|
13495
|
-
* Atomix Configuration Interface
|
|
13496
|
-
*
|
|
13497
|
-
* Tailwind-like configuration for external developers.
|
|
13498
|
-
* Focus on theme customization - build/runtime configs are internal only.
|
|
13499
|
-
*/
|
|
13500
|
-
interface AtomixConfig {
|
|
13784
|
+
declare class ThemeApplicator {
|
|
13785
|
+
private root;
|
|
13786
|
+
private styleId;
|
|
13787
|
+
constructor(root?: HTMLElement);
|
|
13501
13788
|
/**
|
|
13502
|
-
*
|
|
13789
|
+
* Apply a complete theme configuration using DesignTokens
|
|
13503
13790
|
*
|
|
13504
|
-
*
|
|
13505
|
-
*
|
|
13791
|
+
* Uses the unified theme system to generate and inject CSS.
|
|
13792
|
+
* Automatically respects atomix.config.ts when using DesignTokens.
|
|
13506
13793
|
*/
|
|
13507
|
-
|
|
13794
|
+
applyTheme(tokens: Partial<DesignTokens>): void;
|
|
13508
13795
|
/**
|
|
13509
|
-
*
|
|
13510
|
-
*
|
|
13511
|
-
* Use `extend` to add or override design tokens.
|
|
13512
|
-
* Use `tokens` to completely replace the default token system (advanced).
|
|
13796
|
+
* Apply global CSS variables
|
|
13513
13797
|
*/
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
*/
|
|
13528
|
-
tokens?: ThemeTokens;
|
|
13529
|
-
/**
|
|
13530
|
-
* Register custom themes (optional)
|
|
13531
|
-
*
|
|
13532
|
-
* Define CSS or JavaScript themes that can be loaded dynamically.
|
|
13533
|
-
*/
|
|
13534
|
-
themes?: Record<string, ThemeDefinition>;
|
|
13535
|
-
};
|
|
13536
|
-
/** @internal Build configuration (internal use only) */
|
|
13537
|
-
build?: BuildConfig;
|
|
13538
|
-
/** @internal Runtime configuration (internal use only) */
|
|
13539
|
-
runtime?: RuntimeConfig;
|
|
13540
|
-
/** @internal Integration settings (internal use only) */
|
|
13541
|
-
integration?: IntegrationConfig;
|
|
13542
|
-
/** @internal Theme dependencies mapping (internal use only) */
|
|
13543
|
-
dependencies?: Record<string, string[]>;
|
|
13798
|
+
private applyGlobalCSSVars;
|
|
13799
|
+
/**
|
|
13800
|
+
* Clear all applied CSS variables
|
|
13801
|
+
*/
|
|
13802
|
+
private clearAppliedVars;
|
|
13803
|
+
/**
|
|
13804
|
+
* Remove theme application
|
|
13805
|
+
*/
|
|
13806
|
+
removeTheme(): void;
|
|
13807
|
+
/**
|
|
13808
|
+
* Update specific CSS variables without clearing all
|
|
13809
|
+
*/
|
|
13810
|
+
updateCSSVars(vars: Record<string, string | number>): void;
|
|
13544
13811
|
}
|
|
13545
13812
|
/**
|
|
13546
|
-
*
|
|
13547
|
-
*
|
|
13548
|
-
* @param config - Atomix configuration object
|
|
13549
|
-
* @returns The configuration object
|
|
13813
|
+
* Get or create global theme applicator
|
|
13550
13814
|
*/
|
|
13815
|
+
declare function getThemeApplicator(): ThemeApplicator;
|
|
13551
13816
|
/**
|
|
13552
|
-
*
|
|
13553
|
-
*
|
|
13554
|
-
* Similar to Tailwind's defineConfig, provides autocomplete and type checking.
|
|
13555
|
-
*
|
|
13556
|
-
* @param config - Atomix configuration object
|
|
13557
|
-
* @returns The configuration object
|
|
13558
|
-
*
|
|
13559
|
-
* @example
|
|
13560
|
-
* ```typescript
|
|
13561
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
13562
|
-
*
|
|
13563
|
-
* export default defineConfig({
|
|
13564
|
-
* theme: {
|
|
13565
|
-
* extend: {
|
|
13566
|
-
* colors: {
|
|
13567
|
-
* primary: { main: '#7AFFD7' },
|
|
13568
|
-
* },
|
|
13569
|
-
* },
|
|
13570
|
-
* },
|
|
13571
|
-
* });
|
|
13572
|
-
* ```
|
|
13817
|
+
* Apply theme using global applicator
|
|
13573
13818
|
*/
|
|
13574
|
-
declare function
|
|
13819
|
+
declare function applyTheme(tokens: Partial<DesignTokens>): void;
|
|
13575
13820
|
|
|
13576
13821
|
/**
|
|
13577
|
-
* Theme
|
|
13822
|
+
* Theme Preview Component
|
|
13578
13823
|
*
|
|
13579
|
-
*
|
|
13824
|
+
* React component for previewing themes in development
|
|
13825
|
+
* Enhanced with interactive components, viewport controls, and dark mode toggle
|
|
13580
13826
|
*/
|
|
13581
13827
|
|
|
13582
13828
|
/**
|
|
13583
|
-
*
|
|
13829
|
+
* Theme preview props
|
|
13584
13830
|
*/
|
|
13585
|
-
interface
|
|
13586
|
-
/**
|
|
13587
|
-
|
|
13588
|
-
/**
|
|
13589
|
-
|
|
13590
|
-
/**
|
|
13591
|
-
|
|
13592
|
-
/**
|
|
13593
|
-
|
|
13594
|
-
/**
|
|
13595
|
-
|
|
13596
|
-
/**
|
|
13597
|
-
|
|
13598
|
-
/**
|
|
13599
|
-
|
|
13600
|
-
/**
|
|
13601
|
-
|
|
13602
|
-
/** Internal tokens (for generator) */
|
|
13603
|
-
__tokens?: any;
|
|
13604
|
-
/** Internal extensions (for generator) */
|
|
13605
|
-
__extend?: any;
|
|
13831
|
+
interface ThemePreviewProps {
|
|
13832
|
+
/** Theme to preview */
|
|
13833
|
+
theme: Theme;
|
|
13834
|
+
/** Show theme details */
|
|
13835
|
+
showDetails?: boolean;
|
|
13836
|
+
/** Show color palette */
|
|
13837
|
+
showPalette?: boolean;
|
|
13838
|
+
/** Show typography */
|
|
13839
|
+
showTypography?: boolean;
|
|
13840
|
+
/** Show spacing */
|
|
13841
|
+
showSpacing?: boolean;
|
|
13842
|
+
/** Custom components to render */
|
|
13843
|
+
children?: React__default.ReactNode;
|
|
13844
|
+
/** CSS class name */
|
|
13845
|
+
className?: string;
|
|
13846
|
+
/** Inline styles */
|
|
13847
|
+
style?: React__default.CSSProperties;
|
|
13606
13848
|
}
|
|
13607
|
-
|
|
13608
13849
|
/**
|
|
13609
|
-
* Theme
|
|
13850
|
+
* Theme Preview Component
|
|
13610
13851
|
*
|
|
13611
|
-
*
|
|
13852
|
+
* Renders a preview of a theme with sample components
|
|
13612
13853
|
*/
|
|
13854
|
+
declare const ThemePreview: React__default.FC<ThemePreviewProps>;
|
|
13613
13855
|
|
|
13614
13856
|
/**
|
|
13615
|
-
*
|
|
13857
|
+
* Theme Inspector Component
|
|
13858
|
+
*
|
|
13859
|
+
* React component for inspecting and debugging themes
|
|
13860
|
+
* Enhanced with search/filter and copy path functionality
|
|
13616
13861
|
*/
|
|
13617
|
-
interface RegistryEntry {
|
|
13618
|
-
/** Theme ID */
|
|
13619
|
-
id: string;
|
|
13620
|
-
/** Theme definition from config */
|
|
13621
|
-
definition: ThemeDefinition;
|
|
13622
|
-
/** Resolved theme object (for JS themes) */
|
|
13623
|
-
theme?: Theme;
|
|
13624
|
-
/** Whether theme is loaded */
|
|
13625
|
-
loaded: boolean;
|
|
13626
|
-
/** Loading promise (if currently loading) */
|
|
13627
|
-
loading?: Promise<Theme | void>;
|
|
13628
|
-
/** Dependencies */
|
|
13629
|
-
dependencies: string[];
|
|
13630
|
-
/** Dependent themes (themes that depend on this one) */
|
|
13631
|
-
dependents: string[];
|
|
13632
|
-
}
|
|
13633
|
-
/**
|
|
13634
|
-
* Theme Registry
|
|
13635
|
-
*
|
|
13636
|
-
* Manages theme registration, discovery, and dependency resolution
|
|
13637
|
-
*/
|
|
13638
|
-
declare class ThemeRegistry {
|
|
13639
|
-
private entries;
|
|
13640
|
-
private config;
|
|
13641
|
-
private initialized;
|
|
13642
|
-
/**
|
|
13643
|
-
* Initialize registry from config
|
|
13644
|
-
*/
|
|
13645
|
-
initialize(config?: LoadedThemeConfig): Promise<void>;
|
|
13646
|
-
/**
|
|
13647
|
-
* Register a theme
|
|
13648
|
-
*/
|
|
13649
|
-
register(themeId: string, definition: ThemeDefinition): void;
|
|
13650
|
-
/**
|
|
13651
|
-
* Get theme entry
|
|
13652
|
-
*/
|
|
13653
|
-
get(themeId: string): RegistryEntry | undefined;
|
|
13654
|
-
/**
|
|
13655
|
-
* Check if theme exists
|
|
13656
|
-
*/
|
|
13657
|
-
has(themeId: string): boolean;
|
|
13658
|
-
/**
|
|
13659
|
-
* Get all theme IDs
|
|
13660
|
-
*/
|
|
13661
|
-
getAllIds(): string[];
|
|
13662
|
-
/**
|
|
13663
|
-
* Get all theme metadata
|
|
13664
|
-
*/
|
|
13665
|
-
getAllMetadata(): ThemeMetadata[];
|
|
13666
|
-
/**
|
|
13667
|
-
* Get theme definition
|
|
13668
|
-
*/
|
|
13669
|
-
getDefinition(themeId: string): ThemeDefinition | undefined;
|
|
13670
|
-
/**
|
|
13671
|
-
* Check if a theme is loaded
|
|
13672
|
-
*/
|
|
13673
|
-
isThemeLoaded(themeId: string): boolean;
|
|
13674
|
-
/**
|
|
13675
|
-
* Mark a theme as loaded
|
|
13676
|
-
*/
|
|
13677
|
-
markLoaded(themeId: string, theme?: Theme): void;
|
|
13678
|
-
/**
|
|
13679
|
-
* Get theme object (for JS themes)
|
|
13680
|
-
*/
|
|
13681
|
-
getTheme(themeId: string): Theme | undefined;
|
|
13682
|
-
/**
|
|
13683
|
-
* Get dependencies for a theme
|
|
13684
|
-
*/
|
|
13685
|
-
getDependencies(themeId: string): string[];
|
|
13686
|
-
/**
|
|
13687
|
-
* Get dependents for a theme (themes that depend on this one)
|
|
13688
|
-
*/
|
|
13689
|
-
getDependents(themeId: string): string[];
|
|
13690
|
-
/**
|
|
13691
|
-
* Resolve all dependencies in correct order
|
|
13692
|
-
*/
|
|
13693
|
-
resolveDependencyOrder(themeId: string): string[];
|
|
13694
|
-
/**
|
|
13695
|
-
* Resolve dependencies and build dependency graph
|
|
13696
|
-
*/
|
|
13697
|
-
private resolveDependencies;
|
|
13698
|
-
/**
|
|
13699
|
-
* Validate all themes
|
|
13700
|
-
*/
|
|
13701
|
-
validate(): {
|
|
13702
|
-
valid: boolean;
|
|
13703
|
-
errors: string[];
|
|
13704
|
-
};
|
|
13705
|
-
/**
|
|
13706
|
-
* Clear registry
|
|
13707
|
-
*/
|
|
13708
|
-
clear(): void;
|
|
13709
|
-
}
|
|
13710
13862
|
|
|
13711
13863
|
/**
|
|
13712
|
-
*
|
|
13713
|
-
*
|
|
13714
|
-
* Save CSS to file system (Node.js only).
|
|
13864
|
+
* Theme inspector props
|
|
13715
13865
|
*/
|
|
13866
|
+
interface ThemeInspectorProps {
|
|
13867
|
+
/** Theme to inspect */
|
|
13868
|
+
theme: Theme;
|
|
13869
|
+
/** Show validation results */
|
|
13870
|
+
showValidation?: boolean;
|
|
13871
|
+
/** Show CSS variables */
|
|
13872
|
+
showCSSVariables?: boolean;
|
|
13873
|
+
/** Show theme structure */
|
|
13874
|
+
showStructure?: boolean;
|
|
13875
|
+
/** CSS class name */
|
|
13876
|
+
className?: string;
|
|
13877
|
+
/** Inline styles */
|
|
13878
|
+
style?: React__default.CSSProperties;
|
|
13879
|
+
}
|
|
13716
13880
|
/**
|
|
13717
|
-
*
|
|
13718
|
-
*
|
|
13719
|
-
* Writes CSS string to a file. Only works in Node.js environment.
|
|
13720
|
-
*
|
|
13721
|
-
* @param css - CSS string to save
|
|
13722
|
-
* @param filePath - Output file path
|
|
13723
|
-
* @throws Error if called in browser environment
|
|
13881
|
+
* Theme Inspector Component
|
|
13724
13882
|
*
|
|
13725
|
-
*
|
|
13726
|
-
* ```typescript
|
|
13727
|
-
* const css = ':root { --atomix-color-primary: #7AFFD7; }';
|
|
13728
|
-
* await saveCSSFile(css, './themes/custom.css');
|
|
13729
|
-
* ```
|
|
13883
|
+
* Provides detailed inspection and debugging information for themes
|
|
13730
13884
|
*/
|
|
13731
|
-
declare
|
|
13885
|
+
declare const ThemeInspector: React__default.FC<ThemeInspectorProps>;
|
|
13886
|
+
|
|
13732
13887
|
/**
|
|
13733
|
-
*
|
|
13734
|
-
*
|
|
13735
|
-
* Synchronous version of saveCSSFile. Only works in Node.js environment.
|
|
13888
|
+
* Theme Comparator Component
|
|
13736
13889
|
*
|
|
13737
|
-
*
|
|
13738
|
-
*
|
|
13739
|
-
* @throws Error if called in browser environment
|
|
13890
|
+
* React component for comparing two themes side-by-side
|
|
13891
|
+
* Enhanced with search/filter and improved visual diff styling
|
|
13740
13892
|
*/
|
|
13741
|
-
declare function saveCSSFileSync(css: string, filePath: string): void;
|
|
13742
13893
|
|
|
13743
13894
|
/**
|
|
13744
|
-
*
|
|
13745
|
-
*
|
|
13746
|
-
* Inject CSS into HTML head via <style> element.
|
|
13895
|
+
* Theme comparator props
|
|
13747
13896
|
*/
|
|
13897
|
+
interface ThemeComparatorProps {
|
|
13898
|
+
/** First theme to compare */
|
|
13899
|
+
themeA: Theme;
|
|
13900
|
+
/** Second theme to compare */
|
|
13901
|
+
themeB: Theme;
|
|
13902
|
+
/** Show only differences */
|
|
13903
|
+
showOnlyDifferences?: boolean;
|
|
13904
|
+
/** CSS class name */
|
|
13905
|
+
className?: string;
|
|
13906
|
+
/** Inline styles */
|
|
13907
|
+
style?: React__default.CSSProperties;
|
|
13908
|
+
}
|
|
13748
13909
|
/**
|
|
13749
|
-
*
|
|
13750
|
-
*
|
|
13751
|
-
* Creates or updates a style element in the document head.
|
|
13752
|
-
* If an element with the same ID exists, it will be updated.
|
|
13753
|
-
*
|
|
13754
|
-
* @param css - CSS string to inject
|
|
13755
|
-
* @param id - Style element ID (default: 'atomix-theme')
|
|
13756
|
-
*
|
|
13757
|
-
* @example
|
|
13758
|
-
* ```typescript
|
|
13759
|
-
* const css = ':root { --atomix-color-primary: #7AFFD7; }';
|
|
13760
|
-
* injectCSS(css);
|
|
13761
|
-
*
|
|
13762
|
-
* // With custom ID
|
|
13763
|
-
* injectCSS(css, 'my-custom-theme');
|
|
13764
|
-
* ```
|
|
13765
|
-
*/
|
|
13766
|
-
declare function injectCSS(css: string, id?: string): void;
|
|
13767
|
-
/**
|
|
13768
|
-
* Remove injected CSS from DOM
|
|
13769
|
-
*
|
|
13770
|
-
* Removes the style element with the given ID from the document head.
|
|
13771
|
-
*
|
|
13772
|
-
* @param id - Style element ID to remove (default: 'atomix-theme')
|
|
13773
|
-
*
|
|
13774
|
-
* @example
|
|
13775
|
-
* ```typescript
|
|
13776
|
-
* removeCSS(); // Removes default 'atomix-theme'
|
|
13777
|
-
* removeCSS('my-custom-theme'); // Removes custom ID
|
|
13778
|
-
* ```
|
|
13779
|
-
*/
|
|
13780
|
-
declare function removeCSS(id?: string): void;
|
|
13781
|
-
/**
|
|
13782
|
-
* Check if CSS is already injected
|
|
13783
|
-
*
|
|
13784
|
-
* @param id - Style element ID to check (default: 'atomix-theme')
|
|
13785
|
-
* @returns True if style element exists
|
|
13786
|
-
*/
|
|
13787
|
-
declare function isCSSInjected(id?: string): boolean;
|
|
13788
|
-
|
|
13789
|
-
/**
|
|
13790
|
-
* Config Loader
|
|
13791
|
-
*
|
|
13792
|
-
* Load design tokens from atomix.config.ts and convert to flat token format.
|
|
13793
|
-
*/
|
|
13794
|
-
|
|
13795
|
-
/**
|
|
13796
|
-
* Load theme tokens from atomix.config.ts
|
|
13797
|
-
*
|
|
13798
|
-
* Loads atomix.config.ts and extracts theme tokens.
|
|
13799
|
-
* Config file is required - throws error if not found.
|
|
13800
|
-
*
|
|
13801
|
-
* @param configPath - Optional custom config path (default: 'atomix.config.ts')
|
|
13802
|
-
* @returns Partial DesignTokens from config
|
|
13803
|
-
* @throws Error if config file is not found or cannot be loaded
|
|
13804
|
-
*
|
|
13805
|
-
* @example
|
|
13806
|
-
* ```typescript
|
|
13807
|
-
* const tokens = await loadThemeFromConfig();
|
|
13808
|
-
* const css = createTheme(tokens);
|
|
13809
|
-
* injectTheme(css);
|
|
13810
|
-
* ```
|
|
13811
|
-
*/
|
|
13812
|
-
declare function loadThemeFromConfig(configPath?: string): Promise<Partial<DesignTokens>>;
|
|
13813
|
-
/**
|
|
13814
|
-
* Load theme tokens from atomix.config.ts (synchronous version)
|
|
13815
|
-
*
|
|
13816
|
-
* Synchronous version that uses require() instead of dynamic import.
|
|
13817
|
-
* Only works in Node.js environment.
|
|
13818
|
-
* Config file is required - throws error if not found.
|
|
13819
|
-
*
|
|
13820
|
-
* @param configPath - Optional custom config path
|
|
13821
|
-
* @returns Partial DesignTokens from config
|
|
13822
|
-
* @throws Error if config file is not found or cannot be loaded
|
|
13823
|
-
*/
|
|
13824
|
-
declare function loadThemeFromConfigSync(configPath?: string): Partial<DesignTokens>;
|
|
13825
|
-
|
|
13826
|
-
/**
|
|
13827
|
-
* Theme Provider
|
|
13910
|
+
* Theme Comparator Component
|
|
13828
13911
|
*
|
|
13829
|
-
*
|
|
13912
|
+
* Compares two themes and highlights differences
|
|
13830
13913
|
*/
|
|
13914
|
+
declare const ThemeComparator: React__default.FC<ThemeComparatorProps>;
|
|
13831
13915
|
|
|
13832
13916
|
/**
|
|
13833
|
-
*
|
|
13834
|
-
*
|
|
13835
|
-
* Provides theme context to child components and manages theme state.
|
|
13836
|
-
*
|
|
13837
|
-
* **Config-First Approach**: If `defaultTheme` is not provided, loads from `atomix.config.ts`.
|
|
13838
|
-
* Config file is required when `defaultTheme` is not provided.
|
|
13839
|
-
*
|
|
13840
|
-
* @example
|
|
13841
|
-
* ```tsx
|
|
13842
|
-
* import { ThemeProvider } from '@shohojdhara/atomix/theme';
|
|
13843
|
-
*
|
|
13844
|
-
* // Loads from atomix.config.ts (config file required)
|
|
13845
|
-
* function App() {
|
|
13846
|
-
* return (
|
|
13847
|
-
* <ThemeProvider>
|
|
13848
|
-
* <YourApp />
|
|
13849
|
-
* </ThemeProvider>
|
|
13850
|
-
* );
|
|
13851
|
-
* }
|
|
13917
|
+
* Theme Live Editor Component
|
|
13852
13918
|
*
|
|
13853
|
-
*
|
|
13854
|
-
*
|
|
13855
|
-
* return (
|
|
13856
|
-
* <ThemeProvider defaultTheme="dark">
|
|
13857
|
-
* <YourApp />
|
|
13858
|
-
* </ThemeProvider>
|
|
13859
|
-
* );
|
|
13860
|
-
* }
|
|
13861
|
-
* ```
|
|
13919
|
+
* React component for live editing themes in development
|
|
13920
|
+
* Enhanced with undo/redo, keyboard shortcuts, resizable layout, and better color pickers
|
|
13862
13921
|
*/
|
|
13863
|
-
declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
13864
13922
|
|
|
13865
13923
|
/**
|
|
13866
|
-
*
|
|
13867
|
-
*
|
|
13868
|
-
* React hook for accessing theme context
|
|
13924
|
+
* Live editor props
|
|
13869
13925
|
*/
|
|
13870
|
-
|
|
13926
|
+
interface ThemeLiveEditorProps {
|
|
13927
|
+
/** Initial theme */
|
|
13928
|
+
initialTheme: Theme;
|
|
13929
|
+
/** Callback when theme changes */
|
|
13930
|
+
onChange?: (theme: Theme) => void;
|
|
13931
|
+
/** CSS class name */
|
|
13932
|
+
className?: string;
|
|
13933
|
+
/** Inline styles */
|
|
13934
|
+
style?: React__default.CSSProperties;
|
|
13935
|
+
}
|
|
13871
13936
|
/**
|
|
13872
|
-
*
|
|
13873
|
-
*
|
|
13874
|
-
* Access theme context and theme management functions
|
|
13875
|
-
*
|
|
13876
|
-
* @example
|
|
13877
|
-
* ```tsx
|
|
13878
|
-
* function MyComponent() {
|
|
13879
|
-
* const { theme, setTheme, availableThemes } = useTheme();
|
|
13937
|
+
* Theme Live Editor Component
|
|
13880
13938
|
*
|
|
13881
|
-
*
|
|
13882
|
-
* <div>
|
|
13883
|
-
* <p>Current theme: {theme}</p>
|
|
13884
|
-
* <button onClick={() => setTheme('dark-theme')}>
|
|
13885
|
-
* Switch to Dark
|
|
13886
|
-
* </button>
|
|
13887
|
-
* </div>
|
|
13888
|
-
* );
|
|
13889
|
-
* }
|
|
13890
|
-
* ```
|
|
13891
|
-
*/
|
|
13892
|
-
declare function useTheme(): UseThemeReturn;
|
|
13893
|
-
|
|
13894
|
-
/**
|
|
13895
|
-
* Theme context with default values
|
|
13939
|
+
* Allows live editing of theme properties with instant preview
|
|
13896
13940
|
*/
|
|
13897
|
-
declare const
|
|
13941
|
+
declare const ThemeLiveEditor: React__default.FC<ThemeLiveEditorProps>;
|
|
13898
13942
|
|
|
13899
13943
|
/**
|
|
13900
|
-
* Theme
|
|
13944
|
+
* Theme Validator
|
|
13901
13945
|
*
|
|
13902
|
-
*
|
|
13903
|
-
* Prevents the entire app from crashing when theme errors occur.
|
|
13946
|
+
* Runtime theme validation including color contrast and accessibility checks
|
|
13904
13947
|
*/
|
|
13905
13948
|
|
|
13906
13949
|
/**
|
|
13907
|
-
*
|
|
13908
|
-
*/
|
|
13909
|
-
interface ThemeErrorBoundaryState {
|
|
13910
|
-
/** Whether an error has occurred */
|
|
13911
|
-
hasError: boolean;
|
|
13912
|
-
/** The error that occurred */
|
|
13913
|
-
error: Error | null;
|
|
13914
|
-
/** Error information */
|
|
13915
|
-
errorInfo: ErrorInfo | null;
|
|
13916
|
-
}
|
|
13917
|
-
/**
|
|
13918
|
-
* Error boundary props
|
|
13950
|
+
* Validation result
|
|
13919
13951
|
*/
|
|
13920
|
-
interface
|
|
13921
|
-
/**
|
|
13922
|
-
|
|
13923
|
-
/**
|
|
13924
|
-
|
|
13925
|
-
/**
|
|
13926
|
-
|
|
13927
|
-
/**
|
|
13928
|
-
|
|
13929
|
-
/** Custom error message */
|
|
13930
|
-
errorMessage?: string;
|
|
13952
|
+
interface ValidationResult {
|
|
13953
|
+
/** Whether theme is valid */
|
|
13954
|
+
valid: boolean;
|
|
13955
|
+
/** Validation errors */
|
|
13956
|
+
errors: string[];
|
|
13957
|
+
/** Validation warnings */
|
|
13958
|
+
warnings: string[];
|
|
13959
|
+
/** Accessibility issues */
|
|
13960
|
+
a11yIssues: A11yIssue[];
|
|
13931
13961
|
}
|
|
13932
13962
|
/**
|
|
13933
|
-
*
|
|
13934
|
-
*
|
|
13935
|
-
* Catches errors in the theme system and displays a fallback UI
|
|
13936
|
-
* instead of crashing the entire application.
|
|
13963
|
+
* Accessibility issue
|
|
13937
13964
|
*/
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
|
|
13944
|
-
|
|
13965
|
+
interface A11yIssue {
|
|
13966
|
+
/** Issue type */
|
|
13967
|
+
type: 'contrast' | 'color' | 'missing';
|
|
13968
|
+
/** Severity */
|
|
13969
|
+
severity: 'error' | 'warning';
|
|
13970
|
+
/** Issue message */
|
|
13971
|
+
message: string;
|
|
13972
|
+
/** Affected property */
|
|
13973
|
+
property?: string;
|
|
13974
|
+
/** Current value */
|
|
13975
|
+
value?: string;
|
|
13976
|
+
/** Recommended value */
|
|
13977
|
+
recommended?: string;
|
|
13945
13978
|
}
|
|
13946
|
-
|
|
13947
|
-
/**
|
|
13948
|
-
* Theme Applicator
|
|
13949
|
-
*
|
|
13950
|
-
* Applies theme configurations to the DOM, including CSS variables,
|
|
13951
|
-
* component overrides, typography, spacing, and color palettes.
|
|
13952
|
-
*
|
|
13953
|
-
* Uses the unified theme system for CSS generation and injection.
|
|
13954
|
-
*/
|
|
13955
|
-
|
|
13956
13979
|
/**
|
|
13957
|
-
* Theme
|
|
13980
|
+
* Theme Validator
|
|
13958
13981
|
*
|
|
13959
|
-
*
|
|
13982
|
+
* Validates themes for correctness and accessibility
|
|
13960
13983
|
*/
|
|
13961
|
-
declare class
|
|
13962
|
-
private root;
|
|
13963
|
-
private styleId;
|
|
13964
|
-
constructor(root?: HTMLElement);
|
|
13984
|
+
declare class ThemeValidator {
|
|
13965
13985
|
/**
|
|
13966
|
-
*
|
|
13967
|
-
*
|
|
13968
|
-
* Uses the unified theme system to convert Theme to DesignTokens and inject CSS.
|
|
13969
|
-
* Automatically respects atomix.config.ts when using DesignTokens.
|
|
13986
|
+
* Validate theme
|
|
13970
13987
|
*/
|
|
13971
|
-
|
|
13988
|
+
validate(theme: Theme, metadata?: ThemeMetadata): ValidationResult;
|
|
13972
13989
|
/**
|
|
13973
|
-
*
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13990
|
+
* Validate palette
|
|
13991
|
+
*/
|
|
13992
|
+
private validatePalette;
|
|
13993
|
+
/**
|
|
13994
|
+
* Validate typography
|
|
13977
13995
|
*/
|
|
13978
|
-
private
|
|
13996
|
+
private validateTypography;
|
|
13979
13997
|
/**
|
|
13980
|
-
*
|
|
13998
|
+
* Validate spacing
|
|
13981
13999
|
*/
|
|
13982
|
-
private
|
|
14000
|
+
private validateSpacing;
|
|
13983
14001
|
/**
|
|
13984
|
-
*
|
|
14002
|
+
* Validate breakpoints
|
|
13985
14003
|
*/
|
|
13986
|
-
private
|
|
14004
|
+
private validateBreakpoints;
|
|
13987
14005
|
/**
|
|
13988
|
-
*
|
|
14006
|
+
* Check color contrast ratio
|
|
13989
14007
|
*/
|
|
13990
|
-
private
|
|
14008
|
+
private checkContrast;
|
|
13991
14009
|
/**
|
|
13992
|
-
*
|
|
14010
|
+
* Check if color is valid
|
|
13993
14011
|
*/
|
|
13994
|
-
private
|
|
14012
|
+
private isValidColor;
|
|
13995
14013
|
/**
|
|
13996
|
-
*
|
|
14014
|
+
* Validate transitions
|
|
13997
14015
|
*/
|
|
13998
|
-
private
|
|
14016
|
+
private validateTransitions;
|
|
13999
14017
|
/**
|
|
14000
|
-
*
|
|
14018
|
+
* Validate z-index
|
|
14001
14019
|
*/
|
|
14002
|
-
|
|
14020
|
+
private validateZIndex;
|
|
14003
14021
|
/**
|
|
14004
|
-
*
|
|
14022
|
+
* Validate border radius
|
|
14005
14023
|
*/
|
|
14006
|
-
|
|
14024
|
+
private validateBorderRadius;
|
|
14025
|
+
/**
|
|
14026
|
+
* Validate custom properties
|
|
14027
|
+
*/
|
|
14028
|
+
private validateCustom;
|
|
14007
14029
|
}
|
|
14030
|
+
|
|
14008
14031
|
/**
|
|
14009
|
-
*
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
/**
|
|
14013
|
-
* Apply theme using global applicator
|
|
14014
|
-
*/
|
|
14015
|
-
declare function applyTheme(theme: Theme): void;
|
|
14016
|
-
|
|
14017
|
-
/**
|
|
14018
|
-
* Theme Preview Component
|
|
14019
|
-
*
|
|
14020
|
-
* React component for previewing themes in development
|
|
14021
|
-
* Enhanced with interactive components, viewport controls, and dark mode toggle
|
|
14022
|
-
*/
|
|
14023
|
-
|
|
14024
|
-
/**
|
|
14025
|
-
* Theme preview props
|
|
14026
|
-
*/
|
|
14027
|
-
interface ThemePreviewProps {
|
|
14028
|
-
/** Theme to preview */
|
|
14029
|
-
theme: Theme;
|
|
14030
|
-
/** Show theme details */
|
|
14031
|
-
showDetails?: boolean;
|
|
14032
|
-
/** Show color palette */
|
|
14033
|
-
showPalette?: boolean;
|
|
14034
|
-
/** Show typography */
|
|
14035
|
-
showTypography?: boolean;
|
|
14036
|
-
/** Show spacing */
|
|
14037
|
-
showSpacing?: boolean;
|
|
14038
|
-
/** Custom components to render */
|
|
14039
|
-
children?: React__default.ReactNode;
|
|
14040
|
-
/** CSS class name */
|
|
14041
|
-
className?: string;
|
|
14042
|
-
/** Inline styles */
|
|
14043
|
-
style?: React__default.CSSProperties;
|
|
14044
|
-
}
|
|
14045
|
-
/**
|
|
14046
|
-
* Theme Preview Component
|
|
14047
|
-
*
|
|
14048
|
-
* Renders a preview of a theme with sample components
|
|
14049
|
-
*/
|
|
14050
|
-
declare const ThemePreview: React__default.FC<ThemePreviewProps>;
|
|
14051
|
-
|
|
14052
|
-
/**
|
|
14053
|
-
* Theme Inspector Component
|
|
14054
|
-
*
|
|
14055
|
-
* React component for inspecting and debugging themes
|
|
14056
|
-
* Enhanced with search/filter and copy path functionality
|
|
14057
|
-
*/
|
|
14058
|
-
|
|
14059
|
-
/**
|
|
14060
|
-
* Theme inspector props
|
|
14061
|
-
*/
|
|
14062
|
-
interface ThemeInspectorProps {
|
|
14063
|
-
/** Theme to inspect */
|
|
14064
|
-
theme: Theme;
|
|
14065
|
-
/** Show validation results */
|
|
14066
|
-
showValidation?: boolean;
|
|
14067
|
-
/** Show CSS variables */
|
|
14068
|
-
showCSSVariables?: boolean;
|
|
14069
|
-
/** Show theme structure */
|
|
14070
|
-
showStructure?: boolean;
|
|
14071
|
-
/** CSS class name */
|
|
14072
|
-
className?: string;
|
|
14073
|
-
/** Inline styles */
|
|
14074
|
-
style?: React__default.CSSProperties;
|
|
14075
|
-
}
|
|
14076
|
-
/**
|
|
14077
|
-
* Theme Inspector Component
|
|
14078
|
-
*
|
|
14079
|
-
* Provides detailed inspection and debugging information for themes
|
|
14080
|
-
*/
|
|
14081
|
-
declare const ThemeInspector: React__default.FC<ThemeInspectorProps>;
|
|
14082
|
-
|
|
14083
|
-
/**
|
|
14084
|
-
* Theme Comparator Component
|
|
14085
|
-
*
|
|
14086
|
-
* React component for comparing two themes side-by-side
|
|
14087
|
-
* Enhanced with search/filter and improved visual diff styling
|
|
14088
|
-
*/
|
|
14089
|
-
|
|
14090
|
-
/**
|
|
14091
|
-
* Theme comparator props
|
|
14092
|
-
*/
|
|
14093
|
-
interface ThemeComparatorProps {
|
|
14094
|
-
/** First theme to compare */
|
|
14095
|
-
themeA: Theme;
|
|
14096
|
-
/** Second theme to compare */
|
|
14097
|
-
themeB: Theme;
|
|
14098
|
-
/** Show only differences */
|
|
14099
|
-
showOnlyDifferences?: boolean;
|
|
14100
|
-
/** CSS class name */
|
|
14101
|
-
className?: string;
|
|
14102
|
-
/** Inline styles */
|
|
14103
|
-
style?: React__default.CSSProperties;
|
|
14104
|
-
}
|
|
14105
|
-
/**
|
|
14106
|
-
* Theme Comparator Component
|
|
14107
|
-
*
|
|
14108
|
-
* Compares two themes and highlights differences
|
|
14109
|
-
*/
|
|
14110
|
-
declare const ThemeComparator: React__default.FC<ThemeComparatorProps>;
|
|
14111
|
-
|
|
14112
|
-
/**
|
|
14113
|
-
* Theme Live Editor Component
|
|
14114
|
-
*
|
|
14115
|
-
* React component for live editing themes in development
|
|
14116
|
-
* Enhanced with undo/redo, keyboard shortcuts, resizable layout, and better color pickers
|
|
14117
|
-
*/
|
|
14118
|
-
|
|
14119
|
-
/**
|
|
14120
|
-
* Live editor props
|
|
14121
|
-
*/
|
|
14122
|
-
interface ThemeLiveEditorProps {
|
|
14123
|
-
/** Initial theme */
|
|
14124
|
-
initialTheme: Theme;
|
|
14125
|
-
/** Callback when theme changes */
|
|
14126
|
-
onChange?: (theme: Theme) => void;
|
|
14127
|
-
/** CSS class name */
|
|
14128
|
-
className?: string;
|
|
14129
|
-
/** Inline styles */
|
|
14130
|
-
style?: React__default.CSSProperties;
|
|
14131
|
-
}
|
|
14132
|
-
/**
|
|
14133
|
-
* Theme Live Editor Component
|
|
14134
|
-
*
|
|
14135
|
-
* Allows live editing of theme properties with instant preview
|
|
14136
|
-
*/
|
|
14137
|
-
declare const ThemeLiveEditor: React__default.FC<ThemeLiveEditorProps>;
|
|
14138
|
-
|
|
14139
|
-
/**
|
|
14140
|
-
* Theme Validator
|
|
14141
|
-
*
|
|
14142
|
-
* Runtime theme validation including color contrast and accessibility checks
|
|
14143
|
-
*/
|
|
14144
|
-
|
|
14145
|
-
/**
|
|
14146
|
-
* Validation result
|
|
14147
|
-
*/
|
|
14148
|
-
interface ValidationResult {
|
|
14149
|
-
/** Whether theme is valid */
|
|
14150
|
-
valid: boolean;
|
|
14151
|
-
/** Validation errors */
|
|
14152
|
-
errors: string[];
|
|
14153
|
-
/** Validation warnings */
|
|
14154
|
-
warnings: string[];
|
|
14155
|
-
/** Accessibility issues */
|
|
14156
|
-
a11yIssues: A11yIssue[];
|
|
14157
|
-
}
|
|
14158
|
-
/**
|
|
14159
|
-
* Accessibility issue
|
|
14160
|
-
*/
|
|
14161
|
-
interface A11yIssue {
|
|
14162
|
-
/** Issue type */
|
|
14163
|
-
type: 'contrast' | 'color' | 'missing';
|
|
14164
|
-
/** Severity */
|
|
14165
|
-
severity: 'error' | 'warning';
|
|
14166
|
-
/** Issue message */
|
|
14167
|
-
message: string;
|
|
14168
|
-
/** Affected property */
|
|
14169
|
-
property?: string;
|
|
14170
|
-
/** Current value */
|
|
14171
|
-
value?: string;
|
|
14172
|
-
/** Recommended value */
|
|
14173
|
-
recommended?: string;
|
|
14174
|
-
}
|
|
14175
|
-
/**
|
|
14176
|
-
* Theme Validator
|
|
14177
|
-
*
|
|
14178
|
-
* Validates themes for correctness and accessibility
|
|
14179
|
-
*/
|
|
14180
|
-
declare class ThemeValidator {
|
|
14181
|
-
/**
|
|
14182
|
-
* Validate theme
|
|
14183
|
-
*/
|
|
14184
|
-
validate(theme: Theme, metadata?: ThemeMetadata): ValidationResult;
|
|
14185
|
-
/**
|
|
14186
|
-
* Validate palette
|
|
14187
|
-
*/
|
|
14188
|
-
private validatePalette;
|
|
14189
|
-
/**
|
|
14190
|
-
* Validate typography
|
|
14191
|
-
*/
|
|
14192
|
-
private validateTypography;
|
|
14193
|
-
/**
|
|
14194
|
-
* Validate spacing
|
|
14195
|
-
*/
|
|
14196
|
-
private validateSpacing;
|
|
14197
|
-
/**
|
|
14198
|
-
* Validate breakpoints
|
|
14199
|
-
*/
|
|
14200
|
-
private validateBreakpoints;
|
|
14201
|
-
/**
|
|
14202
|
-
* Check color contrast ratio
|
|
14203
|
-
*/
|
|
14204
|
-
private checkContrast;
|
|
14205
|
-
/**
|
|
14206
|
-
* Check if color is valid
|
|
14207
|
-
*/
|
|
14208
|
-
private isValidColor;
|
|
14209
|
-
/**
|
|
14210
|
-
* Validate transitions
|
|
14211
|
-
*/
|
|
14212
|
-
private validateTransitions;
|
|
14213
|
-
/**
|
|
14214
|
-
* Validate z-index
|
|
14215
|
-
*/
|
|
14216
|
-
private validateZIndex;
|
|
14217
|
-
/**
|
|
14218
|
-
* Validate border radius
|
|
14219
|
-
*/
|
|
14220
|
-
private validateBorderRadius;
|
|
14221
|
-
/**
|
|
14222
|
-
* Validate custom properties
|
|
14223
|
-
*/
|
|
14224
|
-
private validateCustom;
|
|
14225
|
-
}
|
|
14226
|
-
|
|
14227
|
-
/**
|
|
14228
|
-
* useHistory Hook
|
|
14229
|
-
*
|
|
14230
|
-
* React hook for managing undo/redo history
|
|
14032
|
+
* useHistory Hook
|
|
14033
|
+
*
|
|
14034
|
+
* React hook for managing undo/redo history
|
|
14231
14035
|
*/
|
|
14232
14036
|
interface UseHistoryOptions {
|
|
14233
14037
|
/** Maximum number of history entries (default: 50) */
|
|
@@ -14277,22 +14081,6 @@ declare function useHistory<T>(options?: UseHistoryOptions): UseHistoryReturn<T>
|
|
|
14277
14081
|
* Converts between Theme objects and DesignTokens.
|
|
14278
14082
|
*/
|
|
14279
14083
|
|
|
14280
|
-
/**
|
|
14281
|
-
* Convert Theme object to DesignTokens
|
|
14282
|
-
*
|
|
14283
|
-
* Extracts values from a Theme object and converts them to flat DesignTokens format.
|
|
14284
|
-
*
|
|
14285
|
-
* @param theme - Theme object to convert
|
|
14286
|
-
* @returns Partial DesignTokens object
|
|
14287
|
-
*
|
|
14288
|
-
* @example
|
|
14289
|
-
* ```typescript
|
|
14290
|
-
* const theme = createTheme({ palette: { primary: { main: '#7c3aed' } } });
|
|
14291
|
-
* const tokens = themeToDesignTokens(theme);
|
|
14292
|
-
* // Returns: { 'primary': '#7c3aed', ... }
|
|
14293
|
-
* ```
|
|
14294
|
-
*/
|
|
14295
|
-
declare function themeToDesignTokens(theme: Theme): Partial<DesignTokens>;
|
|
14296
14084
|
/**
|
|
14297
14085
|
* Convert DesignTokens to Theme-compatible CSS variables
|
|
14298
14086
|
*
|
|
@@ -14300,22 +14088,6 @@ declare function themeToDesignTokens(theme: Theme): Partial<DesignTokens>;
|
|
|
14300
14088
|
* @returns CSS variables object compatible with Theme.cssVars
|
|
14301
14089
|
*/
|
|
14302
14090
|
declare function designTokensToCSSVars(tokens: Partial<DesignTokens>): Record<string, string>;
|
|
14303
|
-
/**
|
|
14304
|
-
* Create DesignTokens from Theme with defaults
|
|
14305
|
-
*
|
|
14306
|
-
* Converts a Theme to DesignTokens and merges with default tokens.
|
|
14307
|
-
*
|
|
14308
|
-
* @param theme - Theme object to convert
|
|
14309
|
-
* @returns Complete DesignTokens object
|
|
14310
|
-
*/
|
|
14311
|
-
declare function createDesignTokensFromTheme(theme: Theme): DesignTokens;
|
|
14312
|
-
/**
|
|
14313
|
-
* Create a minimal Theme object from DesignTokens
|
|
14314
|
-
*
|
|
14315
|
-
* @param tokens - DesignTokens to convert
|
|
14316
|
-
* @returns Minimal Theme object with cssVars populated
|
|
14317
|
-
*/
|
|
14318
|
-
declare function designTokensToTheme(tokens: Partial<DesignTokens>): Partial<Theme>;
|
|
14319
14091
|
|
|
14320
14092
|
/**
|
|
14321
14093
|
* CSS Variable Mapper
|
|
@@ -14349,25 +14121,6 @@ interface CSSVariableNamingOptions {
|
|
|
14349
14121
|
/** Whether to include component name in variable (default: true) */
|
|
14350
14122
|
includeComponent?: boolean;
|
|
14351
14123
|
}
|
|
14352
|
-
/**
|
|
14353
|
-
* Generate CSS variable name from parts
|
|
14354
|
-
*
|
|
14355
|
-
* @example
|
|
14356
|
-
* generateCSSVariableName('button', 'bg', { prefix: 'atomix' })
|
|
14357
|
-
* // Returns: '--atomix-button-bg'
|
|
14358
|
-
*/
|
|
14359
|
-
declare function generateCSSVariableName(component: string, property: string, options?: CSSVariableNamingOptions): string;
|
|
14360
|
-
/**
|
|
14361
|
-
* Generate CSS variables object from configuration
|
|
14362
|
-
*
|
|
14363
|
-
* @example
|
|
14364
|
-
* const vars = generateComponentCSSVars({
|
|
14365
|
-
* component: 'button',
|
|
14366
|
-
* properties: { bg: '#000', color: '#fff' }
|
|
14367
|
-
* })
|
|
14368
|
-
* // Returns: { '--atomix-button-bg': '#000', '--atomix-button-color': '#fff' }
|
|
14369
|
-
*/
|
|
14370
|
-
declare function generateComponentCSSVars(config: CSSVariableConfig, options?: CSSVariableNamingOptions): Record<string, string>;
|
|
14371
14124
|
/**
|
|
14372
14125
|
* Map SCSS tokens to CSS custom properties
|
|
14373
14126
|
*
|
|
@@ -14380,8 +14133,8 @@ declare function mapSCSSTokensToCSSVars(tokens: Record<string, any>, options?: C
|
|
|
14380
14133
|
/**
|
|
14381
14134
|
* Apply CSS variables to an element
|
|
14382
14135
|
*
|
|
14383
|
-
* @param element - Target element (defaults to document.documentElement)
|
|
14384
14136
|
* @param vars - CSS variables to apply
|
|
14137
|
+
* @param element - Target element (defaults to document.documentElement)
|
|
14385
14138
|
*/
|
|
14386
14139
|
declare function applyCSSVariables(vars: Record<string, string | number>, element?: HTMLElement): void;
|
|
14387
14140
|
/**
|
|
@@ -14429,27 +14182,9 @@ declare function extractComponentName(varName: string, prefix?: string): string
|
|
|
14429
14182
|
/**
|
|
14430
14183
|
* Theme Helper Functions
|
|
14431
14184
|
*
|
|
14432
|
-
* Utility functions for working with
|
|
14185
|
+
* Utility functions for working with DesignTokens
|
|
14433
14186
|
*/
|
|
14434
14187
|
|
|
14435
|
-
/**
|
|
14436
|
-
* Get DesignTokens from current theme
|
|
14437
|
-
*
|
|
14438
|
-
* Converts a Theme object to DesignTokens. Useful when you need to
|
|
14439
|
-
* work with DesignTokens but have a Theme object.
|
|
14440
|
-
*
|
|
14441
|
-
* @param theme - Theme object to convert
|
|
14442
|
-
* @returns DesignTokens object
|
|
14443
|
-
*
|
|
14444
|
-
* @example
|
|
14445
|
-
* ```typescript
|
|
14446
|
-
* // If you have a Theme object, convert it to DesignTokens
|
|
14447
|
-
* const tokens = getDesignTokensFromTheme(theme);
|
|
14448
|
-
* // Now you can use tokens with unified theme system
|
|
14449
|
-
* const css = createTheme(tokens);
|
|
14450
|
-
* ```
|
|
14451
|
-
*/
|
|
14452
|
-
declare function getDesignTokensFromTheme(theme: Theme | null): DesignTokens | null;
|
|
14453
14188
|
/**
|
|
14454
14189
|
* Check if a value is DesignTokens
|
|
14455
14190
|
*
|
|
@@ -14459,18 +14194,9 @@ declare function getDesignTokensFromTheme(theme: Theme | null): DesignTokens | n
|
|
|
14459
14194
|
* @returns True if value is DesignTokens
|
|
14460
14195
|
*/
|
|
14461
14196
|
declare function isDesignTokens(value: unknown): value is DesignTokens;
|
|
14197
|
+
|
|
14462
14198
|
/**
|
|
14463
|
-
*
|
|
14464
|
-
*
|
|
14465
|
-
* Type guard to check if an object is a Theme.
|
|
14466
|
-
*
|
|
14467
|
-
* @param value - Value to check
|
|
14468
|
-
* @returns True if value is Theme
|
|
14469
|
-
*/
|
|
14470
|
-
declare function isThemeObject(value: unknown): value is Theme;
|
|
14471
|
-
|
|
14472
|
-
/**
|
|
14473
|
-
* RTL (Right-to-Left) Support Utilities
|
|
14199
|
+
* RTL (Right-to-Left) Support Utilities
|
|
14474
14200
|
*
|
|
14475
14201
|
* Provides utilities for managing RTL text direction in themes
|
|
14476
14202
|
*/
|
|
@@ -14571,13 +14297,13 @@ declare class RTLManager {
|
|
|
14571
14297
|
/**
|
|
14572
14298
|
* Theme System Exports
|
|
14573
14299
|
*
|
|
14574
|
-
*
|
|
14300
|
+
* Simplified theme system using DesignTokens only.
|
|
14575
14301
|
*
|
|
14576
14302
|
* @example
|
|
14577
14303
|
* ```typescript
|
|
14578
14304
|
* import { createTheme, injectTheme } from '@shohojdhara/atomix/theme';
|
|
14579
14305
|
*
|
|
14580
|
-
* // Using DesignTokens
|
|
14306
|
+
* // Using DesignTokens
|
|
14581
14307
|
* const css = createTheme({ 'primary': '#7AFFD7', 'spacing-4': '1rem' });
|
|
14582
14308
|
* injectTheme(css);
|
|
14583
14309
|
*
|
|
@@ -14604,9 +14330,11 @@ declare function saveTheme(css: string, filePath: string): Promise<void>;
|
|
|
14604
14330
|
type themeImport_A11yIssue = A11yIssue;
|
|
14605
14331
|
type themeImport_CSSVariableConfig = CSSVariableConfig;
|
|
14606
14332
|
type themeImport_CSSVariableNamingOptions = CSSVariableNamingOptions;
|
|
14333
|
+
type themeImport_ComponentThemeOptions = ComponentThemeOptions;
|
|
14607
14334
|
type themeImport_ComponentThemeOverride = ComponentThemeOverride;
|
|
14608
14335
|
type themeImport_DesignTokens = DesignTokens;
|
|
14609
14336
|
type themeImport_GenerateCSSVariablesOptions = GenerateCSSVariablesOptions;
|
|
14337
|
+
type themeImport_NamingOptions = NamingOptions;
|
|
14610
14338
|
type themeImport_RTLConfig = RTLConfig;
|
|
14611
14339
|
type themeImport_RTLManager = RTLManager;
|
|
14612
14340
|
declare const themeImport_RTLManager: typeof RTLManager;
|
|
@@ -14627,13 +14355,10 @@ type themeImport_ThemeInspectorProps = ThemeInspectorProps;
|
|
|
14627
14355
|
declare const themeImport_ThemeLiveEditor: typeof ThemeLiveEditor;
|
|
14628
14356
|
type themeImport_ThemeLiveEditorProps = ThemeLiveEditorProps;
|
|
14629
14357
|
type themeImport_ThemeLoadOptions = ThemeLoadOptions;
|
|
14630
|
-
type themeImport_ThemeMetadata = ThemeMetadata;
|
|
14631
14358
|
declare const themeImport_ThemePreview: typeof ThemePreview;
|
|
14632
14359
|
type themeImport_ThemePreviewProps = ThemePreviewProps;
|
|
14633
14360
|
declare const themeImport_ThemeProvider: typeof ThemeProvider;
|
|
14634
14361
|
type themeImport_ThemeProviderProps = ThemeProviderProps;
|
|
14635
|
-
type themeImport_ThemeRegistry = ThemeRegistry;
|
|
14636
|
-
declare const themeImport_ThemeRegistry: typeof ThemeRegistry;
|
|
14637
14362
|
type themeImport_ThemeValidationResult = ThemeValidationResult;
|
|
14638
14363
|
type themeImport_ThemeValidator = ThemeValidator;
|
|
14639
14364
|
declare const themeImport_ThemeValidator: typeof ThemeValidator;
|
|
@@ -14642,48 +14367,57 @@ type themeImport_UseHistoryReturn<T> = UseHistoryReturn<T>;
|
|
|
14642
14367
|
type themeImport_UseThemeReturn = UseThemeReturn;
|
|
14643
14368
|
type themeImport_ValidationResult = ValidationResult;
|
|
14644
14369
|
declare const themeImport_applyCSSVariables: typeof applyCSSVariables;
|
|
14370
|
+
declare const themeImport_applyComponentTheme: typeof applyComponentTheme;
|
|
14645
14371
|
declare const themeImport_applyTheme: typeof applyTheme;
|
|
14646
|
-
declare const
|
|
14372
|
+
declare const themeImport_camelToKebab: typeof camelToKebab;
|
|
14373
|
+
declare const themeImport_clearThemes: typeof clearThemes;
|
|
14647
14374
|
declare const themeImport_createTheme: typeof createTheme;
|
|
14648
|
-
declare const
|
|
14375
|
+
declare const themeImport_createThemeRegistry: typeof createThemeRegistry;
|
|
14649
14376
|
declare const themeImport_createTokens: typeof createTokens;
|
|
14650
14377
|
declare const themeImport_cssVarsToStyle: typeof cssVarsToStyle;
|
|
14651
14378
|
declare const themeImport_deepMerge: typeof deepMerge;
|
|
14652
14379
|
declare const themeImport_defaultTokens: typeof defaultTokens;
|
|
14653
14380
|
declare const themeImport_designTokensToCSSVars: typeof designTokensToCSSVars;
|
|
14654
|
-
declare const themeImport_designTokensToTheme: typeof designTokensToTheme;
|
|
14655
14381
|
declare const themeImport_extendTheme: typeof extendTheme;
|
|
14656
14382
|
declare const themeImport_extractComponentName: typeof extractComponentName;
|
|
14657
14383
|
declare const themeImport_generateCSSVariableName: typeof generateCSSVariableName;
|
|
14658
14384
|
declare const themeImport_generateCSSVariables: typeof generateCSSVariables;
|
|
14659
14385
|
declare const themeImport_generateCSSVariablesForSelector: typeof generateCSSVariablesForSelector;
|
|
14386
|
+
declare const themeImport_generateClassName: typeof generateClassName;
|
|
14660
14387
|
declare const themeImport_generateComponentCSSVars: typeof generateComponentCSSVars;
|
|
14388
|
+
declare const themeImport_getAllThemes: typeof getAllThemes;
|
|
14661
14389
|
declare const themeImport_getCSSVariable: typeof getCSSVariable;
|
|
14662
|
-
declare const
|
|
14390
|
+
declare const themeImport_getComponentThemeValue: typeof getComponentThemeValue;
|
|
14391
|
+
declare const themeImport_getTheme: typeof getTheme;
|
|
14663
14392
|
declare const themeImport_getThemeApplicator: typeof getThemeApplicator;
|
|
14393
|
+
declare const themeImport_getThemeCount: typeof getThemeCount;
|
|
14394
|
+
declare const themeImport_getThemeIds: typeof getThemeIds;
|
|
14395
|
+
declare const themeImport_hasTheme: typeof hasTheme;
|
|
14664
14396
|
declare const themeImport_injectCSS: typeof injectCSS;
|
|
14665
14397
|
declare const themeImport_injectTheme: typeof injectTheme;
|
|
14666
14398
|
declare const themeImport_isCSSInjected: typeof isCSSInjected;
|
|
14667
14399
|
declare const themeImport_isDesignTokens: typeof isDesignTokens;
|
|
14668
|
-
declare const themeImport_isThemeObject: typeof isThemeObject;
|
|
14669
14400
|
declare const themeImport_isValidCSSVariableName: typeof isValidCSSVariableName;
|
|
14670
14401
|
declare const themeImport_loadThemeFromConfig: typeof loadThemeFromConfig;
|
|
14671
14402
|
declare const themeImport_loadThemeFromConfigSync: typeof loadThemeFromConfigSync;
|
|
14672
14403
|
declare const themeImport_mapSCSSTokensToCSSVars: typeof mapSCSSTokensToCSSVars;
|
|
14673
14404
|
declare const themeImport_mergeCSSVars: typeof mergeCSSVars;
|
|
14674
14405
|
declare const themeImport_mergeTheme: typeof mergeTheme;
|
|
14406
|
+
declare const themeImport_normalizeThemeTokens: typeof normalizeThemeTokens;
|
|
14407
|
+
declare const themeImport_registerTheme: typeof registerTheme;
|
|
14675
14408
|
declare const themeImport_removeCSS: typeof removeCSS;
|
|
14676
14409
|
declare const themeImport_removeCSSVariables: typeof removeCSSVariables;
|
|
14677
14410
|
declare const themeImport_removeTheme: typeof removeTheme;
|
|
14678
|
-
declare const themeImport_saveCSSFile: typeof saveCSSFile;
|
|
14679
|
-
declare const themeImport_saveCSSFileSync: typeof saveCSSFileSync;
|
|
14680
14411
|
declare const themeImport_saveTheme: typeof saveTheme;
|
|
14681
|
-
declare const
|
|
14412
|
+
declare const themeImport_themePropertyToCSSVar: typeof themePropertyToCSSVar;
|
|
14413
|
+
declare const themeImport_unregisterTheme: typeof unregisterTheme;
|
|
14414
|
+
declare const themeImport_useComponentTheme: typeof useComponentTheme;
|
|
14682
14415
|
declare const themeImport_useHistory: typeof useHistory;
|
|
14683
14416
|
declare const themeImport_useTheme: typeof useTheme;
|
|
14417
|
+
declare const themeImport_useThemeTokens: typeof useThemeTokens;
|
|
14684
14418
|
declare namespace themeImport {
|
|
14685
|
-
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,
|
|
14686
|
-
export type { themeImport_A11yIssue as A11yIssue, themeImport_CSSVariableConfig as CSSVariableConfig, themeImport_CSSVariableNamingOptions as CSSVariableNamingOptions, themeImport_ComponentThemeOverride as ComponentThemeOverride, themeImport_DesignTokens as DesignTokens, themeImport_GenerateCSSVariablesOptions as GenerateCSSVariablesOptions, 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,
|
|
14419
|
+
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_createTheme as createTheme, 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_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_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_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_unregisterTheme as unregisterTheme, themeImport_useComponentTheme as useComponentTheme, themeImport_useHistory as useHistory, themeImport_useTheme as useTheme, themeImport_useThemeTokens as useThemeTokens };
|
|
14420
|
+
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 };
|
|
14687
14421
|
}
|
|
14688
14422
|
|
|
14689
14423
|
/**
|
|
@@ -14756,6 +14490,301 @@ declare function useMergedProps<T extends Record<string, any>>(defaultProps: T,
|
|
|
14756
14490
|
*/
|
|
14757
14491
|
declare function applyCSSVarsToStyle(cssVars: Record<string, string | number>, baseStyle?: React.CSSProperties): React.CSSProperties;
|
|
14758
14492
|
|
|
14493
|
+
/**
|
|
14494
|
+
* Atomix Config Loader
|
|
14495
|
+
*
|
|
14496
|
+
* Helper functions to load atomix.config.ts from external projects.
|
|
14497
|
+
* Similar to how Tailwind loads tailwind.config.js
|
|
14498
|
+
*/
|
|
14499
|
+
|
|
14500
|
+
/**
|
|
14501
|
+
* Load Atomix configuration from project root
|
|
14502
|
+
*
|
|
14503
|
+
* Attempts to load atomix.config.ts from the current working directory.
|
|
14504
|
+
* Falls back to default config if file doesn't exist.
|
|
14505
|
+
*
|
|
14506
|
+
* @param options - Loader options
|
|
14507
|
+
* @returns Loaded configuration or default
|
|
14508
|
+
*
|
|
14509
|
+
* @example
|
|
14510
|
+
* ```typescript
|
|
14511
|
+
* import { loadAtomixConfig } from '@shohojdhara/atomix/config';
|
|
14512
|
+
* import { createTheme } from '@shohojdhara/atomix/theme';
|
|
14513
|
+
*
|
|
14514
|
+
* const config = loadAtomixConfig();
|
|
14515
|
+
* const theme = createTheme(config.theme?.tokens || {});
|
|
14516
|
+
* ```
|
|
14517
|
+
*/
|
|
14518
|
+
declare function loadAtomixConfig(options?: {
|
|
14519
|
+
/** Custom config path (default: 'atomix.config.ts') */
|
|
14520
|
+
configPath?: string;
|
|
14521
|
+
/** Whether to throw error if config not found (default: false) */
|
|
14522
|
+
required?: boolean;
|
|
14523
|
+
}): AtomixConfig;
|
|
14524
|
+
/**
|
|
14525
|
+
* Resolve config path
|
|
14526
|
+
*
|
|
14527
|
+
* Finds atomix.config.ts in the project, checking common locations.
|
|
14528
|
+
* Returns null in browser environments where file system access is not available.
|
|
14529
|
+
*
|
|
14530
|
+
* This function is designed to work in Node.js environments only.
|
|
14531
|
+
* In browser builds, it will always return null without attempting to access Node.js modules.
|
|
14532
|
+
*
|
|
14533
|
+
* @internal This function uses Node.js modules and should not be called in browser environments.
|
|
14534
|
+
*/
|
|
14535
|
+
declare function resolveConfigPath(): string | null;
|
|
14536
|
+
|
|
14537
|
+
/**
|
|
14538
|
+
* Atomix Configuration System
|
|
14539
|
+
*
|
|
14540
|
+
* Tailwind-like configuration for customizing the Atomix Design System.
|
|
14541
|
+
*
|
|
14542
|
+
* External developers can create `atomix.config.ts` in their project root
|
|
14543
|
+
* to customize design tokens, similar to Tailwind's tailwind.config.js
|
|
14544
|
+
*
|
|
14545
|
+
* @example
|
|
14546
|
+
* ```typescript
|
|
14547
|
+
* // atomix.config.ts (in your project)
|
|
14548
|
+
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
14549
|
+
*
|
|
14550
|
+
* export default defineConfig({
|
|
14551
|
+
* theme: {
|
|
14552
|
+
* extend: {
|
|
14553
|
+
* colors: {
|
|
14554
|
+
* primary: { main: '#7AFFD7' },
|
|
14555
|
+
* },
|
|
14556
|
+
* },
|
|
14557
|
+
* },
|
|
14558
|
+
* });
|
|
14559
|
+
* ```
|
|
14560
|
+
*/
|
|
14561
|
+
|
|
14562
|
+
/**
|
|
14563
|
+
* Color Scale (1-10)
|
|
14564
|
+
*/
|
|
14565
|
+
interface ColorScale {
|
|
14566
|
+
1?: string;
|
|
14567
|
+
2?: string;
|
|
14568
|
+
3?: string;
|
|
14569
|
+
4?: string;
|
|
14570
|
+
5?: string;
|
|
14571
|
+
6?: string;
|
|
14572
|
+
7?: string;
|
|
14573
|
+
8?: string;
|
|
14574
|
+
9?: string;
|
|
14575
|
+
10?: string;
|
|
14576
|
+
[key: string]: string | undefined;
|
|
14577
|
+
}
|
|
14578
|
+
/**
|
|
14579
|
+
* Palette Color Options
|
|
14580
|
+
*/
|
|
14581
|
+
interface PaletteColorOptions {
|
|
14582
|
+
main: string;
|
|
14583
|
+
light?: string;
|
|
14584
|
+
dark?: string;
|
|
14585
|
+
contrastText?: string;
|
|
14586
|
+
}
|
|
14587
|
+
/**
|
|
14588
|
+
* Design Tokens Schema (Tailwind-like)
|
|
14589
|
+
*/
|
|
14590
|
+
interface ThemeTokens {
|
|
14591
|
+
/** Color palette */
|
|
14592
|
+
colors?: Record<string, string | PaletteColorOptions | ColorScale | Record<string, string>>;
|
|
14593
|
+
/** Spacing scale */
|
|
14594
|
+
spacing?: Record<string, string>;
|
|
14595
|
+
/** Border radius scale */
|
|
14596
|
+
borderRadius?: Record<string, string>;
|
|
14597
|
+
/** Typography scale and settings */
|
|
14598
|
+
typography?: {
|
|
14599
|
+
fontFamilies?: Record<string, string>;
|
|
14600
|
+
fontSizes?: Record<string, string>;
|
|
14601
|
+
fontWeights?: Record<string, string | number>;
|
|
14602
|
+
lineHeights?: Record<string, string | number>;
|
|
14603
|
+
letterSpacings?: Record<string, string>;
|
|
14604
|
+
};
|
|
14605
|
+
/** Shadow scale */
|
|
14606
|
+
shadows?: Record<string, string>;
|
|
14607
|
+
/** Z-index scale */
|
|
14608
|
+
zIndex?: Record<string, string | number>;
|
|
14609
|
+
/** Breakpoints scale */
|
|
14610
|
+
breakpoints?: Record<string, string | number>;
|
|
14611
|
+
/** Transitions settings */
|
|
14612
|
+
transitions?: {
|
|
14613
|
+
durations?: Record<string, string>;
|
|
14614
|
+
easings?: Record<string, string>;
|
|
14615
|
+
};
|
|
14616
|
+
}
|
|
14617
|
+
/**
|
|
14618
|
+
* CSS Theme Definition
|
|
14619
|
+
*/
|
|
14620
|
+
interface CSSThemeDefinition {
|
|
14621
|
+
type: 'css';
|
|
14622
|
+
name: string;
|
|
14623
|
+
class?: string;
|
|
14624
|
+
description?: string;
|
|
14625
|
+
author?: string;
|
|
14626
|
+
version?: string;
|
|
14627
|
+
tags?: string[];
|
|
14628
|
+
supportsDarkMode?: boolean;
|
|
14629
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
14630
|
+
a11y?: {
|
|
14631
|
+
contrastTarget?: number;
|
|
14632
|
+
modes?: string[];
|
|
14633
|
+
};
|
|
14634
|
+
color?: string;
|
|
14635
|
+
features?: string[];
|
|
14636
|
+
dependencies?: string[];
|
|
14637
|
+
cssPath?: string;
|
|
14638
|
+
}
|
|
14639
|
+
/**
|
|
14640
|
+
* JavaScript Theme Definition
|
|
14641
|
+
*/
|
|
14642
|
+
interface JSThemeDefinition {
|
|
14643
|
+
type: 'js';
|
|
14644
|
+
name: string;
|
|
14645
|
+
class?: string;
|
|
14646
|
+
description?: string;
|
|
14647
|
+
author?: string;
|
|
14648
|
+
version?: string;
|
|
14649
|
+
tags?: string[];
|
|
14650
|
+
supportsDarkMode?: boolean;
|
|
14651
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
14652
|
+
a11y?: {
|
|
14653
|
+
contrastTarget?: number;
|
|
14654
|
+
modes?: string[];
|
|
14655
|
+
};
|
|
14656
|
+
color?: string;
|
|
14657
|
+
features?: string[];
|
|
14658
|
+
dependencies?: string[];
|
|
14659
|
+
createTheme: () => Theme;
|
|
14660
|
+
}
|
|
14661
|
+
/**
|
|
14662
|
+
* Theme Definition (CSS or JS)
|
|
14663
|
+
*/
|
|
14664
|
+
type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
|
|
14665
|
+
/**
|
|
14666
|
+
* Build configuration (migrated from theme.config.ts)
|
|
14667
|
+
*/
|
|
14668
|
+
interface BuildConfig {
|
|
14669
|
+
output?: {
|
|
14670
|
+
directory?: string;
|
|
14671
|
+
formats?: {
|
|
14672
|
+
expanded?: string;
|
|
14673
|
+
compressed?: string;
|
|
14674
|
+
};
|
|
14675
|
+
};
|
|
14676
|
+
sass?: {
|
|
14677
|
+
style?: 'expanded' | 'compressed';
|
|
14678
|
+
sourceMap?: boolean;
|
|
14679
|
+
loadPaths?: string[];
|
|
14680
|
+
};
|
|
14681
|
+
}
|
|
14682
|
+
/**
|
|
14683
|
+
* Runtime configuration (migrated from theme.config.ts)
|
|
14684
|
+
*/
|
|
14685
|
+
interface RuntimeConfig {
|
|
14686
|
+
basePath?: string;
|
|
14687
|
+
cdnPath?: string | null;
|
|
14688
|
+
preload?: string[];
|
|
14689
|
+
lazy?: boolean;
|
|
14690
|
+
defaultTheme?: string;
|
|
14691
|
+
storageKey?: string;
|
|
14692
|
+
dataAttribute?: string;
|
|
14693
|
+
enablePersistence?: boolean;
|
|
14694
|
+
useMinified?: boolean;
|
|
14695
|
+
}
|
|
14696
|
+
/**
|
|
14697
|
+
* Integration settings (migrated from theme.config.ts)
|
|
14698
|
+
*/
|
|
14699
|
+
interface IntegrationConfig {
|
|
14700
|
+
cssVariables?: Record<string, string>;
|
|
14701
|
+
classNames?: {
|
|
14702
|
+
theme?: string;
|
|
14703
|
+
colorMode?: string;
|
|
14704
|
+
};
|
|
14705
|
+
}
|
|
14706
|
+
/**
|
|
14707
|
+
* Atomix Configuration Interface
|
|
14708
|
+
*
|
|
14709
|
+
* Tailwind-like configuration for external developers.
|
|
14710
|
+
* Focus on theme customization - build/runtime configs are internal only.
|
|
14711
|
+
*/
|
|
14712
|
+
interface AtomixConfig {
|
|
14713
|
+
/**
|
|
14714
|
+
* CSS variable prefix (default: 'atomix')
|
|
14715
|
+
*
|
|
14716
|
+
* Change this to customize all CSS variable names.
|
|
14717
|
+
* Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
|
|
14718
|
+
*/
|
|
14719
|
+
prefix?: string;
|
|
14720
|
+
/**
|
|
14721
|
+
* Theme customization (Tailwind-like)
|
|
14722
|
+
*
|
|
14723
|
+
* Use `extend` to add or override design tokens.
|
|
14724
|
+
* Use `tokens` to completely replace the default token system (advanced).
|
|
14725
|
+
*/
|
|
14726
|
+
theme?: {
|
|
14727
|
+
/**
|
|
14728
|
+
* Extend the default design tokens
|
|
14729
|
+
*
|
|
14730
|
+
* This is the recommended way to customize Atomix.
|
|
14731
|
+
* Your values will override or extend the base tokens.
|
|
14732
|
+
*/
|
|
14733
|
+
extend?: ThemeTokens;
|
|
14734
|
+
/**
|
|
14735
|
+
* Override the default tokens entirely (advanced)
|
|
14736
|
+
*
|
|
14737
|
+
* Use with caution - this replaces the entire token system.
|
|
14738
|
+
* Most users should use `extend` instead.
|
|
14739
|
+
*/
|
|
14740
|
+
tokens?: ThemeTokens;
|
|
14741
|
+
/**
|
|
14742
|
+
* Register custom themes (optional)
|
|
14743
|
+
*
|
|
14744
|
+
* Define CSS or JavaScript themes that can be loaded dynamically.
|
|
14745
|
+
*/
|
|
14746
|
+
themes?: Record<string, ThemeDefinition>;
|
|
14747
|
+
};
|
|
14748
|
+
/** @internal Build configuration (internal use only) */
|
|
14749
|
+
build?: BuildConfig;
|
|
14750
|
+
/** @internal Runtime configuration (internal use only) */
|
|
14751
|
+
runtime?: RuntimeConfig;
|
|
14752
|
+
/** @internal Integration settings (internal use only) */
|
|
14753
|
+
integration?: IntegrationConfig;
|
|
14754
|
+
/** @internal Theme dependencies mapping (internal use only) */
|
|
14755
|
+
dependencies?: Record<string, string[]>;
|
|
14756
|
+
}
|
|
14757
|
+
/**
|
|
14758
|
+
* Helper function to define Atomix configuration with type safety
|
|
14759
|
+
*
|
|
14760
|
+
* @param config - Atomix configuration object
|
|
14761
|
+
* @returns The configuration object
|
|
14762
|
+
*/
|
|
14763
|
+
/**
|
|
14764
|
+
* Helper function to define Atomix configuration with type safety
|
|
14765
|
+
*
|
|
14766
|
+
* Similar to Tailwind's defineConfig, provides autocomplete and type checking.
|
|
14767
|
+
*
|
|
14768
|
+
* @param config - Atomix configuration object
|
|
14769
|
+
* @returns The configuration object
|
|
14770
|
+
*
|
|
14771
|
+
* @example
|
|
14772
|
+
* ```typescript
|
|
14773
|
+
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
14774
|
+
*
|
|
14775
|
+
* export default defineConfig({
|
|
14776
|
+
* theme: {
|
|
14777
|
+
* extend: {
|
|
14778
|
+
* colors: {
|
|
14779
|
+
* primary: { main: '#7AFFD7' },
|
|
14780
|
+
* },
|
|
14781
|
+
* },
|
|
14782
|
+
* },
|
|
14783
|
+
* });
|
|
14784
|
+
* ```
|
|
14785
|
+
*/
|
|
14786
|
+
declare function defineConfig(config: AtomixConfig): AtomixConfig;
|
|
14787
|
+
|
|
14759
14788
|
declare const composables: typeof __lib_composables;
|
|
14760
14789
|
declare const utils: typeof __lib_utils;
|
|
14761
14790
|
declare const types: typeof __lib_types;
|
|
@@ -15143,5 +15172,5 @@ declare const atomix: {
|
|
|
15143
15172
|
VideoPlayer: React$1.ForwardRefExoticComponent<VideoPlayerProps & React$1.RefAttributes<HTMLVideoElement>>;
|
|
15144
15173
|
};
|
|
15145
15174
|
|
|
15146
|
-
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, TODO, TOGGLE, TOOLTIP, TOOLTIP_CSS_VARS, Tabs, Testimonial, Textarea, ThemeApplicator, ThemeComparator, ThemeContext, ThemeErrorBoundary, ThemeInspector, ThemeLiveEditor, ThemePreview, ThemeProvider,
|
|
15147
|
-
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, 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, 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,
|
|
15175
|
+
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, createFontPreloadLink, createPartProps, createSlotComponent, createSlotProps, createTheme, createThemeRegistry, createTokens, cssVarsToStyle, deepMerge, atomix as default, defaultTokens, defineConfig, designTokensToCSSVars, extendTheme, extractComponentName, extractYouTubeId, generateCSSVariableName, generateCSSVariables, generateCSSVariablesForSelector, generateClassName, generateComponentCSSVars, generateFontPreloadTags, generateUUID, getAllThemes, getCSSVariable, getComponentCSSVars, getComponentThemeValue, getPartStyles, getTheme, getThemeApplicator, getThemeCount, getThemeIds, hasCustomization, hasTheme, injectCSS, injectTheme, isCSSInjected, isDesignTokens, isSlot, isValidCSSVariableName, isYouTubeUrl, loadAtomixConfig, loadThemeFromConfig, loadThemeFromConfigSync, mapSCSSTokensToCSSVars, mergeCSSVars, mergeClassNames, mergeComponentProps, mergePartStyles, mergeSlots, mergeTheme, normalizeThemeTokens, preloadFonts, registerTheme, removeCSS, removeCSSVariables, removeTheme, renderSlot, resolveConfigPath, saveTheme, sliderConstants, theme, themePropertyToCSSVar, 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 };
|
|
15176
|
+
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, ExportFormat, 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, SelectionMode, 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 };
|