@usefragments/ui 1.0.2 → 1.2.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/README.md +16 -16
- package/dist/assets/fragments-wordmark.cjs +30 -0
- package/dist/assets/fragments-wordmark.d.ts +13 -0
- package/dist/assets/fragments-wordmark.d.ts.map +1 -0
- package/dist/assets/fragments-wordmark.js +30 -0
- package/dist/assets/ui.css +3234 -3116
- package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
- package/dist/components/Accordion/Accordion.module.scss.js +8 -8
- package/dist/components/Accordion/index.cjs +22 -10
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +22 -10
- package/dist/components/Alert/Alert.module.scss.cjs +13 -13
- package/dist/components/Alert/Alert.module.scss.js +13 -13
- package/dist/components/AppShell/AppShell.module.scss.cjs +22 -10
- package/dist/components/AppShell/AppShell.module.scss.js +22 -10
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/Avatar.module.scss.cjs +13 -13
- package/dist/components/Avatar/Avatar.module.scss.js +13 -13
- package/dist/components/Badge/Badge.module.scss.cjs +16 -16
- package/dist/components/Badge/Badge.module.scss.js +16 -16
- package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +14 -14
- package/dist/components/BentoGrid/BentoGrid.module.scss.js +14 -14
- package/dist/components/Box/Box.module.scss.cjs +152 -152
- package/dist/components/Box/Box.module.scss.js +152 -152
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs +8 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +8 -8
- package/dist/components/Button/Button.module.scss.cjs +13 -13
- package/dist/components/Button/Button.module.scss.js +13 -13
- package/dist/components/Card/Card.module.scss.cjs +17 -17
- package/dist/components/Card/Card.module.scss.js +17 -17
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Chip/Chip.module.scss.cjs +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +21 -21
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +21 -21
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +10 -10
- package/dist/components/Collapsible/Collapsible.module.scss.js +10 -10
- package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +14 -14
- package/dist/components/ColorPicker/ColorPicker.module.scss.js +14 -14
- package/dist/components/Combobox/Combobox.module.scss.cjs +23 -23
- package/dist/components/Combobox/Combobox.module.scss.js +23 -23
- package/dist/components/Combobox/index.cjs +106 -9
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +106 -9
- package/dist/components/Command/Command.module.scss.cjs +11 -11
- package/dist/components/Command/Command.module.scss.js +11 -11
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/DataTable/DataTable.module.scss.cjs +37 -34
- package/dist/components/DataTable/DataTable.module.scss.js +37 -34
- package/dist/components/DataTable/index.d.ts +3 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.scss.cjs +33 -33
- package/dist/components/DatePicker/DatePicker.module.scss.js +33 -33
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.module.scss.cjs +14 -14
- package/dist/components/Dialog/Dialog.module.scss.js +14 -14
- package/dist/components/Drawer/Drawer.module.scss.cjs +28 -28
- package/dist/components/Drawer/Drawer.module.scss.js +28 -28
- package/dist/components/Drawer/index.cjs +20 -3
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +20 -3
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +8 -8
- package/dist/components/EmptyState/EmptyState.module.scss.js +8 -8
- package/dist/components/Field/Field.module.scss.cjs +4 -4
- package/dist/components/Field/Field.module.scss.js +4 -4
- package/dist/components/Field/index.cjs +10 -9
- package/dist/components/Field/index.d.ts +7 -7
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +10 -9
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Header/Header.module.scss.cjs +44 -29
- package/dist/components/Header/Header.module.scss.js +44 -29
- package/dist/components/Header/index.cjs +56 -3
- package/dist/components/Header/index.d.ts +25 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -3
- package/dist/components/Icon/Icon.module.scss.cjs +8 -8
- package/dist/components/Icon/Icon.module.scss.js +8 -8
- package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
- package/dist/components/IconButton/IconButton.module.scss.js +8 -8
- package/dist/components/Image/Image.module.scss.cjs +27 -27
- package/dist/components/Image/Image.module.scss.js +27 -27
- package/dist/components/Input/Input.module.scss.cjs +19 -19
- package/dist/components/Input/Input.module.scss.js +19 -19
- package/dist/components/Link/Link.module.scss.cjs +10 -10
- package/dist/components/Link/Link.module.scss.js +10 -10
- package/dist/components/List/List.module.scss.cjs +19 -19
- package/dist/components/List/List.module.scss.js +19 -19
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +30 -30
- package/dist/components/Loading/Loading.module.scss.js +30 -30
- package/dist/components/Main/Main.module.scss.cjs +26 -0
- package/dist/components/Main/Main.module.scss.js +26 -0
- package/dist/components/Main/index.cjs +128 -0
- package/dist/components/Main/index.d.ts +22 -0
- package/dist/components/Main/index.d.ts.map +1 -0
- package/dist/components/Main/index.js +111 -0
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +14 -14
- package/dist/components/Menu/Menu.module.scss.js +14 -14
- package/dist/components/Message/Message.module.scss.cjs +18 -18
- package/dist/components/Message/Message.module.scss.js +18 -18
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +28 -28
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +28 -28
- package/dist/components/Pagination/Pagination.module.scss.cjs +7 -7
- package/dist/components/Pagination/Pagination.module.scss.js +7 -7
- package/dist/components/Popover/Popover.module.scss.cjs +10 -10
- package/dist/components/Popover/Popover.module.scss.js +10 -10
- package/dist/components/Popover/index.cjs +27 -2
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +27 -2
- package/dist/components/Progress/Progress.module.scss.cjs +25 -25
- package/dist/components/Progress/Progress.module.scss.js +25 -25
- package/dist/components/Prompt/Prompt.module.scss.cjs +18 -18
- package/dist/components/Prompt/Prompt.module.scss.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +17 -17
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +17 -17
- package/dist/components/RadioGroup/index.cjs +2 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +10 -10
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +10 -10
- package/dist/components/Select/Select.module.scss.cjs +17 -17
- package/dist/components/Select/Select.module.scss.js +17 -17
- package/dist/components/Separator/Separator.module.scss.cjs +10 -10
- package/dist/components/Separator/Separator.module.scss.js +10 -10
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +42 -42
- package/dist/components/Sidebar/Sidebar.module.scss.js +42 -42
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +38 -38
- package/dist/components/Skeleton/Skeleton.module.scss.js +38 -38
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/Table/Table.module.scss.cjs +19 -19
- package/dist/components/Table/Table.module.scss.js +19 -19
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +22 -42
- package/dist/components/TableOfContents/index.d.ts +3 -3
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +22 -42
- package/dist/components/Tabs/Tabs.module.scss.cjs +12 -12
- package/dist/components/Tabs/Tabs.module.scss.js +12 -12
- package/dist/components/Text/Text.module.scss.cjs +51 -51
- package/dist/components/Text/Text.module.scss.js +51 -51
- package/dist/components/Textarea/Textarea.module.scss.cjs +23 -23
- package/dist/components/Textarea/Textarea.module.scss.js +23 -23
- package/dist/components/Theme/ThemeToggle.module.scss.cjs +6 -6
- package/dist/components/Theme/ThemeToggle.module.scss.js +6 -6
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
- package/dist/components/Toast/Toast.module.scss.cjs +21 -21
- package/dist/components/Toast/Toast.module.scss.js +21 -21
- package/dist/components/Toggle/Toggle.module.scss.cjs +13 -13
- package/dist/components/Toggle/Toggle.module.scss.js +13 -13
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/data-table.cjs +58 -41
- package/dist/data-table.js +59 -41
- package/dist/datepicker.cjs +32 -72
- package/dist/datepicker.js +32 -72
- package/dist/index.cjs +89 -85
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/fragments.json +1 -1
- package/package.json +9 -8
- package/src/assets/fragments-wordmark.tsx +47 -0
- package/src/components/Accordion/index.tsx +13 -3
- package/src/components/Alert/Alert.module.scss +15 -2
- package/src/components/AppShell/AppShell.module.scss +73 -15
- package/src/components/AppShell/index.tsx +1 -1
- package/src/components/Button/Button.module.scss +19 -20
- package/src/components/Card/Card.module.scss +3 -3
- package/src/components/Card/index.tsx +3 -3
- package/src/components/Checkbox/Checkbox.contract.json +5 -24
- package/src/components/Checkbox/Checkbox.module.scss +4 -2
- package/src/components/Chip/Chip.contract.json +11 -28
- package/src/components/Chip/Chip.module.scss +21 -45
- package/src/components/CodeBlock/CodeBlock.module.scss +2 -7
- package/src/components/Combobox/Combobox.contract.json +6 -24
- package/src/components/Combobox/Combobox.module.scss +3 -2
- package/src/components/Combobox/index.tsx +132 -6
- package/src/components/DataTable/DataTable.contract.json +16 -23
- package/src/components/DataTable/DataTable.module.scss +31 -8
- package/src/components/DataTable/index.tsx +25 -4
- package/src/components/DatePicker/index.tsx +32 -84
- package/src/components/Drawer/index.tsx +38 -12
- package/src/components/Field/index.tsx +35 -35
- package/src/components/Header/Header.contract.json +41 -1
- package/src/components/Header/Header.module.scss +40 -0
- package/src/components/Header/index.tsx +88 -2
- package/src/components/IconButton/IconButton.contract.json +120 -0
- package/src/components/Listbox/Listbox.module.scss +5 -4
- package/src/components/Main/Main.contract.json +79 -0
- package/src/components/Main/Main.module.scss +31 -0
- package/src/components/Main/index.tsx +124 -0
- package/src/components/Menu/Menu.module.scss +8 -10
- package/src/components/Popover/index.tsx +34 -2
- package/src/components/RadioGroup/RadioGroup.contract.json +13 -27
- package/src/components/RadioGroup/index.tsx +4 -0
- package/src/components/Select/Select.module.scss +13 -12
- package/src/components/Table/Table.module.scss +22 -5
- package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
- package/src/components/TableOfContents/TableOfContents.module.scss +20 -14
- package/src/components/TableOfContents/index.tsx +27 -38
- package/src/components/Toast/Toast.module.scss +15 -2
- package/src/components/ToggleGroup/ToggleGroup.module.scss +4 -1
- package/src/index.ts +4 -0
- package/src/styles/globals.scss +13 -10
- package/src/tokens/_component-properties.scss +26 -0
- package/src/tokens/_computed.scss +22 -4
- package/src/tokens/_derive.scss +55 -6
- package/src/tokens/_palettes.scss +24 -0
- package/src/tokens/_seeds.scss +20 -12
- package/src/tokens/_variables.scss +110 -63
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +0 -106
- package/src/components/Alert/Alert.stories.tsx +0 -119
- package/src/components/AppShell/AppShell.stories.tsx +0 -156
- package/src/components/Avatar/Avatar.stories.tsx +0 -74
- package/src/components/Badge/Badge.stories.tsx +0 -92
- package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
- package/src/components/Box/Box.stories.tsx +0 -150
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
- package/src/components/Button/Button.stories.tsx +0 -103
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
- package/src/components/Card/Card.stories.tsx +0 -144
- package/src/components/Chart/Chart.stories.tsx +0 -119
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
- package/src/components/Chip/Chip.stories.tsx +0 -70
- package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
- package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
- package/src/components/Cloud/ControlSizing.module.scss +0 -49
- package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
- package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
- package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
- package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
- package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
- package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
- package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
- package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
- package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
- package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
- package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
- package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
- package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
- package/src/components/Combobox/Combobox.stories.tsx +0 -133
- package/src/components/Command/Command.stories.tsx +0 -102
- package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
- package/src/components/DataTable/DataTable.stories.tsx +0 -129
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
- package/src/components/Dialog/Dialog.stories.tsx +0 -154
- package/src/components/Drawer/Drawer.stories.tsx +0 -144
- package/src/components/Editor/Editor.stories.tsx +0 -99
- package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
- package/src/components/Field/Field.stories.tsx +0 -109
- package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
- package/src/components/Form/Form.stories.tsx +0 -142
- package/src/components/Grid/Grid.stories.tsx +0 -125
- package/src/components/Header/Header.stories.tsx +0 -133
- package/src/components/Icon/Icon.stories.tsx +0 -80
- package/src/components/IconButton/IconButton.stories.tsx +0 -78
- package/src/components/Image/Image.stories.tsx +0 -109
- package/src/components/Input/Input.stories.tsx +0 -104
- package/src/components/Link/Link.stories.tsx +0 -67
- package/src/components/List/List.stories.tsx +0 -95
- package/src/components/Listbox/Listbox.stories.tsx +0 -81
- package/src/components/Loading/Loading.stories.tsx +0 -69
- package/src/components/Markdown/Markdown.stories.tsx +0 -75
- package/src/components/Menu/Menu.stories.tsx +0 -113
- package/src/components/Message/Message.stories.tsx +0 -85
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
- package/src/components/Pagination/Pagination.stories.tsx +0 -81
- package/src/components/Popover/Popover.stories.tsx +0 -152
- package/src/components/Progress/Progress.stories.tsx +0 -64
- package/src/components/Prompt/Prompt.stories.tsx +0 -93
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
- package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
- package/src/components/Select/Select.stories.tsx +0 -127
- package/src/components/Separator/Separator.stories.tsx +0 -84
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
- package/src/components/Slider/Slider.stories.tsx +0 -73
- package/src/components/Stack/Stack.stories.tsx +0 -73
- package/src/components/Switch/Switch.stories.tsx +0 -59
- package/src/components/Table/Table.stories.tsx +0 -219
- package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
- package/src/components/Tabs/Tabs.stories.tsx +0 -136
- package/src/components/Text/Text.stories.tsx +0 -133
- package/src/components/Textarea/Textarea.stories.tsx +0 -107
- package/src/components/Theme/Theme.stories.tsx +0 -95
- package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
- package/src/components/Toast/Toast.stories.tsx +0 -91
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
- package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
|
@@ -65,16 +65,33 @@ function HeaderRoot({
|
|
|
65
65
|
children,
|
|
66
66
|
height = "56px",
|
|
67
67
|
position = "static",
|
|
68
|
+
elevatedOnScroll = false,
|
|
69
|
+
navAlign = "start",
|
|
70
|
+
container = "full",
|
|
68
71
|
icons,
|
|
69
72
|
className,
|
|
70
73
|
style: styleProp,
|
|
71
74
|
...htmlProps
|
|
72
75
|
}) {
|
|
73
76
|
const [mobileOpen, setMobileOpen] = React__namespace.useState(false);
|
|
77
|
+
const [scrolled, setScrolled] = React__namespace.useState(false);
|
|
78
|
+
const shouldElevateOnScroll = Boolean(elevatedOnScroll);
|
|
79
|
+
const scrollThreshold = typeof elevatedOnScroll === "object" ? elevatedOnScroll.threshold ?? 16 : 16;
|
|
80
|
+
React__namespace.useEffect(() => {
|
|
81
|
+
if (!shouldElevateOnScroll) return;
|
|
82
|
+
const updateScrolled = () => setScrolled(window.scrollY > scrollThreshold);
|
|
83
|
+
updateScrolled();
|
|
84
|
+
window.addEventListener("scroll", updateScrolled, { passive: true });
|
|
85
|
+
return () => window.removeEventListener("scroll", updateScrolled);
|
|
86
|
+
}, [scrollThreshold, shouldElevateOnScroll]);
|
|
74
87
|
const classes = [
|
|
75
88
|
Header_module.default.header,
|
|
76
89
|
position === "fixed" && Header_module.default.fixed,
|
|
77
90
|
position === "sticky" && Header_module.default.sticky,
|
|
91
|
+
shouldElevateOnScroll && Header_module.default.elevatedOnScroll,
|
|
92
|
+
shouldElevateOnScroll && scrolled && Header_module.default.scrolled,
|
|
93
|
+
navAlign === "center" && Header_module.default.navCentered,
|
|
94
|
+
container === "page" && Header_module.default.containerPage,
|
|
78
95
|
className
|
|
79
96
|
].filter(Boolean).join(" ");
|
|
80
97
|
const style = {
|
|
@@ -85,10 +102,36 @@ function HeaderRoot({
|
|
|
85
102
|
() => ({ mobileOpen, setMobileOpen, icons }),
|
|
86
103
|
[mobileOpen, icons]
|
|
87
104
|
);
|
|
88
|
-
return /* @__PURE__ */ jsxRuntime.jsx(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(HeaderIconContext.Provider, { value: icons, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(HeaderIconContext.Provider, { value: icons, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
"header",
|
|
107
|
+
{
|
|
108
|
+
...htmlProps,
|
|
109
|
+
className: classes,
|
|
110
|
+
style,
|
|
111
|
+
"data-position": position,
|
|
112
|
+
"data-scrolled": shouldElevateOnScroll ? scrolled : void 0,
|
|
113
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: Header_module.default.container, children })
|
|
114
|
+
}
|
|
115
|
+
) }) });
|
|
89
116
|
}
|
|
90
|
-
function HeaderBrand({
|
|
117
|
+
function HeaderBrand({
|
|
118
|
+
children,
|
|
119
|
+
href,
|
|
120
|
+
asChild = false,
|
|
121
|
+
className,
|
|
122
|
+
...htmlProps
|
|
123
|
+
}) {
|
|
91
124
|
const classes = [Header_module.default.brand, className].filter(Boolean).join(" ");
|
|
125
|
+
if (asChild && React__namespace.isValidElement(children)) {
|
|
126
|
+
const childProps = children.props;
|
|
127
|
+
const { onClick, ...restHtmlProps } = htmlProps;
|
|
128
|
+
return React__namespace.cloneElement(children, {
|
|
129
|
+
...restHtmlProps,
|
|
130
|
+
...href ? { href } : {},
|
|
131
|
+
className: [classes, childProps.className].filter(Boolean).join(" "),
|
|
132
|
+
onClick: onClick ? composeEventHandlers(childProps.onClick, onClick) : childProps.onClick
|
|
133
|
+
});
|
|
134
|
+
}
|
|
92
135
|
if (href) {
|
|
93
136
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { ...htmlProps, href, className: classes, children });
|
|
94
137
|
}
|
|
@@ -340,6 +383,14 @@ function HeaderMobileNavLink({
|
|
|
340
383
|
}
|
|
341
384
|
return /* @__PURE__ */ jsxRuntime.jsx("button", { ...htmlProps, type: "button", className: classes, onClick: handleClick, children });
|
|
342
385
|
}
|
|
386
|
+
function HeaderMobileNavActions({
|
|
387
|
+
children,
|
|
388
|
+
className,
|
|
389
|
+
...htmlProps
|
|
390
|
+
}) {
|
|
391
|
+
const classes = [Header_module.default.mobileNavActions, className].filter(Boolean).join(" ");
|
|
392
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...htmlProps, className: classes, children });
|
|
393
|
+
}
|
|
343
394
|
function HeaderSkipLink({
|
|
344
395
|
children = "Skip to main content",
|
|
345
396
|
href = "#main-content",
|
|
@@ -360,12 +411,14 @@ const Header = Object.assign(HeaderRoot, {
|
|
|
360
411
|
Spacer: HeaderSpacer,
|
|
361
412
|
SkipLink: HeaderSkipLink,
|
|
362
413
|
MobileNav: HeaderMobileNav,
|
|
363
|
-
MobileNavLink: HeaderMobileNavLink
|
|
414
|
+
MobileNavLink: HeaderMobileNavLink,
|
|
415
|
+
MobileNavActions: HeaderMobileNavActions
|
|
364
416
|
});
|
|
365
417
|
exports.Header = Header;
|
|
366
418
|
exports.HeaderActions = HeaderActions;
|
|
367
419
|
exports.HeaderBrand = HeaderBrand;
|
|
368
420
|
exports.HeaderMobileNav = HeaderMobileNav;
|
|
421
|
+
exports.HeaderMobileNavActions = HeaderMobileNavActions;
|
|
369
422
|
exports.HeaderMobileNavLink = HeaderMobileNavLink;
|
|
370
423
|
exports.HeaderNav = HeaderNav;
|
|
371
424
|
exports.HeaderNavItem = HeaderNavItem;
|
|
@@ -6,12 +6,24 @@ export interface HeaderIconRenderState {
|
|
|
6
6
|
}
|
|
7
7
|
export type HeaderIconSlot = React.ReactNode | ((state: HeaderIconRenderState) => React.ReactNode);
|
|
8
8
|
export type HeaderIcons = Partial<Record<HeaderIconRenderState['slot'], HeaderIconSlot>>;
|
|
9
|
+
export type HeaderNavAlign = 'start' | 'center';
|
|
10
|
+
export type HeaderContainer = 'full' | 'page';
|
|
11
|
+
export interface HeaderElevatedOnScrollOptions {
|
|
12
|
+
/** Scroll offset before the elevated surface is applied */
|
|
13
|
+
threshold?: number;
|
|
14
|
+
}
|
|
9
15
|
export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
10
16
|
children: React.ReactNode;
|
|
11
17
|
/** Header height (default: '56px') */
|
|
12
18
|
height?: string;
|
|
13
19
|
/** Position behavior */
|
|
14
20
|
position?: 'static' | 'fixed' | 'sticky';
|
|
21
|
+
/** Apply the elevated header surface after scroll */
|
|
22
|
+
elevatedOnScroll?: boolean | HeaderElevatedOnScrollOptions;
|
|
23
|
+
/** Navigation alignment inside the header */
|
|
24
|
+
navAlign?: HeaderNavAlign;
|
|
25
|
+
/** Header content width */
|
|
26
|
+
container?: HeaderContainer;
|
|
15
27
|
/** Optional icon overrides for internal header controls (mobile trigger + nav menu chevron) */
|
|
16
28
|
icons?: HeaderIcons;
|
|
17
29
|
}
|
|
@@ -19,6 +31,8 @@ export interface HeaderBrandProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
19
31
|
children: React.ReactNode;
|
|
20
32
|
/** Link destination */
|
|
21
33
|
href?: string;
|
|
34
|
+
/** Render as child element (polymorphic) */
|
|
35
|
+
asChild?: boolean;
|
|
22
36
|
}
|
|
23
37
|
export interface HeaderNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
24
38
|
children: React.ReactNode;
|
|
@@ -72,14 +86,17 @@ export interface HeaderMobileNavProps {
|
|
|
72
86
|
/** Optional className for the drawer panel */
|
|
73
87
|
className?: string;
|
|
74
88
|
}
|
|
89
|
+
export interface HeaderMobileNavActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
90
|
+
children: React.ReactNode;
|
|
91
|
+
}
|
|
75
92
|
/**
|
|
76
93
|
* Header - Root header element
|
|
77
94
|
*/
|
|
78
|
-
declare function HeaderRoot({ children, height, position, icons, className, style: styleProp, ...htmlProps }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
declare function HeaderRoot({ children, height, position, elevatedOnScroll, navAlign, container, icons, className, style: styleProp, ...htmlProps }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
79
96
|
/**
|
|
80
97
|
* Header.Brand - Logo/brand slot
|
|
81
98
|
*/
|
|
82
|
-
declare function HeaderBrand({ children, href, className, ...htmlProps }: HeaderBrandProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
declare function HeaderBrand({ children, href, asChild, className, ...htmlProps }: HeaderBrandProps): import("react/jsx-runtime").JSX.Element;
|
|
83
100
|
/**
|
|
84
101
|
* Header.Nav - Navigation container (hidden on mobile)
|
|
85
102
|
*/
|
|
@@ -129,6 +146,10 @@ declare function HeaderMobileNav({ children, className }: HeaderMobileNavProps):
|
|
|
129
146
|
* Header.MobileNavLink - A link inside the mobile drawer
|
|
130
147
|
*/
|
|
131
148
|
declare function HeaderMobileNavLink({ children, href, active, asChild, onClick, className, ...htmlProps }: HeaderNavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
/**
|
|
150
|
+
* Header.MobileNavActions - Action row inside the mobile drawer
|
|
151
|
+
*/
|
|
152
|
+
declare function HeaderMobileNavActions({ children, className, ...htmlProps }: HeaderMobileNavActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
132
153
|
/**
|
|
133
154
|
* Header.SkipLink - Skip to main content link (accessibility)
|
|
134
155
|
*/
|
|
@@ -150,6 +171,7 @@ export declare const Header: typeof HeaderRoot & {
|
|
|
150
171
|
SkipLink: typeof HeaderSkipLink;
|
|
151
172
|
MobileNav: typeof HeaderMobileNav;
|
|
152
173
|
MobileNavLink: typeof HeaderMobileNavLink;
|
|
174
|
+
MobileNavActions: typeof HeaderMobileNavActions;
|
|
153
175
|
};
|
|
154
|
-
export { HeaderRoot, HeaderBrand, HeaderNav, HeaderNavItem, HeaderNavMenu, HeaderNavMenuItem, HeaderSearch, HeaderActions, HeaderTrigger, HeaderSpacer, HeaderSkipLink, HeaderMobileNav, HeaderMobileNavLink, };
|
|
176
|
+
export { HeaderRoot, HeaderBrand, HeaderNav, HeaderNavItem, HeaderNavMenu, HeaderNavMenuItem, HeaderSearch, HeaderActions, HeaderTrigger, HeaderSpacer, HeaderSkipLink, HeaderMobileNav, HeaderMobileNavLink, HeaderMobileNavActions, };
|
|
155
177
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,aAAa,CAAC;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,cAAc,GACtB,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;AAEzF,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACpE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,QAAQ,GAAG,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G;AACH,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,MAAc,EACd,OAAe,EACf,OAAO,EACP,SAAS,EACT,GAAG,SAAS,EACb,EAAE,kBAAkB,2CAuCpB;AAED;;GAEG;AACH,iBAAS,sBAAsB,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,GAAG,SAAS,EACb,EAAE,2BAA2B,2CAQ7B;AAED;;GAEG;AACH,iBAAS,cAAc,CAAC,EACtB,QAAiC,EACjC,IAAsB,EACtB,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAOA;AAMD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAcjB,CAAC;AAEH,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACvB,CAAC"}
|
|
@@ -46,16 +46,33 @@ function HeaderRoot({
|
|
|
46
46
|
children,
|
|
47
47
|
height = "56px",
|
|
48
48
|
position = "static",
|
|
49
|
+
elevatedOnScroll = false,
|
|
50
|
+
navAlign = "start",
|
|
51
|
+
container = "full",
|
|
49
52
|
icons,
|
|
50
53
|
className,
|
|
51
54
|
style: styleProp,
|
|
52
55
|
...htmlProps
|
|
53
56
|
}) {
|
|
54
57
|
const [mobileOpen, setMobileOpen] = React.useState(false);
|
|
58
|
+
const [scrolled, setScrolled] = React.useState(false);
|
|
59
|
+
const shouldElevateOnScroll = Boolean(elevatedOnScroll);
|
|
60
|
+
const scrollThreshold = typeof elevatedOnScroll === "object" ? elevatedOnScroll.threshold ?? 16 : 16;
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
if (!shouldElevateOnScroll) return;
|
|
63
|
+
const updateScrolled = () => setScrolled(window.scrollY > scrollThreshold);
|
|
64
|
+
updateScrolled();
|
|
65
|
+
window.addEventListener("scroll", updateScrolled, { passive: true });
|
|
66
|
+
return () => window.removeEventListener("scroll", updateScrolled);
|
|
67
|
+
}, [scrollThreshold, shouldElevateOnScroll]);
|
|
55
68
|
const classes = [
|
|
56
69
|
styles.header,
|
|
57
70
|
position === "fixed" && styles.fixed,
|
|
58
71
|
position === "sticky" && styles.sticky,
|
|
72
|
+
shouldElevateOnScroll && styles.elevatedOnScroll,
|
|
73
|
+
shouldElevateOnScroll && scrolled && styles.scrolled,
|
|
74
|
+
navAlign === "center" && styles.navCentered,
|
|
75
|
+
container === "page" && styles.containerPage,
|
|
59
76
|
className
|
|
60
77
|
].filter(Boolean).join(" ");
|
|
61
78
|
const style = {
|
|
@@ -66,10 +83,36 @@ function HeaderRoot({
|
|
|
66
83
|
() => ({ mobileOpen, setMobileOpen, icons }),
|
|
67
84
|
[mobileOpen, icons]
|
|
68
85
|
);
|
|
69
|
-
return /* @__PURE__ */ jsx(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(HeaderIconContext.Provider, { value: icons, children: /* @__PURE__ */ jsx(
|
|
86
|
+
return /* @__PURE__ */ jsx(HeaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(HeaderIconContext.Provider, { value: icons, children: /* @__PURE__ */ jsx(
|
|
87
|
+
"header",
|
|
88
|
+
{
|
|
89
|
+
...htmlProps,
|
|
90
|
+
className: classes,
|
|
91
|
+
style,
|
|
92
|
+
"data-position": position,
|
|
93
|
+
"data-scrolled": shouldElevateOnScroll ? scrolled : void 0,
|
|
94
|
+
children: /* @__PURE__ */ jsx("div", { className: styles.container, children })
|
|
95
|
+
}
|
|
96
|
+
) }) });
|
|
70
97
|
}
|
|
71
|
-
function HeaderBrand({
|
|
98
|
+
function HeaderBrand({
|
|
99
|
+
children,
|
|
100
|
+
href,
|
|
101
|
+
asChild = false,
|
|
102
|
+
className,
|
|
103
|
+
...htmlProps
|
|
104
|
+
}) {
|
|
72
105
|
const classes = [styles.brand, className].filter(Boolean).join(" ");
|
|
106
|
+
if (asChild && React.isValidElement(children)) {
|
|
107
|
+
const childProps = children.props;
|
|
108
|
+
const { onClick, ...restHtmlProps } = htmlProps;
|
|
109
|
+
return React.cloneElement(children, {
|
|
110
|
+
...restHtmlProps,
|
|
111
|
+
...href ? { href } : {},
|
|
112
|
+
className: [classes, childProps.className].filter(Boolean).join(" "),
|
|
113
|
+
onClick: onClick ? composeEventHandlers(childProps.onClick, onClick) : childProps.onClick
|
|
114
|
+
});
|
|
115
|
+
}
|
|
73
116
|
if (href) {
|
|
74
117
|
return /* @__PURE__ */ jsx("a", { ...htmlProps, href, className: classes, children });
|
|
75
118
|
}
|
|
@@ -321,6 +364,14 @@ function HeaderMobileNavLink({
|
|
|
321
364
|
}
|
|
322
365
|
return /* @__PURE__ */ jsx("button", { ...htmlProps, type: "button", className: classes, onClick: handleClick, children });
|
|
323
366
|
}
|
|
367
|
+
function HeaderMobileNavActions({
|
|
368
|
+
children,
|
|
369
|
+
className,
|
|
370
|
+
...htmlProps
|
|
371
|
+
}) {
|
|
372
|
+
const classes = [styles.mobileNavActions, className].filter(Boolean).join(" ");
|
|
373
|
+
return /* @__PURE__ */ jsx("div", { ...htmlProps, className: classes, children });
|
|
374
|
+
}
|
|
324
375
|
function HeaderSkipLink({
|
|
325
376
|
children = "Skip to main content",
|
|
326
377
|
href = "#main-content",
|
|
@@ -341,13 +392,15 @@ const Header = Object.assign(HeaderRoot, {
|
|
|
341
392
|
Spacer: HeaderSpacer,
|
|
342
393
|
SkipLink: HeaderSkipLink,
|
|
343
394
|
MobileNav: HeaderMobileNav,
|
|
344
|
-
MobileNavLink: HeaderMobileNavLink
|
|
395
|
+
MobileNavLink: HeaderMobileNavLink,
|
|
396
|
+
MobileNavActions: HeaderMobileNavActions
|
|
345
397
|
});
|
|
346
398
|
export {
|
|
347
399
|
Header,
|
|
348
400
|
HeaderActions,
|
|
349
401
|
HeaderBrand,
|
|
350
402
|
HeaderMobileNav,
|
|
403
|
+
HeaderMobileNavActions,
|
|
351
404
|
HeaderMobileNavLink,
|
|
352
405
|
HeaderNav,
|
|
353
406
|
HeaderNavItem,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const icon = "
|
|
4
|
-
const primary = "
|
|
5
|
-
const secondary = "
|
|
6
|
-
const tertiary = "
|
|
7
|
-
const accent = "
|
|
8
|
-
const success = "
|
|
9
|
-
const warning = "
|
|
10
|
-
const error = "
|
|
3
|
+
const icon = "_icon_gw1xu_1";
|
|
4
|
+
const primary = "_primary_gw1xu_9";
|
|
5
|
+
const secondary = "_secondary_gw1xu_13";
|
|
6
|
+
const tertiary = "_tertiary_gw1xu_17";
|
|
7
|
+
const accent = "_accent_gw1xu_21";
|
|
8
|
+
const success = "_success_gw1xu_25";
|
|
9
|
+
const warning = "_warning_gw1xu_29";
|
|
10
|
+
const error = "_error_gw1xu_33";
|
|
11
11
|
const styles = {
|
|
12
12
|
icon,
|
|
13
13
|
primary,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const icon = "
|
|
2
|
-
const primary = "
|
|
3
|
-
const secondary = "
|
|
4
|
-
const tertiary = "
|
|
5
|
-
const accent = "
|
|
6
|
-
const success = "
|
|
7
|
-
const warning = "
|
|
8
|
-
const error = "
|
|
1
|
+
const icon = "_icon_gw1xu_1";
|
|
2
|
+
const primary = "_primary_gw1xu_9";
|
|
3
|
+
const secondary = "_secondary_gw1xu_13";
|
|
4
|
+
const tertiary = "_tertiary_gw1xu_17";
|
|
5
|
+
const accent = "_accent_gw1xu_21";
|
|
6
|
+
const success = "_success_gw1xu_25";
|
|
7
|
+
const warning = "_warning_gw1xu_29";
|
|
8
|
+
const error = "_error_gw1xu_33";
|
|
9
9
|
const styles = {
|
|
10
10
|
icon,
|
|
11
11
|
primary,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const iconButton = "
|
|
4
|
-
const sm = "
|
|
5
|
-
const md = "
|
|
6
|
-
const lg = "
|
|
7
|
-
const ghost = "
|
|
8
|
-
const subtle = "
|
|
9
|
-
const outlined = "
|
|
10
|
-
const pressed = "
|
|
3
|
+
const iconButton = "_iconButton_19n51_1";
|
|
4
|
+
const sm = "_sm_19n51_43";
|
|
5
|
+
const md = "_md_19n51_52";
|
|
6
|
+
const lg = "_lg_19n51_61";
|
|
7
|
+
const ghost = "_ghost_19n51_70";
|
|
8
|
+
const subtle = "_subtle_19n51_77";
|
|
9
|
+
const outlined = "_outlined_19n51_87";
|
|
10
|
+
const pressed = "_pressed_19n51_98";
|
|
11
11
|
const styles = {
|
|
12
12
|
iconButton,
|
|
13
13
|
sm,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const iconButton = "
|
|
2
|
-
const sm = "
|
|
3
|
-
const md = "
|
|
4
|
-
const lg = "
|
|
5
|
-
const ghost = "
|
|
6
|
-
const subtle = "
|
|
7
|
-
const outlined = "
|
|
8
|
-
const pressed = "
|
|
1
|
+
const iconButton = "_iconButton_19n51_1";
|
|
2
|
+
const sm = "_sm_19n51_43";
|
|
3
|
+
const md = "_md_19n51_52";
|
|
4
|
+
const lg = "_lg_19n51_61";
|
|
5
|
+
const ghost = "_ghost_19n51_70";
|
|
6
|
+
const subtle = "_subtle_19n51_77";
|
|
7
|
+
const outlined = "_outlined_19n51_87";
|
|
8
|
+
const pressed = "_pressed_19n51_98";
|
|
9
9
|
const styles = {
|
|
10
10
|
iconButton,
|
|
11
11
|
sm,
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const imageContainer = "
|
|
4
|
-
const image = "
|
|
5
|
-
const fitCover = "_fit-
|
|
6
|
-
const fitContain = "_fit-
|
|
7
|
-
const fitFill = "_fit-
|
|
8
|
-
const fitNone = "_fit-
|
|
9
|
-
const aspect11 = "_aspect-1-
|
|
10
|
-
const aspect43 = "_aspect-4-
|
|
11
|
-
const aspect169 = "_aspect-16-
|
|
12
|
-
const aspect219 = "_aspect-21-
|
|
13
|
-
const roundedSm = "_rounded-
|
|
14
|
-
const roundedMd = "_rounded-
|
|
15
|
-
const roundedLg = "_rounded-
|
|
16
|
-
const roundedFull = "_rounded-
|
|
17
|
-
const fallback = "
|
|
3
|
+
const imageContainer = "_imageContainer_slsaf_1";
|
|
4
|
+
const image = "_image_slsaf_1";
|
|
5
|
+
const fitCover = "_fit-cover_slsaf_15";
|
|
6
|
+
const fitContain = "_fit-contain_slsaf_19";
|
|
7
|
+
const fitFill = "_fit-fill_slsaf_23";
|
|
8
|
+
const fitNone = "_fit-none_slsaf_27";
|
|
9
|
+
const aspect11 = "_aspect-1-1_slsaf_31";
|
|
10
|
+
const aspect43 = "_aspect-4-3_slsaf_35";
|
|
11
|
+
const aspect169 = "_aspect-16-9_slsaf_39";
|
|
12
|
+
const aspect219 = "_aspect-21-9_slsaf_43";
|
|
13
|
+
const roundedSm = "_rounded-sm_slsaf_47";
|
|
14
|
+
const roundedMd = "_rounded-md_slsaf_51";
|
|
15
|
+
const roundedLg = "_rounded-lg_slsaf_55";
|
|
16
|
+
const roundedFull = "_rounded-full_slsaf_59";
|
|
17
|
+
const fallback = "_fallback_slsaf_63";
|
|
18
18
|
const styles = {
|
|
19
19
|
imageContainer,
|
|
20
20
|
image,
|
|
21
|
-
"fit-cover": "_fit-
|
|
21
|
+
"fit-cover": "_fit-cover_slsaf_15",
|
|
22
22
|
fitCover,
|
|
23
|
-
"fit-contain": "_fit-
|
|
23
|
+
"fit-contain": "_fit-contain_slsaf_19",
|
|
24
24
|
fitContain,
|
|
25
|
-
"fit-fill": "_fit-
|
|
25
|
+
"fit-fill": "_fit-fill_slsaf_23",
|
|
26
26
|
fitFill,
|
|
27
|
-
"fit-none": "_fit-
|
|
27
|
+
"fit-none": "_fit-none_slsaf_27",
|
|
28
28
|
fitNone,
|
|
29
|
-
"aspect-1-1": "_aspect-1-
|
|
29
|
+
"aspect-1-1": "_aspect-1-1_slsaf_31",
|
|
30
30
|
aspect11,
|
|
31
|
-
"aspect-4-3": "_aspect-4-
|
|
31
|
+
"aspect-4-3": "_aspect-4-3_slsaf_35",
|
|
32
32
|
aspect43,
|
|
33
|
-
"aspect-16-9": "_aspect-16-
|
|
33
|
+
"aspect-16-9": "_aspect-16-9_slsaf_39",
|
|
34
34
|
aspect169,
|
|
35
|
-
"aspect-21-9": "_aspect-21-
|
|
35
|
+
"aspect-21-9": "_aspect-21-9_slsaf_43",
|
|
36
36
|
aspect219,
|
|
37
|
-
"rounded-sm": "_rounded-
|
|
37
|
+
"rounded-sm": "_rounded-sm_slsaf_47",
|
|
38
38
|
roundedSm,
|
|
39
|
-
"rounded-md": "_rounded-
|
|
39
|
+
"rounded-md": "_rounded-md_slsaf_51",
|
|
40
40
|
roundedMd,
|
|
41
|
-
"rounded-lg": "_rounded-
|
|
41
|
+
"rounded-lg": "_rounded-lg_slsaf_55",
|
|
42
42
|
roundedLg,
|
|
43
|
-
"rounded-full": "_rounded-
|
|
43
|
+
"rounded-full": "_rounded-full_slsaf_59",
|
|
44
44
|
roundedFull,
|
|
45
45
|
fallback
|
|
46
46
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
const imageContainer = "
|
|
2
|
-
const image = "
|
|
3
|
-
const fitCover = "_fit-
|
|
4
|
-
const fitContain = "_fit-
|
|
5
|
-
const fitFill = "_fit-
|
|
6
|
-
const fitNone = "_fit-
|
|
7
|
-
const aspect11 = "_aspect-1-
|
|
8
|
-
const aspect43 = "_aspect-4-
|
|
9
|
-
const aspect169 = "_aspect-16-
|
|
10
|
-
const aspect219 = "_aspect-21-
|
|
11
|
-
const roundedSm = "_rounded-
|
|
12
|
-
const roundedMd = "_rounded-
|
|
13
|
-
const roundedLg = "_rounded-
|
|
14
|
-
const roundedFull = "_rounded-
|
|
15
|
-
const fallback = "
|
|
1
|
+
const imageContainer = "_imageContainer_slsaf_1";
|
|
2
|
+
const image = "_image_slsaf_1";
|
|
3
|
+
const fitCover = "_fit-cover_slsaf_15";
|
|
4
|
+
const fitContain = "_fit-contain_slsaf_19";
|
|
5
|
+
const fitFill = "_fit-fill_slsaf_23";
|
|
6
|
+
const fitNone = "_fit-none_slsaf_27";
|
|
7
|
+
const aspect11 = "_aspect-1-1_slsaf_31";
|
|
8
|
+
const aspect43 = "_aspect-4-3_slsaf_35";
|
|
9
|
+
const aspect169 = "_aspect-16-9_slsaf_39";
|
|
10
|
+
const aspect219 = "_aspect-21-9_slsaf_43";
|
|
11
|
+
const roundedSm = "_rounded-sm_slsaf_47";
|
|
12
|
+
const roundedMd = "_rounded-md_slsaf_51";
|
|
13
|
+
const roundedLg = "_rounded-lg_slsaf_55";
|
|
14
|
+
const roundedFull = "_rounded-full_slsaf_59";
|
|
15
|
+
const fallback = "_fallback_slsaf_63";
|
|
16
16
|
const styles = {
|
|
17
17
|
imageContainer,
|
|
18
18
|
image,
|
|
19
|
-
"fit-cover": "_fit-
|
|
19
|
+
"fit-cover": "_fit-cover_slsaf_15",
|
|
20
20
|
fitCover,
|
|
21
|
-
"fit-contain": "_fit-
|
|
21
|
+
"fit-contain": "_fit-contain_slsaf_19",
|
|
22
22
|
fitContain,
|
|
23
|
-
"fit-fill": "_fit-
|
|
23
|
+
"fit-fill": "_fit-fill_slsaf_23",
|
|
24
24
|
fitFill,
|
|
25
|
-
"fit-none": "_fit-
|
|
25
|
+
"fit-none": "_fit-none_slsaf_27",
|
|
26
26
|
fitNone,
|
|
27
|
-
"aspect-1-1": "_aspect-1-
|
|
27
|
+
"aspect-1-1": "_aspect-1-1_slsaf_31",
|
|
28
28
|
aspect11,
|
|
29
|
-
"aspect-4-3": "_aspect-4-
|
|
29
|
+
"aspect-4-3": "_aspect-4-3_slsaf_35",
|
|
30
30
|
aspect43,
|
|
31
|
-
"aspect-16-9": "_aspect-16-
|
|
31
|
+
"aspect-16-9": "_aspect-16-9_slsaf_39",
|
|
32
32
|
aspect169,
|
|
33
|
-
"aspect-21-9": "_aspect-21-
|
|
33
|
+
"aspect-21-9": "_aspect-21-9_slsaf_43",
|
|
34
34
|
aspect219,
|
|
35
|
-
"rounded-sm": "_rounded-
|
|
35
|
+
"rounded-sm": "_rounded-sm_slsaf_47",
|
|
36
36
|
roundedSm,
|
|
37
|
-
"rounded-md": "_rounded-
|
|
37
|
+
"rounded-md": "_rounded-md_slsaf_51",
|
|
38
38
|
roundedMd,
|
|
39
|
-
"rounded-lg": "_rounded-
|
|
39
|
+
"rounded-lg": "_rounded-lg_slsaf_55",
|
|
40
40
|
roundedLg,
|
|
41
|
-
"rounded-full": "_rounded-
|
|
41
|
+
"rounded-full": "_rounded-full_slsaf_59",
|
|
42
42
|
roundedFull,
|
|
43
43
|
fallback
|
|
44
44
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const wrapper = "
|
|
4
|
-
const label = "
|
|
5
|
-
const required = "
|
|
6
|
-
const helper = "
|
|
7
|
-
const helperError = "
|
|
8
|
-
const errorMessage = "
|
|
9
|
-
const input = "
|
|
10
|
-
const sm = "
|
|
11
|
-
const md = "
|
|
12
|
-
const lg = "
|
|
13
|
-
const labelSm = "
|
|
14
|
-
const error = "
|
|
15
|
-
const success = "
|
|
16
|
-
const helperSuccess = "
|
|
17
|
-
const inputContainer = "
|
|
18
|
-
const shortcut = "
|
|
19
|
-
const hasAdornment = "
|
|
20
|
-
const adornment = "
|
|
21
|
-
const hasShortcut = "
|
|
3
|
+
const wrapper = "_wrapper_1vwgf_1";
|
|
4
|
+
const label = "_label_1vwgf_6";
|
|
5
|
+
const required = "_required_1vwgf_14";
|
|
6
|
+
const helper = "_helper_1vwgf_19";
|
|
7
|
+
const helperError = "_helperError_1vwgf_26";
|
|
8
|
+
const errorMessage = "_errorMessage_1vwgf_30";
|
|
9
|
+
const input = "_input_1vwgf_36";
|
|
10
|
+
const sm = "_sm_1vwgf_82";
|
|
11
|
+
const md = "_md_1vwgf_89";
|
|
12
|
+
const lg = "_lg_1vwgf_96";
|
|
13
|
+
const labelSm = "_labelSm_1vwgf_103";
|
|
14
|
+
const error = "_error_1vwgf_30";
|
|
15
|
+
const success = "_success_1vwgf_118";
|
|
16
|
+
const helperSuccess = "_helperSuccess_1vwgf_132";
|
|
17
|
+
const inputContainer = "_inputContainer_1vwgf_136";
|
|
18
|
+
const shortcut = "_shortcut_1vwgf_141";
|
|
19
|
+
const hasAdornment = "_hasAdornment_1vwgf_141";
|
|
20
|
+
const adornment = "_adornment_1vwgf_212";
|
|
21
|
+
const hasShortcut = "_hasShortcut_1vwgf_223";
|
|
22
22
|
const styles = {
|
|
23
23
|
wrapper,
|
|
24
24
|
label,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const wrapper = "
|
|
2
|
-
const label = "
|
|
3
|
-
const required = "
|
|
4
|
-
const helper = "
|
|
5
|
-
const helperError = "
|
|
6
|
-
const errorMessage = "
|
|
7
|
-
const input = "
|
|
8
|
-
const sm = "
|
|
9
|
-
const md = "
|
|
10
|
-
const lg = "
|
|
11
|
-
const labelSm = "
|
|
12
|
-
const error = "
|
|
13
|
-
const success = "
|
|
14
|
-
const helperSuccess = "
|
|
15
|
-
const inputContainer = "
|
|
16
|
-
const shortcut = "
|
|
17
|
-
const hasAdornment = "
|
|
18
|
-
const adornment = "
|
|
19
|
-
const hasShortcut = "
|
|
1
|
+
const wrapper = "_wrapper_1vwgf_1";
|
|
2
|
+
const label = "_label_1vwgf_6";
|
|
3
|
+
const required = "_required_1vwgf_14";
|
|
4
|
+
const helper = "_helper_1vwgf_19";
|
|
5
|
+
const helperError = "_helperError_1vwgf_26";
|
|
6
|
+
const errorMessage = "_errorMessage_1vwgf_30";
|
|
7
|
+
const input = "_input_1vwgf_36";
|
|
8
|
+
const sm = "_sm_1vwgf_82";
|
|
9
|
+
const md = "_md_1vwgf_89";
|
|
10
|
+
const lg = "_lg_1vwgf_96";
|
|
11
|
+
const labelSm = "_labelSm_1vwgf_103";
|
|
12
|
+
const error = "_error_1vwgf_30";
|
|
13
|
+
const success = "_success_1vwgf_118";
|
|
14
|
+
const helperSuccess = "_helperSuccess_1vwgf_132";
|
|
15
|
+
const inputContainer = "_inputContainer_1vwgf_136";
|
|
16
|
+
const shortcut = "_shortcut_1vwgf_141";
|
|
17
|
+
const hasAdornment = "_hasAdornment_1vwgf_141";
|
|
18
|
+
const adornment = "_adornment_1vwgf_212";
|
|
19
|
+
const hasShortcut = "_hasShortcut_1vwgf_223";
|
|
20
20
|
const styles = {
|
|
21
21
|
wrapper,
|
|
22
22
|
label,
|