@shohojdhara/atomix 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/dist/index.d.ts +2 -80
- package/dist/index.esm.js +14 -260
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -265
- 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 +1 -32
- package/dist/theme.js +12 -207
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config/index.ts +5 -5
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/core/createTheme.ts +11 -40
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/index.ts +4 -16
- package/src/lib/theme/runtime/ThemeProvider.tsx +1 -16
- package/src/lib/config/loader.ts +0 -147
- package/src/lib/theme/config/__tests__/configLoader.test.ts +0 -207
- package/src/lib/theme/config/configLoader.ts +0 -113
- package/src/lib/theme/config/loader.ts +0 -293
- package/src/lib/theme/generators/cssFile.ts +0 -79
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7dbaeb5: patchFix fs/promises module resolution error by removing server-side only functions (saveTheme, saveCSSFile, loadThemeFromConfig) from the browser bundle. This makes the library fully compatible with Next.js App Router and other browser environments. Breaking Change: Removed Node.js specific file-system utilities from main exports.
|
|
8
|
+
|
|
3
9
|
## [0.3.10] - 2026-01-06
|
|
4
10
|
|
|
5
11
|
### Fixed
|
|
12
|
+
|
|
6
13
|
- Fixed `Module not found: Can't resolve './lib/config/loader'` by bundling `loadAtomixConfig` instead of treating it as external.
|
|
7
14
|
|
|
8
15
|
## [0.3.9] - 2026-01-06
|
|
9
16
|
|
|
10
17
|
### Fixed
|
|
18
|
+
|
|
11
19
|
- Fixed `Module not found` error by replacing dynamic `require` with static import in `ThemeProvider`. This resolves build issues in external projects (e.g. Next.js).
|
|
12
|
-
All notable changes to this project will be documented in this file.
|
|
20
|
+
All notable changes to this project will be documented in this file.
|
|
13
21
|
|
|
14
22
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
15
23
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
package/dist/index.d.ts
CHANGED
|
@@ -13606,33 +13606,6 @@ declare function removeCSS(id?: string): void;
|
|
|
13606
13606
|
*/
|
|
13607
13607
|
declare function isCSSInjected(id?: string): boolean;
|
|
13608
13608
|
|
|
13609
|
-
/**
|
|
13610
|
-
* Theme Configuration Loader
|
|
13611
|
-
*
|
|
13612
|
-
* Provides functions to load theme configurations from atomix.config.ts
|
|
13613
|
-
* Includes both sync and async versions, with automatic fallbacks
|
|
13614
|
-
*/
|
|
13615
|
-
|
|
13616
|
-
/**
|
|
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
|
|
13621
|
-
*/
|
|
13622
|
-
declare function loadThemeFromConfigSync(options?: {
|
|
13623
|
-
configPath?: string;
|
|
13624
|
-
required?: boolean;
|
|
13625
|
-
}): DesignTokens;
|
|
13626
|
-
/**
|
|
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
|
|
13630
|
-
*/
|
|
13631
|
-
declare function loadThemeFromConfig(options?: {
|
|
13632
|
-
configPath?: string;
|
|
13633
|
-
required?: boolean;
|
|
13634
|
-
}): Promise<DesignTokens>;
|
|
13635
|
-
|
|
13636
13609
|
/**
|
|
13637
13610
|
* Theme Provider
|
|
13638
13611
|
*
|
|
@@ -14322,10 +14295,6 @@ declare function injectTheme(css: string, id?: string): void;
|
|
|
14322
14295
|
* Remove theme from DOM
|
|
14323
14296
|
*/
|
|
14324
14297
|
declare function removeTheme(id?: string): void;
|
|
14325
|
-
/**
|
|
14326
|
-
* Save theme to CSS file
|
|
14327
|
-
*/
|
|
14328
|
-
declare function saveTheme(css: string, filePath: string): Promise<void>;
|
|
14329
14298
|
|
|
14330
14299
|
type themeImport_A11yIssue = A11yIssue;
|
|
14331
14300
|
type themeImport_CSSVariableConfig = CSSVariableConfig;
|
|
@@ -14398,8 +14367,6 @@ declare const themeImport_injectTheme: typeof injectTheme;
|
|
|
14398
14367
|
declare const themeImport_isCSSInjected: typeof isCSSInjected;
|
|
14399
14368
|
declare const themeImport_isDesignTokens: typeof isDesignTokens;
|
|
14400
14369
|
declare const themeImport_isValidCSSVariableName: typeof isValidCSSVariableName;
|
|
14401
|
-
declare const themeImport_loadThemeFromConfig: typeof loadThemeFromConfig;
|
|
14402
|
-
declare const themeImport_loadThemeFromConfigSync: typeof loadThemeFromConfigSync;
|
|
14403
14370
|
declare const themeImport_mapSCSSTokensToCSSVars: typeof mapSCSSTokensToCSSVars;
|
|
14404
14371
|
declare const themeImport_mergeCSSVars: typeof mergeCSSVars;
|
|
14405
14372
|
declare const themeImport_mergeTheme: typeof mergeTheme;
|
|
@@ -14408,7 +14375,6 @@ declare const themeImport_registerTheme: typeof registerTheme;
|
|
|
14408
14375
|
declare const themeImport_removeCSS: typeof removeCSS;
|
|
14409
14376
|
declare const themeImport_removeCSSVariables: typeof removeCSSVariables;
|
|
14410
14377
|
declare const themeImport_removeTheme: typeof removeTheme;
|
|
14411
|
-
declare const themeImport_saveTheme: typeof saveTheme;
|
|
14412
14378
|
declare const themeImport_themePropertyToCSSVar: typeof themePropertyToCSSVar;
|
|
14413
14379
|
declare const themeImport_unregisterTheme: typeof unregisterTheme;
|
|
14414
14380
|
declare const themeImport_useComponentTheme: typeof useComponentTheme;
|
|
@@ -14416,7 +14382,7 @@ declare const themeImport_useHistory: typeof useHistory;
|
|
|
14416
14382
|
declare const themeImport_useTheme: typeof useTheme;
|
|
14417
14383
|
declare const themeImport_useThemeTokens: typeof useThemeTokens;
|
|
14418
14384
|
declare namespace themeImport {
|
|
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,
|
|
14385
|
+
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_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_themePropertyToCSSVar as themePropertyToCSSVar, themeImport_unregisterTheme as unregisterTheme, themeImport_useComponentTheme as useComponentTheme, themeImport_useHistory as useHistory, themeImport_useTheme as useTheme, themeImport_useThemeTokens as useThemeTokens };
|
|
14420
14386
|
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 };
|
|
14421
14387
|
}
|
|
14422
14388
|
|
|
@@ -14490,50 +14456,6 @@ declare function useMergedProps<T extends Record<string, any>>(defaultProps: T,
|
|
|
14490
14456
|
*/
|
|
14491
14457
|
declare function applyCSSVarsToStyle(cssVars: Record<string, string | number>, baseStyle?: React.CSSProperties): React.CSSProperties;
|
|
14492
14458
|
|
|
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
14459
|
/**
|
|
14538
14460
|
* Atomix Configuration System
|
|
14539
14461
|
*
|
|
@@ -15172,5 +15094,5 @@ declare const atomix: {
|
|
|
15172
15094
|
VideoPlayer: React$1.ForwardRefExoticComponent<VideoPlayerProps & React$1.RefAttributes<HTMLVideoElement>>;
|
|
15173
15095
|
};
|
|
15174
15096
|
|
|
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,
|
|
15097
|
+
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, mapSCSSTokensToCSSVars, mergeCSSVars, mergeClassNames, mergeComponentProps, mergePartStyles, mergeSlots, mergeTheme, normalizeThemeTokens, preloadFonts, registerTheme, removeCSS, removeCSSVariables, removeTheme, renderSlot, 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
15098
|
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 };
|
package/dist/index.esm.js
CHANGED
|
@@ -19255,39 +19255,13 @@ class ThemeLogger {
|
|
|
19255
19255
|
tokens = input;
|
|
19256
19256
|
}
|
|
19257
19257
|
// Merge with defaults and generate CSS
|
|
19258
|
-
else
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
try {
|
|
19266
|
-
const configLoaderModule = require("../config/configLoader"), loaderModule = require("../../config/loader");
|
|
19267
|
-
// Get prefix from config if needed
|
|
19268
|
-
if (loadThemeFromConfigSync = configLoaderModule.loadThemeFromConfigSync, loadAtomixConfig = loaderModule.loadAtomixConfig,
|
|
19269
|
-
tokens = loadThemeFromConfigSync(), !options?.prefix) try {
|
|
19270
|
-
const config = loadAtomixConfig({
|
|
19271
|
-
configPath: "atomix.config.ts",
|
|
19272
|
-
required: !1
|
|
19273
|
-
});
|
|
19274
|
-
options = {
|
|
19275
|
-
...options,
|
|
19276
|
-
prefix: config?.prefix || "atomix"
|
|
19277
|
-
};
|
|
19278
|
-
} catch (error) {
|
|
19279
|
-
// If config loading fails, use default prefix
|
|
19280
|
-
options = {
|
|
19281
|
-
...options,
|
|
19282
|
-
prefix: "atomix"
|
|
19283
|
-
};
|
|
19284
|
-
}
|
|
19285
|
-
} catch (error) {
|
|
19286
|
-
throw new ThemeError("No input provided and config loading is not available in this environment. Please provide tokens explicitly.", ThemeErrorCode.CONFIG_LOAD_FAILED, {
|
|
19287
|
-
error: error instanceof Error ? error.message : String(error)
|
|
19288
|
-
});
|
|
19289
|
-
}
|
|
19290
|
-
}
|
|
19258
|
+
else
|
|
19259
|
+
// Auto-loading config from file system is removed for browser compatibility.
|
|
19260
|
+
// If no input is provided, we return an empty theme (using defaults only) or user must provide tokens.
|
|
19261
|
+
// This allows createTheme to be isomorphic.
|
|
19262
|
+
// Warn in development if no input provided
|
|
19263
|
+
"production" !== process.env.NODE_ENV && "undefined" != typeof window && console.warn("Atomix: createTheme() called without tokens. Using default tokens only."),
|
|
19264
|
+
tokens = {};
|
|
19291
19265
|
const allTokens = createTokens(tokens), prefix = options?.prefix ?? "atomix";
|
|
19292
19266
|
// Get prefix from options or use default
|
|
19293
19267
|
return generateCSSVariables$1(allTokens, {
|
|
@@ -19520,24 +19494,12 @@ class ThemeLogger {
|
|
|
19520
19494
|
}
|
|
19521
19495
|
|
|
19522
19496
|
/**
|
|
19523
|
-
*
|
|
19497
|
+
* Theme System Constants
|
|
19524
19498
|
*
|
|
19525
|
-
*
|
|
19499
|
+
* Centralized constants for the theme system to avoid magic numbers and strings.
|
|
19526
19500
|
*/
|
|
19527
19501
|
/**
|
|
19528
|
-
*
|
|
19529
|
-
*
|
|
19530
|
-
* Writes CSS string to a file. Only works in Node.js environment.
|
|
19531
|
-
*
|
|
19532
|
-
* @param css - CSS string to save
|
|
19533
|
-
* @param filePath - Output file path
|
|
19534
|
-
* @throws Error if called in browser environment
|
|
19535
|
-
*
|
|
19536
|
-
* @example
|
|
19537
|
-
* ```typescript
|
|
19538
|
-
* const css = ':root { --atomix-color-primary: #7AFFD7; }';
|
|
19539
|
-
* await saveCSSFile(css, './themes/custom.css');
|
|
19540
|
-
* ```
|
|
19502
|
+
* Default storage key for theme persistence
|
|
19541
19503
|
*/ "undefined" != typeof process && process.env;
|
|
19542
19504
|
|
|
19543
19505
|
/**
|
|
@@ -20314,176 +20276,6 @@ function generateClassName(block, element, modifiers) {
|
|
|
20314
20276
|
return property => getComponentThemeValue(component, property, variant, size);
|
|
20315
20277
|
}
|
|
20316
20278
|
|
|
20317
|
-
/**
|
|
20318
|
-
* Atomix Config Loader
|
|
20319
|
-
*
|
|
20320
|
-
* Helper functions to load atomix.config.ts from external projects.
|
|
20321
|
-
* Similar to how Tailwind loads tailwind.config.js
|
|
20322
|
-
*/
|
|
20323
|
-
/**
|
|
20324
|
-
* Load Atomix configuration from project root
|
|
20325
|
-
*
|
|
20326
|
-
* Attempts to load atomix.config.ts from the current working directory.
|
|
20327
|
-
* Falls back to default config if file doesn't exist.
|
|
20328
|
-
*
|
|
20329
|
-
* @param options - Loader options
|
|
20330
|
-
* @returns Loaded configuration or default
|
|
20331
|
-
*
|
|
20332
|
-
* @example
|
|
20333
|
-
* ```typescript
|
|
20334
|
-
* import { loadAtomixConfig } from '@shohojdhara/atomix/config';
|
|
20335
|
-
* import { createTheme } from '@shohojdhara/atomix/theme';
|
|
20336
|
-
*
|
|
20337
|
-
* const config = loadAtomixConfig();
|
|
20338
|
-
* const theme = createTheme(config.theme?.tokens || {});
|
|
20339
|
-
* ```
|
|
20340
|
-
*/ function loadAtomixConfig(options = {}) {
|
|
20341
|
-
const {configPath: configPath = "atomix.config.ts", required: required = !1} = options, defaultConfig = {
|
|
20342
|
-
prefix: "atomix",
|
|
20343
|
-
theme: {
|
|
20344
|
-
extend: {}
|
|
20345
|
-
}
|
|
20346
|
-
};
|
|
20347
|
-
// Default config
|
|
20348
|
-
// In browser environments, config loading is not supported
|
|
20349
|
-
if ("undefined" != typeof window) {
|
|
20350
|
-
if (required) throw new Error("loadAtomixConfig: Not available in browser environment. Config loading requires Node.js/SSR environment.");
|
|
20351
|
-
return defaultConfig;
|
|
20352
|
-
}
|
|
20353
|
-
// Try to load config file
|
|
20354
|
-
try {
|
|
20355
|
-
// Use dynamic import for ESM compatibility
|
|
20356
|
-
const configModule = require(configPath), config = configModule.default || configModule;
|
|
20357
|
-
// Validate it's an AtomixConfig
|
|
20358
|
-
if (config && "object" == typeof config) return config;
|
|
20359
|
-
throw new Error("Invalid config format");
|
|
20360
|
-
} catch (error) {
|
|
20361
|
-
if (required) throw new Error(`Failed to load config from ${configPath}: ${error.message}`);
|
|
20362
|
-
// Return default config if not required
|
|
20363
|
-
return defaultConfig;
|
|
20364
|
-
}
|
|
20365
|
-
}
|
|
20366
|
-
|
|
20367
|
-
/**
|
|
20368
|
-
* Resolve config path
|
|
20369
|
-
*
|
|
20370
|
-
* Finds atomix.config.ts in the project, checking common locations.
|
|
20371
|
-
* Returns null in browser environments where file system access is not available.
|
|
20372
|
-
*
|
|
20373
|
-
* This function is designed to work in Node.js environments only.
|
|
20374
|
-
* In browser builds, it will always return null without attempting to access Node.js modules.
|
|
20375
|
-
*
|
|
20376
|
-
* @internal This function uses Node.js modules and should not be called in browser environments.
|
|
20377
|
-
*/ function resolveConfigPath() {
|
|
20378
|
-
// Early return for browser environments - prevents any Node.js module access
|
|
20379
|
-
// This check happens before any require() calls, preventing bundlers from analyzing them
|
|
20380
|
-
if ("undefined" != typeof window || "undefined" == typeof process || !process.cwd) return null;
|
|
20381
|
-
// Only attempt to load Node.js modules in Node.js runtime
|
|
20382
|
-
// Use a lazy-loading pattern that prevents static analysis by bundlers
|
|
20383
|
-
try {
|
|
20384
|
-
// Create a function that only executes in Node.js runtime
|
|
20385
|
-
// Use string-based module names to prevent static analysis by bundlers
|
|
20386
|
-
const modules = (() => {
|
|
20387
|
-
// These requires are only executed at runtime in Node.js environments
|
|
20388
|
-
// They are marked as external in Rollup config and should not be bundled
|
|
20389
|
-
// Using string concatenation and computed property access to prevent static analysis
|
|
20390
|
-
if ("undefined" == typeof require) return null;
|
|
20391
|
-
// Use a try-catch wrapper to safely access require
|
|
20392
|
-
try {
|
|
20393
|
-
// Build module names dynamically to prevent static analysis
|
|
20394
|
-
const moduleNames = [ "fs", "path" ];
|
|
20395
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
20396
|
-
return {
|
|
20397
|
-
fs: require(moduleNames[0]),
|
|
20398
|
-
path: require(moduleNames[1])
|
|
20399
|
-
};
|
|
20400
|
-
} catch {
|
|
20401
|
-
return null;
|
|
20402
|
-
}
|
|
20403
|
-
})();
|
|
20404
|
-
if (!modules) return null;
|
|
20405
|
-
const {fs: fs, path: path} = modules, cwd = process.cwd(), possiblePaths = [ path.join(cwd, "atomix.config.ts"), path.join(cwd, "atomix.config.js"), path.join(cwd, "atomix.config.mjs") ];
|
|
20406
|
-
for (const configPath of possiblePaths) if (fs.existsSync(configPath)) return configPath;
|
|
20407
|
-
} catch (error) {
|
|
20408
|
-
// Silently fail in browser environments or when modules are unavailable
|
|
20409
|
-
return null;
|
|
20410
|
-
}
|
|
20411
|
-
return null;
|
|
20412
|
-
}
|
|
20413
|
-
|
|
20414
|
-
/**
|
|
20415
|
-
* Theme Configuration Loader
|
|
20416
|
-
*
|
|
20417
|
-
* Provides functions to load theme configurations from atomix.config.ts
|
|
20418
|
-
* Includes both sync and async versions, with automatic fallbacks
|
|
20419
|
-
*/
|
|
20420
|
-
/**
|
|
20421
|
-
* Load theme from config file (synchronous, Node.js only)
|
|
20422
|
-
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
20423
|
-
* @returns DesignTokens from theme configuration
|
|
20424
|
-
* @throws Error if config loading is not available in browser environment
|
|
20425
|
-
*/ function loadThemeFromConfigSync(options) {
|
|
20426
|
-
// Check if we're in a browser environment
|
|
20427
|
-
if ("undefined" != typeof window) throw new Error("loadThemeFromConfigSync: Not available in browser environment. Config loading requires Node.js/SSR environment.");
|
|
20428
|
-
// Use static import - the function handles browser environment checks internally
|
|
20429
|
-
let config;
|
|
20430
|
-
try {
|
|
20431
|
-
config = loadAtomixConfig({
|
|
20432
|
-
configPath: options?.configPath || "atomix.config.ts",
|
|
20433
|
-
required: !1 !== options?.required
|
|
20434
|
-
});
|
|
20435
|
-
} catch (error) {
|
|
20436
|
-
if (!1 !== options?.required) throw new Error("Config loader module not available");
|
|
20437
|
-
// Return empty tokens if config is not required
|
|
20438
|
-
return createTokens({});
|
|
20439
|
-
}
|
|
20440
|
-
if (!config?.theme) return createTokens({});
|
|
20441
|
-
// Extract tokens from config.theme structure
|
|
20442
|
-
// config.theme can have: { extend?: ThemeTokens, tokens?: ThemeTokens, themes?: ... }
|
|
20443
|
-
// We need to extract the actual DesignTokens (flat structure)
|
|
20444
|
-
const themeConfig = config.theme;
|
|
20445
|
-
// Check if theme is directly a flat object (DesignTokens format)
|
|
20446
|
-
// This handles the case where config.theme might be passed as DesignTokens directly
|
|
20447
|
-
return createTokens(!themeConfig || "object" != typeof themeConfig || "extend" in themeConfig || "tokens" in themeConfig || "themes" in themeConfig ? {} : themeConfig);
|
|
20448
|
-
// If theme has nested structure (extend/tokens/themes), we can't directly use it
|
|
20449
|
-
// Return empty tokens - the theme system will use defaults
|
|
20450
|
-
// TODO: Add proper conversion from ThemeTokens to DesignTokens if needed
|
|
20451
|
-
}
|
|
20452
|
-
|
|
20453
|
-
/**
|
|
20454
|
-
* Load theme from config file (asynchronous)
|
|
20455
|
-
* @param configPath - Path to config file (default: atomix.config.ts)
|
|
20456
|
-
* @returns Promise resolving to DesignTokens from theme configuration
|
|
20457
|
-
*/ async function loadThemeFromConfig(options) {
|
|
20458
|
-
// Check if we're in a browser environment
|
|
20459
|
-
if ("undefined" != typeof window) throw new Error("loadThemeFromConfig: Not available in browser environment. Config loading requires Node.js/SSR environment.");
|
|
20460
|
-
// Use static import with runtime check
|
|
20461
|
-
// The function will handle browser environment checks internally
|
|
20462
|
-
let config;
|
|
20463
|
-
try {
|
|
20464
|
-
// loadAtomixConfig is synchronous, not async
|
|
20465
|
-
config = loadAtomixConfig({
|
|
20466
|
-
configPath: options?.configPath || "atomix.config.ts",
|
|
20467
|
-
required: !1 !== options?.required
|
|
20468
|
-
});
|
|
20469
|
-
} catch (error) {
|
|
20470
|
-
if (!1 !== options?.required) throw new Error("Config loader module not available");
|
|
20471
|
-
// Return empty tokens if config is not required
|
|
20472
|
-
return createTokens({});
|
|
20473
|
-
}
|
|
20474
|
-
if (!config?.theme) return createTokens({});
|
|
20475
|
-
// Extract tokens from config.theme structure
|
|
20476
|
-
// config.theme can have: { extend?: ThemeTokens, tokens?: ThemeTokens, themes?: ... }
|
|
20477
|
-
// We need to extract the actual DesignTokens (flat structure)
|
|
20478
|
-
const themeConfig = config.theme;
|
|
20479
|
-
// Check if theme is directly a flat object (DesignTokens format)
|
|
20480
|
-
// This handles the case where config.theme might be passed as DesignTokens directly
|
|
20481
|
-
return createTokens(!themeConfig || "object" != typeof themeConfig || "extend" in themeConfig || "tokens" in themeConfig || "themes" in themeConfig ? {} : themeConfig);
|
|
20482
|
-
// If theme has nested structure (extend/tokens/themes), we can't directly use it
|
|
20483
|
-
// Return empty tokens - the theme system will use defaults
|
|
20484
|
-
// TODO: Add proper conversion from ThemeTokens to DesignTokens if needed
|
|
20485
|
-
}
|
|
20486
|
-
|
|
20487
20279
|
/**
|
|
20488
20280
|
* Theme Context
|
|
20489
20281
|
*
|
|
@@ -20525,21 +20317,9 @@ const ThemeProvider = ({children: children, defaultTheme: defaultTheme, themes:
|
|
|
20525
20317
|
if (stored) return stored;
|
|
20526
20318
|
}
|
|
20527
20319
|
// If defaultTheme is provided, use it
|
|
20528
|
-
|
|
20529
|
-
// Try to load from atomix.config.ts as fallback, but only in Node.js/SSR environments
|
|
20530
|
-
if ("undefined" == typeof window) try {
|
|
20531
|
-
// Dynamically import the config loader to avoid bundling issues in browser
|
|
20532
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20533
|
-
const {loadThemeFromConfigSync: loadThemeFromConfigSync} = require("../config/configLoader"), configTokens = loadThemeFromConfigSync();
|
|
20534
|
-
if (configTokens && Object.keys(configTokens).length > 0)
|
|
20535
|
-
// For simplicity, we'll treat config tokens as a special theme name
|
|
20536
|
-
return "config-theme";
|
|
20537
|
-
} catch (error) {
|
|
20538
|
-
// Failed to load theme from config, using default
|
|
20539
|
-
}
|
|
20320
|
+
return null != defaultTheme ? defaultTheme : "default";
|
|
20540
20321
|
// Default fallback
|
|
20541
|
-
|
|
20542
|
-
}), [ defaultTheme, enablePersistence, storageKey ]), [currentTheme, setCurrentTheme] = useState((() => "string" == typeof initialDefaultTheme ? initialDefaultTheme : "tokens-theme")), [activeTokens, setActiveTokens] = useState((() =>
|
|
20322
|
+
}), [ defaultTheme, enablePersistence, storageKey ]), [currentTheme, setCurrentTheme] = useState((() => "string" == typeof initialDefaultTheme ? initialDefaultTheme : "tokens-theme")), [activeTokens, setActiveTokens] = useState((() =>
|
|
20543
20323
|
// If defaultTheme is DesignTokens, store them
|
|
20544
20324
|
defaultTheme && "string" != typeof defaultTheme ? createTokens(defaultTheme) : null)), [isLoading, setIsLoading] = useState(!1), [error, setError] = useState(null), loadedThemesRef = useRef(new Set), themePromisesRef = useRef({}), abortControllerRef = useRef(null);
|
|
20545
20325
|
// Handle initial DesignTokens defaultTheme
|
|
@@ -23530,6 +23310,7 @@ class RTLManager {
|
|
|
23530
23310
|
// Core Theme Functions
|
|
23531
23311
|
// ============================================================================
|
|
23532
23312
|
// Create theme CSS from DesignTokens
|
|
23313
|
+
// File saving utilities removed to prevent bundling Node.js modules in browser
|
|
23533
23314
|
/**
|
|
23534
23315
|
* Inject theme CSS into DOM
|
|
23535
23316
|
*/ function injectTheme(css, id = "atomix-theme") {
|
|
@@ -23542,30 +23323,6 @@ class RTLManager {
|
|
|
23542
23323
|
removeCSS(id);
|
|
23543
23324
|
}
|
|
23544
23325
|
|
|
23545
|
-
/**
|
|
23546
|
-
* Save theme to CSS file
|
|
23547
|
-
*/ async function saveTheme(css, filePath) {
|
|
23548
|
-
await async function(css, filePath) {
|
|
23549
|
-
// Check if in browser environment
|
|
23550
|
-
if ("undefined" != typeof window) throw new Error("saveCSSFile can only be used in Node.js environment. Use injectCSS() for browser environments.");
|
|
23551
|
-
// Dynamic import to avoid bundling Node.js modules in browser builds
|
|
23552
|
-
const fs = await import("fs/promises"), dir = (await import("path")).dirname(filePath);
|
|
23553
|
-
await fs.mkdir(dir, {
|
|
23554
|
-
recursive: !0
|
|
23555
|
-
}),
|
|
23556
|
-
// Write file
|
|
23557
|
-
await fs.writeFile(filePath, css, "utf8");
|
|
23558
|
-
}
|
|
23559
|
-
/**
|
|
23560
|
-
* Theme System Constants
|
|
23561
|
-
*
|
|
23562
|
-
* Centralized constants for the theme system to avoid magic numbers and strings.
|
|
23563
|
-
*/
|
|
23564
|
-
/**
|
|
23565
|
-
* Default storage key for theme persistence
|
|
23566
|
-
*/ (css, filePath);
|
|
23567
|
-
}
|
|
23568
|
-
|
|
23569
23326
|
const themeImport = Object.freeze( Object.defineProperty({
|
|
23570
23327
|
__proto__: null,
|
|
23571
23328
|
RTLManager: RTLManager,
|
|
@@ -23610,8 +23367,6 @@ const themeImport = Object.freeze( Object.defineProperty({
|
|
|
23610
23367
|
isCSSInjected: isCSSInjected,
|
|
23611
23368
|
isDesignTokens: isDesignTokens,
|
|
23612
23369
|
isValidCSSVariableName: isValidCSSVariableName,
|
|
23613
|
-
loadThemeFromConfig: loadThemeFromConfig,
|
|
23614
|
-
loadThemeFromConfigSync: loadThemeFromConfigSync,
|
|
23615
23370
|
mapSCSSTokensToCSSVars: mapSCSSTokensToCSSVars,
|
|
23616
23371
|
mergeCSSVars: mergeCSSVars,
|
|
23617
23372
|
mergeTheme: mergeTheme,
|
|
@@ -23620,7 +23375,6 @@ const themeImport = Object.freeze( Object.defineProperty({
|
|
|
23620
23375
|
removeCSS: removeCSS,
|
|
23621
23376
|
removeCSSVariables: removeCSSVariables,
|
|
23622
23377
|
removeTheme: removeTheme,
|
|
23623
|
-
saveTheme: saveTheme,
|
|
23624
23378
|
themePropertyToCSSVar: themePropertyToCSSVar,
|
|
23625
23379
|
unregisterTheme: unregisterTheme,
|
|
23626
23380
|
useComponentTheme: useComponentTheme,
|
|
@@ -24247,5 +24001,5 @@ const atomix = {
|
|
|
24247
24001
|
types: types
|
|
24248
24002
|
};
|
|
24249
24003
|
|
|
24250
|
-
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, createDarkVariant, createDebugAttrs, createFontPreloadLink, createPartProps, createSlotComponent, createSlotProps, createTheme, createThemeRegistry, createTokens, cssVarsToStyle, deepMerge, atomix as default, defaultTokens, defineConfig, designTokensToCSSVars, exportTheme, extendTheme, extractComponentName, extractYouTubeId, generateCSSVariableName, generateCSSVariables$1 as generateCSSVariables, generateCSSVariablesForSelector, generateClassName, generateComponentCSSVars, generateFontPreloadTags, generateUUID, getAllThemes, getCSSVariable, getComponentCSSVars, getComponentThemeValue, getPartStyles, getTheme, getThemeApplicator, getThemeCount, getThemeIds, getThemeMetadata, hasCustomization, hasTheme, importTheme, injectCSS$1 as injectCSS, injectTheme, isCSSInjected, isDesignTokens, isSlot, isValidCSSVariableName, isYouTubeUrl,
|
|
24004
|
+
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, createDarkVariant, createDebugAttrs, createFontPreloadLink, createPartProps, createSlotComponent, createSlotProps, createTheme, createThemeRegistry, createTokens, cssVarsToStyle, deepMerge, atomix as default, defaultTokens, defineConfig, designTokensToCSSVars, exportTheme, extendTheme, extractComponentName, extractYouTubeId, generateCSSVariableName, generateCSSVariables$1 as generateCSSVariables, generateCSSVariablesForSelector, generateClassName, generateComponentCSSVars, generateFontPreloadTags, generateUUID, getAllThemes, getCSSVariable, getComponentCSSVars, getComponentThemeValue, getPartStyles, getTheme, getThemeApplicator, getThemeCount, getThemeIds, getThemeMetadata, hasCustomization, hasTheme, importTheme, injectCSS$1 as injectCSS, injectTheme, isCSSInjected, isDesignTokens, isSlot, isValidCSSVariableName, isYouTubeUrl, mapSCSSTokensToCSSVars, mergeCSSVars, mergeClassNames, mergeComponentProps, mergePartStyles, mergeSlots, mergeTheme, normalizeThemeTokens, preloadFonts, quickTheme, registerTheme, removeCSS, removeCSSVariables, removeTheme, renderSlot, sliderConstants, supportsDarkMode, theme, themePropertyToCSSVar, themeToCSS, 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$1 as useModal, useNav, useNavDropdown, useNavItem, useNavbar, usePagination, usePieChart, useRadio, useRiver, useSelect, useSideMenu, useSideMenuItem, useSlider, useSlot, useSpinner, useTextarea, useTheme, useThemeTokens, useTodo, utils, validateTheme };
|
|
24251
24005
|
//# sourceMappingURL=index.esm.js.map
|