@shohojdhara/atomix 0.3.15 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-tools/index.d.ts +31 -30
- package/build-tools/package.json +4 -21
- package/dist/atomix.css +20924 -2611
- 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.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +144 -18
- package/dist/index.esm.js +110 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +110 -55
- 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 +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +32 -23
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +99 -94
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/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 +62 -60
- 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 +109 -16
- 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 +313 -299
- package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
- package/src/components/EdgePanel/EdgePanel.tsx +1 -3
- 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.tsx +184 -182
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +56 -23
- package/src/components/Hero/Hero.tsx +201 -55
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.tsx +19 -23
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/Modal/Modal.tsx +130 -127
- package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
- package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
- package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
- package/src/components/Pagination/Pagination.stories.tsx +7 -4
- package/src/components/Pagination/Pagination.tsx +199 -202
- package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
- package/src/components/Popover/Popover.stories.tsx +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/Tabs/Tabs.stories.tsx +12 -9
- package/src/components/Tabs/Tabs.tsx +74 -72
- 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/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +106 -49
- 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 +106 -104
- package/src/lib/theme/devtools/Comparator.tsx +50 -32
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
- package/src/lib/theme/devtools/Inspector.tsx +75 -60
- package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
- package/src/lib/theme/devtools/Preview.tsx +150 -106
- package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
- package/src/lib/theme/devtools/index.ts +3 -9
- package/src/lib/theme/devtools/useHistory.ts +23 -21
- package/src/lib/theme/errors/errors.ts +12 -11
- package/src/lib/theme/errors/index.ts +2 -7
- package/src/lib/theme/generators/generateCSS.ts +9 -13
- package/src/lib/theme/generators/generateCSSNested.ts +1 -6
- package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/i18n/index.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +13 -13
- package/src/lib/theme/index.ts +7 -16
- package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
- package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
- package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
- package/src/lib/theme/runtime/index.ts +2 -5
- package/src/lib/theme/runtime/useTheme.ts +18 -18
- package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
- package/src/lib/theme/test/testTheme.ts +15 -16
- package/src/lib/theme/tokens/index.ts +2 -7
- package/src/lib/theme/tokens/tokens.ts +25 -24
- package/src/lib/theme/types.ts +428 -411
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
- package/src/lib/theme/utils/componentTheming.ts +18 -18
- package/src/lib/theme/utils/domUtils.ts +277 -289
- package/src/lib/theme/utils/index.ts +1 -2
- package/src/lib/theme/utils/injectCSS.ts +10 -14
- package/src/lib/theme/utils/naming.ts +20 -16
- package/src/lib/theme/utils/themeHelpers.ts +10 -12
- package/src/lib/theme/utils/themeUtils.ts +85 -86
- package/src/lib/theme/utils/themeValidation.ts +82 -33
- package/src/lib/theme-tools.ts +8 -6
- package/src/lib/types/components.ts +172 -71
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +1 -1
- 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 +2 -2
- 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.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +30 -18
- 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 -46
|
@@ -76,144 +76,147 @@ function useModal({
|
|
|
76
76
|
/**
|
|
77
77
|
* Modal component for displaying overlay content
|
|
78
78
|
*/
|
|
79
|
-
export const Modal: React.FC<ModalProps> = memo(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onClose,
|
|
84
|
-
onOpen,
|
|
85
|
-
title,
|
|
86
|
-
subtitle,
|
|
87
|
-
size = 'md',
|
|
88
|
-
backdrop = true,
|
|
89
|
-
keyboard = true,
|
|
90
|
-
className = '',
|
|
91
|
-
style,
|
|
92
|
-
closeButton = true,
|
|
93
|
-
footer,
|
|
94
|
-
glass,
|
|
95
|
-
...props
|
|
96
|
-
}) => {
|
|
97
|
-
const modalRef = useRef<HTMLDivElement>(null);
|
|
98
|
-
const dialogRef = useRef<HTMLDivElement>(null);
|
|
99
|
-
const backdropRef = useRef<HTMLDivElement>(null);
|
|
100
|
-
|
|
101
|
-
const {
|
|
102
|
-
isOpen: isOpenState,
|
|
103
|
-
open,
|
|
104
|
-
close,
|
|
105
|
-
} = useModal({
|
|
106
|
-
isOpen,
|
|
79
|
+
export const Modal: React.FC<ModalProps> = memo(
|
|
80
|
+
({
|
|
81
|
+
children,
|
|
82
|
+
isOpen = false,
|
|
107
83
|
onOpenChange,
|
|
108
84
|
onClose,
|
|
109
85
|
onOpen,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
86
|
+
title,
|
|
87
|
+
subtitle,
|
|
88
|
+
size = 'md',
|
|
89
|
+
backdrop = true,
|
|
90
|
+
keyboard = true,
|
|
91
|
+
className = '',
|
|
92
|
+
style,
|
|
93
|
+
closeButton = true,
|
|
94
|
+
footer,
|
|
95
|
+
glass,
|
|
96
|
+
...props
|
|
97
|
+
}) => {
|
|
98
|
+
const modalRef = useRef<HTMLDivElement>(null);
|
|
99
|
+
const dialogRef = useRef<HTMLDivElement>(null);
|
|
100
|
+
const backdropRef = useRef<HTMLDivElement>(null);
|
|
101
|
+
|
|
102
|
+
const {
|
|
103
|
+
isOpen: isOpenState,
|
|
104
|
+
open,
|
|
105
|
+
close,
|
|
106
|
+
} = useModal({
|
|
107
|
+
isOpen,
|
|
108
|
+
onOpenChange,
|
|
109
|
+
onClose,
|
|
110
|
+
onOpen,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Handle keyboard events for Escape key
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (!keyboard) return undefined;
|
|
116
|
+
|
|
117
|
+
const handleKeydown = (event: KeyboardEvent) => {
|
|
118
|
+
if (event.key === 'Escape' && isOpenState) {
|
|
119
|
+
close();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
document.addEventListener('keydown', handleKeydown);
|
|
124
|
+
return () => {
|
|
125
|
+
document.removeEventListener('keydown', handleKeydown);
|
|
126
|
+
};
|
|
127
|
+
}, [isOpenState, close, keyboard]);
|
|
128
|
+
|
|
129
|
+
// Handle backdrop click
|
|
130
|
+
const handleBackdropClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
131
|
+
if (backdrop && event.target === event.currentTarget) {
|
|
118
132
|
close();
|
|
119
133
|
}
|
|
120
134
|
};
|
|
121
135
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<div className="c-modal__content">
|
|
148
|
-
{(title || closeButton) && (
|
|
149
|
-
<div className="c-modal__header">
|
|
150
|
-
<div className="c-modal__header-content">
|
|
151
|
-
{title && <h3 className="c-modal__title">{title}</h3>}
|
|
152
|
-
{subtitle && <p className="c-modal__sub">{subtitle}</p>}
|
|
153
|
-
</div>
|
|
154
|
-
{closeButton && (
|
|
155
|
-
<button
|
|
156
|
-
type="button"
|
|
157
|
-
className="c-modal__close c-btn js-modal-close"
|
|
158
|
-
onClick={close}
|
|
159
|
-
aria-label="Close modal"
|
|
160
|
-
>
|
|
161
|
-
<svg
|
|
162
|
-
width="20"
|
|
163
|
-
height="20"
|
|
164
|
-
viewBox="0 0 20 20"
|
|
165
|
-
fill="none"
|
|
166
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
136
|
+
// Assemble classes
|
|
137
|
+
const modalClasses = [
|
|
138
|
+
'c-modal',
|
|
139
|
+
isOpenState ? MODAL.CLASSES.IS_OPEN : '',
|
|
140
|
+
size ? `c-modal--${size}` : '',
|
|
141
|
+
glass ? 'c-modal--glass' : '',
|
|
142
|
+
className,
|
|
143
|
+
]
|
|
144
|
+
.filter(Boolean)
|
|
145
|
+
.join(' ');
|
|
146
|
+
|
|
147
|
+
const modalContent = (
|
|
148
|
+
<div className="c-modal__content">
|
|
149
|
+
{(title || closeButton) && (
|
|
150
|
+
<div className="c-modal__header">
|
|
151
|
+
<div className="c-modal__header-content">
|
|
152
|
+
{title && <h3 className="c-modal__title">{title}</h3>}
|
|
153
|
+
{subtitle && <p className="c-modal__sub">{subtitle}</p>}
|
|
154
|
+
</div>
|
|
155
|
+
{closeButton && (
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
className="c-modal__close c-btn js-modal-close"
|
|
159
|
+
onClick={close}
|
|
160
|
+
aria-label="Close modal"
|
|
167
161
|
>
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
162
|
+
<svg
|
|
163
|
+
width="20"
|
|
164
|
+
height="20"
|
|
165
|
+
viewBox="0 0 20 20"
|
|
166
|
+
fill="none"
|
|
167
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
168
|
+
>
|
|
169
|
+
<path
|
|
170
|
+
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"
|
|
171
|
+
fill="#141414"
|
|
172
|
+
/>
|
|
173
|
+
</svg>
|
|
174
|
+
</button>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
</div>
|
|
182
|
-
);
|
|
179
|
+
<div className="c-modal__body">{children}</div>
|
|
183
180
|
|
|
184
|
-
|
|
185
|
-
<div
|
|
186
|
-
ref={modalRef}
|
|
187
|
-
className={modalClasses}
|
|
188
|
-
style={{ display: isOpenState ? 'block' : 'none', ...style }}
|
|
189
|
-
role="dialog"
|
|
190
|
-
aria-modal="true"
|
|
191
|
-
aria-hidden={!isOpenState}
|
|
192
|
-
{...props}
|
|
193
|
-
>
|
|
194
|
-
<div ref={backdropRef} className="c-modal__backdrop" onClick={handleBackdropClick} />
|
|
195
|
-
<div ref={dialogRef} className="c-modal__dialog">
|
|
196
|
-
{glass
|
|
197
|
-
? // Default glass settings for modals
|
|
198
|
-
(() => {
|
|
199
|
-
const defaultGlassProps = {
|
|
200
|
-
displacementScale: document.querySelector('.c-modal---glass .c-modal__content')?.clientHeight,
|
|
201
|
-
blurAmount: 2.2,
|
|
202
|
-
elasticity: 0,
|
|
203
|
-
mode: 'shader' as const,
|
|
204
|
-
shaderMode: 'premiumGlass'
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const glassProps =
|
|
208
|
-
glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
209
|
-
|
|
210
|
-
return <AtomixGlass {...glassProps}>{modalContent}</AtomixGlass>;
|
|
211
|
-
})()
|
|
212
|
-
: modalContent}
|
|
181
|
+
{footer && <div className="c-modal__footer">{footer}</div>}
|
|
213
182
|
</div>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<div
|
|
187
|
+
ref={modalRef}
|
|
188
|
+
className={modalClasses}
|
|
189
|
+
style={{ display: isOpenState ? 'block' : 'none', ...style }}
|
|
190
|
+
role="dialog"
|
|
191
|
+
aria-modal="true"
|
|
192
|
+
aria-hidden={!isOpenState}
|
|
193
|
+
{...props}
|
|
194
|
+
>
|
|
195
|
+
<div ref={backdropRef} className="c-modal__backdrop" onClick={handleBackdropClick} />
|
|
196
|
+
<div ref={dialogRef} className="c-modal__dialog">
|
|
197
|
+
{glass
|
|
198
|
+
? // Default glass settings for modals
|
|
199
|
+
(() => {
|
|
200
|
+
const defaultGlassProps = {
|
|
201
|
+
displacementScale: document.querySelector('.c-modal---glass .c-modal__content')
|
|
202
|
+
?.clientHeight,
|
|
203
|
+
blurAmount: 2.2,
|
|
204
|
+
elasticity: 0,
|
|
205
|
+
mode: 'shader' as const,
|
|
206
|
+
shaderMode: 'premiumGlass',
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const glassProps =
|
|
210
|
+
glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
211
|
+
|
|
212
|
+
return <AtomixGlass {...glassProps}>{modalContent}</AtomixGlass>;
|
|
213
|
+
})()
|
|
214
|
+
: modalContent}
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
);
|
|
217
220
|
|
|
218
221
|
Modal.displayName = 'Modal';
|
|
219
222
|
|
|
@@ -33,83 +33,83 @@ export const MegaMenu = forwardRef<HTMLDivElement, MegaMenuProps>(
|
|
|
33
33
|
|
|
34
34
|
MegaMenu.displayName = 'MegaMenu';
|
|
35
35
|
|
|
36
|
-
export const MegaMenuColumn = forwardRef<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
>(({ title, icon, children, width = 'auto', className = '', disabled = false }, ref) => {
|
|
40
|
-
const columnClass = `o-grid__col o-grid__col--${width} ${className}`;
|
|
36
|
+
export const MegaMenuColumn = forwardRef<HTMLDivElement, MegaMenuColumnProps>(
|
|
37
|
+
({ title, icon, children, width = 'auto', className = '', disabled = false }, ref) => {
|
|
38
|
+
const columnClass = `o-grid__col o-grid__col--${width} ${className}`;
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
return (
|
|
41
|
+
<div ref={ref} className={columnClass}>
|
|
42
|
+
{(title || icon) && (
|
|
43
|
+
<div className="c-menu__header">
|
|
44
|
+
{icon &&
|
|
45
|
+
(typeof icon === 'string' ? (
|
|
46
|
+
icon.startsWith('c-icon-') ? (
|
|
47
|
+
<Icon
|
|
48
|
+
name={mapIconName(icon.replace('c-icon-', ''))}
|
|
49
|
+
size="sm"
|
|
50
|
+
className="c-menu__header-icon"
|
|
51
|
+
/>
|
|
52
|
+
) : (
|
|
53
|
+
<i className={`c-menu__header-icon ${icon}`}>
|
|
54
|
+
{typeof icon !== 'string' && icon}
|
|
55
|
+
</i>
|
|
56
|
+
)
|
|
54
57
|
) : (
|
|
55
|
-
<
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{title && <div className="c-menu__header-title">{title}</div>}
|
|
61
|
-
</div>
|
|
62
|
-
)}
|
|
58
|
+
<span className="c-menu__header-icon">{icon}</span>
|
|
59
|
+
))}
|
|
60
|
+
{title && <div className="c-menu__header-title">{title}</div>}
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
64
|
+
<ul className="c-menu__subitems-list" role="menu">
|
|
65
|
+
{React.Children.map(children, child => {
|
|
66
|
+
if (React.isValidElement(child)) {
|
|
67
|
+
// Pass disabled prop down to all children if column is disabled
|
|
68
|
+
const childProps = child.props as any;
|
|
69
|
+
return (
|
|
70
|
+
<li className="c-menu__subitem" role="menuitem">
|
|
71
|
+
{React.cloneElement(child as React.ReactElement<any>, {
|
|
72
|
+
...childProps,
|
|
73
|
+
disabled: disabled ? true : childProps?.disabled,
|
|
74
|
+
})}
|
|
75
|
+
</li>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
})}
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
84
85
|
|
|
85
86
|
MegaMenuColumn.displayName = 'MegaMenuColumn';
|
|
86
87
|
|
|
87
|
-
export const MegaMenuLink = forwardRef<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
88
|
+
export const MegaMenuLink = forwardRef<HTMLAnchorElement, MegaMenuLinkProps>(
|
|
89
|
+
({ href, children, className = '', disabled = false, onClick }, ref) => {
|
|
90
|
+
const handleClick = (e: React.MouseEvent) => {
|
|
91
|
+
if (disabled) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
if (onClick) {
|
|
97
|
+
onClick();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
101
|
+
return (
|
|
102
|
+
<a
|
|
103
|
+
ref={ref}
|
|
104
|
+
href={href}
|
|
105
|
+
className={`c-menu__subitem-link ${disabled ? 'is-disabled' : ''} ${className}`}
|
|
106
|
+
onClick={handleClick}
|
|
107
|
+
aria-disabled={disabled}
|
|
108
|
+
>
|
|
109
|
+
{children}
|
|
110
|
+
</a>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
114
|
|
|
115
115
|
MegaMenuLink.displayName = 'MegaMenuLink';
|
|
@@ -84,11 +84,7 @@ export const NavDropdown: React.FC<NavDropdownProps> = forwardRef<HTMLLIElement,
|
|
|
84
84
|
|
|
85
85
|
const MenuTag = megaMenu ? 'div' : 'ul';
|
|
86
86
|
const menuContent = (
|
|
87
|
-
<MenuTag
|
|
88
|
-
className={dropdownMenuClass}
|
|
89
|
-
ref={dropdownRef as any}
|
|
90
|
-
aria-hidden={!isActive}
|
|
91
|
-
>
|
|
87
|
+
<MenuTag className={dropdownMenuClass} ref={dropdownRef as any} aria-hidden={!isActive}>
|
|
92
88
|
{children}
|
|
93
89
|
</MenuTag>
|
|
94
90
|
);
|