@shohojdhara/atomix 0.3.15 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-tools/index.d.ts +31 -30
- package/build-tools/package.json +4 -21
- package/dist/atomix.css +20234 -2027
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +76 -2
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/index.d.ts +31 -30
- package/dist/build-tools/package.json +4 -21
- package/dist/charts.js +4 -5
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +87 -10
- package/dist/core.js +673 -480
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +15 -3
- package/dist/forms.js +530 -97
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +5 -6
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +644 -277
- package/dist/index.esm.js +1948 -1347
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3333 -2728
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js.map +1 -1
- package/dist/theme.d.ts +9 -9
- package/dist/theme.js.map +1 -1
- package/package.json +2 -2
- package/scripts/atomix-cli.js +10 -1
- package/scripts/cli/__tests__/utils.test.js +6 -2
- package/scripts/cli/migration-tools.js +2 -2
- package/scripts/cli/theme-bridge.js +7 -9
- package/scripts/cli/utils.js +2 -1
- package/src/components/Accordion/Accordion.stories.tsx +72 -23
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +219 -96
- package/src/components/Accordion/AccordionCompound.test.tsx +70 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/glass-utils.ts +4 -3
- package/src/components/AtomixGlass/shader-utils.ts +128 -52
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +45 -62
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +20 -9
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +14 -4
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +9 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +173 -65
- package/src/components/Breadcrumb/BreadcrumbCompound.test.tsx +84 -0
- package/src/components/Button/Button.stories.tsx +13 -22
- package/src/components/Button/Button.test.tsx +97 -81
- package/src/components/Button/Button.tsx +46 -14
- package/src/components/Button/ButtonGroup.stories.tsx +37 -32
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +166 -918
- package/src/components/Callout/Callout.tsx +196 -84
- package/src/components/Callout/CalloutCompound.test.tsx +72 -0
- package/src/components/Card/Card.stories.tsx +67 -36
- package/src/components/Card/Card.tsx +30 -14
- package/src/components/Chart/AreaChart.tsx +1 -1
- package/src/components/Chart/CandlestickChart.tsx +23 -16
- package/src/components/Chart/Chart.stories.tsx +4 -9
- package/src/components/Chart/Chart.tsx +40 -44
- package/src/components/Chart/ChartRenderer.tsx +39 -12
- package/src/components/Chart/ChartToolbar.tsx +21 -5
- package/src/components/Chart/DonutChart.tsx +1 -1
- package/src/components/Chart/FunnelChart.tsx +4 -1
- package/src/components/Chart/GaugeChart.tsx +3 -1
- package/src/components/Chart/HeatmapChart.tsx +50 -37
- package/src/components/Chart/LineChart.tsx +3 -2
- package/src/components/Chart/MultiAxisChart.tsx +24 -16
- package/src/components/Chart/RadarChart.tsx +19 -17
- package/src/components/Chart/ScatterChart.tsx +29 -21
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -2
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +7 -7
- package/src/components/DataTable/DataTable.stories.tsx +43 -38
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +32 -47
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +425 -298
- package/src/components/Dropdown/DropdownCompound.test.tsx +64 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
- package/src/components/EdgePanel/EdgePanel.tsx +163 -113
- package/src/components/EdgePanel/EdgePanelCompound.test.tsx +53 -0
- package/src/components/Footer/Footer.stories.tsx +21 -16
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.test.tsx +49 -49
- package/src/components/Form/Checkbox.tsx +108 -100
- package/src/components/Form/Form.stories.tsx +2 -10
- package/src/components/Form/Input.stories.tsx +22 -39
- package/src/components/Form/Input.test.tsx +38 -44
- package/src/components/Form/Radio.stories.tsx +6 -12
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.stories.tsx +23 -0
- package/src/components/Form/Select.test.tsx +99 -0
- package/src/components/Form/Select.tsx +239 -186
- package/src/components/Form/SelectOption.tsx +88 -0
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +93 -23
- package/src/components/Hero/Hero.test.tsx +142 -0
- package/src/components/Hero/Hero.tsx +343 -58
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.test.tsx +62 -0
- package/src/components/List/List.tsx +32 -25
- package/src/components/List/ListItem.tsx +20 -0
- package/src/components/Modal/Modal.stories.tsx +67 -2
- package/src/components/Modal/Modal.tsx +208 -125
- package/src/components/Modal/ModalCompound.test.tsx +94 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
- package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
- package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
- package/src/components/Pagination/Pagination.stories.tsx +7 -4
- package/src/components/Pagination/Pagination.tsx +199 -202
- package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
- package/src/components/Popover/Popover.stories.tsx +99 -192
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +35 -44
- package/src/components/River/River.stories.tsx +2 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +71 -71
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +3 -1
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +8 -6
- package/src/components/Steps/Steps.tsx +124 -21
- package/src/components/Steps/StepsCompound.test.tsx +81 -0
- package/src/components/Tabs/Tabs.stories.tsx +12 -9
- package/src/components/Tabs/Tabs.tsx +230 -75
- package/src/components/Tabs/TabsCompound.test.tsx +64 -0
- package/src/components/Toggle/Toggle.stories.tsx +27 -13
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +24 -20
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +129 -127
- package/src/components/Upload/Upload.tsx +287 -283
- package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
- package/src/components/index.ts +13 -2
- package/src/layouts/Grid/Grid.stories.tsx +9 -3
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
- package/src/lib/__tests__/theme-tools.test.ts +32 -6
- package/src/lib/composables/index.ts +0 -4
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +102 -60
- package/src/lib/composables/useChartExport.ts +1 -1
- package/src/lib/composables/useDataTable.ts +29 -17
- package/src/lib/composables/useHero.ts +58 -14
- package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
- package/src/lib/composables/useInput.ts +10 -8
- package/src/lib/composables/useSideMenu.ts +6 -5
- package/src/lib/composables/useTooltip.ts +1 -2
- package/src/lib/composables/useVideoPlayer.ts +44 -35
- package/src/lib/config/index.ts +154 -154
- package/src/lib/constants/cssVariables.ts +29 -29
- package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
- package/src/lib/hooks/index.ts +1 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -17
- package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
- package/src/lib/patterns/__tests__/slots.test.ts +1 -1
- package/src/lib/patterns/index.ts +1 -1
- package/src/lib/patterns/slots.tsx +8 -13
- package/src/lib/storybook/InteractiveDemo.tsx +13 -18
- package/src/lib/storybook/PreviewContainer.tsx +1 -1
- package/src/lib/storybook/VariantsGrid.tsx +3 -7
- package/src/lib/storybook/index.ts +1 -1
- package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
- package/src/lib/theme/adapters/index.ts +3 -9
- package/src/lib/theme/adapters/themeAdapter.ts +41 -26
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +10 -5
- package/src/lib/theme/constants/constants.ts +2 -2
- package/src/lib/theme/constants/index.ts +1 -2
- package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
- package/src/lib/theme/core/composeTheme.ts +32 -26
- package/src/lib/theme/core/createTheme.ts +1 -1
- package/src/lib/theme/core/createThemeObject.ts +308 -301
- package/src/lib/theme/core/index.ts +3 -3
- package/src/lib/theme/devtools/CLI.ts +105 -111
- package/src/lib/theme/devtools/Comparator.tsx +50 -32
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
- package/src/lib/theme/devtools/Inspector.tsx +75 -60
- package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
- package/src/lib/theme/devtools/Preview.tsx +150 -106
- package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
- package/src/lib/theme/devtools/index.ts +3 -9
- package/src/lib/theme/devtools/useHistory.ts +23 -21
- package/src/lib/theme/errors/errors.ts +12 -11
- package/src/lib/theme/errors/index.ts +2 -7
- package/src/lib/theme/generators/generateCSS.ts +9 -13
- package/src/lib/theme/generators/generateCSSNested.ts +1 -6
- package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/i18n/index.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +13 -13
- package/src/lib/theme/index.ts +7 -16
- package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
- package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
- package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
- package/src/lib/theme/runtime/index.ts +2 -5
- package/src/lib/theme/runtime/useTheme.ts +18 -18
- package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
- package/src/lib/theme/test/testTheme.ts +15 -16
- package/src/lib/theme/tokens/index.ts +2 -7
- package/src/lib/theme/tokens/tokens.ts +25 -24
- package/src/lib/theme/types.ts +428 -411
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
- package/src/lib/theme/utils/componentTheming.ts +18 -18
- package/src/lib/theme/utils/domUtils.ts +277 -289
- package/src/lib/theme/utils/index.ts +1 -2
- package/src/lib/theme/utils/injectCSS.ts +10 -14
- package/src/lib/theme/utils/naming.ts +20 -16
- package/src/lib/theme/utils/themeHelpers.ts +10 -12
- package/src/lib/theme/utils/themeUtils.ts +85 -86
- package/src/lib/theme/utils/themeValidation.ts +82 -33
- package/src/lib/theme-tools.ts +8 -6
- package/src/lib/types/components.ts +180 -73
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/componentUtils.test.ts +57 -2
- package/src/lib/utils/__tests__/csv.test.ts +1 -1
- package/src/lib/utils/__tests__/themeNaming.test.ts +117 -0
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +3 -1
- package/src/lib/utils/dataTableExport.ts +1 -5
- package/src/lib/utils/fontPreloader.ts +10 -19
- package/src/lib/utils/icons.ts +4 -1
- package/src/lib/utils/index.ts +2 -6
- package/src/lib/utils/memoryMonitor.ts +10 -8
- package/src/lib/utils/themeNaming.ts +3 -3
- package/src/styles/01-settings/_index.scss +0 -1
- package/src/styles/01-settings/_settings.colors.scss +8 -8
- package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/01-settings/_settings.spacing.scss +3 -4
- package/src/styles/01-settings/_settings.tooltip.scss +1 -1
- package/src/styles/01-settings/_settings.typography.scss +1 -1
- package/src/styles/02-tools/_tools.breakpoints.scss +1 -1
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +36 -24
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.atomix-glass.scss +13 -9
- package/src/styles/06-components/_components.button.scss +16 -4
- package/src/styles/06-components/_components.callout.scss +27 -21
- package/src/styles/06-components/_components.card.scss +5 -14
- package/src/styles/06-components/_components.chart.scss +22 -19
- package/src/styles/06-components/_components.checkbox.scss +3 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
- package/src/styles/06-components/_components.edge-panel.scss +9 -2
- package/src/styles/06-components/_components.footer.scss +1 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -5
- package/src/styles/06-components/_components.toggle.scss +18 -0
- package/src/styles/06-components/_index.scss +1 -1
- package/src/styles/06-components/old.chart.styles.scss +0 -2
- package/src/styles/99-utilities/_utilities.border.scss +69 -27
- package/src/styles/99-utilities/_utilities.display.scss +1 -1
- package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
- package/src/styles/99-utilities/_utilities.position.scss +16 -9
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
- package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
- package/src/styles/99-utilities/_utilities.text-gradient.scss +30 -30
- package/src/styles/99-utilities/_utilities.text.scss +67 -47
package/dist/index.esm.js
CHANGED
|
@@ -8,9 +8,379 @@ import { Pause, Play, SkipBack, SkipForward, SpeakerX, SpeakerHigh, Gear, Downlo
|
|
|
8
8
|
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
|
|
12
|
+
|
|
13
|
+
function getDefaultExportFromCjs(x) {
|
|
14
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var fails$9 = function(exec) {
|
|
18
|
+
try {
|
|
19
|
+
return !!exec();
|
|
20
|
+
} catch (error) {
|
|
21
|
+
return !0;
|
|
22
|
+
}
|
|
23
|
+
}, functionBindNative = !fails$9((function() {
|
|
24
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
25
|
+
var test = function() {/* empty */}.bind();
|
|
26
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
27
|
+
return "function" != typeof test || test.hasOwnProperty("prototype");
|
|
28
|
+
})), NATIVE_BIND$3 = functionBindNative, FunctionPrototype$1 = Function.prototype, call$5 = FunctionPrototype$1.call, uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$1.bind.bind(call$5, call$5), functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function(fn) {
|
|
29
|
+
return function() {
|
|
30
|
+
return call$5.apply(fn, arguments);
|
|
31
|
+
};
|
|
32
|
+
}, objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf), check = function(it) {
|
|
33
|
+
return it && it.Math === Math && it;
|
|
34
|
+
}, globalThis_1 =
|
|
35
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
36
|
+
check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) ||
|
|
37
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
38
|
+
check("object" == typeof self && self) || check("object" == typeof commonjsGlobal && commonjsGlobal) || check("object" == typeof commonjsGlobal && commonjsGlobal) ||
|
|
39
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
40
|
+
function() {
|
|
41
|
+
return this;
|
|
42
|
+
}() || Function("return this")(), NATIVE_BIND$2 = functionBindNative, FunctionPrototype = Function.prototype, apply$1 = FunctionPrototype.apply, call$4 = FunctionPrototype.call, functionApply = "object" == typeof Reflect && Reflect.apply || (NATIVE_BIND$2 ? call$4.bind(apply$1) : function() {
|
|
43
|
+
return call$4.apply(apply$1, arguments);
|
|
44
|
+
}), uncurryThis$7 = functionUncurryThis, toString$3 = uncurryThis$7({}.toString), stringSlice = uncurryThis$7("".slice), classofRaw$2 = function(it) {
|
|
45
|
+
return stringSlice(toString$3(it), 8, -1);
|
|
46
|
+
}, classofRaw$1 = classofRaw$2, uncurryThis$6 = functionUncurryThis, functionUncurryThisClause = function(fn) {
|
|
47
|
+
// Nashorn bug:
|
|
48
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
49
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
50
|
+
if ("Function" === classofRaw$1(fn)) return uncurryThis$6(fn);
|
|
51
|
+
}, documentAll = "object" == typeof document && document.all, isCallable$8 = void 0 === documentAll && void 0 !== documentAll ? function(argument) {
|
|
52
|
+
return "function" == typeof argument || argument === documentAll;
|
|
53
|
+
} : function(argument) {
|
|
54
|
+
return "function" == typeof argument;
|
|
55
|
+
}, objectGetOwnPropertyDescriptor = {}, descriptors = !fails$9((function() {
|
|
56
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
57
|
+
return 7 !== Object.defineProperty({}, 1, {
|
|
58
|
+
get: function() {
|
|
59
|
+
return 7;
|
|
60
|
+
}
|
|
61
|
+
})[1];
|
|
62
|
+
})), NATIVE_BIND$1 = functionBindNative, call$3 = Function.prototype.call, functionCall = NATIVE_BIND$1 ? call$3.bind(call$3) : function() {
|
|
63
|
+
return call$3.apply(call$3, arguments);
|
|
64
|
+
}, objectPropertyIsEnumerable = {}, $propertyIsEnumerable = {}.propertyIsEnumerable, getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({
|
|
65
|
+
1: 2
|
|
66
|
+
}, 1);
|
|
67
|
+
|
|
68
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
69
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
70
|
+
objectPropertyIsEnumerable.f = NASHORN_BUG ? function(V) {
|
|
71
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
72
|
+
return !!descriptor && descriptor.enumerable;
|
|
73
|
+
} : $propertyIsEnumerable;
|
|
74
|
+
|
|
75
|
+
var match, version, createPropertyDescriptor$2 = function(bitmap, value) {
|
|
76
|
+
return {
|
|
77
|
+
enumerable: !(1 & bitmap),
|
|
78
|
+
configurable: !(2 & bitmap),
|
|
79
|
+
writable: !(4 & bitmap),
|
|
80
|
+
value: value
|
|
81
|
+
};
|
|
82
|
+
}, fails$6 = fails$9, classof$4 = classofRaw$2, $Object$3 = Object, split = functionUncurryThis("".split), indexedObject = fails$6((function() {
|
|
83
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
84
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
85
|
+
return !$Object$3("z").propertyIsEnumerable(0);
|
|
86
|
+
})) ? function(it) {
|
|
87
|
+
return "String" === classof$4(it) ? split(it, "") : $Object$3(it);
|
|
88
|
+
} : $Object$3, isNullOrUndefined$2 = function(it) {
|
|
89
|
+
return null == it;
|
|
90
|
+
}, isNullOrUndefined$1 = isNullOrUndefined$2, $TypeError$7 = TypeError, requireObjectCoercible$3 = function(it) {
|
|
91
|
+
if (isNullOrUndefined$1(it)) throw new $TypeError$7("Can't call method on " + it);
|
|
92
|
+
return it;
|
|
93
|
+
}, IndexedObject$1 = indexedObject, requireObjectCoercible$2 = requireObjectCoercible$3, toIndexedObject$2 = function(it) {
|
|
94
|
+
return IndexedObject$1(requireObjectCoercible$2(it));
|
|
95
|
+
}, isCallable$7 = isCallable$8, isObject$6 = function(it) {
|
|
96
|
+
return "object" == typeof it ? null !== it : isCallable$7(it);
|
|
97
|
+
}, path$3 = {}, path$2 = path$3, globalThis$b = globalThis_1, isCallable$6 = isCallable$8, aFunction = function(variable) {
|
|
98
|
+
return isCallable$6(variable) ? variable : void 0;
|
|
99
|
+
}, navigator$1 = globalThis_1.navigator, userAgent$2 = navigator$1 && navigator$1.userAgent, environmentUserAgent = userAgent$2 ? String(userAgent$2) : "", globalThis$9 = globalThis_1, userAgent$1 = environmentUserAgent, process$1 = globalThis$9.process, Deno$1 = globalThis$9.Deno, versions = process$1 && process$1.versions || Deno$1 && Deno$1.version, v8 = versions && versions.v8;
|
|
100
|
+
|
|
101
|
+
v8 && (
|
|
102
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
103
|
+
// but their correct versions are not interesting for us
|
|
104
|
+
version = (match = v8.split("."))[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1])),
|
|
105
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
106
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
107
|
+
!version && userAgent$1 && (!(match = userAgent$1.match(/Edge\/(\d+)/)) || match[1] >= 74) && (match = userAgent$1.match(/Chrome\/(\d+)/)) && (version = +match[1]);
|
|
108
|
+
|
|
109
|
+
var environmentV8Version = version, V8_VERSION = environmentV8Version, fails$5 = fails$9, $String$3 = globalThis_1.String, symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5((function() {
|
|
110
|
+
var symbol = Symbol("symbol detection");
|
|
111
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
112
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
113
|
+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
114
|
+
// of course, fail.
|
|
115
|
+
return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
116
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
117
|
+
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
118
|
+
})), useSymbolAsUid = symbolConstructorDetection && !Symbol.sham && "symbol" == typeof Symbol.iterator, isCallable$5 = isCallable$8, isPrototypeOf$2 = objectIsPrototypeOf, $Object$2 = Object, isSymbol$2 = useSymbolAsUid ? function(it) {
|
|
119
|
+
return "symbol" == typeof it;
|
|
120
|
+
} : function(it) {
|
|
121
|
+
var $Symbol = function(namespace, method) {
|
|
122
|
+
return arguments.length < 2 ? aFunction(path$2[namespace]) || aFunction(globalThis$b[namespace]) : path$2[namespace] && path$2[namespace][method] || globalThis$b[namespace] && globalThis$b[namespace][method];
|
|
123
|
+
}("Symbol");
|
|
124
|
+
return isCallable$5($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
|
|
125
|
+
}, $String$2 = String, isCallable$4 = isCallable$8, $TypeError$6 = TypeError, aCallable$3 = function(argument) {
|
|
126
|
+
if (isCallable$4(argument)) return argument;
|
|
127
|
+
throw new $TypeError$6(function(argument) {
|
|
128
|
+
try {
|
|
129
|
+
return $String$2(argument);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
return "Object";
|
|
132
|
+
}
|
|
133
|
+
}(argument) + " is not a function");
|
|
134
|
+
}, aCallable$2 = aCallable$3, isNullOrUndefined = isNullOrUndefined$2, call$2 = functionCall, isCallable$3 = isCallable$8, isObject$5 = isObject$6, $TypeError$5 = TypeError, sharedStore = {
|
|
135
|
+
exports: {}
|
|
136
|
+
}, globalThis$7 = globalThis_1, defineProperty = Object.defineProperty, globalThis$6 = globalThis_1, store$1 = sharedStore.exports = globalThis$6["__core-js_shared__"] || function(key, value) {
|
|
137
|
+
try {
|
|
138
|
+
defineProperty(globalThis$7, key, {
|
|
139
|
+
value: value,
|
|
140
|
+
configurable: !0,
|
|
141
|
+
writable: !0
|
|
142
|
+
});
|
|
143
|
+
} catch (error) {
|
|
144
|
+
globalThis$7[key] = value;
|
|
145
|
+
}
|
|
146
|
+
return value;
|
|
147
|
+
}("__core-js_shared__", {});
|
|
148
|
+
|
|
149
|
+
/* eslint-disable es/no-symbol -- required for testing */ (store$1.versions || (store$1.versions = [])).push({
|
|
150
|
+
version: "3.43.0",
|
|
151
|
+
mode: "pure",
|
|
152
|
+
copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru)",
|
|
153
|
+
license: "https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",
|
|
154
|
+
source: "https://github.com/zloirock/core-js"
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
var key, value, store = sharedStore.exports, requireObjectCoercible$1 = requireObjectCoercible$3, $Object$1 = Object, toObject$2 = function(argument) {
|
|
158
|
+
return $Object$1(requireObjectCoercible$1(argument));
|
|
159
|
+
}, toObject$1 = toObject$2, hasOwnProperty = functionUncurryThis({}.hasOwnProperty), hasOwnProperty_1 = Object.hasOwn || function(it, key) {
|
|
160
|
+
return hasOwnProperty(toObject$1(it), key);
|
|
161
|
+
}, uncurryThis$3 = functionUncurryThis, id = 0, postfix = Math.random(), toString$2 = uncurryThis$3(1.1.toString), hasOwn$2 = hasOwnProperty_1, NATIVE_SYMBOL = symbolConstructorDetection, USE_SYMBOL_AS_UID = useSymbolAsUid, Symbol$1 = globalThis_1.Symbol, WellKnownSymbolsStore = store[key = "wks"] || (store[key] = value || {}), createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1.for || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || function(key) {
|
|
162
|
+
return "Symbol(" + (void 0 === key ? "" : key) + ")_" + toString$2(++id + postfix, 36);
|
|
163
|
+
}, wellKnownSymbol$5 = function(name) {
|
|
164
|
+
return hasOwn$2(WellKnownSymbolsStore, name) || (WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$2(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol("Symbol." + name)),
|
|
165
|
+
WellKnownSymbolsStore[name];
|
|
166
|
+
}, call$1 = functionCall, isObject$4 = isObject$6, isSymbol$1 = isSymbol$2, $TypeError$4 = TypeError, TO_PRIMITIVE = wellKnownSymbol$5("toPrimitive"), toPrimitive = function(input, pref) {
|
|
167
|
+
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
168
|
+
var result, func, exoticToPrim = (func = input[TO_PRIMITIVE], isNullOrUndefined(func) ? void 0 : aCallable$2(func));
|
|
169
|
+
if (exoticToPrim) {
|
|
170
|
+
if (void 0 === pref && (pref = "default"), result = call$1(exoticToPrim, input, pref),
|
|
171
|
+
!isObject$4(result) || isSymbol$1(result)) return result;
|
|
172
|
+
throw new $TypeError$4("Can't convert object to primitive value");
|
|
173
|
+
}
|
|
174
|
+
return void 0 === pref && (pref = "number"), function(input, pref) {
|
|
175
|
+
var fn, val;
|
|
176
|
+
if ("string" === pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
177
|
+
if (isCallable$3(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
|
|
178
|
+
if ("string" !== pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
179
|
+
throw new $TypeError$5("Can't convert object to primitive value");
|
|
180
|
+
}(input, pref);
|
|
181
|
+
}, isSymbol = isSymbol$2, toPropertyKey$2 = function(argument) {
|
|
182
|
+
var key = toPrimitive(argument, "string");
|
|
183
|
+
return isSymbol(key) ? key : key + "";
|
|
184
|
+
}, isObject$3 = isObject$6, document$1 = globalThis_1.document, EXISTS = isObject$3(document$1) && isObject$3(document$1.createElement), ie8DomDefine = !descriptors && !fails$9((function() {
|
|
185
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
186
|
+
return 7 !== Object.defineProperty((it = "div", EXISTS ? document$1.createElement(it) : {}), "a", {
|
|
187
|
+
get: function() {
|
|
188
|
+
return 7;
|
|
189
|
+
}
|
|
190
|
+
}).a;
|
|
191
|
+
var it;
|
|
192
|
+
})), DESCRIPTORS$3 = descriptors, call = functionCall, propertyIsEnumerableModule = objectPropertyIsEnumerable, createPropertyDescriptor$1 = createPropertyDescriptor$2, toIndexedObject$1 = toIndexedObject$2, toPropertyKey$1 = toPropertyKey$2, hasOwn$1 = hasOwnProperty_1, IE8_DOM_DEFINE$1 = ie8DomDefine, $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
193
|
+
|
|
194
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
195
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
196
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor$1 : function(O, P) {
|
|
197
|
+
if (O = toIndexedObject$1(O), P = toPropertyKey$1(P), IE8_DOM_DEFINE$1) try {
|
|
198
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
199
|
+
} catch (error) {/* empty */}
|
|
200
|
+
if (hasOwn$1(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
var fails$3 = fails$9, isCallable$2 = isCallable$8, replacement = /#|\.prototype\./, isForced$1 = function(feature, detection) {
|
|
204
|
+
var value = data[normalize(feature)];
|
|
205
|
+
return value === POLYFILL || value !== NATIVE && (isCallable$2(detection) ? fails$3(detection) : !!detection);
|
|
206
|
+
}, normalize = isForced$1.normalize = function(string) {
|
|
207
|
+
return String(string).replace(replacement, ".").toLowerCase();
|
|
208
|
+
}, data = isForced$1.data = {}, NATIVE = isForced$1.NATIVE = "N", POLYFILL = isForced$1.POLYFILL = "P", isForced_1 = isForced$1, aCallable$1 = aCallable$3, NATIVE_BIND = functionBindNative, bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind), objectDefineProperty = {}, v8PrototypeDefineBug = descriptors && fails$9((function() {
|
|
209
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
210
|
+
return 42 !== Object.defineProperty((function() {/* empty */}), "prototype", {
|
|
211
|
+
value: 42,
|
|
212
|
+
writable: !1
|
|
213
|
+
}).prototype;
|
|
214
|
+
})), isObject$2 = isObject$6, $String$1 = String, $TypeError$3 = TypeError, DESCRIPTORS$1 = descriptors, IE8_DOM_DEFINE = ie8DomDefine, V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug, anObject = function(argument) {
|
|
215
|
+
if (isObject$2(argument)) return argument;
|
|
216
|
+
throw new $TypeError$3($String$1(argument) + " is not an object");
|
|
217
|
+
}, toPropertyKey = toPropertyKey$2, $TypeError$2 = TypeError, $defineProperty = Object.defineProperty, $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
218
|
+
|
|
219
|
+
// `Object.defineProperty` method
|
|
220
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
221
|
+
objectDefineProperty.f = DESCRIPTORS$1 ? V8_PROTOTYPE_DEFINE_BUG ? function(O, P, Attributes) {
|
|
222
|
+
if (anObject(O), P = toPropertyKey(P), anObject(Attributes), "function" == typeof O && "prototype" === P && "value" in Attributes && "writable" in Attributes && !Attributes.writable) {
|
|
223
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
224
|
+
current && current.writable && (O[P] = Attributes.value, Attributes = {
|
|
225
|
+
configurable: "configurable" in Attributes ? Attributes.configurable : current.configurable,
|
|
226
|
+
enumerable: "enumerable" in Attributes ? Attributes.enumerable : current.enumerable,
|
|
227
|
+
writable: !1
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return $defineProperty(O, P, Attributes);
|
|
231
|
+
} : $defineProperty : function(O, P, Attributes) {
|
|
232
|
+
if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try {
|
|
233
|
+
return $defineProperty(O, P, Attributes);
|
|
234
|
+
} catch (error) {/* empty */}
|
|
235
|
+
if ("get" in Attributes || "set" in Attributes) throw new $TypeError$2("Accessors not supported");
|
|
236
|
+
return "value" in Attributes && (O[P] = Attributes.value), O;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
var definePropertyModule = objectDefineProperty, createPropertyDescriptor = createPropertyDescriptor$2, createNonEnumerableProperty$1 = descriptors ? function(object, key, value) {
|
|
240
|
+
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
|
241
|
+
} : function(object, key, value) {
|
|
242
|
+
return object[key] = value, object;
|
|
243
|
+
}, globalThis$3 = globalThis_1, apply = functionApply, uncurryThis$1 = functionUncurryThisClause, isCallable$1 = isCallable$8, getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f, isForced = isForced_1, path$1 = path$3, bind = function(fn, that) {
|
|
244
|
+
return aCallable$1(fn), void 0 === that ? fn : NATIVE_BIND ? bind$1(fn, that) : function() {
|
|
245
|
+
return fn.apply(that, arguments);
|
|
246
|
+
};
|
|
247
|
+
}, createNonEnumerableProperty = createNonEnumerableProperty$1, hasOwn = hasOwnProperty_1, wrapConstructor = function(NativeConstructor) {
|
|
248
|
+
var Wrapper = function(a, b, c) {
|
|
249
|
+
if (this instanceof Wrapper) {
|
|
250
|
+
switch (arguments.length) {
|
|
251
|
+
case 0:
|
|
252
|
+
return new NativeConstructor;
|
|
253
|
+
|
|
254
|
+
case 1:
|
|
255
|
+
return new NativeConstructor(a);
|
|
256
|
+
|
|
257
|
+
case 2:
|
|
258
|
+
return new NativeConstructor(a, b);
|
|
259
|
+
}
|
|
260
|
+
return new NativeConstructor(a, b, c);
|
|
261
|
+
}
|
|
262
|
+
return apply(NativeConstructor, this, arguments);
|
|
263
|
+
};
|
|
264
|
+
return Wrapper.prototype = NativeConstructor.prototype, Wrapper;
|
|
265
|
+
}, _export = function(options, source) {
|
|
266
|
+
var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE, key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor, TARGET = options.target, GLOBAL = options.global, STATIC = options.stat, PROTO = options.proto, nativeSource = GLOBAL ? globalThis$3 : STATIC ? globalThis$3[TARGET] : globalThis$3[TARGET] && globalThis$3[TARGET].prototype, target = GLOBAL ? path$1 : path$1[TARGET] || createNonEnumerableProperty(path$1, TARGET, {})[TARGET], targetPrototype = target.prototype;
|
|
267
|
+
for (key in source)
|
|
268
|
+
// contains in native
|
|
269
|
+
USE_NATIVE = !(FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced)) && nativeSource && hasOwn(nativeSource, key),
|
|
270
|
+
targetProperty = target[key], USE_NATIVE && (nativeProperty = options.dontCallGetSet ? (descriptor = getOwnPropertyDescriptor(nativeSource, key)) && descriptor.value : nativeSource[key]),
|
|
271
|
+
// export native or implementation
|
|
272
|
+
sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key], (FORCED || PROTO || typeof targetProperty != typeof sourceProperty) && (
|
|
273
|
+
// bind methods to global for calling from export context
|
|
274
|
+
resultProperty = options.bind && USE_NATIVE ? bind(sourceProperty, globalThis$3) : options.wrap && USE_NATIVE ? wrapConstructor(sourceProperty) : PROTO && isCallable$1(sourceProperty) ? uncurryThis$1(sourceProperty) : sourceProperty,
|
|
275
|
+
// add a flag to not completely full polyfills
|
|
276
|
+
(options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) && createNonEnumerableProperty(resultProperty, "sham", !0),
|
|
277
|
+
createNonEnumerableProperty(target, key, resultProperty), PROTO && (hasOwn(path$1, VIRTUAL_PROTOTYPE = TARGET + "Prototype") || createNonEnumerableProperty(path$1, VIRTUAL_PROTOTYPE, {}),
|
|
278
|
+
// export virtual prototype methods
|
|
279
|
+
createNonEnumerableProperty(path$1[VIRTUAL_PROTOTYPE], key, sourceProperty),
|
|
280
|
+
// export real prototype methods
|
|
281
|
+
options.real && targetPrototype && (FORCED || !targetPrototype[key]) && createNonEnumerableProperty(targetPrototype, key, sourceProperty)));
|
|
282
|
+
}, ceil = Math.ceil, floor = Math.floor, trunc = Math.trunc || function(x) {
|
|
283
|
+
var n = +x;
|
|
284
|
+
return (n > 0 ? floor : ceil)(n);
|
|
285
|
+
}, toIntegerOrInfinity$2 = function(argument) {
|
|
286
|
+
var number = +argument;
|
|
287
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
288
|
+
return number != number || 0 === number ? 0 : trunc(number);
|
|
289
|
+
}, toIntegerOrInfinity$1 = toIntegerOrInfinity$2, max = Math.max, min$1 = Math.min, toIntegerOrInfinity = toIntegerOrInfinity$2, min = Math.min, lengthOfArrayLike$2 = function(obj) {
|
|
290
|
+
return argument = obj.length, (len = toIntegerOrInfinity(argument)) > 0 ? min(len, 9007199254740991) : 0;
|
|
291
|
+
var argument, len;
|
|
292
|
+
}, toIndexedObject = toIndexedObject$2, lengthOfArrayLike$1 = lengthOfArrayLike$2, createMethod$1 = function(IS_INCLUDES) {
|
|
293
|
+
return function($this, el, fromIndex) {
|
|
294
|
+
var O = toIndexedObject($this), length = lengthOfArrayLike$1(O);
|
|
295
|
+
if (0 === length) return !IS_INCLUDES && -1;
|
|
296
|
+
var value, index = function(index, length) {
|
|
297
|
+
var integer = toIntegerOrInfinity$1(index);
|
|
298
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
299
|
+
}(fromIndex, length);
|
|
300
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
301
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
302
|
+
if (IS_INCLUDES && el != el) {
|
|
303
|
+
for (;length > index; )
|
|
304
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
305
|
+
if ((value = O[index++]) != value) return !0;
|
|
306
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
307
|
+
} else for (;length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
308
|
+
return !IS_INCLUDES && -1;
|
|
309
|
+
};
|
|
310
|
+
}, $includes = [ createMethod$1(!0), createMethod$1(!1) ][0];
|
|
311
|
+
|
|
312
|
+
// `Array.prototype.includes` method
|
|
313
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
314
|
+
_export({
|
|
315
|
+
target: "Array",
|
|
316
|
+
proto: !0,
|
|
317
|
+
forced: fails$9((function() {
|
|
318
|
+
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
319
|
+
return !Array(1).includes();
|
|
320
|
+
}))
|
|
321
|
+
}, {
|
|
322
|
+
includes: function(el /* , fromIndex = 0 */) {
|
|
323
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
var globalThis$2 = globalThis_1, path = path$3, getBuiltInPrototypeMethod$3 = function(CONSTRUCTOR, METHOD) {
|
|
328
|
+
var Namespace = path[CONSTRUCTOR + "Prototype"], pureMethod = Namespace && Namespace[METHOD];
|
|
329
|
+
if (pureMethod) return pureMethod;
|
|
330
|
+
var NativeConstructor = globalThis$2[CONSTRUCTOR], NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
|
331
|
+
return NativePrototype && NativePrototype[METHOD];
|
|
332
|
+
}, includes$4 = getBuiltInPrototypeMethod$3("Array", "includes"), isObject$1 = isObject$6, classof$3 = classofRaw$2, MATCH$1 = wellKnownSymbol$5("match"), $TypeError$1 = TypeError, test = {};
|
|
333
|
+
|
|
334
|
+
test[wellKnownSymbol$5("toStringTag")] = "z";
|
|
335
|
+
|
|
336
|
+
var TO_STRING_TAG_SUPPORT = "[object z]" === String(test), isCallable = isCallable$8, classofRaw = classofRaw$2, TO_STRING_TAG = wellKnownSymbol$5("toStringTag"), $Object = Object, CORRECT_ARGUMENTS = "Arguments" === classofRaw(function() {
|
|
337
|
+
return arguments;
|
|
338
|
+
}()), classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
|
|
339
|
+
var O, tag, result;
|
|
340
|
+
return void 0 === it ? "Undefined" : null === it ? "Null" : "string" == typeof (tag = function(it, key) {
|
|
341
|
+
try {
|
|
342
|
+
return it[key];
|
|
343
|
+
} catch (error) {/* empty */}
|
|
344
|
+
}(O = $Object(it), TO_STRING_TAG)) ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : "Object" === (result = classofRaw(O)) && isCallable(O.callee) ? "Arguments" : result;
|
|
345
|
+
}, $String = String, MATCH = wellKnownSymbol$5("match"), $$1 = _export, notARegExp = function(it) {
|
|
346
|
+
if (function(it) {
|
|
347
|
+
var isRegExp;
|
|
348
|
+
return isObject$1(it) && (void 0 !== (isRegExp = it[MATCH$1]) ? !!isRegExp : "RegExp" === classof$3(it));
|
|
349
|
+
}(it)) throw new $TypeError$1("The method doesn't accept regular expressions");
|
|
350
|
+
return it;
|
|
351
|
+
}, requireObjectCoercible = requireObjectCoercible$3, toString = function(argument) {
|
|
352
|
+
if ("Symbol" === classof$1(argument)) throw new TypeError("Cannot convert a Symbol value to a string");
|
|
353
|
+
return $String(argument);
|
|
354
|
+
}, stringIndexOf = functionUncurryThis("".indexOf);
|
|
355
|
+
|
|
356
|
+
// `String.prototype.includes` method
|
|
357
|
+
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
358
|
+
$$1({
|
|
359
|
+
target: "String",
|
|
360
|
+
proto: !0,
|
|
361
|
+
forced: !function(METHOD_NAME) {
|
|
362
|
+
var regexp = /./;
|
|
363
|
+
try {
|
|
364
|
+
"/./"[METHOD_NAME](regexp);
|
|
365
|
+
} catch (error1) {
|
|
366
|
+
try {
|
|
367
|
+
return regexp[MATCH] = !1, "/./"[METHOD_NAME](regexp);
|
|
368
|
+
} catch (error2) {/* empty */}
|
|
369
|
+
}
|
|
370
|
+
return !1;
|
|
371
|
+
}("includes")
|
|
372
|
+
}, {
|
|
373
|
+
includes: function(searchString /* , position = 0 */) {
|
|
374
|
+
return !!~stringIndexOf(toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : void 0);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
var includes$3 = getBuiltInPrototypeMethod$3("String", "includes"), isPrototypeOf$1 = objectIsPrototypeOf, arrayMethod = includes$4, stringMethod = includes$3, ArrayPrototype$1 = Array.prototype, StringPrototype = String.prototype;
|
|
379
|
+
|
|
380
|
+
const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
|
|
381
|
+
var own = it.includes;
|
|
382
|
+
return it === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.includes ? arrayMethod : "string" == typeof it || it === StringPrototype || isPrototypeOf$1(StringPrototype, it) && own === StringPrototype.includes ? stringMethod : own;
|
|
383
|
+
})), THEME_COLORS = [ "primary", "secondary", "success", "info", "warning", "error", "light", "dark" ], SIZES = [ "sm", "md", "lg" ], CLASS_PREFIX = {
|
|
14
384
|
COMPONENT: "c-",
|
|
15
385
|
UTILITY: "u-",
|
|
16
386
|
LAYOUT: "l-",
|
|
@@ -1523,7 +1893,7 @@ import { createPortal } from "react-dom";
|
|
|
1523
1893
|
};
|
|
1524
1894
|
|
|
1525
1895
|
/**
|
|
1526
|
-
* Default
|
|
1896
|
+
* Default theme colors for components
|
|
1527
1897
|
*/
|
|
1528
1898
|
/**
|
|
1529
1899
|
* Accordion functionality hook
|
|
@@ -2170,7 +2540,7 @@ class {
|
|
|
2170
2540
|
* Composable hook for AtomixGlass component logic
|
|
2171
2541
|
* Manages all state, calculations, and event handlers
|
|
2172
2542
|
*/
|
|
2173
|
-
function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadius: cornerRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, disableEffects: disableEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugCornerRadius: debugCornerRadius = !1, debugOverLight: debugOverLight = !1,
|
|
2543
|
+
function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadius: cornerRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, disableEffects: disableEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugCornerRadius: debugCornerRadius = !1, debugOverLight: debugOverLight = !1, children: children}) {
|
|
2174
2544
|
// State
|
|
2175
2545
|
const [isHovered, setIsHovered] = useState(!1), [isActive, setIsActive] = useState(!1), [glassSize, setGlassSize] = useState({
|
|
2176
2546
|
width: 270,
|
|
@@ -2371,9 +2741,8 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
2371
2741
|
if (effectiveDisableEffects) return;
|
|
2372
2742
|
const container = mouseContainer?.current || glassRef.current;
|
|
2373
2743
|
if (!container) return;
|
|
2374
|
-
enablePerformanceMonitoring && performance.now();
|
|
2375
2744
|
// Use cached rect if available, otherwise get new one
|
|
2376
|
-
|
|
2745
|
+
let rect = cachedRectRef.current;
|
|
2377
2746
|
if (rect && 0 !== rect.width && 0 !== rect.height || (rect = container.getBoundingClientRect(),
|
|
2378
2747
|
cachedRectRef.current = rect), 0 === rect.width || 0 === rect.height) return;
|
|
2379
2748
|
const center = calculateElementCenter(rect), newOffset = {
|
|
@@ -2382,8 +2751,8 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
2382
2751
|
};
|
|
2383
2752
|
// Calculate offset relative to this container
|
|
2384
2753
|
// React 18 automatically batches these updates
|
|
2385
|
-
setInternalMouseOffset(newOffset), setInternalGlobalMousePosition(globalPos)
|
|
2386
|
-
}), [ mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects
|
|
2754
|
+
setInternalMouseOffset(newOffset), setInternalGlobalMousePosition(globalPos);
|
|
2755
|
+
}), [ mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects ]);
|
|
2387
2756
|
// Subscribe to shared mouse tracker
|
|
2388
2757
|
useEffect((() => {
|
|
2389
2758
|
if (externalGlobalMousePosition && externalMouseOffset)
|
|
@@ -2823,7 +3192,69 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
2823
3192
|
});
|
|
2824
3193
|
}
|
|
2825
3194
|
|
|
2826
|
-
|
|
3195
|
+
// Default icon
|
|
3196
|
+
const DefaultIcon = () => jsx("i", {
|
|
3197
|
+
className: "c-accordion__icon",
|
|
3198
|
+
"aria-hidden": "true",
|
|
3199
|
+
children: jsx("svg", {
|
|
3200
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3201
|
+
width: "24",
|
|
3202
|
+
height: "24",
|
|
3203
|
+
viewBox: "0 0 24 24",
|
|
3204
|
+
fill: "none",
|
|
3205
|
+
stroke: "currentColor",
|
|
3206
|
+
strokeWidth: "2",
|
|
3207
|
+
strokeLinecap: "round",
|
|
3208
|
+
strokeLinejoin: "round",
|
|
3209
|
+
"aria-hidden": "true",
|
|
3210
|
+
focusable: "false",
|
|
3211
|
+
children: jsx("polyline", {
|
|
3212
|
+
points: "6 9 12 15 18 9"
|
|
3213
|
+
})
|
|
3214
|
+
})
|
|
3215
|
+
}), AccordionHeader = forwardRef((({title: title, icon: icon, iconPosition: iconPosition = "right", isOpen: isOpen, children: children, className: className = "", ...props}, ref) => {
|
|
3216
|
+
// Determine icon to render. Explicit check for undefined to allow null/false to hide icon.
|
|
3217
|
+
const iconElement = void 0 === icon ? jsx(DefaultIcon, {}) : icon;
|
|
3218
|
+
return jsxs("button", {
|
|
3219
|
+
ref: ref,
|
|
3220
|
+
type: "button",
|
|
3221
|
+
className: className,
|
|
3222
|
+
...props,
|
|
3223
|
+
children: [ title && jsx("span", {
|
|
3224
|
+
className: "c-accordion__title",
|
|
3225
|
+
children: title
|
|
3226
|
+
}), children, iconElement ]
|
|
3227
|
+
});
|
|
3228
|
+
}));
|
|
3229
|
+
|
|
3230
|
+
AccordionHeader.displayName = "AccordionHeader";
|
|
3231
|
+
|
|
3232
|
+
const AccordionBody = forwardRef((({children: children, className: className = "", panelRef: panelRef, contentRef: contentRef, ...props}, ref) => {
|
|
3233
|
+
const mergedPanelRef = React.useMemo((() =>
|
|
3234
|
+
// Helper to merge refs
|
|
3235
|
+
function(...refs) {
|
|
3236
|
+
return node => {
|
|
3237
|
+
refs.forEach((ref => {
|
|
3238
|
+
"function" == typeof ref ? ref(node) : null != ref && (ref.current = node);
|
|
3239
|
+
}));
|
|
3240
|
+
};
|
|
3241
|
+
}(ref, panelRef)), [ ref, panelRef ]);
|
|
3242
|
+
return jsx("div", {
|
|
3243
|
+
ref: mergedPanelRef,
|
|
3244
|
+
className: className,
|
|
3245
|
+
role: "region",
|
|
3246
|
+
...props,
|
|
3247
|
+
children: jsx("div", {
|
|
3248
|
+
className: ACCORDION.SELECTORS.BODY.replace(".", ""),
|
|
3249
|
+
ref: contentRef,
|
|
3250
|
+
children: children
|
|
3251
|
+
})
|
|
3252
|
+
});
|
|
3253
|
+
}));
|
|
3254
|
+
|
|
3255
|
+
AccordionBody.displayName = "AccordionBody";
|
|
3256
|
+
|
|
3257
|
+
const AccordionImpl = memo((({title: title, children: children, defaultOpen: defaultOpen = !1, isOpen: controlledOpen, onOpenChange: onOpenChange, onOpen: onOpen, onClose: onClose, disabled: disabled = !1, iconPosition: iconPosition = "right", icon: icon, className: className = "", style: style, glass: glass}) => {
|
|
2827
3258
|
// Generate unique IDs for accessibility
|
|
2828
3259
|
const instanceId = useId(), buttonId = `accordion-header-${instanceId}`, panelId = `accordion-panel-${instanceId}`, {state: state, toggle: toggle, updatePanelHeight: updatePanelHeight, panelRef: panelRef, contentRef: contentRef, generateClassNames: generateClassNames, generateHeaderClassNames: generateHeaderClassNames} = useAccordion({
|
|
2829
3260
|
defaultOpen: defaultOpen,
|
|
@@ -2833,53 +3264,59 @@ const Accordion = memo((({title: title, children: children, defaultOpen: defaul
|
|
|
2833
3264
|
onOpenChange: onOpenChange,
|
|
2834
3265
|
onOpen: onOpen,
|
|
2835
3266
|
onClose: onClose
|
|
2836
|
-
}),
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
width: "24",
|
|
2842
|
-
height: "24",
|
|
2843
|
-
viewBox: "0 0 24 24",
|
|
2844
|
-
fill: "none",
|
|
2845
|
-
stroke: "currentColor",
|
|
2846
|
-
strokeWidth: "2",
|
|
2847
|
-
strokeLinecap: "round",
|
|
2848
|
-
strokeLinejoin: "round",
|
|
2849
|
-
"aria-hidden": "true",
|
|
2850
|
-
focusable: "false",
|
|
2851
|
-
children: jsx("polyline", {
|
|
2852
|
-
points: "6 9 12 15 18 9"
|
|
2853
|
-
})
|
|
2854
|
-
})
|
|
2855
|
-
}), accordionContent = jsxs("div", {
|
|
3267
|
+
}), headerClassNames = generateHeaderClassNames(), panelClassNames = ACCORDION.SELECTORS.PANEL.replace(".", ""), hasCompoundComponents = React.Children.toArray(children).some((child => {
|
|
3268
|
+
var _context;
|
|
3269
|
+
|
|
3270
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "AccordionHeader", "AccordionBody" ]).call(_context, child.type.displayName);
|
|
3271
|
+
})), content = jsx("div", {
|
|
2856
3272
|
className: generateClassNames(className) + (glass ? " c-accordion--glass" : ""),
|
|
2857
3273
|
style: style,
|
|
2858
|
-
children:
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
3274
|
+
children: hasCompoundComponents ? React.Children.map(children, (child => {
|
|
3275
|
+
if ( React.isValidElement(child)) {
|
|
3276
|
+
if ("AccordionHeader" === child.type.displayName)
|
|
3277
|
+
return React.cloneElement(child, {
|
|
3278
|
+
id: buttonId,
|
|
3279
|
+
className: `${headerClassNames} ${child.props.className || ""}`.trim(),
|
|
3280
|
+
onClick: e => {
|
|
3281
|
+
toggle(), child.props.onClick?.(e);
|
|
3282
|
+
},
|
|
3283
|
+
"aria-expanded": state.isOpen,
|
|
3284
|
+
"aria-controls": panelId,
|
|
3285
|
+
"aria-disabled": disabled,
|
|
3286
|
+
disabled: disabled,
|
|
3287
|
+
iconPosition: child.props.iconPosition || iconPosition
|
|
3288
|
+
});
|
|
3289
|
+
if ("AccordionBody" === child.type.displayName)
|
|
3290
|
+
return React.cloneElement(child, {
|
|
3291
|
+
id: panelId,
|
|
3292
|
+
className: `${panelClassNames} ${child.props.className || ""}`.trim(),
|
|
3293
|
+
"aria-labelledby": buttonId,
|
|
3294
|
+
panelRef: panelRef,
|
|
3295
|
+
contentRef: contentRef
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3298
|
+
return child;
|
|
3299
|
+
})) : jsxs(Fragment, {
|
|
3300
|
+
children: [ jsx(AccordionHeader, {
|
|
3301
|
+
id: buttonId,
|
|
3302
|
+
className: headerClassNames,
|
|
3303
|
+
onClick: toggle,
|
|
3304
|
+
"aria-expanded": state.isOpen,
|
|
3305
|
+
"aria-controls": panelId,
|
|
3306
|
+
"aria-disabled": disabled,
|
|
3307
|
+
disabled: disabled,
|
|
3308
|
+
title: title,
|
|
3309
|
+
icon: icon,
|
|
3310
|
+
iconPosition: iconPosition
|
|
3311
|
+
}), jsx(AccordionBody, {
|
|
3312
|
+
id: panelId,
|
|
3313
|
+
className: panelClassNames,
|
|
3314
|
+
"aria-labelledby": buttonId,
|
|
3315
|
+
panelRef: panelRef,
|
|
3316
|
+
contentRef: contentRef,
|
|
2880
3317
|
children: children
|
|
2881
|
-
})
|
|
2882
|
-
})
|
|
3318
|
+
}) ]
|
|
3319
|
+
})
|
|
2883
3320
|
});
|
|
2884
3321
|
if (glass) {
|
|
2885
3322
|
// Default glass settings for accordions
|
|
@@ -2892,16 +3329,20 @@ const Accordion = memo((({title: title, children: children, defaultOpen: defaul
|
|
|
2892
3329
|
};
|
|
2893
3330
|
return jsx(AtomixGlass, {
|
|
2894
3331
|
...glassProps,
|
|
2895
|
-
children:
|
|
3332
|
+
children: content
|
|
2896
3333
|
});
|
|
2897
3334
|
}
|
|
2898
|
-
return
|
|
3335
|
+
return content;
|
|
2899
3336
|
}));
|
|
2900
3337
|
|
|
2901
|
-
|
|
2902
|
-
|
|
3338
|
+
AccordionImpl.displayName = "Accordion";
|
|
3339
|
+
|
|
3340
|
+
// Attach subcomponents
|
|
3341
|
+
const AccordionWithSubcomponents = AccordionImpl;
|
|
2903
3342
|
|
|
2904
|
-
|
|
3343
|
+
AccordionWithSubcomponents.Header = AccordionHeader, AccordionWithSubcomponents.Body = AccordionBody;
|
|
3344
|
+
|
|
3345
|
+
const Accordion = AccordionWithSubcomponents, AtomixLogo = ({height: height = 24, width: width = 24, color: color = "currentColor", ...props}) => jsxs("svg", {
|
|
2905
3346
|
width: width,
|
|
2906
3347
|
height: height,
|
|
2907
3348
|
viewBox: "0 0 24 24",
|
|
@@ -3162,596 +3603,193 @@ const AtomixLogo = ({height: height = 24, width: width = 24, color: color = "cur
|
|
|
3162
3603
|
let dx = pos.x * w - x, dy = pos.y * h - y;
|
|
3163
3604
|
// Apply edge smoothing for Apple-like effect
|
|
3164
3605
|
const edgeX = 2 * Math.min(x / w, (w - x) / w), edgeY = 2 * Math.min(y / h, (h - y) / h), edgeFactor = Math.min(edgeX, edgeY);
|
|
3165
|
-
dx *= smoothStep(0, .2, edgeFactor), dy *= smoothStep(0, .2, edgeFactor), maxScale = Math.max(maxScale, Math.abs(dx), Math.abs(dy)),
|
|
3166
|
-
rawValues.push(dx, dy);
|
|
3167
|
-
}
|
|
3168
|
-
// Improved normalization to prevent artifacts while maintaining intensity
|
|
3169
|
-
maxScale = Math.max(maxScale, 1);
|
|
3170
|
-
// Create ImageData and fill it
|
|
3171
|
-
const imageData = this.context.createImageData(w, h), data = imageData.data;
|
|
3172
|
-
// Convert to image data with smoother normalization
|
|
3173
|
-
let rawIndex = 0;
|
|
3174
|
-
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
|
|
3175
|
-
const dx = rawValues[rawIndex++] || 0, dy = rawValues[rawIndex++] || 0, edgeDistance = Math.min(x, y, w - x - 1, h - y - 1), edgeFactor = Math.min(1, edgeDistance / 2), r = dx * edgeFactor / maxScale + .5, g = dy * edgeFactor / maxScale + .5, pixelIndex = 4 * (y * w + x);
|
|
3176
|
-
data[pixelIndex] = clampValue(255 * r, 0, 255), // Red channel (X displacement)
|
|
3177
|
-
data[pixelIndex + 1] = clampValue(255 * g, 0, 255), // Green channel (Y displacement)
|
|
3178
|
-
data[pixelIndex + 2] = clampValue(255 * g, 0, 255), // Blue channel (Y displacement for SVG filter compatibility)
|
|
3179
|
-
data[pixelIndex + 3] = 255;
|
|
3180
|
-
}
|
|
3181
|
-
return this.context.putImageData(imageData, 0, 0), this.canvas.toDataURL();
|
|
3182
|
-
} catch (error) {
|
|
3183
|
-
// Graceful fallback on error
|
|
3184
|
-
return console.warn("ShaderDisplacementGenerator: Error generating shader map, using fallback", error),
|
|
3185
|
-
"";
|
|
3186
|
-
// Return empty string as fallback
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3189
|
-
destroy() {
|
|
3190
|
-
try {
|
|
3191
|
-
// Clear canvas data to free memory
|
|
3192
|
-
this.context && this.context.clearRect(0, 0, this.canvas.width, this.canvas.height),
|
|
3193
|
-
// Reduce memory footprint by setting dimensions to 0
|
|
3194
|
-
this.canvas.width = 0, this.canvas.height = 0,
|
|
3195
|
-
// Remove from DOM
|
|
3196
|
-
this.canvas.remove();
|
|
3197
|
-
} catch (e) {
|
|
3198
|
-
// Silently handle cleanup errors
|
|
3199
|
-
console.warn("ShaderDisplacementGenerator: Error during cleanup", e);
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
getScale() {
|
|
3203
|
-
return this.canvasDPI;
|
|
3204
|
-
}
|
|
3205
|
-
},
|
|
3206
|
-
fragmentShaders: fragmentShaders
|
|
3207
|
-
}, Symbol.toStringTag, {
|
|
3208
|
-
value: "Module"
|
|
3209
|
-
})), sizeMap = {
|
|
3210
|
-
xs: 16,
|
|
3211
|
-
sm: 20,
|
|
3212
|
-
md: 24,
|
|
3213
|
-
lg: 32,
|
|
3214
|
-
xl: 40
|
|
3215
|
-
}, Icon = ({name: name, size: size = "md", weight: weight = "regular", color: color, className: className = "", style: style, alt: alt}) => {
|
|
3216
|
-
// Get the icon component from Phosphor
|
|
3217
|
-
const IconComponent = PhosphorIcons[name];
|
|
3218
|
-
return IconComponent ? jsx("span", {
|
|
3219
|
-
className: `c-icon c-icon--${size} ${className}`,
|
|
3220
|
-
style: style,
|
|
3221
|
-
"aria-hidden": !alt,
|
|
3222
|
-
title: alt,
|
|
3223
|
-
children: jsx(IconComponent, {
|
|
3224
|
-
size: "string" == typeof size ? sizeMap[size] || 24 : size,
|
|
3225
|
-
weight: weight,
|
|
3226
|
-
color: color,
|
|
3227
|
-
"aria-label": alt
|
|
3228
|
-
})
|
|
3229
|
-
}) : (console.warn(`Icon "${name}" not found in Phosphor Icons`), null);
|
|
3230
|
-
// Convert string size to pixel value if needed
|
|
3231
|
-
};
|
|
3232
|
-
|
|
3233
|
-
// Adapted from https://github.com/shuding/liquid-glass
|
|
3234
|
-
// Constants
|
|
3235
|
-
Icon.displayName = "Icon";
|
|
3236
|
-
|
|
3237
|
-
const Avatar = memo((({src: src, alt: alt = "Avatar", initials: initials, icon: icon, size: size = "md", circle: circle = !1, className: className = "", disabled: disabled = !1, onClick: onClick, style: style, glass: glass}) => {
|
|
3238
|
-
const [imageError, setImageError] = useState(!1), avatarClasses = [ AVATAR.CLASSES.BASE, "md" !== size && `c-avatar--${size}`, circle && AVATAR.CLASSES.CIRCLE, disabled && "is-disabled", className ].filter(Boolean).join(" ");
|
|
3239
|
-
return jsx("div", {
|
|
3240
|
-
className: avatarClasses,
|
|
3241
|
-
onClick: onClick ? e => {
|
|
3242
|
-
!disabled && onClick && onClick(e);
|
|
3243
|
-
} : void 0,
|
|
3244
|
-
role: onClick ? "button" : void 0,
|
|
3245
|
-
tabIndex: onClick && !disabled ? 0 : void 0,
|
|
3246
|
-
"aria-disabled": disabled || void 0,
|
|
3247
|
-
style: style,
|
|
3248
|
-
children: src && !imageError ? jsx("img", {
|
|
3249
|
-
src: src,
|
|
3250
|
-
alt: alt,
|
|
3251
|
-
className: "c-avatar__image",
|
|
3252
|
-
onError: () => {
|
|
3253
|
-
setImageError(!0);
|
|
3254
|
-
}
|
|
3255
|
-
}) : jsx("span", initials ? {
|
|
3256
|
-
className: "c-avatar__initials",
|
|
3257
|
-
children: initials
|
|
3258
|
-
} : icon ? {
|
|
3259
|
-
className: "c-avatar__icon",
|
|
3260
|
-
children: icon
|
|
3261
|
-
} : {
|
|
3262
|
-
className: "c-avatar__icon",
|
|
3263
|
-
children: jsx(Icon, {
|
|
3264
|
-
name: "User",
|
|
3265
|
-
size: "xs" === size ? "xs" : "sm" === size ? "sm" : "md"
|
|
3266
|
-
})
|
|
3267
|
-
})
|
|
3268
|
-
});
|
|
3269
|
-
}));
|
|
3270
|
-
|
|
3271
|
-
Avatar.displayName = "Avatar";
|
|
3272
|
-
|
|
3273
|
-
const AvatarGroup = ({children: children, max: max, stacked: stacked = !1, className: className = "", style: style, moreText: moreText}) => {
|
|
3274
|
-
// Generate CSS classes
|
|
3275
|
-
const avatarGroupClasses = [ AVATAR_GROUP.CLASSES.BASE, stacked && AVATAR_GROUP.CLASSES.STACKED, className ].filter(Boolean).join(" "), avatarChildren = Children.toArray(children).filter((child => isValidElement(child) && child.type === Avatar)), showMoreIndicator = void 0 !== max && avatarChildren.length > max, visibleAvatars = showMoreIndicator ? avatarChildren.slice(0, max) : avatarChildren, hiddenAvatarCount = avatarChildren.length - (max || 0), firstAvatar = isValidElement(avatarChildren[0]) ? avatarChildren[0].props : null, avatarSize = firstAvatar?.size || "md", isCircle = firstAvatar?.circle || !1, moreClasses = [ AVATAR.CLASSES.BASE, AVATAR_GROUP.CLASSES.MORE, "md" !== avatarSize && `c-avatar--${avatarSize}`, isCircle && "c-avatar--circle" ].filter(Boolean).join(" ");
|
|
3276
|
-
// Get valid Avatar children
|
|
3277
|
-
return jsxs("div", {
|
|
3278
|
-
className: avatarGroupClasses,
|
|
3279
|
-
style: style,
|
|
3280
|
-
children: [ visibleAvatars.map(((child, index) => isValidElement(child) ? cloneElement(child, {
|
|
3281
|
-
key: index,
|
|
3282
|
-
...child.props
|
|
3283
|
-
}) : null)), showMoreIndicator && jsx("div", {
|
|
3284
|
-
className: moreClasses,
|
|
3285
|
-
children: moreText || `+${hiddenAvatarCount}`
|
|
3286
|
-
}) ]
|
|
3287
|
-
});
|
|
3288
|
-
};
|
|
3289
|
-
|
|
3290
|
-
/**
|
|
3291
|
-
* Badge state and functionality
|
|
3292
|
-
* @param initialProps - Initial badge properties
|
|
3293
|
-
* @returns Badge state and methods
|
|
3294
|
-
*/
|
|
3295
|
-
function useBadge(initialProps) {
|
|
3296
|
-
// Default badge properties
|
|
3297
|
-
const defaultProps = {
|
|
3298
|
-
variant: "primary",
|
|
3299
|
-
size: "md",
|
|
3300
|
-
disabled: !1,
|
|
3301
|
-
...initialProps
|
|
3302
|
-
};
|
|
3303
|
-
/**
|
|
3304
|
-
* Generate badge class based on properties
|
|
3305
|
-
* @param props - Badge properties
|
|
3306
|
-
* @returns Class string
|
|
3307
|
-
*/ return {
|
|
3308
|
-
defaultProps: defaultProps,
|
|
3309
|
-
generateBadgeClass: props => {
|
|
3310
|
-
const {variant: variant = defaultProps.variant, size: size = defaultProps.size, disabled: disabled = defaultProps.disabled, className: className = ""} = props;
|
|
3311
|
-
return `${BADGE.BASE_CLASS} ${variant ? `${BADGE.VARIANT_PREFIX}${variant}` : ""} ${"md" === size ? "" : `${BADGE.SIZE_PREFIX}${size}`} ${disabled ? "c-badge--disabled" : ""} ${className}`.trim();
|
|
3606
|
+
dx *= smoothStep(0, .2, edgeFactor), dy *= smoothStep(0, .2, edgeFactor), maxScale = Math.max(maxScale, Math.abs(dx), Math.abs(dy)),
|
|
3607
|
+
rawValues.push(dx, dy);
|
|
3608
|
+
}
|
|
3609
|
+
// Improved normalization to prevent artifacts while maintaining intensity
|
|
3610
|
+
maxScale = Math.max(maxScale, 1);
|
|
3611
|
+
// Create ImageData and fill it
|
|
3612
|
+
const imageData = this.context.createImageData(w, h), data = imageData.data;
|
|
3613
|
+
// Convert to image data with smoother normalization
|
|
3614
|
+
let rawIndex = 0;
|
|
3615
|
+
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
|
|
3616
|
+
const dx = rawValues[rawIndex++] || 0, dy = rawValues[rawIndex++] || 0, edgeDistance = Math.min(x, y, w - x - 1, h - y - 1), edgeFactor = Math.min(1, edgeDistance / 2), r = dx * edgeFactor / maxScale + .5, g = dy * edgeFactor / maxScale + .5, pixelIndex = 4 * (y * w + x);
|
|
3617
|
+
data[pixelIndex] = clampValue(255 * r, 0, 255), // Red channel (X displacement)
|
|
3618
|
+
data[pixelIndex + 1] = clampValue(255 * g, 0, 255), // Green channel (Y displacement)
|
|
3619
|
+
data[pixelIndex + 2] = clampValue(255 * g, 0, 255), // Blue channel (Y displacement for SVG filter compatibility)
|
|
3620
|
+
data[pixelIndex + 3] = 255;
|
|
3621
|
+
}
|
|
3622
|
+
return this.context.putImageData(imageData, 0, 0), this.canvas.toDataURL();
|
|
3623
|
+
} catch (error) {
|
|
3624
|
+
// Graceful fallback on error
|
|
3625
|
+
return console.warn("ShaderDisplacementGenerator: Error generating shader map, using fallback", error),
|
|
3626
|
+
"";
|
|
3627
|
+
// Return empty string as fallback
|
|
3628
|
+
}
|
|
3312
3629
|
}
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
size: size,
|
|
3326
|
-
disabled: disabled,
|
|
3327
|
-
className: `${className} ${glass ? "c-badge--glass" : ""}`.trim()
|
|
3328
|
-
}), badgeElement = jsxs("span", {
|
|
3329
|
-
className: badgeClass,
|
|
3330
|
-
"aria-disabled": disabled,
|
|
3331
|
-
"aria-label": ariaLabel,
|
|
3332
|
-
ref: ref,
|
|
3333
|
-
style: style,
|
|
3334
|
-
children: [ icon && jsx("span", {
|
|
3335
|
-
className: BADGE.ICON_CLASS,
|
|
3336
|
-
children: icon
|
|
3337
|
-
}), jsx("span", {
|
|
3338
|
-
children: label
|
|
3339
|
-
}), onRemove && jsx("button", {
|
|
3340
|
-
type: "button",
|
|
3341
|
-
className: "c-badge__close",
|
|
3342
|
-
onClick: onRemove,
|
|
3343
|
-
"aria-label": "Remove badge",
|
|
3344
|
-
disabled: disabled,
|
|
3345
|
-
children: "×"
|
|
3346
|
-
}) ]
|
|
3347
|
-
});
|
|
3348
|
-
if (glass) {
|
|
3349
|
-
// Default glass settings for badges
|
|
3350
|
-
const defaultGlassProps = {
|
|
3351
|
-
displacementScale: 20,
|
|
3352
|
-
cornerRadius: ref.current?.getBoundingClientRect().width ? ref.current?.getBoundingClientRect().width / 2 : 16,
|
|
3353
|
-
className: "c-badge--glass",
|
|
3354
|
-
elasticity: 0
|
|
3355
|
-
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
3356
|
-
...defaultGlassProps,
|
|
3357
|
-
...glass
|
|
3358
|
-
};
|
|
3359
|
-
return jsx(AtomixGlass, {
|
|
3360
|
-
...glassProps,
|
|
3361
|
-
children: badgeElement
|
|
3362
|
-
});
|
|
3363
|
-
}
|
|
3364
|
-
return badgeElement;
|
|
3365
|
-
}));
|
|
3366
|
-
|
|
3367
|
-
Badge.displayName = "Badge";
|
|
3368
|
-
|
|
3369
|
-
/**
|
|
3370
|
-
* Container component for creating responsive layouts.
|
|
3371
|
-
* Uses the CSS container classes defined in _objects.container.scss.
|
|
3372
|
-
*
|
|
3373
|
-
* @example
|
|
3374
|
-
* ```tsx
|
|
3375
|
-
* <Container>
|
|
3376
|
-
* Content with responsive max-width
|
|
3377
|
-
* </Container>
|
|
3378
|
-
*
|
|
3379
|
-
* <Container type="fluid">
|
|
3380
|
-
* Full width content
|
|
3381
|
-
* </Container>
|
|
3382
|
-
*
|
|
3383
|
-
* <Container type="md">
|
|
3384
|
-
* Content with max-width at md breakpoint
|
|
3385
|
-
* </Container>
|
|
3386
|
-
* ```
|
|
3387
|
-
*/
|
|
3388
|
-
const Container = forwardRef((({children: children, className: className = "", type: type, ...props}, ref) => {
|
|
3389
|
-
let containerClass = "o-container";
|
|
3390
|
-
return type && (containerClass = `o-container-${type}`), jsx("div", {
|
|
3391
|
-
ref: ref,
|
|
3392
|
-
className: `${containerClass} ${className}`.trim(),
|
|
3393
|
-
...props,
|
|
3394
|
-
children: children
|
|
3395
|
-
});
|
|
3396
|
-
}));
|
|
3397
|
-
|
|
3398
|
-
Container.displayName = "Container";
|
|
3399
|
-
|
|
3400
|
-
/**
|
|
3401
|
-
* useBlock composable for Block component
|
|
3402
|
-
* Provides utility functions for generating consistent block styling
|
|
3403
|
-
*/
|
|
3404
|
-
const useBlock = () => ({
|
|
3405
|
-
generateBlockClass: ({spacing: spacing = BLOCK.SPACING.DEFAULT, background: background = "", fullWidth: fullWidth = !1, className: className = ""}) => {
|
|
3406
|
-
const classes = [ BLOCK.BASE_CLASS ];
|
|
3407
|
-
// Add spacing class
|
|
3408
|
-
// Add background class
|
|
3409
|
-
if (spacing && "none" !== spacing && classes.push(`${BLOCK.SPACING_PREFIX}${spacing}`),
|
|
3410
|
-
background) {
|
|
3411
|
-
const bgClass = BLOCK.CLASSES[`BG_${background.toUpperCase()}`];
|
|
3412
|
-
bgClass && classes.push(bgClass);
|
|
3630
|
+
destroy() {
|
|
3631
|
+
try {
|
|
3632
|
+
// Clear canvas data to free memory
|
|
3633
|
+
this.context && this.context.clearRect(0, 0, this.canvas.width, this.canvas.height),
|
|
3634
|
+
// Reduce memory footprint by setting dimensions to 0
|
|
3635
|
+
this.canvas.width = 0, this.canvas.height = 0,
|
|
3636
|
+
// Remove from DOM
|
|
3637
|
+
this.canvas.remove();
|
|
3638
|
+
} catch (e) {
|
|
3639
|
+
// Silently handle cleanup errors
|
|
3640
|
+
console.warn("ShaderDisplacementGenerator: Error during cleanup", e);
|
|
3641
|
+
}
|
|
3413
3642
|
}
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
// Add custom className
|
|
3417
|
-
className && classes.push(className), classes.filter(Boolean).join(" ");
|
|
3418
|
-
}
|
|
3419
|
-
}), Block = forwardRef((({children: children, as: Component = "section", spacing: spacing = "md", container: container = {}, fullWidth: fullWidth = !1, className: className = "", style: style, background: background = "", ...props}, ref) => {
|
|
3420
|
-
const {generateBlockClass: generateBlockClass} = useBlock(), blockClasses = generateBlockClass({
|
|
3421
|
-
spacing: spacing,
|
|
3422
|
-
background: background,
|
|
3423
|
-
fullWidth: fullWidth,
|
|
3424
|
-
className: className
|
|
3425
|
-
});
|
|
3426
|
-
return jsx(Component, {
|
|
3427
|
-
ref: ref,
|
|
3428
|
-
className: blockClasses,
|
|
3429
|
-
style: style,
|
|
3430
|
-
...props,
|
|
3431
|
-
children: fullWidth ? children : jsx(Container, {
|
|
3432
|
-
type: container.type,
|
|
3433
|
-
className: container.className,
|
|
3434
|
-
children: children
|
|
3435
|
-
})
|
|
3436
|
-
});
|
|
3437
|
-
}));
|
|
3438
|
-
|
|
3439
|
-
/**
|
|
3440
|
-
* Block component for creating structured section layouts.
|
|
3441
|
-
* Provides consistent spacing, backgrounds, and container behavior for content sections.
|
|
3442
|
-
*
|
|
3443
|
-
* @example
|
|
3444
|
-
* ```tsx
|
|
3445
|
-
* // Basic usage
|
|
3446
|
-
* <Block>
|
|
3447
|
-
* <h2>Section Title</h2>
|
|
3448
|
-
* <p>Section content goes here...</p>
|
|
3449
|
-
* </Block>
|
|
3450
|
-
*
|
|
3451
|
-
* // With custom spacing and background
|
|
3452
|
-
* <Block spacing="lg" background="subtle">
|
|
3453
|
-
* <h2>Featured Section</h2>
|
|
3454
|
-
* <p>This section has extra padding and a subtle background.</p>
|
|
3455
|
-
* </Block>
|
|
3456
|
-
*
|
|
3457
|
-
* // Full-width with custom container
|
|
3458
|
-
* <Block fullWidth background="primary">
|
|
3459
|
-
* <Container type="lg">
|
|
3460
|
-
* <h2>Hero Section</h2>
|
|
3461
|
-
* <p>Full-width section with centered content.</p>
|
|
3462
|
-
* </Container>
|
|
3463
|
-
* </Block>
|
|
3464
|
-
*
|
|
3465
|
-
* // As article element
|
|
3466
|
-
* <Block as="article" spacing="xl" background="accent">
|
|
3467
|
-
* <h1>Blog Post</h1>
|
|
3468
|
-
* <p>Article content...</p>
|
|
3469
|
-
* </Block>
|
|
3470
|
-
* ```
|
|
3471
|
-
*/ Block.displayName = "Block";
|
|
3472
|
-
|
|
3473
|
-
const Breadcrumb = memo((({items: items, divider: divider, className: className = "", "aria-label": ariaLabel = "Breadcrumb", LinkComponent: LinkComponent, style: style}) => {
|
|
3474
|
-
const breadcrumbClasses = [ BREADCRUMB.CLASSES.BASE, className ].filter(Boolean).join(" ");
|
|
3475
|
-
return jsx("nav", {
|
|
3476
|
-
"aria-label": ariaLabel,
|
|
3477
|
-
style: style,
|
|
3478
|
-
children: jsx("ol", {
|
|
3479
|
-
className: breadcrumbClasses,
|
|
3480
|
-
children: items.map(((item, index) => {
|
|
3481
|
-
const isLast = index === items.length - 1, itemClasses = [ BREADCRUMB.CLASSES.ITEM, item.active || isLast ? BREADCRUMB.CLASSES.ACTIVE : "" ].filter(Boolean).join(" "), linkContent = jsxs(Fragment, {
|
|
3482
|
-
children: [ item.icon && jsx("span", {
|
|
3483
|
-
className: "c-breadcrumb__icon",
|
|
3484
|
-
children: item.icon
|
|
3485
|
-
}), item.label ]
|
|
3486
|
-
}), linkProps = {
|
|
3487
|
-
href: item.href,
|
|
3488
|
-
className: BREADCRUMB.CLASSES.LINK,
|
|
3489
|
-
onClick: item.onClick,
|
|
3490
|
-
style: item.style
|
|
3491
|
-
};
|
|
3492
|
-
return jsx("li", {
|
|
3493
|
-
className: itemClasses,
|
|
3494
|
-
style: item.style,
|
|
3495
|
-
children: item.href && !item.active ? jsx(LinkComponent || "a", {
|
|
3496
|
-
...linkProps,
|
|
3497
|
-
children: linkContent
|
|
3498
|
-
}) : jsx("span", {
|
|
3499
|
-
className: BREADCRUMB.CLASSES.LINK,
|
|
3500
|
-
children: linkContent
|
|
3501
|
-
})
|
|
3502
|
-
}, index);
|
|
3503
|
-
}))
|
|
3504
|
-
})
|
|
3505
|
-
});
|
|
3506
|
-
}));
|
|
3507
|
-
|
|
3508
|
-
/**
|
|
3509
|
-
* Spinner state and functionality
|
|
3510
|
-
* @param initialProps - Initial spinner properties
|
|
3511
|
-
* @returns Spinner state and methods
|
|
3512
|
-
*/
|
|
3513
|
-
function useSpinner(initialProps) {
|
|
3514
|
-
// Default spinner properties
|
|
3515
|
-
const defaultProps = {
|
|
3516
|
-
variant: "primary",
|
|
3517
|
-
size: "md",
|
|
3518
|
-
fullscreen: !1,
|
|
3519
|
-
...initialProps
|
|
3520
|
-
};
|
|
3521
|
-
/**
|
|
3522
|
-
* Generate spinner class based on properties
|
|
3523
|
-
* @param props - Spinner properties
|
|
3524
|
-
* @returns Class string
|
|
3525
|
-
*/ return {
|
|
3526
|
-
defaultProps: defaultProps,
|
|
3527
|
-
generateSpinnerClass: props => {
|
|
3528
|
-
const {variant: variant = defaultProps.variant, size: size = defaultProps.size, fullscreen: fullscreen = defaultProps.fullscreen, className: className = ""} = props;
|
|
3529
|
-
return `c-spinner ${variant ? `c-spinner--${variant}` : ""} ${"md" !== size ? `c-spinner--${size}` : ""} ${fullscreen ? "c-spinner--fullscreen" : ""} ${className}`.trim();
|
|
3643
|
+
getScale() {
|
|
3644
|
+
return this.canvasDPI;
|
|
3530
3645
|
}
|
|
3531
|
-
}
|
|
3532
|
-
|
|
3646
|
+
},
|
|
3647
|
+
fragmentShaders: fragmentShaders
|
|
3648
|
+
}, Symbol.toStringTag, {
|
|
3649
|
+
value: "Module"
|
|
3650
|
+
})), sizeMap = {
|
|
3651
|
+
xs: 16,
|
|
3652
|
+
sm: 20,
|
|
3653
|
+
md: 24,
|
|
3654
|
+
lg: 32,
|
|
3655
|
+
xl: 40
|
|
3656
|
+
}, Icon = ({name: name, size: size = "md", weight: weight = "regular", color: color, className: className = "", style: style, alt: alt}) => {
|
|
3657
|
+
// Get the icon component from Phosphor
|
|
3658
|
+
const IconComponent = PhosphorIcons[name];
|
|
3659
|
+
return IconComponent ? jsx("span", {
|
|
3660
|
+
className: `c-icon c-icon--${size} ${className}`,
|
|
3661
|
+
style: style,
|
|
3662
|
+
"aria-hidden": !alt,
|
|
3663
|
+
title: alt,
|
|
3664
|
+
children: jsx(IconComponent, {
|
|
3665
|
+
size: "string" == typeof size ? sizeMap[size] || 24 : size,
|
|
3666
|
+
weight: weight,
|
|
3667
|
+
color: color,
|
|
3668
|
+
"aria-label": alt
|
|
3669
|
+
})
|
|
3670
|
+
}) : (console.warn(`Icon "${name}" not found in Phosphor Icons`), null);
|
|
3671
|
+
// Convert string size to pixel value if needed
|
|
3672
|
+
};
|
|
3533
3673
|
|
|
3534
|
-
|
|
3674
|
+
Icon.displayName = "Icon";
|
|
3535
3675
|
|
|
3536
|
-
const
|
|
3537
|
-
const
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
}), spinnerContent = jsx("div", {
|
|
3547
|
-
className: spinnerClass,
|
|
3676
|
+
const Avatar = memo((({src: src, alt: alt = "Avatar", initials: initials, icon: icon, size: size = "md", circle: circle = !1, className: className = "", disabled: disabled = !1, onClick: onClick, style: style, glass: glass}) => {
|
|
3677
|
+
const [imageError, setImageError] = useState(!1), avatarClasses = [ AVATAR.CLASSES.BASE, "md" !== size && `c-avatar--${size}`, circle && AVATAR.CLASSES.CIRCLE, disabled && "is-disabled", className ].filter(Boolean).join(" ");
|
|
3678
|
+
return jsx("div", {
|
|
3679
|
+
className: avatarClasses,
|
|
3680
|
+
onClick: onClick ? e => {
|
|
3681
|
+
!disabled && onClick && onClick(e);
|
|
3682
|
+
} : void 0,
|
|
3683
|
+
role: onClick ? "button" : void 0,
|
|
3684
|
+
tabIndex: onClick && !disabled ? 0 : void 0,
|
|
3685
|
+
"aria-disabled": disabled || void 0,
|
|
3548
3686
|
style: style,
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
className:
|
|
3553
|
-
|
|
3687
|
+
children: src && !imageError ? jsx("img", {
|
|
3688
|
+
src: src,
|
|
3689
|
+
alt: alt,
|
|
3690
|
+
className: "c-avatar__image",
|
|
3691
|
+
onError: () => {
|
|
3692
|
+
setImageError(!0);
|
|
3693
|
+
}
|
|
3694
|
+
}) : jsx("span", initials ? {
|
|
3695
|
+
className: "c-avatar__initials",
|
|
3696
|
+
children: initials
|
|
3697
|
+
} : icon ? {
|
|
3698
|
+
className: "c-avatar__icon",
|
|
3699
|
+
children: icon
|
|
3700
|
+
} : {
|
|
3701
|
+
className: "c-avatar__icon",
|
|
3702
|
+
children: jsx(Icon, {
|
|
3703
|
+
name: "User",
|
|
3704
|
+
size: "xs" === size ? "xs" : "sm" === size ? "sm" : "md"
|
|
3705
|
+
})
|
|
3554
3706
|
})
|
|
3555
3707
|
});
|
|
3556
|
-
if (glass) {
|
|
3557
|
-
const defaultGlassProps = {
|
|
3558
|
-
displacementScale: 20,
|
|
3559
|
-
blurAmount: 1,
|
|
3560
|
-
cornerRadius: 999,
|
|
3561
|
-
mode: "shader"
|
|
3562
|
-
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
3563
|
-
...defaultGlassProps,
|
|
3564
|
-
...glass
|
|
3565
|
-
};
|
|
3566
|
-
return jsx(AtomixGlass, {
|
|
3567
|
-
...glassProps,
|
|
3568
|
-
children: spinnerContent
|
|
3569
|
-
});
|
|
3570
|
-
}
|
|
3571
|
-
return spinnerContent;
|
|
3572
3708
|
}));
|
|
3573
3709
|
|
|
3574
|
-
|
|
3710
|
+
Avatar.displayName = "Avatar";
|
|
3711
|
+
|
|
3712
|
+
const AvatarGroup = ({children: children, max: max, stacked: stacked = !1, className: className = "", style: style, moreText: moreText}) => {
|
|
3713
|
+
// Generate CSS classes
|
|
3714
|
+
const avatarGroupClasses = [ AVATAR_GROUP.CLASSES.BASE, stacked && AVATAR_GROUP.CLASSES.STACKED, className ].filter(Boolean).join(" "), avatarChildren = Children.toArray(children).filter((child => isValidElement(child) && child.type === Avatar)), showMoreIndicator = void 0 !== max && avatarChildren.length > max, visibleAvatars = showMoreIndicator ? avatarChildren.slice(0, max) : avatarChildren, hiddenAvatarCount = avatarChildren.length - (max || 0), firstAvatar = isValidElement(avatarChildren[0]) ? avatarChildren[0].props : null, avatarSize = firstAvatar?.size || "md", isCircle = firstAvatar?.circle || !1, moreClasses = [ AVATAR.CLASSES.BASE, AVATAR_GROUP.CLASSES.MORE, "md" !== avatarSize && `c-avatar--${avatarSize}`, isCircle && "c-avatar--circle" ].filter(Boolean).join(" ");
|
|
3715
|
+
// Get valid Avatar children
|
|
3716
|
+
return jsxs("div", {
|
|
3717
|
+
className: avatarGroupClasses,
|
|
3718
|
+
style: style,
|
|
3719
|
+
children: [ visibleAvatars.map(((child, index) => isValidElement(child) ? cloneElement(child, {
|
|
3720
|
+
key: index,
|
|
3721
|
+
...child.props
|
|
3722
|
+
}) : null)), showMoreIndicator && jsx("div", {
|
|
3723
|
+
className: moreClasses,
|
|
3724
|
+
children: moreText || `+${hiddenAvatarCount}`
|
|
3725
|
+
}) ]
|
|
3726
|
+
});
|
|
3727
|
+
};
|
|
3575
3728
|
|
|
3576
3729
|
/**
|
|
3577
|
-
*
|
|
3578
|
-
*
|
|
3579
|
-
*
|
|
3580
|
-
* and JavaScript properties throughout the theme system.
|
|
3730
|
+
* Badge state and functionality
|
|
3731
|
+
* @param initialProps - Initial badge properties
|
|
3732
|
+
* @returns Badge state and methods
|
|
3581
3733
|
*/
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
}
|
|
3590
|
-
/**
|
|
3591
|
-
*
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
}
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
let className = `c-${block}`;
|
|
3620
|
-
return element && (className += `__${element}`), modifier && (className += `--${modifier}`),
|
|
3621
|
-
className;
|
|
3622
|
-
}
|
|
3623
|
-
/**
|
|
3624
|
-
* Create a variant class name
|
|
3625
|
-
* @param component - Component name
|
|
3626
|
-
* @param variant - Variant name
|
|
3627
|
-
*/ static variantClass(component, variant) {
|
|
3628
|
-
return `c-${component}--${variant}`;
|
|
3629
|
-
}
|
|
3630
|
-
/**
|
|
3631
|
-
* Create a size class name
|
|
3632
|
-
* @param component - Component name
|
|
3633
|
-
* @param size - Size name
|
|
3634
|
-
*/ static sizeClass(component, size) {
|
|
3635
|
-
return `c-${component}--${size}`;
|
|
3636
|
-
}
|
|
3637
|
-
/**
|
|
3638
|
-
* Create a state class name
|
|
3639
|
-
* @param component - Component name
|
|
3640
|
-
* @param state - State name
|
|
3641
|
-
*/ static stateClass(component, state) {
|
|
3642
|
-
return `c-${component}--${state}`;
|
|
3643
|
-
}
|
|
3644
|
-
/**
|
|
3645
|
-
* Create a utility class name
|
|
3646
|
-
* @param utility - Utility name
|
|
3647
|
-
*/ static utilityClass(utility) {
|
|
3648
|
-
return `u-${utility}`;
|
|
3649
|
-
}
|
|
3650
|
-
/**
|
|
3651
|
-
* Create a layout class name
|
|
3652
|
-
* @param layout - Layout name
|
|
3653
|
-
*/ static layoutClass(layout) {
|
|
3654
|
-
return `l-${layout}`;
|
|
3655
|
-
}
|
|
3656
|
-
/**
|
|
3657
|
-
* Create an object class name
|
|
3658
|
-
* @param object - Object name
|
|
3659
|
-
*/ static objectClass(object) {
|
|
3660
|
-
return `o-${object}`;
|
|
3661
|
-
}
|
|
3662
|
-
}
|
|
3663
|
-
|
|
3664
|
-
ThemeNaming.prefix = "atomix";
|
|
3665
|
-
|
|
3666
|
-
const Button = React.memo( forwardRef((({label: label, children: children, onClick: onClick, variant: variant = "primary", size: size = "md", disabled: disabled = !1, loading: loading = !1, loadingText: loadingText, icon: icon, iconName: iconName, iconSize: iconSize = "sm", iconPosition: iconPosition = "start", iconOnly: iconOnly = !1, rounded: rounded = !1, fullWidth: fullWidth = !1, block: block = !1, active: active = !1, selected: selected = !1, type: type = "button", className: className = "", as: Component = "button", href: href, target: target, glass: glass, onHover: onHover, onFocus: onFocus, onBlur: onBlur, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, tabIndex: tabIndex, style: style, LinkComponent: LinkComponent, ...props}, ref) => {
|
|
3667
|
-
const isDisabled = disabled || loading, shouldRenderAsLink = Boolean(href && !isDisabled), iconElement = iconName ? jsx(Icon, {
|
|
3668
|
-
name: iconName,
|
|
3669
|
-
size: iconSize
|
|
3670
|
-
}) : icon, buttonClass = [ BUTTON.BASE_CLASS, ThemeNaming.variantClass(THEME_NAMING.BUTTON_PREFIX, variant), "md" !== size ? ThemeNaming.sizeClass(THEME_NAMING.BUTTON_PREFIX, size) : "", iconOnly ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.ICON_ELEMENT) : "", rounded ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "rounded") : "", isDisabled ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "disabled") : "", glass ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "glass") : "", loading ? BUTTON.CLASSES.LOADING : "", fullWidth ? BUTTON.CLASSES.FULL_WIDTH : "", block ? BUTTON.CLASSES.BLOCK : "", active ? BUTTON.CLASSES.ACTIVE : "", selected ? BUTTON.CLASSES.SELECTED : "", className ].filter(Boolean).join(" "), handleClickEvent = useCallback((event => {
|
|
3671
|
-
isDisabled ? event.preventDefault() : onClick?.(event);
|
|
3672
|
-
}), [ isDisabled, onClick ]), handleMouseEnter = useCallback((event => {
|
|
3673
|
-
isDisabled || onHover?.(event);
|
|
3674
|
-
}), [ isDisabled, onHover ]), handleFocusEvent = useCallback((event => {
|
|
3675
|
-
isDisabled || onFocus?.(event);
|
|
3676
|
-
}), [ isDisabled, onFocus ]), handleBlurEvent = useCallback((event => {
|
|
3677
|
-
isDisabled || onBlur?.(event);
|
|
3678
|
-
}), [ isDisabled, onBlur ]), buttonText = loading && loadingText ? loadingText : label || children, spinnerSize = "sm" === size ? "sm" : "lg" === size ? "md" : "sm", safeAriaLabel = ariaLabel || (iconOnly ? "string" == typeof label ? label : "string" == typeof children ? children : void 0 : void 0), buttonContent = jsxs(Fragment, {
|
|
3679
|
-
children: [ loading && jsx("span", {
|
|
3680
|
-
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.SPINNER_ELEMENT),
|
|
3681
|
-
"aria-hidden": "true",
|
|
3682
|
-
children: jsx(Spinner, {
|
|
3683
|
-
size: spinnerSize,
|
|
3684
|
-
variant: "link" === variant || "string" == typeof variant && variant.startsWith("outline-") ? "primary" : "danger" === variant ? "error" : variant
|
|
3685
|
-
})
|
|
3686
|
-
}), iconElement && !loading && jsx("span", {
|
|
3687
|
-
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.ICON_ELEMENT),
|
|
3688
|
-
"aria-hidden": "true",
|
|
3689
|
-
children: iconElement
|
|
3690
|
-
}), !iconOnly && buttonText && jsx("span", {
|
|
3691
|
-
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.LABEL_ELEMENT),
|
|
3692
|
-
children: buttonText
|
|
3693
|
-
}) ]
|
|
3694
|
-
}), buttonProps = {
|
|
3695
|
-
className: buttonClass,
|
|
3696
|
-
onClick: handleClickEvent,
|
|
3697
|
-
onMouseEnter: onHover ? handleMouseEnter : void 0,
|
|
3698
|
-
onFocus: onFocus ? handleFocusEvent : void 0,
|
|
3699
|
-
onBlur: onBlur ? handleBlurEvent : void 0,
|
|
3700
|
-
"aria-disabled": isDisabled,
|
|
3701
|
-
"aria-busy": loading,
|
|
3702
|
-
"aria-label": safeAriaLabel,
|
|
3703
|
-
"aria-describedby": ariaDescribedBy,
|
|
3704
|
-
"aria-expanded": ariaExpanded,
|
|
3705
|
-
"aria-controls": ariaControls,
|
|
3706
|
-
tabIndex: void 0 !== tabIndex ? tabIndex : isDisabled ? -1 : 0,
|
|
3707
|
-
style: style,
|
|
3708
|
-
...props
|
|
3709
|
-
};
|
|
3710
|
-
// Determine if we should render as a link
|
|
3711
|
-
// If disabled, we still check href, but we might want to render as button or anchor with aria-disabled
|
|
3712
|
-
// The previous logic was Boolean(href && !isDisabled). This meant if disabled, it renders as <button>.
|
|
3713
|
-
// This is a safe fallback for disabled links.
|
|
3714
|
-
let content;
|
|
3715
|
-
// Render as anchor if href is provided
|
|
3716
|
-
if (shouldRenderAsLink)
|
|
3717
|
-
// Use custom LinkComponent if provided (e.g., Next.js Link)
|
|
3718
|
-
if (LinkComponent) {
|
|
3719
|
-
const LinkComp = LinkComponent, linkProps = {
|
|
3720
|
-
...buttonProps,
|
|
3721
|
-
ref: ref,
|
|
3722
|
-
// LinkComponent usually forwards ref to anchor
|
|
3723
|
-
href: href,
|
|
3724
|
-
target: target,
|
|
3725
|
-
rel: "_blank" === target ? "noopener noreferrer" : void 0
|
|
3726
|
-
};
|
|
3727
|
-
content = jsx(LinkComp, {
|
|
3728
|
-
...linkProps,
|
|
3729
|
-
children: buttonContent
|
|
3730
|
-
});
|
|
3731
|
-
} else
|
|
3732
|
-
// Fallback to regular anchor tag
|
|
3733
|
-
content = jsx("a", {
|
|
3734
|
-
...buttonProps,
|
|
3735
|
-
ref: ref,
|
|
3736
|
-
href: href,
|
|
3737
|
-
target: target,
|
|
3738
|
-
rel: "_blank" === target ? "noopener noreferrer" : void 0,
|
|
3739
|
-
children: buttonContent
|
|
3740
|
-
}); else
|
|
3741
|
-
// Default button rendering
|
|
3742
|
-
content = jsx(Component, {
|
|
3743
|
-
...buttonProps,
|
|
3734
|
+
function useBadge(initialProps) {
|
|
3735
|
+
// Default badge properties
|
|
3736
|
+
const defaultProps = {
|
|
3737
|
+
variant: "primary",
|
|
3738
|
+
size: "md",
|
|
3739
|
+
disabled: !1,
|
|
3740
|
+
...initialProps
|
|
3741
|
+
};
|
|
3742
|
+
/**
|
|
3743
|
+
* Generate badge class based on properties
|
|
3744
|
+
* @param props - Badge properties
|
|
3745
|
+
* @returns Class string
|
|
3746
|
+
*/ return {
|
|
3747
|
+
defaultProps: defaultProps,
|
|
3748
|
+
generateBadgeClass: props => {
|
|
3749
|
+
const {variant: variant = defaultProps.variant, size: size = defaultProps.size, disabled: disabled = defaultProps.disabled, className: className = ""} = props;
|
|
3750
|
+
return `${BADGE.BASE_CLASS} ${variant ? `${BADGE.VARIANT_PREFIX}${variant}` : ""} ${"md" === size ? "" : `${BADGE.SIZE_PREFIX}${size}`} ${disabled ? "c-badge--disabled" : ""} ${className}`.trim();
|
|
3751
|
+
}
|
|
3752
|
+
};
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
3756
|
+
|
|
3757
|
+
const Badge = memo((({label: label, variant: variant = "primary", size: size = "md", disabled: disabled = !1, icon: icon, onRemove: onRemove, "aria-label": ariaLabel, className: className = "", glass: glass, style: style}) => {
|
|
3758
|
+
const {generateBadgeClass: generateBadgeClass} = useBadge({
|
|
3759
|
+
variant: variant,
|
|
3760
|
+
size: size,
|
|
3761
|
+
disabled: disabled
|
|
3762
|
+
}), ref = useRef(null), badgeClass = generateBadgeClass({
|
|
3763
|
+
variant: variant,
|
|
3764
|
+
size: size,
|
|
3765
|
+
disabled: disabled,
|
|
3766
|
+
className: `${className} ${glass ? "c-badge--glass" : ""}`.trim()
|
|
3767
|
+
}), badgeElement = jsxs("span", {
|
|
3768
|
+
className: badgeClass,
|
|
3769
|
+
"aria-disabled": disabled,
|
|
3770
|
+
"aria-label": ariaLabel,
|
|
3744
3771
|
ref: ref,
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3772
|
+
style: style,
|
|
3773
|
+
children: [ icon && jsx("span", {
|
|
3774
|
+
className: BADGE.ICON_CLASS,
|
|
3775
|
+
children: icon
|
|
3776
|
+
}), jsx("span", {
|
|
3777
|
+
children: label
|
|
3778
|
+
}), onRemove && jsx("button", {
|
|
3779
|
+
type: "button",
|
|
3780
|
+
className: "c-badge__close",
|
|
3781
|
+
onClick: onRemove,
|
|
3782
|
+
"aria-label": "Remove badge",
|
|
3783
|
+
disabled: disabled,
|
|
3784
|
+
children: "×"
|
|
3785
|
+
}) ]
|
|
3748
3786
|
});
|
|
3749
3787
|
if (glass) {
|
|
3750
|
-
// Default glass
|
|
3788
|
+
// Default glass settings for badges
|
|
3751
3789
|
const defaultGlassProps = {
|
|
3752
3790
|
displacementScale: 20,
|
|
3753
|
-
|
|
3754
|
-
|
|
3791
|
+
cornerRadius: ref.current?.getBoundingClientRect().width ? ref.current?.getBoundingClientRect().width / 2 : 16,
|
|
3792
|
+
className: "c-badge--glass",
|
|
3755
3793
|
elasticity: 0
|
|
3756
3794
|
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
3757
3795
|
...defaultGlassProps,
|
|
@@ -3759,420 +3797,557 @@ const Button = React.memo( forwardRef((({label: label, children: children, onCl
|
|
|
3759
3797
|
};
|
|
3760
3798
|
return jsx(AtomixGlass, {
|
|
3761
3799
|
...glassProps,
|
|
3762
|
-
children:
|
|
3800
|
+
children: badgeElement
|
|
3763
3801
|
});
|
|
3764
3802
|
}
|
|
3765
|
-
return
|
|
3766
|
-
}))
|
|
3803
|
+
return badgeElement;
|
|
3804
|
+
}));
|
|
3767
3805
|
|
|
3768
|
-
|
|
3806
|
+
Badge.displayName = "Badge";
|
|
3769
3807
|
|
|
3770
3808
|
/**
|
|
3771
|
-
*
|
|
3772
|
-
*
|
|
3773
|
-
* Groups buttons together with proper border radius handling and spacing.
|
|
3774
|
-
* The buttons will be visually connected with shared borders.
|
|
3809
|
+
* Container component for creating responsive layouts.
|
|
3810
|
+
* Uses the CSS container classes defined in _objects.container.scss.
|
|
3775
3811
|
*
|
|
3776
3812
|
* @example
|
|
3777
3813
|
* ```tsx
|
|
3778
|
-
* <
|
|
3779
|
-
*
|
|
3780
|
-
*
|
|
3781
|
-
*
|
|
3782
|
-
*
|
|
3814
|
+
* <Container>
|
|
3815
|
+
* Content with responsive max-width
|
|
3816
|
+
* </Container>
|
|
3817
|
+
*
|
|
3818
|
+
* <Container type="fluid">
|
|
3819
|
+
* Full width content
|
|
3820
|
+
* </Container>
|
|
3821
|
+
*
|
|
3822
|
+
* <Container type="md">
|
|
3823
|
+
* Content with max-width at md breakpoint
|
|
3824
|
+
* </Container>
|
|
3783
3825
|
* ```
|
|
3784
3826
|
*/
|
|
3785
|
-
const
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
role: role,
|
|
3793
|
-
"aria-label": ariaLabel,
|
|
3794
|
-
children: buttonChildren.map(((child, index) => isValidElement(child) ? cloneElement(child, {
|
|
3795
|
-
key: index,
|
|
3796
|
-
...child.props
|
|
3797
|
-
}) : null))
|
|
3827
|
+
const Container = forwardRef((({children: children, className: className = "", type: type, ...props}, ref) => {
|
|
3828
|
+
let containerClass = "o-container";
|
|
3829
|
+
return type && (containerClass = `o-container-${type}`), jsx("div", {
|
|
3830
|
+
ref: ref,
|
|
3831
|
+
className: `${containerClass} ${className}`.trim(),
|
|
3832
|
+
...props,
|
|
3833
|
+
children: children
|
|
3798
3834
|
});
|
|
3799
|
-
};
|
|
3835
|
+
}));
|
|
3800
3836
|
|
|
3801
|
-
|
|
3837
|
+
Container.displayName = "Container";
|
|
3802
3838
|
|
|
3803
|
-
|
|
3839
|
+
/**
|
|
3840
|
+
* useBlock composable for Block component
|
|
3841
|
+
* Provides utility functions for generating consistent block styling
|
|
3842
|
+
*/
|
|
3843
|
+
const useBlock = () => ({
|
|
3844
|
+
generateBlockClass: ({spacing: spacing = BLOCK.SPACING.DEFAULT, background: background = "", fullWidth: fullWidth = !1, className: className = ""}) => {
|
|
3845
|
+
const classes = [ BLOCK.BASE_CLASS ];
|
|
3846
|
+
// Add spacing class
|
|
3847
|
+
// Add background class
|
|
3848
|
+
if (spacing && "none" !== spacing && classes.push(`${BLOCK.SPACING_PREFIX}${spacing}`),
|
|
3849
|
+
background) {
|
|
3850
|
+
const bgClass = BLOCK.CLASSES[`BG_${background.toUpperCase()}`];
|
|
3851
|
+
bgClass && classes.push(bgClass);
|
|
3852
|
+
}
|
|
3853
|
+
// Add full-width class
|
|
3854
|
+
return fullWidth && classes.push(BLOCK.CLASSES.FULL_WIDTH),
|
|
3855
|
+
// Add custom className
|
|
3856
|
+
className && classes.push(className), classes.filter(Boolean).join(" ");
|
|
3857
|
+
}
|
|
3858
|
+
}), Block = forwardRef((({children: children, as: Component = "section", spacing: spacing = "md", container: container = {}, fullWidth: fullWidth = !1, className: className = "", style: style, background: background = "", ...props}, ref) => {
|
|
3859
|
+
const {generateBlockClass: generateBlockClass} = useBlock(), blockClasses = generateBlockClass({
|
|
3860
|
+
spacing: spacing,
|
|
3861
|
+
background: background,
|
|
3862
|
+
fullWidth: fullWidth,
|
|
3863
|
+
className: className
|
|
3864
|
+
});
|
|
3865
|
+
return jsx(Component, {
|
|
3866
|
+
ref: ref,
|
|
3867
|
+
className: blockClasses,
|
|
3868
|
+
style: style,
|
|
3869
|
+
...props,
|
|
3870
|
+
children: fullWidth ? children : jsx(Container, {
|
|
3871
|
+
type: container.type,
|
|
3872
|
+
className: container.className,
|
|
3873
|
+
children: children
|
|
3874
|
+
})
|
|
3875
|
+
});
|
|
3876
|
+
}));
|
|
3804
3877
|
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3878
|
+
/**
|
|
3879
|
+
* Block component for creating structured section layouts.
|
|
3880
|
+
* Provides consistent spacing, backgrounds, and container behavior for content sections.
|
|
3881
|
+
*
|
|
3882
|
+
* @example
|
|
3883
|
+
* ```tsx
|
|
3884
|
+
* // Basic usage
|
|
3885
|
+
* <Block>
|
|
3886
|
+
* <h2>Section Title</h2>
|
|
3887
|
+
* <p>Section content goes here...</p>
|
|
3888
|
+
* </Block>
|
|
3889
|
+
*
|
|
3890
|
+
* // With custom spacing and background
|
|
3891
|
+
* <Block spacing="lg" background="subtle">
|
|
3892
|
+
* <h2>Featured Section</h2>
|
|
3893
|
+
* <p>This section has extra padding and a subtle background.</p>
|
|
3894
|
+
* </Block>
|
|
3895
|
+
*
|
|
3896
|
+
* // Full-width with custom container
|
|
3897
|
+
* <Block fullWidth background="primary">
|
|
3898
|
+
* <Container type="lg">
|
|
3899
|
+
* <h2>Hero Section</h2>
|
|
3900
|
+
* <p>Full-width section with centered content.</p>
|
|
3901
|
+
* </Container>
|
|
3902
|
+
* </Block>
|
|
3903
|
+
*
|
|
3904
|
+
* // As article element
|
|
3905
|
+
* <Block as="article" spacing="xl" background="accent">
|
|
3906
|
+
* <h1>Blog Post</h1>
|
|
3907
|
+
* <p>Article content...</p>
|
|
3908
|
+
* </Block>
|
|
3909
|
+
* ```
|
|
3910
|
+
*/ Block.displayName = "Block";
|
|
3808
3911
|
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
},
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
return function() {
|
|
3822
|
-
return call$5.apply(fn, arguments);
|
|
3912
|
+
const BreadcrumbItem = forwardRef((({children: children, href: href, active: active, icon: icon, onClick: onClick, className: className = "", style: style, linkAs: LinkComponent, linkProps: linkProps = {}, ...props}, ref) => {
|
|
3913
|
+
const itemClasses = [ BREADCRUMB.CLASSES.ITEM, active ? BREADCRUMB.CLASSES.ACTIVE : "", className ].filter(Boolean).join(" "), linkContent = jsxs(Fragment, {
|
|
3914
|
+
children: [ icon && jsx("span", {
|
|
3915
|
+
className: "c-breadcrumb__icon",
|
|
3916
|
+
children: icon
|
|
3917
|
+
}), children ]
|
|
3918
|
+
}), commonLinkProps = {
|
|
3919
|
+
className: BREADCRUMB.CLASSES.LINK,
|
|
3920
|
+
onClick: onClick,
|
|
3921
|
+
style: style,
|
|
3922
|
+
// Apply style to the link as per legacy behavior
|
|
3923
|
+
...linkProps
|
|
3823
3924
|
};
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
})
|
|
3837
|
-
|
|
3838
|
-
}
|
|
3839
|
-
// Nashorn bug:
|
|
3840
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
3841
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
3842
|
-
if ("Function" === classofRaw$1(fn)) return uncurryThis$6(fn);
|
|
3843
|
-
}, documentAll = "object" == typeof document && document.all, isCallable$8 = void 0 === documentAll && void 0 !== documentAll ? function(argument) {
|
|
3844
|
-
return "function" == typeof argument || argument === documentAll;
|
|
3845
|
-
} : function(argument) {
|
|
3846
|
-
return "function" == typeof argument;
|
|
3847
|
-
}, objectGetOwnPropertyDescriptor = {}, descriptors = !fails$9((function() {
|
|
3848
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
3849
|
-
return 7 !== Object.defineProperty({}, 1, {
|
|
3850
|
-
get: function() {
|
|
3851
|
-
return 7;
|
|
3852
|
-
}
|
|
3853
|
-
})[1];
|
|
3854
|
-
})), NATIVE_BIND$1 = functionBindNative, call$3 = Function.prototype.call, functionCall = NATIVE_BIND$1 ? call$3.bind(call$3) : function() {
|
|
3855
|
-
return call$3.apply(call$3, arguments);
|
|
3856
|
-
}, objectPropertyIsEnumerable = {}, $propertyIsEnumerable = {}.propertyIsEnumerable, getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({
|
|
3857
|
-
1: 2
|
|
3858
|
-
}, 1);
|
|
3859
|
-
|
|
3860
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
3861
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
3862
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function(V) {
|
|
3863
|
-
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
3864
|
-
return !!descriptor && descriptor.enumerable;
|
|
3865
|
-
} : $propertyIsEnumerable;
|
|
3925
|
+
return jsx("li", {
|
|
3926
|
+
ref: ref,
|
|
3927
|
+
className: itemClasses,
|
|
3928
|
+
style: style,
|
|
3929
|
+
...props,
|
|
3930
|
+
children: href && !active ? jsx(LinkComponent || "a", {
|
|
3931
|
+
href: href,
|
|
3932
|
+
...commonLinkProps,
|
|
3933
|
+
children: linkContent
|
|
3934
|
+
}) : jsx("span", {
|
|
3935
|
+
className: BREADCRUMB.CLASSES.LINK,
|
|
3936
|
+
children: linkContent
|
|
3937
|
+
})
|
|
3938
|
+
});
|
|
3939
|
+
}));
|
|
3866
3940
|
|
|
3867
|
-
|
|
3868
|
-
return {
|
|
3869
|
-
enumerable: !(1 & bitmap),
|
|
3870
|
-
configurable: !(2 & bitmap),
|
|
3871
|
-
writable: !(4 & bitmap),
|
|
3872
|
-
value: value
|
|
3873
|
-
};
|
|
3874
|
-
}, fails$6 = fails$9, classof$4 = classofRaw$2, $Object$3 = Object, split = functionUncurryThis("".split), indexedObject = fails$6((function() {
|
|
3875
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
3876
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
3877
|
-
return !$Object$3("z").propertyIsEnumerable(0);
|
|
3878
|
-
})) ? function(it) {
|
|
3879
|
-
return "String" === classof$4(it) ? split(it, "") : $Object$3(it);
|
|
3880
|
-
} : $Object$3, isNullOrUndefined$2 = function(it) {
|
|
3881
|
-
return null == it;
|
|
3882
|
-
}, isNullOrUndefined$1 = isNullOrUndefined$2, $TypeError$7 = TypeError, requireObjectCoercible$3 = function(it) {
|
|
3883
|
-
if (isNullOrUndefined$1(it)) throw new $TypeError$7("Can't call method on " + it);
|
|
3884
|
-
return it;
|
|
3885
|
-
}, IndexedObject$1 = indexedObject, requireObjectCoercible$2 = requireObjectCoercible$3, toIndexedObject$2 = function(it) {
|
|
3886
|
-
return IndexedObject$1(requireObjectCoercible$2(it));
|
|
3887
|
-
}, isCallable$7 = isCallable$8, isObject$6 = function(it) {
|
|
3888
|
-
return "object" == typeof it ? null !== it : isCallable$7(it);
|
|
3889
|
-
}, path$3 = {}, path$2 = path$3, globalThis$b = globalThis_1, isCallable$6 = isCallable$8, aFunction = function(variable) {
|
|
3890
|
-
return isCallable$6(variable) ? variable : void 0;
|
|
3891
|
-
}, navigator$1 = globalThis_1.navigator, userAgent$2 = navigator$1 && navigator$1.userAgent, environmentUserAgent = userAgent$2 ? String(userAgent$2) : "", globalThis$9 = globalThis_1, userAgent$1 = environmentUserAgent, process$1 = globalThis$9.process, Deno$1 = globalThis$9.Deno, versions = process$1 && process$1.versions || Deno$1 && Deno$1.version, v8 = versions && versions.v8;
|
|
3941
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
3892
3942
|
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
//
|
|
3898
|
-
|
|
3899
|
-
|
|
3943
|
+
const Breadcrumb = memo((({items: items, divider: divider, className: className = "", "aria-label": ariaLabel = "Breadcrumb", LinkComponent: LinkComponent, style: style, children: children}) => {
|
|
3944
|
+
const breadcrumbClasses = [ BREADCRUMB.CLASSES.BASE, className ].filter(Boolean).join(" ");
|
|
3945
|
+
let content;
|
|
3946
|
+
if (items && items.length > 0)
|
|
3947
|
+
// Legacy rendering
|
|
3948
|
+
content = items.map(((item, index) => {
|
|
3949
|
+
const isLast = index === items.length - 1;
|
|
3950
|
+
return jsx(BreadcrumbItem, {
|
|
3951
|
+
href: item.href,
|
|
3952
|
+
active: item.active || isLast,
|
|
3953
|
+
icon: item.icon,
|
|
3954
|
+
onClick: item.onClick,
|
|
3955
|
+
className: item.className,
|
|
3956
|
+
style: item.style,
|
|
3957
|
+
linkAs: LinkComponent,
|
|
3958
|
+
children: item.label
|
|
3959
|
+
}, index);
|
|
3960
|
+
})); else {
|
|
3961
|
+
// Compound rendering
|
|
3962
|
+
const childrenCount = Children.count(children);
|
|
3963
|
+
content = Children.map(children, ((child, index) => {
|
|
3964
|
+
if ( isValidElement(child)) {
|
|
3965
|
+
const isLast = index === childrenCount - 1, childProps = child.props;
|
|
3966
|
+
|
|
3967
|
+
return cloneElement(child, {
|
|
3968
|
+
active: childProps.active ?? (!!isLast || void 0),
|
|
3969
|
+
linkAs: childProps.linkAs ?? LinkComponent
|
|
3970
|
+
});
|
|
3971
|
+
}
|
|
3972
|
+
return child;
|
|
3973
|
+
}));
|
|
3974
|
+
}
|
|
3975
|
+
return jsx("nav", {
|
|
3976
|
+
"aria-label": ariaLabel,
|
|
3977
|
+
style: style,
|
|
3978
|
+
children: jsx("ol", {
|
|
3979
|
+
className: breadcrumbClasses,
|
|
3980
|
+
children: content
|
|
3981
|
+
})
|
|
3982
|
+
});
|
|
3983
|
+
}));
|
|
3900
3984
|
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
return "Object";
|
|
3985
|
+
/**
|
|
3986
|
+
* Spinner state and functionality
|
|
3987
|
+
* @param initialProps - Initial spinner properties
|
|
3988
|
+
* @returns Spinner state and methods
|
|
3989
|
+
*/
|
|
3990
|
+
function useSpinner(initialProps) {
|
|
3991
|
+
// Default spinner properties
|
|
3992
|
+
const defaultProps = {
|
|
3993
|
+
variant: "primary",
|
|
3994
|
+
size: "md",
|
|
3995
|
+
fullscreen: !1,
|
|
3996
|
+
...initialProps
|
|
3997
|
+
};
|
|
3998
|
+
/**
|
|
3999
|
+
* Generate spinner class based on properties
|
|
4000
|
+
* @param props - Spinner properties
|
|
4001
|
+
* @returns Class string
|
|
4002
|
+
*/ return {
|
|
4003
|
+
defaultProps: defaultProps,
|
|
4004
|
+
generateSpinnerClass: props => {
|
|
4005
|
+
const {variant: variant = defaultProps.variant, size: size = defaultProps.size, fullscreen: fullscreen = defaultProps.fullscreen, className: className = ""} = props;
|
|
4006
|
+
return `c-spinner ${variant ? `c-spinner--${variant}` : ""} ${"md" !== size ? `c-spinner--${size}` : ""} ${fullscreen ? "c-spinner--fullscreen" : ""} ${className}`.trim();
|
|
3924
4007
|
}
|
|
3925
|
-
}
|
|
3926
|
-
}
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
4008
|
+
};
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
Breadcrumb.displayName = "Breadcrumb", Breadcrumb.Item = BreadcrumbItem;
|
|
4012
|
+
|
|
4013
|
+
const Spinner = memo((({size: size = "md", variant: variant = "primary", fullscreen: fullscreen = !1, className: className = "", style: style, glass: glass, "aria-label": ariaLabel, role: role = "status"}) => {
|
|
4014
|
+
const {generateSpinnerClass: generateSpinnerClass} = useSpinner({
|
|
4015
|
+
size: size,
|
|
4016
|
+
variant: variant,
|
|
4017
|
+
fullscreen: fullscreen
|
|
4018
|
+
}), spinnerClass = generateSpinnerClass({
|
|
4019
|
+
size: size,
|
|
4020
|
+
variant: variant,
|
|
4021
|
+
fullscreen: fullscreen,
|
|
4022
|
+
className: `${className} ${glass ? "c-spinner--glass" : ""}`.trim()
|
|
4023
|
+
}), spinnerContent = jsx("div", {
|
|
4024
|
+
className: spinnerClass,
|
|
4025
|
+
style: style,
|
|
4026
|
+
role: role,
|
|
4027
|
+
"aria-label": ariaLabel || "Loading",
|
|
4028
|
+
children: jsx("span", {
|
|
4029
|
+
className: SPINNER.VISUALLY_HIDDEN,
|
|
4030
|
+
children: ariaLabel || "Loading..."
|
|
4031
|
+
})
|
|
4032
|
+
});
|
|
4033
|
+
if (glass) {
|
|
4034
|
+
const defaultGlassProps = {
|
|
4035
|
+
displacementScale: 20,
|
|
4036
|
+
blurAmount: 1,
|
|
4037
|
+
cornerRadius: 999,
|
|
4038
|
+
mode: "shader"
|
|
4039
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
4040
|
+
...defaultGlassProps,
|
|
4041
|
+
...glass
|
|
4042
|
+
};
|
|
4043
|
+
return jsx(AtomixGlass, {
|
|
4044
|
+
...glassProps,
|
|
4045
|
+
children: spinnerContent
|
|
3934
4046
|
});
|
|
3935
|
-
} catch (error) {
|
|
3936
|
-
globalThis$7[key] = value;
|
|
3937
4047
|
}
|
|
3938
|
-
return
|
|
3939
|
-
}
|
|
4048
|
+
return spinnerContent;
|
|
4049
|
+
}));
|
|
3940
4050
|
|
|
3941
|
-
|
|
3942
|
-
version: "3.43.0",
|
|
3943
|
-
mode: "pure",
|
|
3944
|
-
copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru)",
|
|
3945
|
-
license: "https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",
|
|
3946
|
-
source: "https://github.com/zloirock/core-js"
|
|
3947
|
-
});
|
|
4051
|
+
Spinner.displayName = "Spinner";
|
|
3948
4052
|
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
4053
|
+
/**
|
|
4054
|
+
* Theme Naming Utility
|
|
4055
|
+
*
|
|
4056
|
+
* Provides consistent naming conventions for CSS classes, CSS variables,
|
|
4057
|
+
* and JavaScript properties throughout the theme system.
|
|
4058
|
+
*/
|
|
4059
|
+
class ThemeNaming {
|
|
4060
|
+
/**
|
|
4061
|
+
* Set the global prefix for all theme tokens
|
|
4062
|
+
* @param newPrefix - New prefix to use
|
|
4063
|
+
*/
|
|
4064
|
+
static setPrefix(newPrefix) {
|
|
4065
|
+
this.prefix = newPrefix;
|
|
4066
|
+
}
|
|
4067
|
+
/**
|
|
4068
|
+
* Get the current prefix
|
|
4069
|
+
*/ static getPrefix() {
|
|
4070
|
+
return this.prefix;
|
|
4071
|
+
}
|
|
4072
|
+
/**
|
|
4073
|
+
* Convert camelCase to kebab-case for CSS variables
|
|
4074
|
+
* @param str - String to convert
|
|
4075
|
+
*/ static camelToKebab(str) {
|
|
4076
|
+
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
4077
|
+
}
|
|
4078
|
+
/**
|
|
4079
|
+
* Convert kebab-case to camelCase for JavaScript properties
|
|
4080
|
+
* @param str - String to convert
|
|
4081
|
+
*/ static kebabToCamel(str) {
|
|
4082
|
+
return str.replace(/-([a-z])/g, (g => g[1]?.toUpperCase() ?? ""));
|
|
4083
|
+
}
|
|
4084
|
+
/**
|
|
4085
|
+
* Create a CSS variable name
|
|
4086
|
+
* @param token - Token name in camelCase
|
|
4087
|
+
*/ static cssVar(token) {
|
|
4088
|
+
return `--${this.prefix}-${this.camelToKebab(token)}`;
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* Create a BEM CSS class name
|
|
4092
|
+
* @param block - Block name
|
|
4093
|
+
* @param element - Element name (optional)
|
|
4094
|
+
* @param modifier - Modifier name (optional)
|
|
4095
|
+
*/ static bemClass(block, element, modifier) {
|
|
4096
|
+
let className = `c-${block}`;
|
|
4097
|
+
return element && (className += `__${element}`), modifier && (className += `--${modifier}`),
|
|
4098
|
+
className;
|
|
4099
|
+
}
|
|
4100
|
+
/**
|
|
4101
|
+
* Create a variant class name
|
|
4102
|
+
* @param component - Component name
|
|
4103
|
+
* @param variant - Variant name
|
|
4104
|
+
*/ static variantClass(component, variant) {
|
|
4105
|
+
return `c-${component}--${variant}`;
|
|
4106
|
+
}
|
|
4107
|
+
/**
|
|
4108
|
+
* Create a size class name
|
|
4109
|
+
* @param component - Component name
|
|
4110
|
+
* @param size - Size name
|
|
4111
|
+
*/ static sizeClass(component, size) {
|
|
4112
|
+
return `c-${component}--${size}`;
|
|
4113
|
+
}
|
|
4114
|
+
/**
|
|
4115
|
+
* Create a state class name
|
|
4116
|
+
* @param component - Component name
|
|
4117
|
+
* @param state - State name
|
|
4118
|
+
*/ static stateClass(component, state) {
|
|
4119
|
+
return `c-${component}--${state}`;
|
|
4120
|
+
}
|
|
4121
|
+
/**
|
|
4122
|
+
* Create a utility class name
|
|
4123
|
+
* @param utility - Utility name
|
|
4124
|
+
*/ static utilityClass(utility) {
|
|
4125
|
+
return `u-${utility}`;
|
|
4126
|
+
}
|
|
4127
|
+
/**
|
|
4128
|
+
* Create a layout class name
|
|
4129
|
+
* @param layout - Layout name
|
|
4130
|
+
*/ static layoutClass(layout) {
|
|
4131
|
+
return `l-${layout}`;
|
|
4132
|
+
}
|
|
4133
|
+
/**
|
|
4134
|
+
* Create an object class name
|
|
4135
|
+
* @param object - Object name
|
|
4136
|
+
*/ static objectClass(object) {
|
|
4137
|
+
return `o-${object}`;
|
|
3965
4138
|
}
|
|
3966
|
-
|
|
3967
|
-
var fn, val;
|
|
3968
|
-
if ("string" === pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
3969
|
-
if (isCallable$3(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
|
|
3970
|
-
if ("string" !== pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
|
|
3971
|
-
throw new $TypeError$5("Can't convert object to primitive value");
|
|
3972
|
-
}(input, pref);
|
|
3973
|
-
}, isSymbol = isSymbol$2, toPropertyKey$2 = function(argument) {
|
|
3974
|
-
var key = toPrimitive(argument, "string");
|
|
3975
|
-
return isSymbol(key) ? key : key + "";
|
|
3976
|
-
}, isObject$3 = isObject$6, document$1 = globalThis_1.document, EXISTS = isObject$3(document$1) && isObject$3(document$1.createElement), ie8DomDefine = !descriptors && !fails$9((function() {
|
|
3977
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
3978
|
-
return 7 !== Object.defineProperty((it = "div", EXISTS ? document$1.createElement(it) : {}), "a", {
|
|
3979
|
-
get: function() {
|
|
3980
|
-
return 7;
|
|
3981
|
-
}
|
|
3982
|
-
}).a;
|
|
3983
|
-
var it;
|
|
3984
|
-
})), DESCRIPTORS$3 = descriptors, call = functionCall, propertyIsEnumerableModule = objectPropertyIsEnumerable, createPropertyDescriptor$1 = createPropertyDescriptor$2, toIndexedObject$1 = toIndexedObject$2, toPropertyKey$1 = toPropertyKey$2, hasOwn$1 = hasOwnProperty_1, IE8_DOM_DEFINE$1 = ie8DomDefine, $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
3985
|
-
|
|
3986
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
3987
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
3988
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor$1 : function(O, P) {
|
|
3989
|
-
if (O = toIndexedObject$1(O), P = toPropertyKey$1(P), IE8_DOM_DEFINE$1) try {
|
|
3990
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
3991
|
-
} catch (error) {/* empty */}
|
|
3992
|
-
if (hasOwn$1(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
3993
|
-
};
|
|
4139
|
+
}
|
|
3994
4140
|
|
|
3995
|
-
|
|
3996
|
-
var value = data[normalize(feature)];
|
|
3997
|
-
return value === POLYFILL || value !== NATIVE && (isCallable$2(detection) ? fails$3(detection) : !!detection);
|
|
3998
|
-
}, normalize = isForced$1.normalize = function(string) {
|
|
3999
|
-
return String(string).replace(replacement, ".").toLowerCase();
|
|
4000
|
-
}, data = isForced$1.data = {}, NATIVE = isForced$1.NATIVE = "N", POLYFILL = isForced$1.POLYFILL = "P", isForced_1 = isForced$1, aCallable$1 = aCallable$3, NATIVE_BIND = functionBindNative, bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind), objectDefineProperty = {}, v8PrototypeDefineBug = descriptors && fails$9((function() {
|
|
4001
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
4002
|
-
return 42 !== Object.defineProperty((function() {/* empty */}), "prototype", {
|
|
4003
|
-
value: 42,
|
|
4004
|
-
writable: !1
|
|
4005
|
-
}).prototype;
|
|
4006
|
-
})), isObject$2 = isObject$6, $String$1 = String, $TypeError$3 = TypeError, DESCRIPTORS$1 = descriptors, IE8_DOM_DEFINE = ie8DomDefine, V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug, anObject = function(argument) {
|
|
4007
|
-
if (isObject$2(argument)) return argument;
|
|
4008
|
-
throw new $TypeError$3($String$1(argument) + " is not an object");
|
|
4009
|
-
}, toPropertyKey = toPropertyKey$2, $TypeError$2 = TypeError, $defineProperty = Object.defineProperty, $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
4141
|
+
ThemeNaming.prefix = "atomix";
|
|
4010
4142
|
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4143
|
+
const Button = React.memo( forwardRef((({label: label, children: children, onClick: onClick, variant: variant = "primary", size: size = "md", disabled: disabled = !1, loading: loading = !1, loadingText: loadingText, icon: icon, iconName: iconName, iconSize: iconSize = "sm", iconPosition: iconPosition = "start", iconOnly: iconOnly = !1, rounded: rounded = !1, fullWidth: fullWidth = !1, block: block = !1, active: active = !1, selected: selected = !1, type: type = "button", className: className = "", as: Component = "button", href: href, target: target, glass: glass, onHover: onHover, onFocus: onFocus, onBlur: onBlur, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, tabIndex: tabIndex, style: style, LinkComponent: LinkComponent, ...props}, ref) => {
|
|
4144
|
+
const isDisabled = disabled || loading, shouldRenderAsLink = Boolean(href && !isDisabled), iconElement = iconName ? jsx(Icon, {
|
|
4145
|
+
name: iconName,
|
|
4146
|
+
size: iconSize
|
|
4147
|
+
}) : icon, buttonClass = [ BUTTON.BASE_CLASS, ThemeNaming.variantClass(THEME_NAMING.BUTTON_PREFIX, variant), "md" !== size ? ThemeNaming.sizeClass(THEME_NAMING.BUTTON_PREFIX, size) : "", iconOnly ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.ICON_ELEMENT) : "", rounded ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "rounded") : "", isDisabled ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "disabled") : "", glass ? ThemeNaming.stateClass(THEME_NAMING.BUTTON_PREFIX, "glass") : "", loading ? BUTTON.CLASSES.LOADING : "", fullWidth ? BUTTON.CLASSES.FULL_WIDTH : "", block ? BUTTON.CLASSES.BLOCK : "", active ? BUTTON.CLASSES.ACTIVE : "", selected ? BUTTON.CLASSES.SELECTED : "", className ].filter(Boolean).join(" "), handleClickEvent = useCallback((event => {
|
|
4148
|
+
isDisabled ? event.preventDefault() : onClick?.(event);
|
|
4149
|
+
}), [ isDisabled, onClick ]), handleMouseEnter = useCallback((event => {
|
|
4150
|
+
isDisabled || onHover?.(event);
|
|
4151
|
+
}), [ isDisabled, onHover ]), handleFocusEvent = useCallback((event => {
|
|
4152
|
+
isDisabled || onFocus?.(event);
|
|
4153
|
+
}), [ isDisabled, onFocus ]), handleBlurEvent = useCallback((event => {
|
|
4154
|
+
isDisabled || onBlur?.(event);
|
|
4155
|
+
}), [ isDisabled, onBlur ]), buttonText = loading && loadingText ? loadingText : label || children, spinnerSize = "sm" === size ? "sm" : "lg" === size ? "md" : "sm", safeAriaLabel = ariaLabel || (iconOnly ? "string" == typeof label ? label : "string" == typeof children ? children : void 0 : void 0), buttonContent = jsxs(Fragment, {
|
|
4156
|
+
children: [ loading && jsx("span", {
|
|
4157
|
+
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.SPINNER_ELEMENT),
|
|
4158
|
+
"aria-hidden": "true",
|
|
4159
|
+
children: jsx(Spinner, {
|
|
4160
|
+
size: spinnerSize,
|
|
4161
|
+
variant: "link" === variant || "string" == typeof variant && variant.startsWith("outline-") ? "primary" : "danger" === variant ? "error" : variant
|
|
4162
|
+
})
|
|
4163
|
+
}), iconElement && !loading && jsx("span", {
|
|
4164
|
+
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.ICON_ELEMENT),
|
|
4165
|
+
"aria-hidden": "true",
|
|
4166
|
+
children: iconElement
|
|
4167
|
+
}), !iconOnly && buttonText && jsx("span", {
|
|
4168
|
+
className: ThemeNaming.bemClass(THEME_NAMING.BUTTON_PREFIX, THEME_NAMING.LABEL_ELEMENT),
|
|
4169
|
+
children: buttonText
|
|
4170
|
+
}) ]
|
|
4171
|
+
}), buttonProps = {
|
|
4172
|
+
className: buttonClass,
|
|
4173
|
+
onClick: handleClickEvent,
|
|
4174
|
+
onMouseEnter: onHover ? handleMouseEnter : void 0,
|
|
4175
|
+
onFocus: onFocus ? handleFocusEvent : void 0,
|
|
4176
|
+
onBlur: onBlur ? handleBlurEvent : void 0,
|
|
4177
|
+
"aria-disabled": isDisabled,
|
|
4178
|
+
"aria-busy": loading,
|
|
4179
|
+
"aria-label": safeAriaLabel,
|
|
4180
|
+
"aria-describedby": ariaDescribedBy,
|
|
4181
|
+
"aria-expanded": ariaExpanded,
|
|
4182
|
+
"aria-controls": ariaControls,
|
|
4183
|
+
tabIndex: void 0 !== tabIndex ? tabIndex : isDisabled ? -1 : 0,
|
|
4184
|
+
style: style,
|
|
4185
|
+
...props
|
|
4186
|
+
};
|
|
4187
|
+
// Determine if we should render as a link
|
|
4188
|
+
// If disabled, we still check href, but we might want to render as button or anchor with aria-disabled
|
|
4189
|
+
// The previous logic was Boolean(href && !isDisabled). This meant if disabled, it renders as <button>.
|
|
4190
|
+
// This is a safe fallback for disabled links.
|
|
4191
|
+
let content;
|
|
4192
|
+
// Render as anchor if href is provided
|
|
4193
|
+
if (shouldRenderAsLink)
|
|
4194
|
+
// Use custom LinkComponent if provided (e.g., Next.js Link)
|
|
4195
|
+
if (LinkComponent) {
|
|
4196
|
+
const LinkComp = LinkComponent, linkProps = {
|
|
4197
|
+
...buttonProps,
|
|
4198
|
+
ref: ref,
|
|
4199
|
+
// LinkComponent usually forwards ref to anchor
|
|
4200
|
+
href: href,
|
|
4201
|
+
target: target,
|
|
4202
|
+
rel: "_blank" === target ? "noopener noreferrer" : void 0
|
|
4203
|
+
};
|
|
4204
|
+
content = jsx(LinkComp, {
|
|
4205
|
+
...linkProps,
|
|
4206
|
+
children: buttonContent
|
|
4207
|
+
});
|
|
4208
|
+
} else
|
|
4209
|
+
// Fallback to regular anchor tag
|
|
4210
|
+
content = jsx("a", {
|
|
4211
|
+
...buttonProps,
|
|
4212
|
+
ref: ref,
|
|
4213
|
+
href: href,
|
|
4214
|
+
target: target,
|
|
4215
|
+
rel: "_blank" === target ? "noopener noreferrer" : void 0,
|
|
4216
|
+
children: buttonContent
|
|
4217
|
+
}); else
|
|
4218
|
+
// Default button rendering
|
|
4219
|
+
content = jsx(Component, {
|
|
4220
|
+
...buttonProps,
|
|
4221
|
+
ref: ref,
|
|
4222
|
+
type: "button" === Component ? type : void 0,
|
|
4223
|
+
disabled: isDisabled,
|
|
4224
|
+
children: buttonContent
|
|
4225
|
+
});
|
|
4226
|
+
if (glass) {
|
|
4227
|
+
// Default glass props
|
|
4228
|
+
const defaultGlassProps = {
|
|
4229
|
+
displacementScale: 20,
|
|
4230
|
+
blurAmount: 0,
|
|
4231
|
+
saturation: 200,
|
|
4232
|
+
elasticity: 0
|
|
4233
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
4234
|
+
...defaultGlassProps,
|
|
4235
|
+
...glass
|
|
4236
|
+
};
|
|
4237
|
+
return jsx(AtomixGlass, {
|
|
4238
|
+
...glassProps,
|
|
4239
|
+
children: content
|
|
4020
4240
|
});
|
|
4021
4241
|
}
|
|
4022
|
-
return
|
|
4023
|
-
}
|
|
4024
|
-
if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try {
|
|
4025
|
-
return $defineProperty(O, P, Attributes);
|
|
4026
|
-
} catch (error) {/* empty */}
|
|
4027
|
-
if ("get" in Attributes || "set" in Attributes) throw new $TypeError$2("Accessors not supported");
|
|
4028
|
-
return "value" in Attributes && (O[P] = Attributes.value), O;
|
|
4029
|
-
};
|
|
4030
|
-
|
|
4031
|
-
var definePropertyModule = objectDefineProperty, createPropertyDescriptor = createPropertyDescriptor$2, createNonEnumerableProperty$1 = descriptors ? function(object, key, value) {
|
|
4032
|
-
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
|
4033
|
-
} : function(object, key, value) {
|
|
4034
|
-
return object[key] = value, object;
|
|
4035
|
-
}, globalThis$3 = globalThis_1, apply = functionApply, uncurryThis$1 = functionUncurryThisClause, isCallable$1 = isCallable$8, getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f, isForced = isForced_1, path$1 = path$3, bind = function(fn, that) {
|
|
4036
|
-
return aCallable$1(fn), void 0 === that ? fn : NATIVE_BIND ? bind$1(fn, that) : function() {
|
|
4037
|
-
return fn.apply(that, arguments);
|
|
4038
|
-
};
|
|
4039
|
-
}, createNonEnumerableProperty = createNonEnumerableProperty$1, hasOwn = hasOwnProperty_1, wrapConstructor = function(NativeConstructor) {
|
|
4040
|
-
var Wrapper = function(a, b, c) {
|
|
4041
|
-
if (this instanceof Wrapper) {
|
|
4042
|
-
switch (arguments.length) {
|
|
4043
|
-
case 0:
|
|
4044
|
-
return new NativeConstructor;
|
|
4242
|
+
return content;
|
|
4243
|
+
})));
|
|
4045
4244
|
|
|
4046
|
-
|
|
4047
|
-
return new NativeConstructor(a);
|
|
4245
|
+
Button.displayName = "Button";
|
|
4048
4246
|
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
//
|
|
4066
|
-
|
|
4067
|
-
//
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
}
|
|
4078
|
-
|
|
4079
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
4080
|
-
return number != number || 0 === number ? 0 : trunc(number);
|
|
4081
|
-
}, toIntegerOrInfinity$1 = toIntegerOrInfinity$2, max = Math.max, min$1 = Math.min, toIntegerOrInfinity = toIntegerOrInfinity$2, min = Math.min, lengthOfArrayLike$2 = function(obj) {
|
|
4082
|
-
return argument = obj.length, (len = toIntegerOrInfinity(argument)) > 0 ? min(len, 9007199254740991) : 0;
|
|
4083
|
-
var argument, len;
|
|
4084
|
-
}, toIndexedObject = toIndexedObject$2, lengthOfArrayLike$1 = lengthOfArrayLike$2, createMethod$1 = function(IS_INCLUDES) {
|
|
4085
|
-
return function($this, el, fromIndex) {
|
|
4086
|
-
var O = toIndexedObject($this), length = lengthOfArrayLike$1(O);
|
|
4087
|
-
if (0 === length) return !IS_INCLUDES && -1;
|
|
4088
|
-
var value, index = function(index, length) {
|
|
4089
|
-
var integer = toIntegerOrInfinity$1(index);
|
|
4090
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
4091
|
-
}(fromIndex, length);
|
|
4092
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
4093
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
4094
|
-
if (IS_INCLUDES && el != el) {
|
|
4095
|
-
for (;length > index; )
|
|
4096
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
4097
|
-
if ((value = O[index++]) != value) return !0;
|
|
4098
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
4099
|
-
} else for (;length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
4100
|
-
return !IS_INCLUDES && -1;
|
|
4101
|
-
};
|
|
4102
|
-
}, $includes = [ createMethod$1(!0), createMethod$1(!1) ][0];
|
|
4247
|
+
/**
|
|
4248
|
+
* ButtonGroup - A component for grouping buttons together
|
|
4249
|
+
*
|
|
4250
|
+
* Groups buttons together with proper border radius handling and spacing.
|
|
4251
|
+
* The buttons will be visually connected with shared borders.
|
|
4252
|
+
*
|
|
4253
|
+
* @example
|
|
4254
|
+
* ```tsx
|
|
4255
|
+
* <ButtonGroup>
|
|
4256
|
+
* <Button label="Left" />
|
|
4257
|
+
* <Button label="Middle" />
|
|
4258
|
+
* <Button label="Right" />
|
|
4259
|
+
* </ButtonGroup>
|
|
4260
|
+
* ```
|
|
4261
|
+
*/
|
|
4262
|
+
const ButtonGroup = ({children: children, className: className = "", style: style, "aria-label": ariaLabel, role: role = "group"}) => {
|
|
4263
|
+
// Generate CSS classes
|
|
4264
|
+
const buttonGroupClasses = [ BUTTON_GROUP.CLASSES.BASE, className ].filter(Boolean).join(" "), buttonChildren = Children.toArray(children).filter((child => isValidElement(child) && child.type === Button));
|
|
4265
|
+
// Get valid Button children
|
|
4266
|
+
return jsx("div", {
|
|
4267
|
+
className: buttonGroupClasses,
|
|
4268
|
+
style: style,
|
|
4269
|
+
role: role,
|
|
4270
|
+
"aria-label": ariaLabel,
|
|
4271
|
+
children: buttonChildren.map(((child, index) => isValidElement(child) ? cloneElement(child, {
|
|
4272
|
+
key: index,
|
|
4273
|
+
...child.props
|
|
4274
|
+
}) : null))
|
|
4275
|
+
});
|
|
4276
|
+
};
|
|
4103
4277
|
|
|
4104
|
-
|
|
4105
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
4106
|
-
_export({
|
|
4107
|
-
target: "Array",
|
|
4108
|
-
proto: !0,
|
|
4109
|
-
forced: fails$9((function() {
|
|
4110
|
-
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
4111
|
-
return !Array(1).includes();
|
|
4112
|
-
}))
|
|
4113
|
-
}, {
|
|
4114
|
-
includes: function(el /* , fromIndex = 0 */) {
|
|
4115
|
-
return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
|
|
4116
|
-
}
|
|
4117
|
-
});
|
|
4278
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
4118
4279
|
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4280
|
+
// Subcomponents
|
|
4281
|
+
const CalloutIcon = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4282
|
+
ref: ref,
|
|
4283
|
+
className: `c-callout__icon ${className}`.trim(),
|
|
4284
|
+
...props,
|
|
4285
|
+
children: children
|
|
4286
|
+
})));
|
|
4125
4287
|
|
|
4126
|
-
|
|
4288
|
+
CalloutIcon.displayName = "CalloutIcon";
|
|
4127
4289
|
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
}()
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
return it[key];
|
|
4135
|
-
} catch (error) {/* empty */}
|
|
4136
|
-
}(O = $Object(it), TO_STRING_TAG)) ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : "Object" === (result = classofRaw(O)) && isCallable(O.callee) ? "Arguments" : result;
|
|
4137
|
-
}, $String = String, MATCH = wellKnownSymbol$5("match"), $$1 = _export, notARegExp = function(it) {
|
|
4138
|
-
if (function(it) {
|
|
4139
|
-
var isRegExp;
|
|
4140
|
-
return isObject$1(it) && (void 0 !== (isRegExp = it[MATCH$1]) ? !!isRegExp : "RegExp" === classof$3(it));
|
|
4141
|
-
}(it)) throw new $TypeError$1("The method doesn't accept regular expressions");
|
|
4142
|
-
return it;
|
|
4143
|
-
}, requireObjectCoercible = requireObjectCoercible$3, toString = function(argument) {
|
|
4144
|
-
if ("Symbol" === classof$1(argument)) throw new TypeError("Cannot convert a Symbol value to a string");
|
|
4145
|
-
return $String(argument);
|
|
4146
|
-
}, stringIndexOf = functionUncurryThis("".indexOf);
|
|
4290
|
+
const CalloutMessage = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4291
|
+
ref: ref,
|
|
4292
|
+
className: `c-callout__message ${className}`.trim(),
|
|
4293
|
+
...props,
|
|
4294
|
+
children: children
|
|
4295
|
+
})));
|
|
4147
4296
|
|
|
4148
|
-
|
|
4149
|
-
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
4150
|
-
$$1({
|
|
4151
|
-
target: "String",
|
|
4152
|
-
proto: !0,
|
|
4153
|
-
forced: !function(METHOD_NAME) {
|
|
4154
|
-
var regexp = /./;
|
|
4155
|
-
try {
|
|
4156
|
-
"/./"[METHOD_NAME](regexp);
|
|
4157
|
-
} catch (error1) {
|
|
4158
|
-
try {
|
|
4159
|
-
return regexp[MATCH] = !1, "/./"[METHOD_NAME](regexp);
|
|
4160
|
-
} catch (error2) {/* empty */}
|
|
4161
|
-
}
|
|
4162
|
-
return !1;
|
|
4163
|
-
}("includes")
|
|
4164
|
-
}, {
|
|
4165
|
-
includes: function(searchString /* , position = 0 */) {
|
|
4166
|
-
return !!~stringIndexOf(toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : void 0);
|
|
4167
|
-
}
|
|
4168
|
-
});
|
|
4297
|
+
CalloutMessage.displayName = "CalloutMessage";
|
|
4169
4298
|
|
|
4170
|
-
|
|
4299
|
+
const CalloutTitle = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4300
|
+
ref: ref,
|
|
4301
|
+
className: `c-callout__title ${className}`.trim(),
|
|
4302
|
+
...props,
|
|
4303
|
+
children: children
|
|
4304
|
+
})));
|
|
4171
4305
|
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4306
|
+
CalloutTitle.displayName = "CalloutTitle";
|
|
4307
|
+
|
|
4308
|
+
const CalloutText = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4309
|
+
ref: ref,
|
|
4310
|
+
className: `c-callout__text ${className}`.trim(),
|
|
4311
|
+
...props,
|
|
4312
|
+
children: children
|
|
4313
|
+
})));
|
|
4314
|
+
|
|
4315
|
+
CalloutText.displayName = "CalloutText";
|
|
4316
|
+
|
|
4317
|
+
const CalloutActions = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4318
|
+
ref: ref,
|
|
4319
|
+
className: `c-callout__actions ${className}`.trim(),
|
|
4320
|
+
...props,
|
|
4321
|
+
children: children
|
|
4322
|
+
})));
|
|
4323
|
+
|
|
4324
|
+
CalloutActions.displayName = "CalloutActions";
|
|
4325
|
+
|
|
4326
|
+
const CalloutCloseButton = forwardRef((({onClick: onClick, className: className = "", ...props}, ref) => jsx("button", {
|
|
4327
|
+
ref: ref,
|
|
4328
|
+
className: `c-callout__close-btn ${className}`.trim(),
|
|
4329
|
+
onClick: onClick,
|
|
4330
|
+
"aria-label": "Close",
|
|
4331
|
+
...props,
|
|
4332
|
+
children: jsx(Icon, {
|
|
4333
|
+
name: "X",
|
|
4334
|
+
size: "md"
|
|
4335
|
+
})
|
|
4336
|
+
})));
|
|
4337
|
+
|
|
4338
|
+
CalloutCloseButton.displayName = "CalloutCloseButton";
|
|
4339
|
+
|
|
4340
|
+
// Wrapper for content (icon + message)
|
|
4341
|
+
const CalloutContent = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
4342
|
+
ref: ref,
|
|
4343
|
+
className: `c-callout__content ${className}`.trim(),
|
|
4344
|
+
...props,
|
|
4345
|
+
children: children
|
|
4346
|
+
})));
|
|
4347
|
+
|
|
4348
|
+
CalloutContent.displayName = "CalloutContent";
|
|
4349
|
+
|
|
4350
|
+
const Callout = memo((({title: title, children: children, icon: icon, variant: variant = "primary", onClose: onClose, actions: actions, compact: compact = !1, isToast: isToast = !1, glass: glass, className: className, style: style, ...props}) => {
|
|
4176
4351
|
const {generateCalloutClass: generateCalloutClass, handleClose: handleClose} =
|
|
4177
4352
|
/**
|
|
4178
4353
|
* Callout state and functionality
|
|
@@ -4202,10 +4377,7 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
|
|
|
4202
4377
|
handler && handler();
|
|
4203
4378
|
}
|
|
4204
4379
|
};
|
|
4205
|
-
}
|
|
4206
|
-
/**
|
|
4207
|
-
* Callout component for displaying important messages, notifications, or alerts
|
|
4208
|
-
*/ ({
|
|
4380
|
+
}({
|
|
4209
4381
|
variant: variant,
|
|
4210
4382
|
compact: compact,
|
|
4211
4383
|
isToast: isToast,
|
|
@@ -4221,7 +4393,11 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
|
|
|
4221
4393
|
return isToast ? (baseAttributes.role = "alert", baseAttributes["aria-live"] = "polite") : _includesInstanceProperty(_context = [ "warning", "error" ]).call(_context, variant) ? (baseAttributes.role = "alert",
|
|
4222
4394
|
baseAttributes["aria-live"] = "assertive") : _includesInstanceProperty(_context2 = [ "info", "success" ]).call(_context2, variant) && (baseAttributes.role = "status",
|
|
4223
4395
|
baseAttributes["aria-live"] = "polite"), baseAttributes;
|
|
4224
|
-
}, calloutContent =
|
|
4396
|
+
}, calloutContent = React.Children.toArray(children).some((child => {
|
|
4397
|
+
var _context3;
|
|
4398
|
+
|
|
4399
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context3 = [ "CalloutIcon", "CalloutMessage", "CalloutTitle", "CalloutText", "CalloutActions", "CalloutContent" ]).call(_context3, child.type.displayName);
|
|
4400
|
+
})) ? children : jsxs(Fragment, {
|
|
4225
4401
|
children: [ jsxs("div", {
|
|
4226
4402
|
className: "c-callout__content",
|
|
4227
4403
|
children: [ icon && jsx("div", {
|
|
@@ -4297,9 +4473,13 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
|
|
|
4297
4473
|
style: style,
|
|
4298
4474
|
children: calloutContent
|
|
4299
4475
|
});
|
|
4300
|
-
};
|
|
4476
|
+
}));
|
|
4301
4477
|
|
|
4302
|
-
Callout.displayName = "Callout"
|
|
4478
|
+
Callout.displayName = "Callout",
|
|
4479
|
+
// Attach subcomponents
|
|
4480
|
+
Callout.Icon = CalloutIcon, Callout.Message = CalloutMessage, Callout.Title = CalloutTitle,
|
|
4481
|
+
Callout.Text = CalloutText, Callout.Actions = CalloutActions, Callout.CloseButton = CalloutCloseButton,
|
|
4482
|
+
Callout.Content = CalloutContent;
|
|
4303
4483
|
|
|
4304
4484
|
const Card = React.memo( forwardRef((({
|
|
4305
4485
|
// Variants
|
|
@@ -9037,7 +9217,9 @@ function getRowId$1(row, rowKey) {
|
|
|
9037
9217
|
}))) return !1;
|
|
9038
9218
|
// Apply column-specific filters
|
|
9039
9219
|
for (let i = 0; i < activeColumnFilters.length; i++) {
|
|
9040
|
-
const
|
|
9220
|
+
const filter = activeColumnFilters[i];
|
|
9221
|
+
if (!filter) continue;
|
|
9222
|
+
const {key: key, value: value, lowercaseValue: lowercaseValue, column: column} = filter, cellValue = row[key];
|
|
9041
9223
|
if (null == cellValue) return !1;
|
|
9042
9224
|
// Use custom filter function if provided
|
|
9043
9225
|
var _context2;
|
|
@@ -9403,7 +9585,38 @@ const DropdownContext = createContext({
|
|
|
9403
9585
|
close: () => {},
|
|
9404
9586
|
id: "",
|
|
9405
9587
|
trigger: "click"
|
|
9406
|
-
}),
|
|
9588
|
+
}), DropdownMenu = forwardRef((({children: children, className: className = "", ...props}, ref) => {
|
|
9589
|
+
const {glass: glass} = useContext(DropdownStyleContext);
|
|
9590
|
+
// We need to access glass prop here?
|
|
9591
|
+
// Wait, the original code wrapped <ul> in Context Provider.
|
|
9592
|
+
// And applied glass wrapper around <ul>.
|
|
9593
|
+
// If we use Compound Component, DropdownMenu should be the list.
|
|
9594
|
+
return jsx("ul", {
|
|
9595
|
+
ref: ref,
|
|
9596
|
+
className: `c-dropdown__menu ${glass ? "c-dropdown__menu--glass" : ""} ${className}`.trim(),
|
|
9597
|
+
...props,
|
|
9598
|
+
children: children
|
|
9599
|
+
});
|
|
9600
|
+
}));
|
|
9601
|
+
|
|
9602
|
+
// Compound Components
|
|
9603
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
9604
|
+
|
|
9605
|
+
const DropdownTrigger = forwardRef((({children: children, className: className = "", onClick: onClick, onKeyDown: onKeyDown, ...props}, ref) => jsx("div", {
|
|
9606
|
+
ref: ref,
|
|
9607
|
+
className: `c-dropdown__toggle ${className}`.trim(),
|
|
9608
|
+
onClick: onClick,
|
|
9609
|
+
onKeyDown: onKeyDown,
|
|
9610
|
+
...props,
|
|
9611
|
+
children: children
|
|
9612
|
+
})));
|
|
9613
|
+
|
|
9614
|
+
DropdownTrigger.displayName = "DropdownTrigger";
|
|
9615
|
+
|
|
9616
|
+
/**
|
|
9617
|
+
* DropdownItem component for menu items
|
|
9618
|
+
*/
|
|
9619
|
+
const DropdownItem = memo((({children: children, href: href, active: active = !1, disabled: disabled = !1, icon: icon, onClick: onClick, className: className = "", LinkComponent: LinkComponent, ...props}) => {
|
|
9407
9620
|
const {close: close} = useContext(DropdownContext), handleClick = e => {
|
|
9408
9621
|
disabled ? e.preventDefault() : (onClick && onClick(e),
|
|
9409
9622
|
// Always close the dropdown when an item is clicked
|
|
@@ -9445,7 +9658,7 @@ const DropdownContext = createContext({
|
|
|
9445
9658
|
}))), DropdownHeader = memo((({children: children, className: className = ""}) => jsx("li", {
|
|
9446
9659
|
className: `c-dropdown__header ${className}`,
|
|
9447
9660
|
children: children
|
|
9448
|
-
}))), Dropdown = memo((({children: children, menu: menu, placement: placement = "bottom-start", trigger: trigger = "click", offset: offset = DROPDOWN.DEFAULTS.OFFSET, isOpen: controlledIsOpen, onOpenChange: onOpenChange, closeOnClickOutside: closeOnClickOutside = !0, closeOnEscape: closeOnEscape = !0, maxHeight: maxHeight, minWidth: minWidth = DROPDOWN.DEFAULTS.MIN_WIDTH, variant: variant, className: className = "", style: style, glass: glass, ...props}) => {
|
|
9661
|
+
}))), DropdownStyleContext = createContext({}), Dropdown = memo((({children: children, menu: menu, placement: placement = "bottom-start", trigger: trigger = "click", offset: offset = DROPDOWN.DEFAULTS.OFFSET, isOpen: controlledIsOpen, onOpenChange: onOpenChange, closeOnClickOutside: closeOnClickOutside = !0, closeOnEscape: closeOnEscape = !0, maxHeight: maxHeight, minWidth: minWidth = DROPDOWN.DEFAULTS.MIN_WIDTH, variant: variant, className: className = "", style: style, glass: glass, ...props}) => {
|
|
9449
9662
|
// Set up controlled vs uncontrolled state
|
|
9450
9663
|
const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState(!1), isControlled = void 0 !== controlledIsOpen, isOpen = isControlled ? controlledIsOpen : uncontrolledIsOpen, dropdownRef = useRef(null), toggleRef = useRef(null), menuRef = useRef(null), dropdownId = useRef(`dropdown-${Math.random().toString(36).substring(2, 9)}`).current, setIsOpen = useCallback((nextIsOpen => {
|
|
9451
9664
|
isControlled || setUncontrolledIsOpen(nextIsOpen), onOpenChange && onOpenChange(nextIsOpen);
|
|
@@ -9508,20 +9721,59 @@ const DropdownContext = createContext({
|
|
|
9508
9721
|
"hover" === trigger && setIsOpen(!0);
|
|
9509
9722
|
}), [ trigger, setIsOpen ]), dropdownClasses = [ "c-dropdown", "click" === trigger ? "c-dropdown--onclick" : "", variant ? `c-dropdown--${variant}` : "", isOpen ? "is-open" : "", glass ? "c-dropdown--glass" : "", className ].filter(Boolean).join(" "), menuStyleProps = {};
|
|
9510
9723
|
// Event handlers
|
|
9511
|
-
|
|
9724
|
+
let triggerContent, menuContentNode;
|
|
9725
|
+
maxHeight && (menuStyleProps.maxHeight = maxHeight), void 0 !== minWidth && (menuStyleProps.minWidth = "number" == typeof minWidth ? `${minWidth}px` : minWidth),
|
|
9726
|
+
React.Children.toArray(children).some((child => {
|
|
9727
|
+
var _context;
|
|
9728
|
+
|
|
9729
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "DropdownTrigger", "DropdownMenu" ]).call(_context, child.type.displayName);
|
|
9730
|
+
})) ?
|
|
9731
|
+
// Find Trigger and Menu in children
|
|
9732
|
+
React.Children.forEach(children, (child => {
|
|
9733
|
+
React.isValidElement(child) && ("DropdownTrigger" === child.type.displayName ? triggerContent = React.cloneElement(child, {
|
|
9734
|
+
ref: toggleRef,
|
|
9735
|
+
onClick: e => {
|
|
9736
|
+
handleToggleClick(e), child.props.onClick?.(e);
|
|
9737
|
+
},
|
|
9738
|
+
onKeyDown: e => {
|
|
9739
|
+
handleToggleKeyDown(e), child.props.onKeyDown?.(e);
|
|
9740
|
+
},
|
|
9741
|
+
"aria-haspopup": "menu",
|
|
9742
|
+
"aria-expanded": isOpen,
|
|
9743
|
+
"aria-controls": dropdownId,
|
|
9744
|
+
tabIndex: 0
|
|
9745
|
+
}) : "DropdownMenu" === child.type.displayName && (menuContentNode = child));
|
|
9746
|
+
})) : (
|
|
9747
|
+
// Legacy mode
|
|
9748
|
+
triggerContent = jsx("div", {
|
|
9749
|
+
ref: toggleRef,
|
|
9750
|
+
className: "c-dropdown__toggle",
|
|
9751
|
+
onClick: handleToggleClick,
|
|
9752
|
+
onKeyDown: handleToggleKeyDown,
|
|
9753
|
+
"aria-haspopup": "menu",
|
|
9754
|
+
"aria-expanded": isOpen,
|
|
9755
|
+
"aria-controls": dropdownId,
|
|
9756
|
+
tabIndex: 0,
|
|
9757
|
+
children: children
|
|
9758
|
+
}), menuContentNode = jsx("ul", {
|
|
9759
|
+
className: "c-dropdown__menu " + (glass ? "c-dropdown__menu--glass" : ""),
|
|
9760
|
+
children: menu
|
|
9761
|
+
}));
|
|
9512
9762
|
const menuContent = jsx("div", {
|
|
9513
9763
|
className: "c-dropdown__menu-inner",
|
|
9514
9764
|
style: menuStyleProps,
|
|
9515
|
-
children: jsx(
|
|
9765
|
+
children: jsx(DropdownStyleContext.Provider, {
|
|
9516
9766
|
value: {
|
|
9517
|
-
|
|
9518
|
-
close: close,
|
|
9519
|
-
id: dropdownId,
|
|
9520
|
-
trigger: trigger
|
|
9767
|
+
glass: glass
|
|
9521
9768
|
},
|
|
9522
|
-
children: jsx(
|
|
9523
|
-
|
|
9524
|
-
|
|
9769
|
+
children: jsx(DropdownContext.Provider, {
|
|
9770
|
+
value: {
|
|
9771
|
+
isOpen: isOpen,
|
|
9772
|
+
close: close,
|
|
9773
|
+
id: dropdownId,
|
|
9774
|
+
trigger: trigger
|
|
9775
|
+
},
|
|
9776
|
+
children: menuContentNode
|
|
9525
9777
|
})
|
|
9526
9778
|
})
|
|
9527
9779
|
});
|
|
@@ -9531,17 +9783,7 @@ const DropdownContext = createContext({
|
|
|
9531
9783
|
style: style,
|
|
9532
9784
|
onMouseEnter: "hover" === trigger ? handleHoverOpen : void 0,
|
|
9533
9785
|
...props,
|
|
9534
|
-
children: [ jsx("div", {
|
|
9535
|
-
ref: toggleRef,
|
|
9536
|
-
className: "c-dropdown__toggle",
|
|
9537
|
-
onClick: handleToggleClick,
|
|
9538
|
-
onKeyDown: handleToggleKeyDown,
|
|
9539
|
-
"aria-haspopup": "menu",
|
|
9540
|
-
"aria-expanded": isOpen,
|
|
9541
|
-
"aria-controls": dropdownId,
|
|
9542
|
-
tabIndex: 0,
|
|
9543
|
-
children: children
|
|
9544
|
-
}), jsx("div", {
|
|
9786
|
+
children: [ triggerContent, jsx("div", {
|
|
9545
9787
|
ref: menuRef,
|
|
9546
9788
|
id: dropdownId,
|
|
9547
9789
|
className: `c-dropdown__menu-wrapper c-dropdown__menu-wrapper--${placement} ${isOpen ? "is-open" : ""} ${glass ? "is-glass" : ""}`,
|
|
@@ -9569,9 +9811,9 @@ const DropdownContext = createContext({
|
|
|
9569
9811
|
}));
|
|
9570
9812
|
|
|
9571
9813
|
/**
|
|
9572
|
-
*
|
|
9573
|
-
*/ Dropdown.displayName = "Dropdown",
|
|
9574
|
-
|
|
9814
|
+
* DropdownDivider component for separating groups of items
|
|
9815
|
+
*/ Dropdown.displayName = "Dropdown", Dropdown.Trigger = DropdownTrigger, Dropdown.Menu = DropdownMenu,
|
|
9816
|
+
Dropdown.Item = DropdownItem, Dropdown.Divider = DropdownDivider, Dropdown.Header = DropdownHeader;
|
|
9575
9817
|
|
|
9576
9818
|
/**
|
|
9577
9819
|
* DataTable - A flexible and accessible data table component with advanced features
|
|
@@ -10660,53 +10902,50 @@ function useEdgePanel(initialProps) {
|
|
|
10660
10902
|
};
|
|
10661
10903
|
}
|
|
10662
10904
|
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
* title="Glass Panel"
|
|
10682
|
-
* isOpen={isOpen}
|
|
10683
|
-
* onOpenChange={setIsOpen}
|
|
10684
|
-
* position="end"
|
|
10685
|
-
* glass={true}
|
|
10686
|
-
* >
|
|
10687
|
-
* <p>Panel with glass morphism</p>
|
|
10688
|
-
* </EdgePanel>
|
|
10689
|
-
*
|
|
10690
|
-
* // With custom glass configuration
|
|
10691
|
-
* <EdgePanel
|
|
10692
|
-
* title="Custom Glass"
|
|
10693
|
-
* isOpen={isOpen}
|
|
10694
|
-
* onOpenChange={setIsOpen}
|
|
10695
|
-
* position="start"
|
|
10696
|
-
* glass={{
|
|
10697
|
-
* mode: 'shader',
|
|
10698
|
-
* shaderVariant: 'liquidGlass',
|
|
10699
|
-
* displacementScale: 70,
|
|
10700
|
-
* blurAmount: 1.8,
|
|
10701
|
-
* saturation: 170,
|
|
10702
|
-
* }}
|
|
10703
|
-
* >
|
|
10704
|
-
* <p>Panel with custom glass effect</p>
|
|
10705
|
-
* </EdgePanel>
|
|
10706
|
-
* ```
|
|
10707
|
-
*/ DatePicker.displayName = "DatePicker";
|
|
10905
|
+
// Subcomponents
|
|
10906
|
+
DatePicker.displayName = "DatePicker";
|
|
10907
|
+
|
|
10908
|
+
const EdgePanelHeader = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
10909
|
+
ref: ref,
|
|
10910
|
+
className: `c-edge-panel__header ${className}`.trim(),
|
|
10911
|
+
...props,
|
|
10912
|
+
children: children
|
|
10913
|
+
})));
|
|
10914
|
+
|
|
10915
|
+
EdgePanelHeader.displayName = "EdgePanelHeader";
|
|
10916
|
+
|
|
10917
|
+
const EdgePanelBody = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
10918
|
+
ref: ref,
|
|
10919
|
+
className: `c-edge-panel__body ${className}`.trim(),
|
|
10920
|
+
...props,
|
|
10921
|
+
children: children
|
|
10922
|
+
})));
|
|
10708
10923
|
|
|
10709
|
-
|
|
10924
|
+
EdgePanelBody.displayName = "EdgePanelBody";
|
|
10925
|
+
|
|
10926
|
+
const EdgePanelFooter = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
10927
|
+
ref: ref,
|
|
10928
|
+
className: `c-edge-panel__footer ${className}`.trim(),
|
|
10929
|
+
...props,
|
|
10930
|
+
children: children
|
|
10931
|
+
})));
|
|
10932
|
+
|
|
10933
|
+
EdgePanelFooter.displayName = "EdgePanelFooter";
|
|
10934
|
+
|
|
10935
|
+
const EdgePanelCloseButton = forwardRef((({className: className = "", onClick: onClick, ...props}, ref) => jsx("button", {
|
|
10936
|
+
ref: ref,
|
|
10937
|
+
className: `c-edge-panel__close c-btn c-btn--icon ${className}`.trim(),
|
|
10938
|
+
onClick: onClick,
|
|
10939
|
+
"aria-label": "Close panel",
|
|
10940
|
+
...props,
|
|
10941
|
+
children: jsx(Icon, {
|
|
10942
|
+
name: "X"
|
|
10943
|
+
})
|
|
10944
|
+
})));
|
|
10945
|
+
|
|
10946
|
+
EdgePanelCloseButton.displayName = "EdgePanelCloseButton";
|
|
10947
|
+
|
|
10948
|
+
const EdgePanel = memo((({title: title, children: children, position: position = "start", mode: mode = "slide", isOpen: isOpen = !1, onOpenChange: onOpenChange, backdrop: backdrop = !0, closeOnBackdropClick: closeOnBackdropClick = !0, closeOnEscape: closeOnEscape = !0, className: className = "", style: style, glass: glass}) => {
|
|
10710
10949
|
const {isOpen: isOpenState, containerRef: containerRef, backdropRef: backdropRef, generateEdgePanelClass: generateEdgePanelClass, closePanel: closePanel, handleBackdropClick: handleBackdropClick} = useEdgePanel({
|
|
10711
10950
|
position: position,
|
|
10712
10951
|
mode: mode,
|
|
@@ -10723,13 +10962,23 @@ const EdgePanel = ({title: title, children: children, position: position = "star
|
|
|
10723
10962
|
});
|
|
10724
10963
|
// Moved useRef outside of conditional rendering to fix hook order issue
|
|
10725
10964
|
// If not open and not controlled by parent, don't render
|
|
10965
|
+
// Note: useEdgePanel manages internal state if onOpenChange is not provided?
|
|
10966
|
+
// Looking at useEdgePanel (implied): it seems to return isOpenState.
|
|
10967
|
+
// If we return null here, animations might be cut off.
|
|
10968
|
+
// Usually EdgePanel/Drawer should stay mounted but hidden or conditionally mounted.
|
|
10969
|
+
// The original code returned null if !isOpenState && isOpen === false.
|
|
10970
|
+
// Let's keep that logic.
|
|
10726
10971
|
if (!isOpenState && !1 === isOpen) return null;
|
|
10727
10972
|
const defaultGlassProps = {
|
|
10728
10973
|
elasticity: 0
|
|
10729
10974
|
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
10730
10975
|
...defaultGlassProps,
|
|
10731
10976
|
...glass
|
|
10732
|
-
}, panelContent =
|
|
10977
|
+
}, panelContent = React.Children.toArray(children).some((child => {
|
|
10978
|
+
var _context;
|
|
10979
|
+
|
|
10980
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "EdgePanelHeader", "EdgePanelBody", "EdgePanelFooter" ]).call(_context, child.type.displayName);
|
|
10981
|
+
})) ? children : jsxs(Fragment, {
|
|
10733
10982
|
children: [ jsxs("div", {
|
|
10734
10983
|
className: "c-edge-panel__header",
|
|
10735
10984
|
children: [ jsx("h4", {
|
|
@@ -10772,7 +11021,7 @@ const EdgePanel = ({title: title, children: children, position: position = "star
|
|
|
10772
11021
|
}) : panelContent
|
|
10773
11022
|
}) ]
|
|
10774
11023
|
});
|
|
10775
|
-
};
|
|
11024
|
+
}));
|
|
10776
11025
|
|
|
10777
11026
|
/**
|
|
10778
11027
|
* Form state and functionality
|
|
@@ -10806,7 +11055,8 @@ function useForm(initialProps) {
|
|
|
10806
11055
|
|
|
10807
11056
|
/**
|
|
10808
11057
|
* Form - A component for creating form layouts
|
|
10809
|
-
*/ EdgePanel.displayName = "EdgePanel"
|
|
11058
|
+
*/ EdgePanel.displayName = "EdgePanel", EdgePanel.Header = EdgePanelHeader, EdgePanel.Body = EdgePanelBody,
|
|
11059
|
+
EdgePanel.Footer = EdgePanelFooter, EdgePanel.CloseButton = EdgePanelCloseButton;
|
|
10810
11060
|
|
|
10811
11061
|
const Form = ({children: children, onSubmit: onSubmit, onReset: onReset, className: className = "", style: style, disabled: disabled = !1, id: id, method: method = "post", encType: encType, noValidate: noValidate = !1, autoComplete: autoComplete = "on"}) => {
|
|
10812
11062
|
const {generateFormClass: generateFormClass, handleSubmit: handleSubmit, handleReset: handleReset} = useForm({
|
|
@@ -11016,6 +11266,8 @@ function useHero(initialProps) {
|
|
|
11016
11266
|
contentWidth: void 0,
|
|
11017
11267
|
parallax: !1,
|
|
11018
11268
|
parallaxIntensity: .5,
|
|
11269
|
+
headingLevel: "h1",
|
|
11270
|
+
reverseOnMobile: !1,
|
|
11019
11271
|
...initialProps
|
|
11020
11272
|
}, hasBackgroundSlider = !!defaultProps.backgroundSlider, backgroundSliderResult =
|
|
11021
11273
|
/**
|
|
@@ -11096,7 +11348,9 @@ function useHero(initialProps) {
|
|
|
11096
11348
|
autoplay: {
|
|
11097
11349
|
delay: 5e3,
|
|
11098
11350
|
pauseOnHover: !0
|
|
11099
|
-
}
|
|
11351
|
+
},
|
|
11352
|
+
transition: "fade",
|
|
11353
|
+
transitionDuration: 1e3
|
|
11100
11354
|
}), backgroundSlider = hasBackgroundSlider && defaultProps.backgroundSlider ? backgroundSliderResult : void 0, hasBackgroundImage = !!hasBackgroundSlider || !!defaultProps.backgroundImageSrc || !!defaultProps.videoBackground, hasForegroundImage = !!defaultProps.imageSrc, useGridLayout = hasForegroundImage && "center" !== defaultProps.alignment, applyParallaxEffect = (element, intensity = .5) => {
|
|
11101
11355
|
if (!element) return;
|
|
11102
11356
|
// Ensure intensity is between 0 and 1
|
|
@@ -11147,13 +11401,20 @@ function useHero(initialProps) {
|
|
|
11147
11401
|
defaultProps.videoBackground && classes.push("c-hero--video"), baseClassName && classes.push(baseClassName),
|
|
11148
11402
|
classes.join(" ");
|
|
11149
11403
|
},
|
|
11150
|
-
generateImageColClass: (size = defaultProps.imageColSize || 7) => {
|
|
11404
|
+
generateImageColClass: (size = defaultProps.imageColSize || 7, customClass) => {
|
|
11151
11405
|
const classes = [ `o-grid__col o-grid__col--md-${size}` ];
|
|
11152
11406
|
// Add responsive margin if needed for mobile view
|
|
11153
11407
|
return "left" === defaultProps.alignment && classes.push("u-mt-5 u-mt-md-0"),
|
|
11154
|
-
|
|
11408
|
+
// Handle mobile stacking order
|
|
11409
|
+
defaultProps.reverseOnMobile && ("right" === defaultProps.alignment || "center" === defaultProps.alignment ? classes.push("u-order-first u-order-md-last") : classes.push("u-order-last u-order-md-first")),
|
|
11410
|
+
customClass && classes.push(customClass), classes.join(" ");
|
|
11411
|
+
},
|
|
11412
|
+
generateContentColClass: (size = defaultProps.contentColSize || 5, customClass) => {
|
|
11413
|
+
const classes = [ `o-grid__col o-grid__col--md-${size}` ];
|
|
11414
|
+
// Handle mobile stacking order
|
|
11415
|
+
return defaultProps.reverseOnMobile && ("right" === defaultProps.alignment || "center" === defaultProps.alignment ? classes.push("u-order-last u-order-md-first") : classes.push("u-order-first u-order-md-last")),
|
|
11416
|
+
customClass && classes.push(customClass), classes.join(" ");
|
|
11155
11417
|
},
|
|
11156
|
-
generateContentColClass: (size = defaultProps.contentColSize || 5) => `o-grid__col o-grid__col--md-${size}`,
|
|
11157
11418
|
hasBackgroundImage: hasBackgroundImage,
|
|
11158
11419
|
hasForegroundImage: hasForegroundImage,
|
|
11159
11420
|
useGridLayout: useGridLayout,
|
|
@@ -12368,8 +12629,6 @@ function useSlider(options) {
|
|
|
12368
12629
|
};
|
|
12369
12630
|
}
|
|
12370
12631
|
|
|
12371
|
-
// Button composables
|
|
12372
|
-
// export * from './useButton';
|
|
12373
12632
|
// Accordion composables
|
|
12374
12633
|
const composablesImport = Object.freeze( Object.defineProperty({
|
|
12375
12634
|
__proto__: null,
|
|
@@ -12410,7 +12669,57 @@ const composablesImport = Object.freeze( Object.defineProperty({
|
|
|
12410
12669
|
useTodo: useTodo
|
|
12411
12670
|
}, Symbol.toStringTag, {
|
|
12412
12671
|
value: "Module"
|
|
12413
|
-
})),
|
|
12672
|
+
})), SelectContext = createContext(null), SelectOption = memo((({value: value, children: children, disabled: disabled = !1, className: className = "", style: style}) => {
|
|
12673
|
+
const context = useContext(SelectContext), label = "string" == typeof children ? children : value;
|
|
12674
|
+
// We assume children is the label if it's a string, or we need a way to get label.
|
|
12675
|
+
// For simplicity, we use children as label for registration if it's a string.
|
|
12676
|
+
if (useEffect((() => {
|
|
12677
|
+
if (context) return context.registerOption({
|
|
12678
|
+
value: value,
|
|
12679
|
+
label: label,
|
|
12680
|
+
disabled: disabled
|
|
12681
|
+
}), () => {
|
|
12682
|
+
context.unregisterOption(value);
|
|
12683
|
+
};
|
|
12684
|
+
}), [ context, value, label, disabled ]), !context) return console.warn("SelectOption must be used within a Select component"),
|
|
12685
|
+
null;
|
|
12686
|
+
const {selectedValue: selectedValue, onSelect: onSelect} = context, isSelected = Array.isArray(selectedValue) ? _includesInstanceProperty(selectedValue).call(selectedValue, value) : selectedValue === value;
|
|
12687
|
+
return jsx("li", {
|
|
12688
|
+
className: `${SELECT.CLASSES.SELECT_ITEM} ${className}`.trim(),
|
|
12689
|
+
"data-value": value,
|
|
12690
|
+
onClick: e => {
|
|
12691
|
+
e.preventDefault(), e.stopPropagation(), disabled || onSelect(value, label);
|
|
12692
|
+
},
|
|
12693
|
+
style: style,
|
|
12694
|
+
role: "option",
|
|
12695
|
+
"aria-selected": isSelected,
|
|
12696
|
+
"aria-disabled": disabled,
|
|
12697
|
+
children: jsxs("label", {
|
|
12698
|
+
className: "c-checkbox",
|
|
12699
|
+
style: {
|
|
12700
|
+
pointerEvents: "none"
|
|
12701
|
+
},
|
|
12702
|
+
children: [ jsx("input", {
|
|
12703
|
+
type: "checkbox",
|
|
12704
|
+
className: "c-checkbox__input c-select__item-input",
|
|
12705
|
+
checked: isSelected,
|
|
12706
|
+
readOnly: !0,
|
|
12707
|
+
disabled: disabled,
|
|
12708
|
+
tabIndex: -1
|
|
12709
|
+
}), jsx("div", {
|
|
12710
|
+
className: "c-select__item-label",
|
|
12711
|
+
children: children
|
|
12712
|
+
}) ]
|
|
12713
|
+
})
|
|
12714
|
+
});
|
|
12715
|
+
}));
|
|
12716
|
+
|
|
12717
|
+
SelectOption.displayName = "SelectOption";
|
|
12718
|
+
|
|
12719
|
+
/**
|
|
12720
|
+
* Select - A component for dropdown selection
|
|
12721
|
+
*/
|
|
12722
|
+
const Select = memo((({options: options, value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder = "Select an option", className: className = "", style: style, disabled: disabled = !1, required: required = !1, id: id, name: name, size: size = "md", invalid: invalid = !1, valid: valid = !1, multiple: multiple = !1, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, glass: glass, children: children}) => {
|
|
12414
12723
|
const {generateSelectClass: generateSelectClass} = useSelect({
|
|
12415
12724
|
size: size,
|
|
12416
12725
|
disabled: disabled,
|
|
@@ -12422,112 +12731,129 @@ const composablesImport = Object.freeze( Object.defineProperty({
|
|
|
12422
12731
|
disabled: disabled,
|
|
12423
12732
|
invalid: invalid,
|
|
12424
12733
|
valid: valid
|
|
12425
|
-
}), [isOpen, setIsOpen] = useState(!1), [selectedLabel, setSelectedLabel] = useState(placeholder), dropdownRef = useRef(null), panelRef = useRef(null), bodyRef = useRef(null), nativeSelectRef = useRef(null)
|
|
12734
|
+
}), [isOpen, setIsOpen] = useState(!1), [selectedLabel, setSelectedLabel] = useState(placeholder), dropdownRef = useRef(null), panelRef = useRef(null), bodyRef = useRef(null), nativeSelectRef = useRef(null), [registeredOptions, setRegisteredOptions] = useState([]), registerOption = useCallback((option => {
|
|
12735
|
+
setRegisteredOptions((prev => prev.some((o => o.value === option.value)) ? prev : [ ...prev, option ]));
|
|
12736
|
+
}), []), unregisterOption = useCallback((value => {
|
|
12737
|
+
setRegisteredOptions((prev => prev.filter((o => o.value !== value))));
|
|
12738
|
+
}), []), hasOptionsProp = options && options.length > 0, activeOptions = hasOptionsProp ? options : registeredOptions;
|
|
12426
12739
|
// Update selected label when value changes
|
|
12427
12740
|
useEffect((() => {
|
|
12428
12741
|
if (value) {
|
|
12429
|
-
const selectedOption =
|
|
12742
|
+
const selectedOption = activeOptions.find((opt => opt.value === value));
|
|
12430
12743
|
selectedOption && setSelectedLabel(selectedOption.label);
|
|
12431
12744
|
} else setSelectedLabel(placeholder);
|
|
12432
|
-
}), [ value,
|
|
12745
|
+
}), [ value, activeOptions, placeholder ]),
|
|
12433
12746
|
// Handle click outside to close dropdown
|
|
12434
|
-
useEffect((() => {
|
|
12435
|
-
const handleClickOutside = event => {
|
|
12436
|
-
dropdownRef.current && !dropdownRef.current.contains(event.target) && (setIsOpen(!1),
|
|
12437
|
-
bodyRef.current && (bodyRef.current.style.height = "0px"));
|
|
12438
|
-
};
|
|
12439
|
-
return document.addEventListener("mousedown", handleClickOutside), () => {
|
|
12440
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
12441
|
-
};
|
|
12442
|
-
}), []);
|
|
12443
|
-
// Toggle dropdown
|
|
12444
|
-
const
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
|
|
12497
|
-
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12747
|
+
useEffect((() => {
|
|
12748
|
+
const handleClickOutside = event => {
|
|
12749
|
+
dropdownRef.current && !dropdownRef.current.contains(event.target) && (setIsOpen(!1),
|
|
12750
|
+
bodyRef.current && (bodyRef.current.style.height = "0px"));
|
|
12751
|
+
};
|
|
12752
|
+
return document.addEventListener("mousedown", handleClickOutside), () => {
|
|
12753
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
12754
|
+
};
|
|
12755
|
+
}), []);
|
|
12756
|
+
// Toggle dropdown
|
|
12757
|
+
const handleItemClick = useCallback((option => {
|
|
12758
|
+
if (setSelectedLabel(option.label), setIsOpen(!1), bodyRef.current && (bodyRef.current.style.height = "0px"),
|
|
12759
|
+
nativeSelectRef.current && (nativeSelectRef.current.value = option.value), onChange) {
|
|
12760
|
+
// Create a synthetic event
|
|
12761
|
+
const event = {
|
|
12762
|
+
target: {
|
|
12763
|
+
name: name,
|
|
12764
|
+
value: option.value
|
|
12765
|
+
}
|
|
12766
|
+
};
|
|
12767
|
+
onChange(event);
|
|
12768
|
+
}
|
|
12769
|
+
}), [ onChange, name ]), onSelect = useCallback(((val, label) => {
|
|
12770
|
+
handleItemClick({
|
|
12771
|
+
value: val,
|
|
12772
|
+
label: label
|
|
12773
|
+
});
|
|
12774
|
+
}), [ handleItemClick ]), contextValue = React.useMemo((() => ({
|
|
12775
|
+
registerOption: registerOption,
|
|
12776
|
+
unregisterOption: unregisterOption,
|
|
12777
|
+
selectedValue: value,
|
|
12778
|
+
onSelect: onSelect
|
|
12779
|
+
})), [ registerOption, unregisterOption, value, onSelect ]), selectContent = jsx(SelectContext.Provider, {
|
|
12780
|
+
value: contextValue,
|
|
12781
|
+
children: jsxs("div", {
|
|
12782
|
+
className: `${selectClass} ${isOpen ? SELECT.CLASSES.IS_OPEN : ""}`,
|
|
12783
|
+
ref: dropdownRef,
|
|
12784
|
+
style: style,
|
|
12785
|
+
"aria-expanded": isOpen,
|
|
12786
|
+
children: [ jsxs("select", {
|
|
12787
|
+
ref: nativeSelectRef,
|
|
12788
|
+
value: value,
|
|
12789
|
+
onChange: onChange,
|
|
12790
|
+
onBlur: onBlur,
|
|
12791
|
+
onFocus: onFocus,
|
|
12792
|
+
disabled: disabled,
|
|
12793
|
+
required: required,
|
|
12794
|
+
id: id,
|
|
12795
|
+
name: name,
|
|
12796
|
+
multiple: multiple,
|
|
12797
|
+
"aria-label": ariaLabel,
|
|
12798
|
+
"aria-describedby": ariaDescribedBy,
|
|
12799
|
+
"aria-invalid": invalid,
|
|
12800
|
+
style: {
|
|
12801
|
+
display: "none"
|
|
12802
|
+
},
|
|
12803
|
+
children: [ placeholder && jsx("option", {
|
|
12804
|
+
value: "",
|
|
12805
|
+
disabled: !0,
|
|
12806
|
+
children: placeholder
|
|
12807
|
+
}), activeOptions.map((option => jsx("option", {
|
|
12808
|
+
value: option.value,
|
|
12809
|
+
disabled: option.disabled,
|
|
12810
|
+
children: option.label
|
|
12811
|
+
}, option.value))) ]
|
|
12812
|
+
}), jsx("div", {
|
|
12813
|
+
className: SELECT.CLASSES.SELECTED,
|
|
12814
|
+
onClick: () => {
|
|
12815
|
+
disabled || (!isOpen && bodyRef.current && panelRef.current ? bodyRef.current.style.height = `${panelRef.current.clientHeight}px` : bodyRef.current && (bodyRef.current.style.height = "0px"),
|
|
12816
|
+
setIsOpen(!isOpen));
|
|
12817
|
+
},
|
|
12818
|
+
"aria-disabled": disabled,
|
|
12819
|
+
children: selectedLabel
|
|
12820
|
+
}), jsx("i", {
|
|
12821
|
+
className: `${SELECT.CLASSES.ICON_CARET} ${SELECT.CLASSES.TOGGLE_ICON}`
|
|
12822
|
+
}), jsx("div", {
|
|
12823
|
+
className: SELECT.CLASSES.SELECT_BODY,
|
|
12824
|
+
ref: bodyRef,
|
|
12825
|
+
style: {
|
|
12826
|
+
height: 0
|
|
12827
|
+
},
|
|
12828
|
+
children: jsx("div", {
|
|
12829
|
+
className: SELECT.CLASSES.SELECT_PANEL,
|
|
12830
|
+
ref: panelRef,
|
|
12831
|
+
children: jsx("ul", {
|
|
12832
|
+
className: SELECT.CLASSES.SELECT_ITEMS,
|
|
12833
|
+
children: hasOptionsProp ? options.map(((option, index) => jsx("li", {
|
|
12834
|
+
className: SELECT.CLASSES.SELECT_ITEM,
|
|
12835
|
+
"data-value": option.value,
|
|
12836
|
+
onClick: () => !option.disabled && handleItemClick(option),
|
|
12837
|
+
children: jsxs("label", {
|
|
12838
|
+
htmlFor: `SelectItem${index}`,
|
|
12839
|
+
className: "c-checkbox",
|
|
12840
|
+
children: [ jsx("input", {
|
|
12841
|
+
type: "checkbox",
|
|
12842
|
+
id: `SelectItem${index}`,
|
|
12843
|
+
className: "c-checkbox__input c-select__item-input",
|
|
12844
|
+
checked: value === option.value,
|
|
12845
|
+
readOnly: !0,
|
|
12846
|
+
disabled: option.disabled
|
|
12847
|
+
}), jsx("div", {
|
|
12848
|
+
className: "c-select__item-label",
|
|
12849
|
+
children: option.label
|
|
12850
|
+
}) ]
|
|
12851
|
+
})
|
|
12852
|
+
}, option.value))) : children
|
|
12853
|
+
})
|
|
12528
12854
|
})
|
|
12529
|
-
})
|
|
12530
|
-
})
|
|
12855
|
+
}) ]
|
|
12856
|
+
})
|
|
12531
12857
|
});
|
|
12532
12858
|
// Handle item selection
|
|
12533
12859
|
if (glass) {
|
|
@@ -12551,9 +12877,7 @@ const composablesImport = Object.freeze( Object.defineProperty({
|
|
|
12551
12877
|
return selectContent;
|
|
12552
12878
|
}));
|
|
12553
12879
|
|
|
12554
|
-
|
|
12555
|
-
* Select - A component for dropdown selection
|
|
12556
|
-
*/ Select.displayName = "Select";
|
|
12880
|
+
Select.displayName = "Select", Select.Option = SelectOption;
|
|
12557
12881
|
|
|
12558
12882
|
/**
|
|
12559
12883
|
* Radio - A component for radio button inputs
|
|
@@ -13427,12 +13751,14 @@ const FooterLink = forwardRef((({href: href, icon: icon, external: external = !
|
|
|
13427
13751
|
|
|
13428
13752
|
FooterLink.displayName = "FooterLink";
|
|
13429
13753
|
|
|
13430
|
-
const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc, imageAlt: imageAlt = "Hero image", alignment: alignment = "left", backgroundImageSrc: backgroundImageSrc, showOverlay: showOverlay = !0, fullViewportHeight: fullViewportHeight = !1, actions: actions, imageColSize: imageColSize = 7, contentColSize: contentColSize = 5, contentWidth: contentWidth, className: className = "", style: style, parallax: parallax = !1, parallaxIntensity: parallaxIntensity = .5, videoBackground: videoBackground, children: children, glass: glass, videoOptions: videoOptions = {
|
|
13754
|
+
const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc, imageAlt: imageAlt = "Hero image", alignment: alignment = "left", backgroundImageSrc: backgroundImageSrc, showOverlay: showOverlay = !0, fullViewportHeight: fullViewportHeight = !1, actions: actions, imageColSize: imageColSize = 7, imageColClassName: imageColClassName, imageColStyle: imageColStyle, contentColSize: contentColSize = 5, contentColClassName: contentColClassName, contentColStyle: contentColStyle, contentWidth: contentWidth, className: className = "", style: style, parallax: parallax = !1, parallaxIntensity: parallaxIntensity = .5, videoBackground: videoBackground, children: children, glass: glass, videoOptions: videoOptions = {
|
|
13431
13755
|
autoplay: !0,
|
|
13432
13756
|
loop: !0,
|
|
13433
13757
|
muted: !0
|
|
13434
|
-
}, backgroundSlider: backgroundSlider}) => {
|
|
13435
|
-
|
|
13758
|
+
}, backgroundSlider: backgroundSlider, headingLevel: headingLevel = "h1", reverseOnMobile: reverseOnMobile = !1, parts: parts, backgroundElement: backgroundElement, ...rest}) => {
|
|
13759
|
+
// Define dynamic heading tag
|
|
13760
|
+
const HeadingTag = headingLevel, {generateHeroClassNames: generateHeroClassNames, generateImageColClass: generateImageColClass, generateContentColClass: generateContentColClass, hasBackgroundImage: hasBackgroundImage, hasForegroundImage: hasForegroundImage, useGridLayout: useGridLayout, heroRef: heroRef, videoRef: videoRef, backgroundSlider: sliderHook, hasBackgroundSlider: hasBackgroundSlider} = useHero({
|
|
13761
|
+
title: title,
|
|
13436
13762
|
alignment: alignment,
|
|
13437
13763
|
imageColSize: imageColSize,
|
|
13438
13764
|
contentColSize: contentColSize,
|
|
@@ -13444,7 +13770,8 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13444
13770
|
parallax: parallax,
|
|
13445
13771
|
parallaxIntensity: parallaxIntensity,
|
|
13446
13772
|
videoBackground: videoBackground,
|
|
13447
|
-
backgroundSlider: backgroundSlider
|
|
13773
|
+
backgroundSlider: backgroundSlider,
|
|
13774
|
+
reverseOnMobile: reverseOnMobile
|
|
13448
13775
|
}), heroStyle = {
|
|
13449
13776
|
...contentWidth ? {
|
|
13450
13777
|
"--atomix-hero-content-width": contentWidth
|
|
@@ -13468,18 +13795,23 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13468
13795
|
});
|
|
13469
13796
|
}, renderContent = () => {
|
|
13470
13797
|
const content = jsxs("div", {
|
|
13471
|
-
className: HERO.SELECTORS.CONTENT.replace(".", ""),
|
|
13798
|
+
className: `${HERO.SELECTORS.CONTENT.replace(".", "")} ${parts?.content?.className || ""}`.trim(),
|
|
13799
|
+
style: parts?.content?.style,
|
|
13472
13800
|
children: [ subtitle && jsx("p", {
|
|
13473
|
-
className: HERO.SELECTORS.SUBTITLE.replace(".", ""),
|
|
13801
|
+
className: `${HERO.SELECTORS.SUBTITLE.replace(".", "")} ${parts?.subtitle?.className || ""}`.trim(),
|
|
13802
|
+
style: parts?.subtitle?.style,
|
|
13474
13803
|
children: subtitle
|
|
13475
|
-
}), jsx(
|
|
13476
|
-
className: HERO.SELECTORS.TITLE.replace(".", ""),
|
|
13804
|
+
}), jsx(HeadingTag, {
|
|
13805
|
+
className: `${HERO.SELECTORS.TITLE.replace(".", "")} ${parts?.title?.className || ""}`.trim(),
|
|
13806
|
+
style: parts?.title?.style,
|
|
13477
13807
|
children: title
|
|
13478
13808
|
}), text && jsx("p", {
|
|
13479
|
-
className: HERO.SELECTORS.TEXT.replace(".", ""),
|
|
13809
|
+
className: `${HERO.SELECTORS.TEXT.replace(".", "")} ${parts?.text?.className || ""}`.trim(),
|
|
13810
|
+
style: parts?.text?.style,
|
|
13480
13811
|
children: text
|
|
13481
13812
|
}), actions && jsx("div", {
|
|
13482
|
-
className: HERO.SELECTORS.ACTIONS.replace(".", ""),
|
|
13813
|
+
className: `${HERO.SELECTORS.ACTIONS.replace(".", "")} ${parts?.actions?.className || ""}`.trim(),
|
|
13814
|
+
style: parts?.actions?.style,
|
|
13483
13815
|
children: actions
|
|
13484
13816
|
}) ]
|
|
13485
13817
|
});
|
|
@@ -13489,7 +13821,8 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13489
13821
|
glass ? jsx("div",
|
|
13490
13822
|
// If glass is true, use default glass props
|
|
13491
13823
|
!0 === glass ? {
|
|
13492
|
-
className: HERO.SELECTORS.CONTENT.replace(".", ""),
|
|
13824
|
+
className: `${HERO.SELECTORS.CONTENT.replace(".", "")} ${parts?.content?.className || ""}`.trim(),
|
|
13825
|
+
style: parts?.content?.style,
|
|
13493
13826
|
children: jsx(AtomixGlass, {
|
|
13494
13827
|
displacementScale: 60,
|
|
13495
13828
|
blurAmount: 3,
|
|
@@ -13501,71 +13834,93 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13501
13834
|
children: jsxs("div", {
|
|
13502
13835
|
className: "u-p-4",
|
|
13503
13836
|
children: [ subtitle && jsx("p", {
|
|
13504
|
-
className: HERO.SELECTORS.SUBTITLE.replace(".", ""),
|
|
13837
|
+
className: `${HERO.SELECTORS.SUBTITLE.replace(".", "")} ${parts?.subtitle?.className || ""}`.trim(),
|
|
13838
|
+
style: parts?.subtitle?.style,
|
|
13505
13839
|
children: subtitle
|
|
13506
|
-
}), jsx(
|
|
13507
|
-
className: HERO.SELECTORS.TITLE.replace(".", ""),
|
|
13840
|
+
}), jsx(HeadingTag, {
|
|
13841
|
+
className: `${HERO.SELECTORS.TITLE.replace(".", "")} ${parts?.title?.className || ""}`.trim(),
|
|
13842
|
+
style: parts?.title?.style,
|
|
13508
13843
|
children: title
|
|
13509
13844
|
}), text && jsx("p", {
|
|
13510
|
-
className: HERO.SELECTORS.TEXT.replace(".", ""),
|
|
13845
|
+
className: `${HERO.SELECTORS.TEXT.replace(".", "")} ${parts?.text?.className || ""}`.trim(),
|
|
13846
|
+
style: parts?.text?.style,
|
|
13511
13847
|
children: text
|
|
13512
13848
|
}), actions && jsx("div", {
|
|
13513
|
-
className: HERO.SELECTORS.ACTIONS.replace(".", ""),
|
|
13849
|
+
className: `${HERO.SELECTORS.ACTIONS.replace(".", "")} ${parts?.actions?.className || ""}`.trim(),
|
|
13850
|
+
style: parts?.actions?.style,
|
|
13514
13851
|
children: actions
|
|
13515
13852
|
}) ]
|
|
13516
13853
|
})
|
|
13517
13854
|
})
|
|
13518
13855
|
} : {
|
|
13519
|
-
className: HERO.SELECTORS.CONTENT.replace(".", ""),
|
|
13856
|
+
className: `${HERO.SELECTORS.CONTENT.replace(".", "")} ${parts?.content?.className || ""}`.trim(),
|
|
13857
|
+
style: parts?.content?.style,
|
|
13520
13858
|
children: jsx(AtomixGlass, {
|
|
13521
13859
|
...glass,
|
|
13522
13860
|
children: jsxs("div", {
|
|
13523
13861
|
className: "u-p-4",
|
|
13524
13862
|
children: [ subtitle && jsx("p", {
|
|
13525
|
-
className: HERO.SELECTORS.SUBTITLE.replace(".", ""),
|
|
13863
|
+
className: `${HERO.SELECTORS.SUBTITLE.replace(".", "")} ${parts?.subtitle?.className || ""}`.trim(),
|
|
13864
|
+
style: parts?.subtitle?.style,
|
|
13526
13865
|
children: subtitle
|
|
13527
|
-
}), jsx(
|
|
13528
|
-
className: HERO.SELECTORS.TITLE.replace(".", ""),
|
|
13866
|
+
}), jsx(HeadingTag, {
|
|
13867
|
+
className: `${HERO.SELECTORS.TITLE.replace(".", "")} ${parts?.title?.className || ""}`.trim(),
|
|
13868
|
+
style: parts?.title?.style,
|
|
13529
13869
|
children: title
|
|
13530
13870
|
}), text && jsx("p", {
|
|
13531
|
-
className: HERO.SELECTORS.TEXT.replace(".", ""),
|
|
13871
|
+
className: `${HERO.SELECTORS.TEXT.replace(".", "")} ${parts?.text?.className || ""}`.trim(),
|
|
13872
|
+
style: parts?.text?.style,
|
|
13532
13873
|
children: text
|
|
13533
13874
|
}), actions && jsx("div", {
|
|
13534
|
-
className: HERO.SELECTORS.ACTIONS.replace(".", ""),
|
|
13875
|
+
className: `${HERO.SELECTORS.ACTIONS.replace(".", "")} ${parts?.actions?.className || ""}`.trim(),
|
|
13876
|
+
style: parts?.actions?.style,
|
|
13535
13877
|
children: actions
|
|
13536
13878
|
}) ]
|
|
13537
13879
|
})
|
|
13538
13880
|
})
|
|
13539
13881
|
}) : content;
|
|
13540
13882
|
}, renderForegroundImage = () => hasForegroundImage ? jsx("div", "center" === alignment ? {
|
|
13541
|
-
className: HERO.SELECTORS.IMAGE_WRAPPER.replace(".", ""),
|
|
13883
|
+
className: `${HERO.SELECTORS.IMAGE_WRAPPER.replace(".", "")} ${imageColClassName || ""} ${parts?.imageWrapper?.className || ""}`.trim(),
|
|
13884
|
+
style: {
|
|
13885
|
+
...imageColStyle,
|
|
13886
|
+
...parts?.imageWrapper?.style
|
|
13887
|
+
},
|
|
13542
13888
|
children: jsx("img", {
|
|
13543
13889
|
src: imageSrc,
|
|
13544
13890
|
alt: imageAlt,
|
|
13545
|
-
className: HERO.SELECTORS.IMAGE.replace(".", "")
|
|
13891
|
+
className: `${HERO.SELECTORS.IMAGE.replace(".", "")} ${parts?.image?.className || ""}`.trim(),
|
|
13892
|
+
style: parts?.image?.style
|
|
13546
13893
|
})
|
|
13547
13894
|
} : {
|
|
13548
|
-
className: generateImageColClass(),
|
|
13895
|
+
className: `${generateImageColClass(imageColSize, imageColClassName)} ${parts?.imageWrapper?.className || ""}`.trim(),
|
|
13896
|
+
style: {
|
|
13897
|
+
...imageColStyle,
|
|
13898
|
+
...parts?.imageWrapper?.style
|
|
13899
|
+
},
|
|
13549
13900
|
children: jsx("img", {
|
|
13550
13901
|
src: imageSrc,
|
|
13551
13902
|
alt: imageAlt,
|
|
13552
|
-
className: HERO.SELECTORS.IMAGE.replace(".", "")
|
|
13903
|
+
className: `${HERO.SELECTORS.IMAGE.replace(".", "")} ${parts?.image?.className || ""}`.trim(),
|
|
13904
|
+
style: parts?.image?.style
|
|
13553
13905
|
})
|
|
13554
13906
|
}) : null;
|
|
13555
|
-
|
|
13556
|
-
return jsxs("div", {
|
|
13907
|
+
return jsxs("div", {
|
|
13557
13908
|
ref: heroRef,
|
|
13558
|
-
className: generateHeroClassNames(className),
|
|
13559
|
-
style:
|
|
13909
|
+
className: `${generateHeroClassNames(className)} ${parts?.root?.className || ""}`.trim(),
|
|
13910
|
+
style: {
|
|
13911
|
+
...heroStyle,
|
|
13912
|
+
...parts?.root?.style
|
|
13913
|
+
},
|
|
13560
13914
|
"data-parallax": parallax ? "true" : void 0,
|
|
13561
13915
|
"data-parallax-intensity": parallax ? parallaxIntensity : void 0,
|
|
13562
|
-
|
|
13916
|
+
...rest,
|
|
13917
|
+
children: [ backgroundElement, (() => {
|
|
13563
13918
|
// Render background slider if configured
|
|
13564
13919
|
if (hasBackgroundSlider && backgroundSlider && sliderHook) {
|
|
13565
13920
|
const {slides: slides, transition: transition = "fade", transitionDuration: transitionDuration = 1e3} = backgroundSlider, {currentIndex: currentIndex, slideRefs: slideRefs, videoRefs: videoRefs} = sliderHook;
|
|
13566
13921
|
// Determine transition class
|
|
13567
13922
|
let transitionClass = HERO.CLASSES.SLIDER_FADE;
|
|
13568
|
-
return "slide" === transition
|
|
13923
|
+
return "slide" === transition && (transitionClass = HERO.CLASSES.SLIDER_SLIDE),
|
|
13569
13924
|
jsxs("div", {
|
|
13570
13925
|
className: `${HERO.SELECTORS.SLIDER.replace(".", "")} ${transitionClass}`,
|
|
13571
13926
|
style: {
|
|
@@ -13582,57 +13937,68 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13582
13937
|
return jsx("div", {
|
|
13583
13938
|
ref: slideRef,
|
|
13584
13939
|
className: `${HERO.SELECTORS.SLIDER_ITEM.replace(".", "")} ${isActive ? HERO.CLASSES.SLIDER_ITEM_ACTIVE : ""}`,
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
alt: slide.alt || "Background slide",
|
|
13588
|
-
className: HERO.SELECTORS.BG_IMAGE.replace(".", "")
|
|
13589
|
-
}) : jsxs("video", {
|
|
13940
|
+
"aria-hidden": !isActive,
|
|
13941
|
+
children: "video" === slide.type ? jsxs("video", {
|
|
13590
13942
|
ref: videoRef,
|
|
13591
|
-
className: "c-
|
|
13592
|
-
|
|
13593
|
-
|
|
13594
|
-
muted:
|
|
13943
|
+
className: "c-hero__bg-video",
|
|
13944
|
+
src: slide.src,
|
|
13945
|
+
poster: slide.videoOptions?.posterUrl || slide.alt,
|
|
13946
|
+
muted: slide.videoOptions?.muted ?? !0,
|
|
13947
|
+
loop: slide.videoOptions?.loop ?? !0,
|
|
13595
13948
|
playsInline: !0,
|
|
13596
|
-
|
|
13949
|
+
"aria-hidden": "true",
|
|
13950
|
+
autoPlay: !1 !== slide.videoOptions?.autoplay,
|
|
13597
13951
|
children: [ jsx("source", {
|
|
13598
13952
|
src: slide.src,
|
|
13599
13953
|
type: `video/${slide.src.split(".").pop() || "mp4"}`
|
|
13600
13954
|
}), "Your browser does not support the video tag." ]
|
|
13955
|
+
}) : jsx("img", {
|
|
13956
|
+
src: slide.src,
|
|
13957
|
+
alt: slide.alt || "Background slide",
|
|
13958
|
+
className: HERO.SELECTORS.BG_IMAGE.replace(".", "")
|
|
13601
13959
|
})
|
|
13602
13960
|
}, index);
|
|
13603
13961
|
})), showOverlay && jsx("div", {
|
|
13604
|
-
className: HERO.SELECTORS.OVERLAY.replace(".", "")
|
|
13962
|
+
className: `${HERO.SELECTORS.OVERLAY.replace(".", "")} ${parts?.overlay?.className || ""}`.trim(),
|
|
13963
|
+
style: parts?.overlay?.style
|
|
13605
13964
|
}) ]
|
|
13606
13965
|
});
|
|
13607
13966
|
}
|
|
13608
13967
|
// Fall back to single background image/video
|
|
13609
13968
|
return hasBackgroundImage || videoBackground ? jsxs("div", {
|
|
13610
|
-
className: HERO.SELECTORS.BG.replace(".", ""),
|
|
13969
|
+
className: `${HERO.SELECTORS.BG.replace(".", "")} ${parts?.background?.className || ""}`.trim(),
|
|
13970
|
+
style: parts?.background?.style,
|
|
13611
13971
|
children: [ backgroundImageSrc && jsx("img", {
|
|
13612
13972
|
src: backgroundImageSrc,
|
|
13613
13973
|
alt: "Background",
|
|
13614
13974
|
className: HERO.SELECTORS.BG_IMAGE.replace(".", "")
|
|
13615
13975
|
}), renderVideoBackground(), showOverlay && jsx("div", {
|
|
13616
|
-
className: HERO.SELECTORS.OVERLAY.replace(".", "")
|
|
13976
|
+
className: `${HERO.SELECTORS.OVERLAY.replace(".", "")} ${parts?.overlay?.className || ""}`.trim(),
|
|
13977
|
+
style: parts?.overlay?.style
|
|
13617
13978
|
}) ]
|
|
13618
13979
|
}) : null;
|
|
13619
13980
|
})(), jsx("div", {
|
|
13620
|
-
className: `${HERO.SELECTORS.CONTAINER.replace(".", "")} o-container
|
|
13981
|
+
className: `${HERO.SELECTORS.CONTAINER.replace(".", "")} o-container ${parts?.container?.className || ""}`.trim(),
|
|
13982
|
+
style: parts?.container?.style,
|
|
13621
13983
|
children: children ? jsx("div", {
|
|
13622
|
-
className: HERO.SELECTORS.GRID.replace(".", ""),
|
|
13984
|
+
className: `${HERO.SELECTORS.GRID.replace(".", "")} ${parts?.grid?.className || ""}`.trim(),
|
|
13985
|
+
style: parts?.grid?.style,
|
|
13623
13986
|
children: children
|
|
13624
13987
|
}) : useGridLayout ? jsx("div", {
|
|
13625
|
-
className: `${HERO.SELECTORS.GRID.replace(".", "")} o-grid
|
|
13988
|
+
className: `${HERO.SELECTORS.GRID.replace(".", "")} o-grid ${parts?.grid?.className || ""}`.trim(),
|
|
13989
|
+
style: parts?.grid?.style,
|
|
13626
13990
|
children: jsxs(Fragment,
|
|
13627
13991
|
// For left-aligned content, render content first then image
|
|
13628
13992
|
"left" === alignment ? {
|
|
13629
13993
|
children: [ jsx("div", {
|
|
13630
|
-
className: generateContentColClass(),
|
|
13994
|
+
className: generateContentColClass(contentColSize, contentColClassName),
|
|
13995
|
+
style: contentColStyle,
|
|
13631
13996
|
children: renderContent()
|
|
13632
13997
|
}), renderForegroundImage() ]
|
|
13633
13998
|
} : {
|
|
13634
13999
|
children: [ renderForegroundImage(), jsx("div", {
|
|
13635
|
-
className: generateContentColClass(),
|
|
14000
|
+
className: generateContentColClass(contentColSize, contentColClassName),
|
|
14001
|
+
style: contentColStyle,
|
|
13636
14002
|
children: renderContent()
|
|
13637
14003
|
}) ]
|
|
13638
14004
|
})
|
|
@@ -13643,7 +14009,81 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
|
|
|
13643
14009
|
});
|
|
13644
14010
|
};
|
|
13645
14011
|
|
|
13646
|
-
Hero.
|
|
14012
|
+
Hero.Title = ({children: children, className: className, level: level = "h1", ...props}) => jsx(level, {
|
|
14013
|
+
className: `${HERO.SELECTORS.TITLE.replace(".", "")} ${className || ""}`.trim(),
|
|
14014
|
+
...props,
|
|
14015
|
+
children: children
|
|
14016
|
+
}), Hero.Subtitle = ({children: children, className: className, ...props}) => jsx("p", {
|
|
14017
|
+
className: `${HERO.SELECTORS.SUBTITLE.replace(".", "")} ${className || ""}`.trim(),
|
|
14018
|
+
...props,
|
|
14019
|
+
children: children
|
|
14020
|
+
}), Hero.Text = ({children: children, className: className, ...props}) => jsx("p", {
|
|
14021
|
+
className: `${HERO.SELECTORS.TEXT.replace(".", "")} ${className || ""}`.trim(),
|
|
14022
|
+
...props,
|
|
14023
|
+
children: children
|
|
14024
|
+
}), Hero.Actions = ({children: children, className: className, ...props}) => jsx("div", {
|
|
14025
|
+
className: `${HERO.SELECTORS.ACTIONS.replace(".", "")} ${className || ""}`.trim(),
|
|
14026
|
+
...props,
|
|
14027
|
+
children: children
|
|
14028
|
+
}), Hero.Content = ({children: children, className: className, style: style, glass: glass, ...props}) => {
|
|
14029
|
+
const contentClass = `${HERO.SELECTORS.CONTENT.replace(".", "")} ${className || ""}`.trim();
|
|
14030
|
+
if (glass) {
|
|
14031
|
+
const glassProps = "boolean" == typeof glass ? {
|
|
14032
|
+
displacementScale: 60,
|
|
14033
|
+
blurAmount: 3,
|
|
14034
|
+
saturation: 180,
|
|
14035
|
+
aberrationIntensity: 0,
|
|
14036
|
+
cornerRadius: 8,
|
|
14037
|
+
overLight: !1,
|
|
14038
|
+
mode: "standard"
|
|
14039
|
+
} : glass;
|
|
14040
|
+
return jsx("div", {
|
|
14041
|
+
className: contentClass,
|
|
14042
|
+
style: style,
|
|
14043
|
+
...props,
|
|
14044
|
+
children: jsx(AtomixGlass, {
|
|
14045
|
+
...glassProps,
|
|
14046
|
+
children: jsx("div", {
|
|
14047
|
+
className: "u-p-4",
|
|
14048
|
+
children: children
|
|
14049
|
+
})
|
|
14050
|
+
})
|
|
14051
|
+
});
|
|
14052
|
+
}
|
|
14053
|
+
return jsx("div", {
|
|
14054
|
+
className: contentClass,
|
|
14055
|
+
style: style,
|
|
14056
|
+
...props,
|
|
14057
|
+
children: children
|
|
14058
|
+
});
|
|
14059
|
+
}, Hero.Image = ({src: src, alt: alt = "", className: className, wrapperClassName: wrapperClassName, wrapperStyle: wrapperStyle, ...props}) => jsx("div", {
|
|
14060
|
+
className: `${HERO.SELECTORS.IMAGE_WRAPPER.replace(".", "")} ${wrapperClassName || ""}`.trim(),
|
|
14061
|
+
style: wrapperStyle,
|
|
14062
|
+
children: jsx("img", {
|
|
14063
|
+
src: src,
|
|
14064
|
+
alt: alt,
|
|
14065
|
+
className: `${HERO.SELECTORS.IMAGE.replace(".", "")} ${className || ""}`.trim(),
|
|
14066
|
+
...props
|
|
14067
|
+
})
|
|
14068
|
+
}), Hero.Background = ({className: className, style: style, src: src, children: children, ...props}) => jsxs("div", {
|
|
14069
|
+
className: `${HERO.SELECTORS.BG.replace(".", "")} ${className || ""}`.trim(),
|
|
14070
|
+
style: style,
|
|
14071
|
+
...props,
|
|
14072
|
+
children: [ src && jsx("img", {
|
|
14073
|
+
src: src,
|
|
14074
|
+
alt: "Background",
|
|
14075
|
+
className: HERO.SELECTORS.BG_IMAGE.replace(".", "")
|
|
14076
|
+
}), children ]
|
|
14077
|
+
}), Hero.displayName = "Hero";
|
|
14078
|
+
|
|
14079
|
+
const ListItem = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("li", {
|
|
14080
|
+
ref: ref,
|
|
14081
|
+
className: `${LIST.ITEM_CLASS} ${className}`.trim(),
|
|
14082
|
+
...props,
|
|
14083
|
+
children: children
|
|
14084
|
+
})));
|
|
14085
|
+
|
|
14086
|
+
ListItem.displayName = "ListItem";
|
|
13647
14087
|
|
|
13648
14088
|
const List = memo((({children: children, variant: variant = "default", className: className = "", style: style, ...props}) => {
|
|
13649
14089
|
var _context;
|
|
@@ -13654,14 +14094,14 @@ const List = memo((({children: children, variant: variant = "default", classNam
|
|
|
13654
14094
|
className: listClasses,
|
|
13655
14095
|
style: style,
|
|
13656
14096
|
...props,
|
|
13657
|
-
children: React.Children.map(children, (child => jsx("li", {
|
|
14097
|
+
children: React.Children.map(children, (child => React.isValidElement(child) && child.type === ListItem ? child : jsx("li", {
|
|
13658
14098
|
className: "c-list__item",
|
|
13659
14099
|
children: child
|
|
13660
14100
|
})))
|
|
13661
14101
|
});
|
|
13662
14102
|
}));
|
|
13663
14103
|
|
|
13664
|
-
List.displayName = "List";
|
|
14104
|
+
List.displayName = "List", List.Item = ListItem;
|
|
13665
14105
|
|
|
13666
14106
|
const ListGroup = ({children: children, className: className = "", style: style, variant: variant = "default"}) => {
|
|
13667
14107
|
// Generate CSS classes
|
|
@@ -13878,10 +14318,59 @@ const Messages = ({messages: messages = [], otherAvatar: otherAvatar, selfAvatar
|
|
|
13878
14318
|
* Messages component for displaying a chat interface with messages, images, and file attachments
|
|
13879
14319
|
*/ Messages.displayName = "Messages";
|
|
13880
14320
|
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
14321
|
+
const ModalHeader = forwardRef((({title: title, subtitle: subtitle, closeButton: closeButton, onClose: onClose, children: children, className: className = "", ...props}, ref) => jsxs("div", {
|
|
14322
|
+
ref: ref,
|
|
14323
|
+
className: `c-modal__header ${className}`.trim(),
|
|
14324
|
+
...props,
|
|
14325
|
+
children: [ jsxs("div", {
|
|
14326
|
+
className: "c-modal__header-content",
|
|
14327
|
+
children: [ title && jsx("h3", {
|
|
14328
|
+
className: "c-modal__title",
|
|
14329
|
+
children: title
|
|
14330
|
+
}), subtitle && jsx("p", {
|
|
14331
|
+
className: "c-modal__sub",
|
|
14332
|
+
children: subtitle
|
|
14333
|
+
}), children ]
|
|
14334
|
+
}), closeButton && jsx("button", {
|
|
14335
|
+
type: "button",
|
|
14336
|
+
className: "c-modal__close c-btn js-modal-close",
|
|
14337
|
+
onClick: onClose,
|
|
14338
|
+
"aria-label": "Close modal",
|
|
14339
|
+
children: jsx("svg", {
|
|
14340
|
+
width: "20",
|
|
14341
|
+
height: "20",
|
|
14342
|
+
viewBox: "0 0 20 20",
|
|
14343
|
+
fill: "none",
|
|
14344
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14345
|
+
children: jsx("path", {
|
|
14346
|
+
d: "M16.0672 15.1828C16.1253 15.2409 16.1713 15.3098 16.2028 15.3857C16.2342 15.4615 16.2504 15.5429 16.2504 15.625C16.2504 15.7071 16.2342 15.7884 16.2028 15.8643C16.1713 15.9402 16.1253 16.0091 16.0672 16.0672C16.0091 16.1252 15.9402 16.1713 15.8643 16.2027C15.7885 16.2342 15.7071 16.2503 15.625 16.2503C15.5429 16.2503 15.4616 16.2342 15.3857 16.2027C15.3098 16.1713 15.2409 16.1252 15.1828 16.0672L10 10.8836L4.8172 16.0672C4.69992 16.1844 4.54086 16.2503 4.37501 16.2503C4.20916 16.2503 4.0501 16.1844 3.93282 16.0672C3.81555 15.9499 3.74966 15.7908 3.74966 15.625C3.74966 15.4591 3.81555 15.3001 3.93282 15.1828L9.11642 9.99998L3.93282 4.81717C3.81555 4.69989 3.74966 4.54083 3.74966 4.37498C3.74966 4.20913 3.81555 4.05007 3.93282 3.93279C4.0501 3.81552 4.20916 3.74963 4.37501 3.74963C4.54086 3.74963 4.69992 3.81552 4.8172 3.93279L10 9.11639L15.1828 3.93279C15.3001 3.81552 15.4592 3.74963 15.625 3.74963C15.7909 3.74963 15.9499 3.81552 16.0672 3.93279C16.1845 4.05007 16.2504 4.20913 16.2504 4.37498C16.2504 4.54083 16.1845 4.69989 16.0672 4.81717L10.8836 9.99998L16.0672 15.1828Z",
|
|
14347
|
+
fill: "#141414"
|
|
14348
|
+
})
|
|
14349
|
+
})
|
|
14350
|
+
}) ]
|
|
14351
|
+
})));
|
|
14352
|
+
|
|
14353
|
+
ModalHeader.displayName = "ModalHeader";
|
|
14354
|
+
|
|
14355
|
+
const ModalBody = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
14356
|
+
ref: ref,
|
|
14357
|
+
className: `c-modal__body ${className}`.trim(),
|
|
14358
|
+
...props,
|
|
14359
|
+
children: children
|
|
14360
|
+
})));
|
|
14361
|
+
|
|
14362
|
+
ModalBody.displayName = "ModalBody";
|
|
14363
|
+
|
|
14364
|
+
const ModalFooter = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
14365
|
+
ref: ref,
|
|
14366
|
+
className: `c-modal__footer ${className}`.trim(),
|
|
14367
|
+
...props,
|
|
14368
|
+
children: children
|
|
14369
|
+
})));
|
|
14370
|
+
|
|
14371
|
+
ModalFooter.displayName = "ModalFooter";
|
|
14372
|
+
|
|
14373
|
+
const ModalImpl = memo((({children: children, isOpen: isOpen = !1, onOpenChange: onOpenChange, onClose: onClose, onOpen: onOpen, title: title, subtitle: subtitle, size: size = "md", backdrop: backdrop = !0, keyboard: keyboard = !0, className: className = "", style: style, closeButton: closeButton = !0, footer: footer, glass: glass, ...props}) => {
|
|
13885
14374
|
const modalRef = useRef(null), dialogRef = useRef(null), backdropRef = useRef(null), {isOpen: isOpenState, open: open, close: close} =
|
|
13886
14375
|
/**
|
|
13887
14376
|
* Hook for managing modal state
|
|
@@ -13931,43 +14420,26 @@ const Modal = memo((({children: children, isOpen: isOpen = !1, onOpenChange: on
|
|
|
13931
14420
|
};
|
|
13932
14421
|
}), [ isOpenState, close, keyboard ]);
|
|
13933
14422
|
// Handle backdrop click
|
|
13934
|
-
const modalClasses = [ "c-modal", isOpenState ? MODAL.CLASSES.IS_OPEN : "", size ? `c-modal--${size}` : "", glass ? "c-modal--glass" : "", className ].filter(Boolean).join(" "),
|
|
14423
|
+
const modalClasses = [ "c-modal", isOpenState ? MODAL.CLASSES.IS_OPEN : "", size ? `c-modal--${size}` : "", glass ? "c-modal--glass" : "", className ].filter(Boolean).join(" "), hasCompoundComponents = React.Children.toArray(children).some((child => {
|
|
14424
|
+
var _context;
|
|
14425
|
+
|
|
14426
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "ModalHeader", "ModalBody", "ModalFooter" ]).call(_context, child.type.displayName);
|
|
14427
|
+
})), modalContent = jsx("div", {
|
|
13935
14428
|
className: "c-modal__content",
|
|
13936
|
-
children:
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
type: "button",
|
|
13949
|
-
className: "c-modal__close c-btn js-modal-close",
|
|
13950
|
-
onClick: close,
|
|
13951
|
-
"aria-label": "Close modal",
|
|
13952
|
-
children: jsx("svg", {
|
|
13953
|
-
width: "20",
|
|
13954
|
-
height: "20",
|
|
13955
|
-
viewBox: "0 0 20 20",
|
|
13956
|
-
fill: "none",
|
|
13957
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
13958
|
-
children: jsx("path", {
|
|
13959
|
-
d: "M16.0672 15.1828C16.1253 15.2409 16.1713 15.3098 16.2028 15.3857C16.2342 15.4615 16.2504 15.5429 16.2504 15.625C16.2504 15.7071 16.2342 15.7884 16.2028 15.8643C16.1713 15.9402 16.1253 16.0091 16.0672 16.0672C16.0091 16.1252 15.9402 16.1713 15.8643 16.2027C15.7885 16.2342 15.7071 16.2503 15.625 16.2503C15.5429 16.2503 15.4616 16.2342 15.3857 16.2027C15.3098 16.1713 15.2409 16.1252 15.1828 16.0672L10 10.8836L4.8172 16.0672C4.69992 16.1844 4.54086 16.2503 4.37501 16.2503C4.20916 16.2503 4.0501 16.1844 3.93282 16.0672C3.81555 15.9499 3.74966 15.7908 3.74966 15.625C3.74966 15.4591 3.81555 15.3001 3.93282 15.1828L9.11642 9.99998L3.93282 4.81717C3.81555 4.69989 3.74966 4.54083 3.74966 4.37498C3.74966 4.20913 3.81555 4.05007 3.93282 3.93279C4.0501 3.81552 4.20916 3.74963 4.37501 3.74963C4.54086 3.74963 4.69992 3.81552 4.8172 3.93279L10 9.11639L15.1828 3.93279C15.3001 3.81552 15.4592 3.74963 15.625 3.74963C15.7909 3.74963 15.9499 3.81552 16.0672 3.93279C16.1845 4.05007 16.2504 4.20913 16.2504 4.37498C16.2504 4.54083 16.1845 4.69989 16.0672 4.81717L10.8836 9.99998L16.0672 15.1828Z",
|
|
13960
|
-
fill: "#141414"
|
|
13961
|
-
})
|
|
13962
|
-
})
|
|
14429
|
+
children: hasCompoundComponents ? React.Children.map(children, (child => React.isValidElement(child) && "ModalHeader" === child.type.displayName ? React.cloneElement(child, {
|
|
14430
|
+
onClose: child.props.onClose || close
|
|
14431
|
+
}) : child)) : jsxs(Fragment, {
|
|
14432
|
+
children: [ (title || closeButton) && jsx(ModalHeader, {
|
|
14433
|
+
title: title,
|
|
14434
|
+
subtitle: subtitle,
|
|
14435
|
+
closeButton: closeButton,
|
|
14436
|
+
onClose: close
|
|
14437
|
+
}), jsx(ModalBody, {
|
|
14438
|
+
children: children
|
|
14439
|
+
}), footer && jsx(ModalFooter, {
|
|
14440
|
+
children: footer
|
|
13963
14441
|
}) ]
|
|
13964
|
-
})
|
|
13965
|
-
className: "c-modal__body",
|
|
13966
|
-
children: children
|
|
13967
|
-
}), footer && jsx("div", {
|
|
13968
|
-
className: "c-modal__footer",
|
|
13969
|
-
children: footer
|
|
13970
|
-
}) ]
|
|
14442
|
+
})
|
|
13971
14443
|
});
|
|
13972
14444
|
// Assemble classes
|
|
13973
14445
|
return jsxs("div", {
|
|
@@ -14012,24 +14484,15 @@ const Modal = memo((({children: children, isOpen: isOpen = !1, onOpenChange: on
|
|
|
14012
14484
|
});
|
|
14013
14485
|
}));
|
|
14014
14486
|
|
|
14015
|
-
|
|
14487
|
+
ModalImpl.displayName = "Modal";
|
|
14016
14488
|
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
* <NavItem href="/about">About</NavItem>
|
|
14025
|
-
* <NavDropdown title="Services">
|
|
14026
|
-
* <MenuItem href="/web">Web Design</MenuItem>
|
|
14027
|
-
* <MenuItem href="/mobile">Mobile Apps</MenuItem>
|
|
14028
|
-
* </NavDropdown>
|
|
14029
|
-
* </Nav>
|
|
14030
|
-
* ```
|
|
14031
|
-
*/
|
|
14032
|
-
const Nav = forwardRef((({children: children, alignment: alignment = "start", variant: variant = "default", className: className = "", disabled: disabled = !1, glass: glass}, ref) => {
|
|
14489
|
+
// Attach subcomponents
|
|
14490
|
+
const ModalWithSubcomponents = ModalImpl;
|
|
14491
|
+
|
|
14492
|
+
ModalWithSubcomponents.Header = ModalHeader, ModalWithSubcomponents.Body = ModalBody,
|
|
14493
|
+
ModalWithSubcomponents.Footer = ModalFooter;
|
|
14494
|
+
|
|
14495
|
+
const Modal = ModalWithSubcomponents, Nav = forwardRef((({children: children, alignment: alignment = "start", variant: variant = "default", className: className = "", disabled: disabled = !1, glass: glass}, ref) => {
|
|
14033
14496
|
const {generateNavClass: generateNavClass} = useNav({
|
|
14034
14497
|
alignment: alignment,
|
|
14035
14498
|
variant: variant
|
|
@@ -14072,7 +14535,21 @@ const Nav = forwardRef((({children: children, alignment: alignment = "start", v
|
|
|
14072
14535
|
return navContent;
|
|
14073
14536
|
}));
|
|
14074
14537
|
|
|
14075
|
-
|
|
14538
|
+
/**
|
|
14539
|
+
* Nav component provides a container for navigation items with proper alignment and accessibility.
|
|
14540
|
+
*
|
|
14541
|
+
* @example
|
|
14542
|
+
* ```tsx
|
|
14543
|
+
* <Nav alignment="center">
|
|
14544
|
+
* <NavItem href="/">Home</NavItem>
|
|
14545
|
+
* <NavItem href="/about">About</NavItem>
|
|
14546
|
+
* <NavDropdown title="Services">
|
|
14547
|
+
* <MenuItem href="/web">Web Design</MenuItem>
|
|
14548
|
+
* <MenuItem href="/mobile">Mobile Apps</MenuItem>
|
|
14549
|
+
* </NavDropdown>
|
|
14550
|
+
* </Nav>
|
|
14551
|
+
* ```
|
|
14552
|
+
*/ Nav.displayName = "Nav";
|
|
14076
14553
|
|
|
14077
14554
|
/**
|
|
14078
14555
|
* NavItem component represents a single navigation item that can be a link, dropdown trigger, or mega menu trigger.
|
|
@@ -16948,39 +17425,72 @@ const Slider = forwardRef(((props, ref) => {
|
|
|
16948
17425
|
|
|
16949
17426
|
Slider.displayName = "Slider";
|
|
16950
17427
|
|
|
17428
|
+
const StepsItem = forwardRef((({children: children, className: className = "", number: number, title: title, active: active, completed: completed, index: index, ...props}, ref) => {
|
|
17429
|
+
const itemClasses = [ "c-steps__item", active ? STEPS.CLASSES.ACTIVE : "", completed ? STEPS.CLASSES.COMPLETED : "", className ].filter(Boolean).join(" ");
|
|
17430
|
+
return jsxs("div", {
|
|
17431
|
+
ref: ref,
|
|
17432
|
+
className: itemClasses,
|
|
17433
|
+
"aria-current": active ? "step" : void 0,
|
|
17434
|
+
"data-index": index,
|
|
17435
|
+
...props,
|
|
17436
|
+
children: [ jsx("div", {
|
|
17437
|
+
className: "c-steps__line"
|
|
17438
|
+
}), jsxs("div", {
|
|
17439
|
+
className: "c-steps__content",
|
|
17440
|
+
children: [ null != number && jsx("div", {
|
|
17441
|
+
className: "c-steps__number",
|
|
17442
|
+
children: number
|
|
17443
|
+
}), title && jsx("div", {
|
|
17444
|
+
className: "c-steps__text",
|
|
17445
|
+
children: title
|
|
17446
|
+
}), children && jsx("div", {
|
|
17447
|
+
className: "c-steps__custom-content",
|
|
17448
|
+
children: children
|
|
17449
|
+
}) ]
|
|
17450
|
+
}) ]
|
|
17451
|
+
});
|
|
17452
|
+
}));
|
|
17453
|
+
|
|
17454
|
+
StepsItem.displayName = "StepsItem";
|
|
17455
|
+
|
|
16951
17456
|
/**
|
|
16952
17457
|
* Steps component for displaying a sequence of steps
|
|
16953
17458
|
*/
|
|
16954
|
-
const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical = !1, onStepChange: onStepChange, className: className = "", style: style, glass: glass}) => {
|
|
17459
|
+
const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical = !1, onStepChange: onStepChange, className: className = "", style: style, glass: glass, children: children}) => {
|
|
16955
17460
|
const [currentStep, setCurrentStep] = useState(activeIndex);
|
|
16956
17461
|
// Update steps when activeIndex prop changes
|
|
16957
|
-
|
|
17462
|
+
let content;
|
|
17463
|
+
useEffect((() => {
|
|
16958
17464
|
currentStep !== activeIndex && setCurrentStep(activeIndex);
|
|
16959
|
-
}), [ activeIndex ])
|
|
17465
|
+
}), [ activeIndex ]),
|
|
17466
|
+
// Legacy rendering
|
|
17467
|
+
content = items && items.length > 0 ? items.map(((item, index) => jsx(StepsItem, {
|
|
17468
|
+
index: index,
|
|
17469
|
+
number: item.number,
|
|
17470
|
+
title: item.text,
|
|
17471
|
+
active: index <= currentStep,
|
|
17472
|
+
completed: index < currentStep,
|
|
17473
|
+
children: item.content
|
|
17474
|
+
}, `step-${index}`))) : Children.map(children, ((child, index) => {
|
|
17475
|
+
if ( isValidElement(child)) {
|
|
17476
|
+
const childProps = child.props, isActive = childProps.active ?? index <= currentStep, isCompleted = childProps.completed ?? index < currentStep, number = childProps.number ?? index + 1;
|
|
17477
|
+
// Inject active/completed based on index if not explicitly provided
|
|
17478
|
+
|
|
17479
|
+
return cloneElement(child, {
|
|
17480
|
+
index: index,
|
|
17481
|
+
active: isActive,
|
|
17482
|
+
completed: isCompleted,
|
|
17483
|
+
number: number
|
|
17484
|
+
});
|
|
17485
|
+
}
|
|
17486
|
+
return child;
|
|
17487
|
+
}));
|
|
16960
17488
|
const stepsContent = jsx("div", {
|
|
16961
17489
|
className: `c-steps ${vertical ? STEPS.CLASSES.VERTICAL : ""} ${className}`,
|
|
16962
17490
|
style: style,
|
|
16963
17491
|
role: "navigation",
|
|
16964
17492
|
"aria-label": "Steps",
|
|
16965
|
-
children:
|
|
16966
|
-
className: `c-steps__item ${index <= currentStep ? STEPS.CLASSES.ACTIVE : ""} ${index < currentStep ? STEPS.CLASSES.COMPLETED : ""}`,
|
|
16967
|
-
"aria-current": index === currentStep ? "step" : void 0,
|
|
16968
|
-
children: [ jsx("div", {
|
|
16969
|
-
className: "c-steps__line"
|
|
16970
|
-
}), jsxs("div", {
|
|
16971
|
-
className: "c-steps__content",
|
|
16972
|
-
children: [ jsx("div", {
|
|
16973
|
-
className: "c-steps__number",
|
|
16974
|
-
children: item.number
|
|
16975
|
-
}), jsx("div", {
|
|
16976
|
-
className: "c-steps__text",
|
|
16977
|
-
children: item.text
|
|
16978
|
-
}), item.content && jsx("div", {
|
|
16979
|
-
className: "c-steps__custom-content",
|
|
16980
|
-
children: item.content
|
|
16981
|
-
}) ]
|
|
16982
|
-
}) ]
|
|
16983
|
-
}, `step-${index}`)))
|
|
17493
|
+
children: content
|
|
16984
17494
|
});
|
|
16985
17495
|
if (glass) {
|
|
16986
17496
|
// Default glass settings for steps
|
|
@@ -17003,24 +17513,104 @@ const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical =
|
|
|
17003
17513
|
return stepsContent;
|
|
17004
17514
|
};
|
|
17005
17515
|
|
|
17006
|
-
Steps.displayName = "Steps";
|
|
17516
|
+
Steps.displayName = "Steps", Steps.Item = StepsItem, Steps.Step = StepsItem;
|
|
17007
17517
|
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17518
|
+
// Context for compound usage
|
|
17519
|
+
const TabsContext = createContext({
|
|
17520
|
+
currentTab: 0,
|
|
17521
|
+
handleTabClick: () => {}
|
|
17522
|
+
}), TabsList = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("ul", {
|
|
17523
|
+
ref: ref,
|
|
17524
|
+
className: `c-tabs__nav ${className}`.trim(),
|
|
17525
|
+
...props,
|
|
17526
|
+
children: React.Children.map(children, ((child, index) => React.isValidElement(child) ? React.cloneElement(child, {
|
|
17527
|
+
index: index
|
|
17528
|
+
}) : child))
|
|
17529
|
+
})));
|
|
17530
|
+
|
|
17531
|
+
// Compound components
|
|
17532
|
+
TabsList.displayName = "TabsList";
|
|
17533
|
+
|
|
17534
|
+
const TabsTrigger = forwardRef((({children: children, className: className = "", index: index, onClick: onClick, ...props}, ref) => {
|
|
17535
|
+
const {currentTab: currentTab, handleTabClick: handleTabClick} = useContext(TabsContext);
|
|
17536
|
+
// Safety check if used outside context or without index
|
|
17537
|
+
void 0 === index && console.warn("TabsTrigger requires an index prop or must be a direct child of TabsList");
|
|
17538
|
+
const isActive = void 0 !== index && currentTab === index;
|
|
17539
|
+
return jsx("li", {
|
|
17540
|
+
className: "c-tabs__nav-item",
|
|
17541
|
+
children: jsx("button", {
|
|
17542
|
+
ref: ref,
|
|
17543
|
+
className: `c-tabs__nav-btn ${isActive ? TAB.CLASSES.ACTIVE : ""} ${className}`.trim(),
|
|
17544
|
+
onClick: e => {
|
|
17545
|
+
void 0 !== index && handleTabClick(index), onClick?.(e);
|
|
17546
|
+
},
|
|
17547
|
+
"data-tabindex": index,
|
|
17548
|
+
role: "tab",
|
|
17549
|
+
"aria-selected": isActive,
|
|
17550
|
+
"aria-controls": `tab-panel-${index}`,
|
|
17551
|
+
type: "button",
|
|
17552
|
+
...props,
|
|
17553
|
+
children: children
|
|
17554
|
+
})
|
|
17555
|
+
});
|
|
17556
|
+
}));
|
|
17557
|
+
|
|
17558
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
17559
|
+
|
|
17560
|
+
const TabsPanels = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
17561
|
+
ref: ref,
|
|
17562
|
+
className: `c-tabs__panels ${className}`.trim(),
|
|
17563
|
+
...props,
|
|
17564
|
+
children: React.Children.map(children, ((child, index) => React.isValidElement(child) ? React.cloneElement(child, {
|
|
17565
|
+
index: index
|
|
17566
|
+
}) : child))
|
|
17567
|
+
})));
|
|
17568
|
+
|
|
17569
|
+
TabsPanels.displayName = "TabsPanels";
|
|
17570
|
+
|
|
17571
|
+
const TabsPanel = forwardRef((({children: children, className: className = "", index: index, style: style, ...props}, ref) => {
|
|
17572
|
+
const {currentTab: currentTab} = useContext(TabsContext), isActive = void 0 !== index && currentTab === index;
|
|
17573
|
+
return jsx("div", {
|
|
17574
|
+
ref: ref,
|
|
17575
|
+
className: `c-tabs__panel ${isActive ? TAB.CLASSES.ACTIVE : ""} ${className}`.trim(),
|
|
17576
|
+
"data-tabindex": index,
|
|
17577
|
+
id: `tab-panel-${index}`,
|
|
17578
|
+
role: "tabpanel",
|
|
17579
|
+
"aria-labelledby": `tab-nav-${index}`,
|
|
17580
|
+
style: {
|
|
17581
|
+
height: isActive ? "auto" : "0px",
|
|
17582
|
+
opacity: isActive ? 1 : 0,
|
|
17583
|
+
overflow: "hidden",
|
|
17584
|
+
transition: "height 0.3s ease, opacity 0.3s ease",
|
|
17585
|
+
...style
|
|
17586
|
+
},
|
|
17587
|
+
...props,
|
|
17588
|
+
children: jsx("div", {
|
|
17589
|
+
className: "c-tabs__panel-body",
|
|
17590
|
+
children: children
|
|
17591
|
+
})
|
|
17592
|
+
});
|
|
17593
|
+
}));
|
|
17594
|
+
|
|
17595
|
+
TabsPanel.displayName = "TabsPanel";
|
|
17596
|
+
|
|
17597
|
+
const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTIVE_INDEX, onTabChange: onTabChange, className: className = "", style: style, glass: glass, children: children}) => {
|
|
17598
|
+
const [currentTab, setCurrentTab] = useState(activeIndex), handleTabClick = index => {
|
|
17599
|
+
setCurrentTab(index), onTabChange && onTabChange(index);
|
|
17600
|
+
};
|
|
17601
|
+
// Handle tab change
|
|
17602
|
+
// Determine content based on mode (legacy items vs compound children)
|
|
17603
|
+
let content;
|
|
17604
|
+
// Use items prop if provided
|
|
17605
|
+
// Legacy mode
|
|
17606
|
+
content = items && items.length > 0 ? jsxs(Fragment, {
|
|
17015
17607
|
children: [ jsx("ul", {
|
|
17016
17608
|
className: "c-tabs__nav",
|
|
17017
17609
|
children: items.map(((item, index) => jsx("li", {
|
|
17018
17610
|
className: "c-tabs__nav-item",
|
|
17019
17611
|
children: jsx("button", {
|
|
17020
17612
|
className: `c-tabs__nav-btn ${index === currentTab ? TAB.CLASSES.ACTIVE : ""}`,
|
|
17021
|
-
onClick: () => (index
|
|
17022
|
-
setCurrentTab(index), onTabChange && onTabChange(index);
|
|
17023
|
-
})(index),
|
|
17613
|
+
onClick: () => handleTabClick(index),
|
|
17024
17614
|
"data-tabindex": index,
|
|
17025
17615
|
role: "tab",
|
|
17026
17616
|
"aria-selected": index === currentTab,
|
|
@@ -17048,9 +17638,19 @@ const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTI
|
|
|
17048
17638
|
})
|
|
17049
17639
|
}, `tab-panel-${index}`)))
|
|
17050
17640
|
}) ]
|
|
17641
|
+
}) : jsx(TabsContext.Provider, {
|
|
17642
|
+
value: {
|
|
17643
|
+
currentTab: currentTab,
|
|
17644
|
+
handleTabClick: handleTabClick
|
|
17645
|
+
},
|
|
17646
|
+
children: children
|
|
17051
17647
|
});
|
|
17052
|
-
|
|
17053
|
-
|
|
17648
|
+
const wrapper = jsx("div", {
|
|
17649
|
+
className: `c-tabs js-atomix-tab ${className}`,
|
|
17650
|
+
style: style,
|
|
17651
|
+
children: content
|
|
17652
|
+
});
|
|
17653
|
+
if (glass) {
|
|
17054
17654
|
// Default glass settings for tabs
|
|
17055
17655
|
const defaultGlassProps = {
|
|
17056
17656
|
displacementScale: 60,
|
|
@@ -17065,13 +17665,14 @@ const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTI
|
|
|
17065
17665
|
};
|
|
17066
17666
|
return jsx(AtomixGlass, {
|
|
17067
17667
|
...glassProps,
|
|
17068
|
-
children:
|
|
17668
|
+
children: wrapper
|
|
17069
17669
|
});
|
|
17070
17670
|
}
|
|
17071
|
-
return
|
|
17671
|
+
return wrapper;
|
|
17072
17672
|
}));
|
|
17073
17673
|
|
|
17074
|
-
Tabs.displayName = "Tabs"
|
|
17674
|
+
Tabs.displayName = "Tabs", Tabs.List = TabsList, Tabs.Trigger = TabsTrigger, Tabs.Panels = TabsPanels,
|
|
17675
|
+
Tabs.Panel = TabsPanel;
|
|
17075
17676
|
|
|
17076
17677
|
/**
|
|
17077
17678
|
* Testimonial component for displaying customer quotes and feedback
|
|
@@ -17275,7 +17876,7 @@ const Toggle = ({checked: controlledChecked, defaultChecked: defaultChecked = !1
|
|
|
17275
17876
|
if (disabled) return;
|
|
17276
17877
|
const nextChecked = !isChecked;
|
|
17277
17878
|
isControlled || setInternalChecked(nextChecked), onChange?.(nextChecked);
|
|
17278
|
-
}), [ disabled, isChecked, isControlled, onChange ]), toggleClass = [ "c-toggle", isChecked && TOGGLE.CLASSES.IS_ON, disabled && "is-disabled", className ].filter(Boolean).join(" "), toggleContent = jsx("div", {
|
|
17879
|
+
}), [ disabled, isChecked, isControlled, onChange ]), toggleClass = [ "c-toggle", isChecked && TOGGLE.CLASSES.IS_ON, disabled && "is-disabled", glass && "c-toggle--glass", className ].filter(Boolean).join(" "), toggleContent = jsx("div", {
|
|
17279
17880
|
className: toggleClass,
|
|
17280
17881
|
style: style,
|
|
17281
17882
|
onClick: handleClick,
|