@heymantle/litho 0.0.14 → 0.0.16
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/AI_COMPONENTS_GUIDE.md +28 -15
- package/AI_INTEGRATION_GUIDE.md +3 -3
- package/AI_PATTERNS_GUIDE.md +59 -25
- package/COMPONENT_QUICK_REFERENCE.md +3 -3
- package/README.md +52 -0
- package/dist/cjs/components/ActionList.js +33 -25
- package/dist/cjs/components/AnnouncementBar.js +115 -18
- package/dist/cjs/components/AnnouncementCard.js +269 -0
- package/dist/cjs/components/AppProvider.js +15 -2
- package/dist/cjs/components/Autocomplete.js +58 -36
- package/dist/cjs/components/Badge.js +28 -14
- package/dist/cjs/components/Banner.js +37 -27
- package/dist/cjs/components/Box.js +50 -38
- package/dist/cjs/components/Button.js +338 -109
- package/dist/cjs/components/ButtonGroup.js +27 -14
- package/dist/cjs/components/Card.js +311 -143
- package/dist/cjs/components/Checkbox.js +55 -47
- package/dist/cjs/components/CheckboxCard.js +222 -0
- package/dist/cjs/components/CheckboxCardGroup.js +384 -0
- package/dist/cjs/components/ChoiceList.js +21 -11
- package/dist/cjs/components/Code.js +22 -8
- package/dist/cjs/components/Collapsible.js +24 -11
- package/dist/cjs/components/ColorField.js +163 -38
- package/dist/cjs/components/ContextualSaveBar.js +13 -6
- package/dist/cjs/components/DatePicker.js +48 -37
- package/dist/cjs/components/Disclosure.js +57 -13
- package/dist/cjs/components/Divider.js +82 -18
- package/dist/cjs/components/DropZone.js +194 -68
- package/dist/cjs/components/EmptyState.js +18 -6
- package/dist/cjs/components/Filters.js +84 -36
- package/dist/cjs/components/FooterHelp.js +14 -4
- package/dist/cjs/components/Form.js +13 -2
- package/dist/cjs/components/Frame.js +57 -22
- package/dist/cjs/components/FrameSaveBar.js +37 -6
- package/dist/cjs/components/Grid.js +31 -15
- package/dist/cjs/components/HorizontalStack.js +38 -25
- package/dist/cjs/components/Icon.js +683 -61
- package/dist/cjs/components/Image.js +35 -22
- package/dist/cjs/components/InlineError.js +19 -10
- package/dist/cjs/components/Label.js +21 -12
- package/dist/cjs/components/Layout.js +37 -26
- package/dist/cjs/components/LayoutSection.js +84 -22
- package/dist/cjs/components/Link.js +35 -22
- package/dist/cjs/components/List.js +28 -12
- package/dist/cjs/components/Listbox.js +53 -31
- package/dist/cjs/components/Loading.js +14 -2
- package/dist/cjs/components/Modal.js +32 -39
- package/dist/cjs/components/Navigation.js +107 -36
- package/dist/cjs/components/Page.js +44 -31
- package/dist/cjs/components/Pagination.js +20 -5
- package/dist/cjs/components/Pane.js +67 -4
- package/dist/cjs/components/Popover.js +63 -30
- package/dist/cjs/components/PopoverManager.js +14 -1
- package/dist/cjs/components/ProgressBar.js +28 -15
- package/dist/cjs/components/RadioButton.js +32 -24
- package/dist/cjs/components/RadioButtonCard.js +92 -67
- package/dist/cjs/components/RadioButtonCardGroup.js +379 -0
- package/dist/cjs/components/RangeSlider.js +34 -26
- package/dist/cjs/components/ResourceList.js +28 -14
- package/dist/cjs/components/Select.js +38 -26
- package/dist/cjs/components/SkeletonText.js +33 -18
- package/dist/cjs/components/Spinner.js +24 -12
- package/dist/cjs/components/Stack.js +131 -71
- package/dist/cjs/components/TabNavigation.js +27 -1
- package/dist/cjs/components/Table.js +85 -29
- package/dist/cjs/components/Tabs.js +84 -24
- package/dist/cjs/components/Tag.js +37 -16
- package/dist/cjs/components/Text.js +32 -18
- package/dist/cjs/components/TextField.js +119 -69
- package/dist/cjs/components/Thumbnail.js +25 -11
- package/dist/cjs/components/TimePicker.js +22 -1
- package/dist/cjs/components/Tip.js +140 -25
- package/dist/cjs/components/ToastNotification.js +107 -34
- package/dist/cjs/components/ToastProvider.js +13 -3
- package/dist/cjs/components/Tooltip.js +50 -41
- package/dist/cjs/components/TopBar.js +83 -9
- package/dist/cjs/components/VerticalStack.js +31 -16
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/playwright.config.js +114 -0
- package/dist/cjs/stories/Autocomplete.stories.js +10 -10
- package/dist/cjs/stories/Checkbox.stories.js +6 -8
- package/dist/cjs/stories/CheckboxCardGroup.stories.js +459 -0
- package/dist/cjs/stories/Collapsible.stories.js +11 -11
- package/dist/cjs/stories/ColorField.stories.js +2 -3
- package/dist/cjs/stories/ComplexExamples.stories.js +48 -77
- package/dist/cjs/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/cjs/stories/Divider.stories.js +15 -16
- package/dist/cjs/stories/DropZone.stories.js +3 -3
- package/dist/cjs/stories/FooterHelp.stories.js +3 -4
- package/dist/cjs/stories/Form.stories.js +2 -4
- package/dist/cjs/stories/Grid.stories.js +24 -33
- package/dist/cjs/stories/Icon.stories.js +22 -23
- package/dist/cjs/stories/Image.stories.js +12 -15
- package/dist/cjs/stories/InlineError.stories.js +0 -1
- package/dist/cjs/stories/Layout.stories.js +96 -2
- package/dist/cjs/stories/LayoutSection.stories.js +13 -18
- package/dist/cjs/stories/List.stories.js +24 -28
- package/dist/cjs/stories/Listbox.stories.js +2 -2
- package/dist/cjs/stories/Loading.stories.js +21 -25
- package/dist/cjs/stories/Modal.stories.js +0 -1
- package/dist/cjs/stories/Pagination.stories.js +4 -4
- package/dist/cjs/stories/Pane.stories.js +10 -18
- package/dist/cjs/stories/Popover.stories.js +7 -7
- package/dist/cjs/stories/PopoverManager.stories.js +9 -9
- package/dist/cjs/stories/ProgressBar.stories.js +8 -8
- package/dist/cjs/stories/RadioButton.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCard.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCardGroup.stories.js +502 -0
- package/dist/cjs/stories/RangeSlider.stories.js +1 -3
- package/dist/cjs/stories/ResourceList.stories.js +13 -13
- package/dist/cjs/stories/Spinner.stories.js +9 -9
- package/dist/cjs/stories/Stack.stories.js +233 -51
- package/dist/cjs/stories/Tabs.stories.js +2 -2
- package/dist/cjs/stories/Tag.stories.js +1 -1
- package/dist/cjs/stories/Thumbnail.stories.js +17 -18
- package/dist/cjs/stories/TimePicker.stories.js +0 -5
- package/dist/cjs/stories/Tip.stories.js +1 -1
- package/dist/cjs/styles/Table.js +2 -7
- package/dist/cjs/tests/visual/stories.spec.js +637 -0
- package/dist/cjs/utilities/dates.js +7 -7
- package/dist/esm/components/ActionList.js +33 -25
- package/dist/esm/components/AnnouncementBar.js +115 -18
- package/dist/esm/components/AnnouncementCard.js +254 -0
- package/dist/esm/components/AppProvider.js +15 -2
- package/dist/esm/components/Autocomplete.js +58 -36
- package/dist/esm/components/Badge.js +28 -14
- package/dist/esm/components/Banner.js +37 -27
- package/dist/esm/components/Box.js +50 -38
- package/dist/esm/components/Button.js +338 -109
- package/dist/esm/components/ButtonGroup.js +27 -14
- package/dist/esm/components/Card.js +300 -140
- package/dist/esm/components/Checkbox.js +55 -47
- package/dist/esm/components/CheckboxCard.js +207 -0
- package/dist/esm/components/CheckboxCardGroup.js +370 -0
- package/dist/esm/components/ChoiceList.js +21 -11
- package/dist/esm/components/Code.js +22 -8
- package/dist/esm/components/Collapsible.js +24 -11
- package/dist/esm/components/ColorField.js +165 -40
- package/dist/esm/components/ContextualSaveBar.js +13 -6
- package/dist/esm/components/DatePicker.js +48 -37
- package/dist/esm/components/Disclosure.js +50 -6
- package/dist/esm/components/Divider.js +78 -20
- package/dist/esm/components/DropZone.js +194 -68
- package/dist/esm/components/EmptyState.js +18 -6
- package/dist/esm/components/Filters.js +84 -36
- package/dist/esm/components/FooterHelp.js +14 -4
- package/dist/esm/components/Form.js +13 -2
- package/dist/esm/components/Frame.js +57 -22
- package/dist/esm/components/FrameSaveBar.js +37 -6
- package/dist/esm/components/Grid.js +31 -15
- package/dist/esm/components/HorizontalStack.js +38 -25
- package/dist/esm/components/Icon.js +681 -62
- package/dist/esm/components/Image.js +35 -22
- package/dist/esm/components/InlineError.js +19 -10
- package/dist/esm/components/Label.js +21 -12
- package/dist/esm/components/Layout.js +62 -27
- package/dist/esm/components/LayoutSection.js +84 -22
- package/dist/esm/components/Link.js +35 -22
- package/dist/esm/components/List.js +28 -12
- package/dist/esm/components/Listbox.js +53 -31
- package/dist/esm/components/Loading.js +14 -2
- package/dist/esm/components/Modal.js +79 -40
- package/dist/esm/components/Navigation.js +107 -36
- package/dist/esm/components/Page.js +44 -31
- package/dist/esm/components/Pagination.js +20 -5
- package/dist/esm/components/Pane.js +67 -4
- package/dist/esm/components/Popover.js +63 -30
- package/dist/esm/components/PopoverManager.js +14 -1
- package/dist/esm/components/ProgressBar.js +28 -15
- package/dist/esm/components/RadioButton.js +32 -24
- package/dist/esm/components/RadioButtonCard.js +92 -67
- package/dist/esm/components/RadioButtonCardGroup.js +364 -0
- package/dist/esm/components/RangeSlider.js +34 -26
- package/dist/esm/components/ResourceList.js +28 -14
- package/dist/esm/components/Select.js +38 -26
- package/dist/esm/components/SkeletonText.js +33 -18
- package/dist/esm/components/Spinner.js +24 -12
- package/dist/esm/components/Stack.js +131 -71
- package/dist/esm/components/TabNavigation.js +27 -1
- package/dist/esm/components/Table.js +85 -29
- package/dist/esm/components/Tabs.js +84 -24
- package/dist/esm/components/Tag.js +37 -16
- package/dist/esm/components/Text.js +32 -18
- package/dist/esm/components/TextField.js +119 -69
- package/dist/esm/components/Thumbnail.js +25 -11
- package/dist/esm/components/TimePicker.js +22 -1
- package/dist/esm/components/Tip.js +140 -25
- package/dist/esm/components/ToastNotification.js +107 -34
- package/dist/esm/components/ToastProvider.js +13 -3
- package/dist/esm/components/Tooltip.js +50 -41
- package/dist/esm/components/TopBar.js +83 -9
- package/dist/esm/components/VerticalStack.js +31 -16
- package/dist/esm/index.js +6 -0
- package/dist/esm/playwright.config.js +104 -0
- package/dist/esm/stories/Autocomplete.stories.js +10 -10
- package/dist/esm/stories/Checkbox.stories.js +6 -8
- package/dist/esm/stories/CheckboxCardGroup.stories.js +421 -0
- package/dist/esm/stories/Collapsible.stories.js +11 -11
- package/dist/esm/stories/ColorField.stories.js +2 -3
- package/dist/esm/stories/ComplexExamples.stories.js +48 -77
- package/dist/esm/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/esm/stories/Divider.stories.js +15 -16
- package/dist/esm/stories/DropZone.stories.js +3 -3
- package/dist/esm/stories/FooterHelp.stories.js +3 -4
- package/dist/esm/stories/Form.stories.js +2 -4
- package/dist/esm/stories/Grid.stories.js +24 -33
- package/dist/esm/stories/Icon.stories.js +22 -23
- package/dist/esm/stories/Image.stories.js +12 -15
- package/dist/esm/stories/InlineError.stories.js +0 -1
- package/dist/esm/stories/Layout.stories.js +93 -2
- package/dist/esm/stories/LayoutSection.stories.js +13 -18
- package/dist/esm/stories/List.stories.js +24 -28
- package/dist/esm/stories/Listbox.stories.js +2 -2
- package/dist/esm/stories/Loading.stories.js +21 -25
- package/dist/esm/stories/Modal.stories.js +0 -1
- package/dist/esm/stories/Pagination.stories.js +4 -4
- package/dist/esm/stories/Pane.stories.js +10 -18
- package/dist/esm/stories/Popover.stories.js +7 -7
- package/dist/esm/stories/PopoverManager.stories.js +9 -9
- package/dist/esm/stories/ProgressBar.stories.js +8 -8
- package/dist/esm/stories/RadioButton.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCard.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCardGroup.stories.js +461 -0
- package/dist/esm/stories/RangeSlider.stories.js +1 -3
- package/dist/esm/stories/ResourceList.stories.js +13 -13
- package/dist/esm/stories/Spinner.stories.js +9 -9
- package/dist/esm/stories/Stack.stories.js +224 -51
- package/dist/esm/stories/Tabs.stories.js +2 -2
- package/dist/esm/stories/Tag.stories.js +1 -1
- package/dist/esm/stories/Thumbnail.stories.js +17 -18
- package/dist/esm/stories/TimePicker.stories.js +0 -5
- package/dist/esm/stories/Tip.stories.js +1 -1
- package/dist/esm/styles/Table.js +2 -7
- package/dist/esm/tests/visual/stories.spec.js +633 -0
- package/dist/esm/utilities/dates.js +7 -7
- package/dist/types/components/ActionList.d.ts +1 -31
- package/dist/types/components/ActionList.d.ts.map +1 -1
- package/dist/types/components/AnnouncementBar.d.ts +1 -19
- package/dist/types/components/AnnouncementBar.d.ts.map +1 -1
- package/dist/types/components/AnnouncementCard.d.ts +3 -0
- package/dist/types/components/AnnouncementCard.d.ts.map +1 -0
- package/dist/types/components/AppProvider.d.ts +14 -1
- package/dist/types/components/AppProvider.d.ts.map +1 -1
- package/dist/types/components/Autocomplete.d.ts +1 -71
- package/dist/types/components/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/Badge.d.ts +1 -19
- package/dist/types/components/Badge.d.ts.map +1 -1
- package/dist/types/components/Banner.d.ts +1 -37
- package/dist/types/components/Banner.d.ts.map +1 -1
- package/dist/types/components/Box.d.ts +1 -68
- package/dist/types/components/Box.d.ts.map +1 -1
- package/dist/types/components/Button.d.ts +1 -131
- package/dist/types/components/Button.d.ts.map +1 -1
- package/dist/types/components/ButtonGroup.d.ts +1 -22
- package/dist/types/components/ButtonGroup.d.ts.map +1 -1
- package/dist/types/components/Card.d.ts +54 -59
- package/dist/types/components/Card.d.ts.map +1 -1
- package/dist/types/components/Checkbox.d.ts +1 -63
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/CheckboxCard.d.ts +3 -0
- package/dist/types/components/CheckboxCard.d.ts.map +1 -0
- package/dist/types/components/CheckboxCardGroup.d.ts +3 -0
- package/dist/types/components/CheckboxCardGroup.d.ts.map +1 -0
- package/dist/types/components/ChoiceList.d.ts +1 -42
- package/dist/types/components/ChoiceList.d.ts.map +1 -1
- package/dist/types/components/Code.d.ts +1 -26
- package/dist/types/components/Code.d.ts.map +1 -1
- package/dist/types/components/Collapsible.d.ts +1 -15
- package/dist/types/components/Collapsible.d.ts.map +1 -1
- package/dist/types/components/ColorField.d.ts +13 -34
- package/dist/types/components/ColorField.d.ts.map +1 -1
- package/dist/types/components/ContextualSaveBar.d.ts +13 -6
- package/dist/types/components/ContextualSaveBar.d.ts.map +1 -1
- package/dist/types/components/DatePicker.d.ts +1 -64
- package/dist/types/components/DatePicker.d.ts.map +1 -1
- package/dist/types/components/Disclosure.d.ts +1 -25
- package/dist/types/components/Disclosure.d.ts.map +1 -1
- package/dist/types/components/Divider.d.ts +1 -19
- package/dist/types/components/Divider.d.ts.map +1 -1
- package/dist/types/components/DropZone.d.ts +3 -62
- package/dist/types/components/DropZone.d.ts.map +1 -1
- package/dist/types/components/EmptyState.d.ts +1 -50
- package/dist/types/components/EmptyState.d.ts.map +1 -1
- package/dist/types/components/Filters.d.ts +13 -68
- package/dist/types/components/Filters.d.ts.map +1 -1
- package/dist/types/components/FooterHelp.d.ts +14 -4
- package/dist/types/components/FooterHelp.d.ts.map +1 -1
- package/dist/types/components/Form.d.ts +13 -2
- package/dist/types/components/Form.d.ts.map +1 -1
- package/dist/types/components/Frame.d.ts +15 -36
- package/dist/types/components/Frame.d.ts.map +1 -1
- package/dist/types/components/FrameSaveBar.d.ts +3 -6
- package/dist/types/components/FrameSaveBar.d.ts.map +1 -1
- package/dist/types/components/Grid.d.ts +5 -21
- package/dist/types/components/Grid.d.ts.map +1 -1
- package/dist/types/components/HorizontalStack.d.ts +1 -34
- package/dist/types/components/HorizontalStack.d.ts.map +1 -1
- package/dist/types/components/Icon.d.ts +1 -41
- package/dist/types/components/Icon.d.ts.map +1 -1
- package/dist/types/components/Image.d.ts +1 -43
- package/dist/types/components/Image.d.ts.map +1 -1
- package/dist/types/components/InlineError.d.ts +1 -20
- package/dist/types/components/InlineError.d.ts.map +1 -1
- package/dist/types/components/Label.d.ts +1 -26
- package/dist/types/components/Label.d.ts.map +1 -1
- package/dist/types/components/Layout.d.ts +24 -15
- package/dist/types/components/Layout.d.ts.map +1 -1
- package/dist/types/components/LayoutSection.d.ts +1 -19
- package/dist/types/components/LayoutSection.d.ts.map +1 -1
- package/dist/types/components/Link.d.ts +1 -37
- package/dist/types/components/Link.d.ts.map +1 -1
- package/dist/types/components/List.d.ts +5 -17
- package/dist/types/components/List.d.ts.map +1 -1
- package/dist/types/components/Listbox.d.ts +1 -32
- package/dist/types/components/Listbox.d.ts.map +1 -1
- package/dist/types/components/Loading.d.ts +14 -2
- package/dist/types/components/Loading.d.ts.map +1 -1
- package/dist/types/components/Modal.d.ts +26 -35
- package/dist/types/components/Modal.d.ts.map +1 -1
- package/dist/types/components/Navigation.d.ts +1 -25
- package/dist/types/components/Navigation.d.ts.map +1 -1
- package/dist/types/components/Page.d.ts +1 -57
- package/dist/types/components/Page.d.ts.map +1 -1
- package/dist/types/components/Pagination.d.ts +13 -3
- package/dist/types/components/Pagination.d.ts.map +1 -1
- package/dist/types/components/Pane.d.ts +55 -3
- package/dist/types/components/Pane.d.ts.map +1 -1
- package/dist/types/components/Popover.d.ts +5 -35
- package/dist/types/components/Popover.d.ts.map +1 -1
- package/dist/types/components/PopoverManager.d.ts.map +1 -1
- package/dist/types/components/ProgressBar.d.ts +1 -22
- package/dist/types/components/ProgressBar.d.ts.map +1 -1
- package/dist/types/components/RadioButton.d.ts +1 -37
- package/dist/types/components/RadioButton.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCard.d.ts +1 -39
- package/dist/types/components/RadioButtonCard.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCardGroup.d.ts +3 -0
- package/dist/types/components/RadioButtonCardGroup.d.ts.map +1 -0
- package/dist/types/components/RangeSlider.d.ts +1 -42
- package/dist/types/components/RangeSlider.d.ts.map +1 -1
- package/dist/types/components/ResourceList.d.ts +5 -30
- package/dist/types/components/ResourceList.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +1 -46
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/SkeletonText.d.ts +1 -26
- package/dist/types/components/SkeletonText.d.ts.map +1 -1
- package/dist/types/components/Spinner.d.ts +1 -16
- package/dist/types/components/Spinner.d.ts.map +1 -1
- package/dist/types/components/Stack.d.ts +1 -47
- package/dist/types/components/Stack.d.ts.map +1 -1
- package/dist/types/components/TabNavigation.d.ts.map +1 -1
- package/dist/types/components/Table.d.ts +13 -58
- package/dist/types/components/Table.d.ts.map +1 -1
- package/dist/types/components/Tabs.d.ts +40 -34
- package/dist/types/components/Tabs.d.ts.map +1 -1
- package/dist/types/components/Tag.d.ts +1 -24
- package/dist/types/components/Tag.d.ts.map +1 -1
- package/dist/types/components/Text.d.ts +1 -30
- package/dist/types/components/Text.d.ts.map +1 -1
- package/dist/types/components/TextField.d.ts +1 -109
- package/dist/types/components/TextField.d.ts.map +1 -1
- package/dist/types/components/Thumbnail.d.ts +1 -16
- package/dist/types/components/Thumbnail.d.ts.map +1 -1
- package/dist/types/components/TimePicker.d.ts +28 -1
- package/dist/types/components/TimePicker.d.ts.map +1 -1
- package/dist/types/components/Tip.d.ts +1 -21
- package/dist/types/components/Tip.d.ts.map +1 -1
- package/dist/types/components/ToastNotification.d.ts +1 -34
- package/dist/types/components/ToastNotification.d.ts.map +1 -1
- package/dist/types/components/ToastProvider.d.ts +13 -3
- package/dist/types/components/ToastProvider.d.ts.map +1 -1
- package/dist/types/components/Tooltip.d.ts +1 -54
- package/dist/types/components/Tooltip.d.ts.map +1 -1
- package/dist/types/components/TopBar.d.ts +1 -19
- package/dist/types/components/TopBar.d.ts.map +1 -1
- package/dist/types/components/VerticalStack.d.ts +1 -25
- package/dist/types/components/VerticalStack.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/styles/Table.d.ts.map +1 -1
- package/index.css +76 -14
- package/package.json +15 -5
|
@@ -66,7 +66,44 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
66
66
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67
67
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @component Listbox
|
|
71
|
+
*
|
|
72
|
+
* @description A selectable list component that renders options as interactive items with optional icons and descriptions.
|
|
73
|
+
*
|
|
74
|
+
* @usage
|
|
75
|
+
* - DO: Use for custom-styled selection lists with full keyboard navigation.
|
|
76
|
+
* - DON'T: Use for simple dropdowns (use Select).
|
|
77
|
+
*
|
|
78
|
+
* @accessibility
|
|
79
|
+
* - Implements listbox ARIA pattern with keyboard arrow navigation and selection.
|
|
80
|
+
*
|
|
81
|
+
* @alternative
|
|
82
|
+
* - If you need a native dropdown, use `Select`. If you need a searchable list, use `Autocomplete`.
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} props - The properties object.
|
|
85
|
+
* @param {Array<Object>} props.options - Array of options to render in the listbox.
|
|
86
|
+
* Each option should be an object with the following properties:
|
|
87
|
+
* - `label` {string}: The display label of the option.
|
|
88
|
+
* - `value` {string | number}: The unique value of the option.
|
|
89
|
+
* - `icon` {React.ComponentType | string} [optional]: Icon source (Polaris, Lucide component, or string) rendered via `<Icon>`. Colors automatically based on selected state.
|
|
90
|
+
* - `showIconOnMobile` {boolean} [optional, default: true]: When false, the option icon is hidden on mobile and only shown at md (≥800px) breakpoint.
|
|
91
|
+
* - `selected` {boolean}: Whether the option is currently selected.
|
|
92
|
+
* - `onAction` {function}: A callback function invoked when the option is clicked or "Enter" is pressed.
|
|
93
|
+
* @param {boolean} [props.showIcon=false] - Determines whether to display an icon next to selected options.
|
|
94
|
+
* @param {React.ReactNode} [props.icon=MobileAcceptMajor] - The icon to display for selected options (default is `MobileAcceptMajor`).
|
|
95
|
+
* @param {boolean} [props.displayHorizontallyOnMobile=false] - Determines whether to display the listbox horizontally on mobile.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* const options = [
|
|
99
|
+
* { label: "Option 1", value: "opt1", selected: false, onAction: () => console.log("Option 1 clicked") },
|
|
100
|
+
* { label: "Option 2", value: "opt2", selected: true, onAction: () => console.log("Option 2 clicked") },
|
|
101
|
+
* ];
|
|
102
|
+
*
|
|
103
|
+
* <Listbox options={options} showIcon={true} icon={CustomIcon} />
|
|
104
|
+
*
|
|
105
|
+
* @returns {JSX.Element} The rendered Listbox component.
|
|
106
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
70
107
|
base: "Litho-Listbox__Option rounded-md cursor-pointer min-h-8 py-1 flex items-center justify-between pl-3 focus:outline-hidden active:ring-0",
|
|
71
108
|
variants: {
|
|
72
109
|
showIcon: {
|
|
@@ -95,32 +132,7 @@ var containerStyles = (0, _tailwindvariants.tv)({
|
|
|
95
132
|
displayHorizontallyOnMobile: false
|
|
96
133
|
}
|
|
97
134
|
});
|
|
98
|
-
|
|
99
|
-
* A customizable Listbox component for displaying a list of options with selectable states.
|
|
100
|
-
* The component supports keyboard navigation and optional icons for selected items.
|
|
101
|
-
*
|
|
102
|
-
* @component
|
|
103
|
-
* @param {Object} props - The properties object.
|
|
104
|
-
* @param {Array<Object>} props.options - Array of options to render in the listbox.
|
|
105
|
-
* Each option should be an object with the following properties:
|
|
106
|
-
* - `label` {string}: The display label of the option.
|
|
107
|
-
* - `value` {string | number}: The unique value of the option.
|
|
108
|
-
* - `selected` {boolean}: Whether the option is currently selected.
|
|
109
|
-
* - `onAction` {function}: A callback function invoked when the option is clicked or "Enter" is pressed.
|
|
110
|
-
* @param {boolean} [props.showIcon=false] - Determines whether to display an icon next to selected options.
|
|
111
|
-
* @param {React.ReactNode} [props.icon=MobileAcceptMajor] - The icon to display for selected options (default is `MobileAcceptMajor`).
|
|
112
|
-
* @param {boolean} [props.displayHorizontallyOnMobile=false] - Determines whether to display the listbox horizontally on mobile.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* const options = [
|
|
116
|
-
* { label: "Option 1", value: "opt1", selected: false, onAction: () => console.log("Option 1 clicked") },
|
|
117
|
-
* { label: "Option 2", value: "opt2", selected: true, onAction: () => console.log("Option 2 clicked") },
|
|
118
|
-
* ];
|
|
119
|
-
*
|
|
120
|
-
* <Listbox options={options} showIcon={true} icon={CustomIcon} />
|
|
121
|
-
*
|
|
122
|
-
* @returns {JSX.Element} The rendered Listbox component.
|
|
123
|
-
*/ function Listbox() {
|
|
135
|
+
function Listbox() {
|
|
124
136
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
125
137
|
var options = props.options, _props_showIcon = props.showIcon, showIcon = _props_showIcon === void 0 ? false : _props_showIcon, _props_displayHorizontallyOnMobile = props.displayHorizontallyOnMobile, displayHorizontallyOnMobile = _props_displayHorizontallyOnMobile === void 0 ? false : _props_displayHorizontallyOnMobile, _props_icon = props.icon, icon = _props_icon === void 0 ? _polarisicons.MobileAcceptMajor : _props_icon;
|
|
126
138
|
var screenSizes = (0, _Frame.useFrame)().screenSizes;
|
|
@@ -176,7 +188,7 @@ var containerStyles = (0, _tailwindvariants.tv)({
|
|
|
176
188
|
displayHorizontallyOnMobile: displayHorizontallyOnMobile
|
|
177
189
|
}),
|
|
178
190
|
children: options.map(function(option, index) {
|
|
179
|
-
var selected = option.selected, label = option.label, value = option.value, onAction = option.onAction;
|
|
191
|
+
var selected = option.selected, label = option.label, value = option.value, optionIcon = option.icon, _option_showIconOnMobile = option.showIconOnMobile, showIconOnMobile = _option_showIconOnMobile === void 0 ? true : _option_showIconOnMobile, onAction = option.onAction;
|
|
180
192
|
var classes = styles({
|
|
181
193
|
selected: selected,
|
|
182
194
|
showIcon: showIcon,
|
|
@@ -197,9 +209,19 @@ var containerStyles = (0, _tailwindvariants.tv)({
|
|
|
197
209
|
return handleKeyDown(e, index);
|
|
198
210
|
},
|
|
199
211
|
children: [
|
|
200
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
201
|
-
className: "whitespace-nowrap pointer-events-none w-full",
|
|
202
|
-
children:
|
|
212
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
213
|
+
className: "flex items-center gap-2 whitespace-nowrap pointer-events-none w-full",
|
|
214
|
+
children: [
|
|
215
|
+
optionIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
216
|
+
className: showIconOnMobile ? "" : "hidden @md:inline-flex",
|
|
217
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
218
|
+
source: optionIcon,
|
|
219
|
+
color: selected ? "active" : "subdued",
|
|
220
|
+
size: "sm"
|
|
221
|
+
})
|
|
222
|
+
}),
|
|
223
|
+
label
|
|
224
|
+
]
|
|
203
225
|
}),
|
|
204
226
|
showIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
205
227
|
className: "w-5 h-5 pointer-events-none",
|
|
@@ -58,9 +58,21 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
58
58
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* @component Loading
|
|
62
|
+
*
|
|
63
|
+
* @description A page-level progress bar that animates across the top of the viewport during navigation or data fetching.
|
|
64
|
+
*
|
|
65
|
+
* @usage
|
|
66
|
+
* - DO: Use as a page-level loading indicator at the top of the viewport during navigation or data fetching.
|
|
67
|
+
* - DON'T: Use for inline or localized loading states; use `Spinner` for those cases.
|
|
68
|
+
*
|
|
69
|
+
* @accessibility
|
|
70
|
+
* - The progress bar is purely visual; pair with `aria-busy` on the loading container if screen reader announcements are needed.
|
|
71
|
+
*
|
|
72
|
+
* @alternative
|
|
73
|
+
* - If you need an inline loading indicator, use `Spinner` instead.
|
|
74
|
+
* - If you need placeholder content while data loads, use `SkeletonText` instead.
|
|
62
75
|
*
|
|
63
|
-
* @component
|
|
64
76
|
* @param {Object} props - The props object.
|
|
65
77
|
* @param {number} [props.maxDuration=10000] - The maximum duration (in milliseconds) for the loading progress bar to reach 100%.
|
|
66
78
|
* @returns {JSX.Element} A fixed progress bar displayed at the top of the page.
|
|
@@ -127,7 +127,21 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
127
127
|
}
|
|
128
128
|
var ModalContext = /*#__PURE__*/ (0, _react.createContext)(false);
|
|
129
129
|
var containerStyles = (0, _tailwindvariants.tv)({
|
|
130
|
-
base: "Litho-ModalContainer fixed inset-0 block flex flex-col justify-end
|
|
130
|
+
base: "Litho-ModalContainer fixed inset-0 block flex flex-col justify-end items-center pointer-events-none",
|
|
131
|
+
variants: {
|
|
132
|
+
hidden: {
|
|
133
|
+
true: "hidden opacity-0 pointer-events-none",
|
|
134
|
+
false: ""
|
|
135
|
+
},
|
|
136
|
+
pinToTop: {
|
|
137
|
+
true: "md:justify-start md:py-5",
|
|
138
|
+
false: "md:justify-center"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
defaultVariants: {
|
|
142
|
+
hidden: false,
|
|
143
|
+
pinToTop: false
|
|
144
|
+
}
|
|
131
145
|
});
|
|
132
146
|
var styles = (0, _tailwindvariants.tv)({
|
|
133
147
|
base: "Litho-Modal relative bg-surface-highest shadow-modal dark:shadow-modal-dark w-full mx-auto pointer-events-auto flex flex-col overflow-hidden",
|
|
@@ -173,40 +187,9 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
173
187
|
flush: false
|
|
174
188
|
}
|
|
175
189
|
});
|
|
176
|
-
|
|
177
|
-
* Modal component for displaying a customizable dialog.
|
|
178
|
-
*
|
|
179
|
-
* @param {Object} props - The component props.
|
|
180
|
-
* @param {React.ReactNode} [props.children] - The content of the modal.
|
|
181
|
-
* @param {string} [props.title] - The title of the modal.
|
|
182
|
-
* @param {string} [props.subtitle] - The subtitle of the modal.
|
|
183
|
-
* @param {boolean} [props.open=false] - Whether the modal is open.
|
|
184
|
-
* @param {Function} [props.onClose] - Callback function for closing the modal.
|
|
185
|
-
* @param {boolean} [props.sectioned=false] - Whether the modal content should be sectioned.
|
|
186
|
-
* @param {Object} [props.primaryAction] - The primary action for the modal.
|
|
187
|
-
* @param {string} [props.primaryAction.content] - Content of the primary action button.
|
|
188
|
-
* @param {Function} [props.primaryAction.onAction] - Callback for the primary action.
|
|
189
|
-
* @param {boolean} [props.primaryAction.loading=false] - Whether the primary action is loading.
|
|
190
|
-
* @param {boolean} [props.primaryAction.disabled=false] - Whether the primary action is disabled.
|
|
191
|
-
* @param {boolean} [props.primaryAction.destructive=false] - Whether the primary action is destructive.
|
|
192
|
-
* @param {Object} [props.secondaryAction] - The secondary action for the modal.
|
|
193
|
-
* @param {string} [props.secondaryAction.content] - Content of the secondary action button.
|
|
194
|
-
* @param {Function} [props.secondaryAction.onAction] - Callback for the secondary action.
|
|
195
|
-
* @param {boolean} [props.secondaryAction.disabled=false] - Whether the secondary action is disabled.
|
|
196
|
-
* @param {Object[]} [props.secondaryActions=[]] - Additional secondary actions.
|
|
197
|
-
* @param {Object} [props.destructiveAction] - A destructive action for the modal.
|
|
198
|
-
* @param {boolean} [props.loading=false] - Whether the modal is in a loading state.
|
|
199
|
-
* @param {string} [props.size="default"] - The size of the modal (default, large, or full).
|
|
200
|
-
* @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
|
|
201
|
-
* @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
|
|
202
|
-
* @param {Function} [props.backAction] - Callback function for the back button. When provided, displays a back button next to the title.
|
|
203
|
-
* @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
|
|
204
|
-
* @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
|
|
205
|
-
* @param {string} [props.bodyClassName] - Additional CSS classes to apply to the modal body.
|
|
206
|
-
* @returns {React.ReactPortal|null} The rendered modal component or null if not open.
|
|
207
|
-
*/ function Modal() {
|
|
190
|
+
function Modal() {
|
|
208
191
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
209
|
-
var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput, bodyClassName = props.bodyClassName;
|
|
192
|
+
var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, _props_hidden = props.hidden, hidden = _props_hidden === void 0 ? false : _props_hidden, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput, _props_pinToTop = props.pinToTop, pinToTop = _props_pinToTop === void 0 ? false : _props_pinToTop, bodyClassName = props.bodyClassName;
|
|
210
193
|
var setModalIsOpen = (0, _Frame.useFrame)().setModalIsOpen;
|
|
211
194
|
var modalContentRef = (0, _react.useRef)(null);
|
|
212
195
|
var hasChildren = !!children;
|
|
@@ -214,7 +197,10 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
214
197
|
sectioned: sectioned,
|
|
215
198
|
size: size
|
|
216
199
|
});
|
|
217
|
-
var containerClasses = containerStyles(
|
|
200
|
+
var containerClasses = containerStyles({
|
|
201
|
+
hidden: hidden,
|
|
202
|
+
pinToTop: pinToTop
|
|
203
|
+
});
|
|
218
204
|
var headerClasses = headerStyles({
|
|
219
205
|
hasChildren: hasChildren
|
|
220
206
|
});
|
|
@@ -223,7 +209,7 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
223
209
|
var _useState = _sliced_to_array((0, _react.useState)(null), 2), container = _useState[0], setContainer = _useState[1];
|
|
224
210
|
(0, _react.useEffect)(function() {
|
|
225
211
|
var div = document.createElement("div");
|
|
226
|
-
div.className = "@container Litho-ModalPortal";
|
|
212
|
+
div.className = "@container/main Litho-ModalPortal";
|
|
227
213
|
setContainer(div);
|
|
228
214
|
document.body.appendChild(div);
|
|
229
215
|
return function() {
|
|
@@ -366,6 +352,7 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
366
352
|
onClick: primaryAction.onAction,
|
|
367
353
|
loading: primaryAction.loading,
|
|
368
354
|
disabled: primaryAction.disabled,
|
|
355
|
+
insight: primaryAction.insight,
|
|
369
356
|
destructive: primaryAction.destructive,
|
|
370
357
|
url: primaryAction.url,
|
|
371
358
|
tooltip: primaryAction.tooltip,
|
|
@@ -382,6 +369,7 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
382
369
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
383
370
|
className: overlayClasses,
|
|
384
371
|
onClick: onClose,
|
|
372
|
+
"aria-hidden": "true",
|
|
385
373
|
style: zIndexOverride ? {
|
|
386
374
|
zIndex: zIndexOverride - 1
|
|
387
375
|
} : {}
|
|
@@ -390,19 +378,24 @@ var sectionStyles = (0, _tailwindvariants.tv)({
|
|
|
390
378
|
}), container);
|
|
391
379
|
}
|
|
392
380
|
/**
|
|
393
|
-
*
|
|
381
|
+
* @component Modal.Section
|
|
382
|
+
*
|
|
383
|
+
* @usage
|
|
384
|
+
* - DO: Divide modal content into bordered sections for visual separation.
|
|
394
385
|
*
|
|
395
386
|
* @param {Object} props - The component props.
|
|
396
387
|
* @param {React.ReactNode} [props.children] - The content of the section.
|
|
397
388
|
* @param {boolean} [props.flush=false] - Whether the section should be flush with no padding.
|
|
389
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the section.
|
|
398
390
|
* @returns {JSX.Element} The rendered section.
|
|
399
391
|
*/ function Section() {
|
|
400
392
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
401
|
-
var children = props.children, flush = props.flush, title = props.title, _props_titleVariant = props.titleVariant, titleVariant = _props_titleVariant === void 0 ? "headingSm" : _props_titleVariant, description = props.description, action = props.action, icon = props.icon, accessory = props.accessory, tooltip = props.tooltip;
|
|
393
|
+
var children = props.children, flush = props.flush, title = props.title, _props_titleVariant = props.titleVariant, titleVariant = _props_titleVariant === void 0 ? "headingSm" : _props_titleVariant, description = props.description, action = props.action, icon = props.icon, accessory = props.accessory, tooltip = props.tooltip, className = props.className;
|
|
402
394
|
var showHeader = !!(title || action);
|
|
403
395
|
var sectionClasses = sectionStyles({
|
|
404
396
|
flush: flush,
|
|
405
|
-
showHeader: showHeader
|
|
397
|
+
showHeader: showHeader,
|
|
398
|
+
className: className
|
|
406
399
|
});
|
|
407
400
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
408
401
|
className: sectionClasses,
|
|
@@ -49,28 +49,45 @@ function _object_spread(target) {
|
|
|
49
49
|
}
|
|
50
50
|
return target;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
variants: {
|
|
61
|
-
selected: {
|
|
62
|
-
true: "after:content-[''] after:absolute after:-left-2.5 after:top-0.5 after:bottom-0.5 after:w-0.75 after:rounded-r-md after:bg-brand-saturated"
|
|
63
|
-
},
|
|
64
|
-
hasAction: {
|
|
65
|
-
true: "cursor-pointer rounded-md hover"
|
|
52
|
+
function ownKeys(object, enumerableOnly) {
|
|
53
|
+
var keys = Object.keys(object);
|
|
54
|
+
if (Object.getOwnPropertySymbols) {
|
|
55
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
56
|
+
if (enumerableOnly) {
|
|
57
|
+
symbols = symbols.filter(function(sym) {
|
|
58
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
59
|
+
});
|
|
66
60
|
}
|
|
61
|
+
keys.push.apply(keys, symbols);
|
|
67
62
|
}
|
|
68
|
-
|
|
63
|
+
return keys;
|
|
64
|
+
}
|
|
65
|
+
function _object_spread_props(target, source) {
|
|
66
|
+
source = source != null ? source : {};
|
|
67
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
68
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
69
|
+
} else {
|
|
70
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
71
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return target;
|
|
75
|
+
}
|
|
69
76
|
/**
|
|
70
|
-
* Navigation
|
|
71
|
-
*
|
|
77
|
+
* @component Navigation
|
|
78
|
+
*
|
|
79
|
+
* @description A sidebar navigation component that renders a vertical list of links and sections for primary app navigation within a Frame.
|
|
80
|
+
*
|
|
81
|
+
* @usage
|
|
82
|
+
* - DO: Use as the primary navigation sidebar within a Frame layout.
|
|
83
|
+
* - DON'T: Use for in-page content tabs (use Tabs).
|
|
84
|
+
*
|
|
85
|
+
* @accessibility
|
|
86
|
+
* - Renders as a `<nav>` element; ensure navigation items have descriptive labels.
|
|
87
|
+
*
|
|
88
|
+
* @alternative
|
|
89
|
+
* - If you need in-page tab switching, use `Tabs`. If you need a top bar, use `TopBar`.
|
|
72
90
|
*
|
|
73
|
-
* @component
|
|
74
91
|
* @param {Object} props - Component properties.
|
|
75
92
|
* @param {Object} [props.breadcrumb] - Breadcrumb navigation item.
|
|
76
93
|
* @param {string} [props.breadcrumb.content] - Label for the breadcrumb.
|
|
@@ -83,7 +100,24 @@ var titleStyles = (0, _tailwindvariants.tv)({
|
|
|
83
100
|
* @param {Array<Object>} [props.sections[].links] - Array of link configurations for the section.
|
|
84
101
|
* @param {Array<Object>} [props.footerLinks] - Array of footer link configurations.
|
|
85
102
|
* @returns {JSX.Element} The rendered Navigation component.
|
|
86
|
-
*/
|
|
103
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
104
|
+
base: "Litho-Navigation h-full w-full pt-12 @md:pt-0 pr-2.5 pb-3 @md:pb-0 flex flex-col gap-2 justify-between bg-surface-normal"
|
|
105
|
+
});
|
|
106
|
+
var sectionStyles = (0, _tailwindvariants.tv)({
|
|
107
|
+
base: "Litho-Navigation-Section mb-4"
|
|
108
|
+
});
|
|
109
|
+
var titleStyles = (0, _tailwindvariants.tv)({
|
|
110
|
+
base: "Litho-Navigation-Title relative min-h-8 ml-2.5 px-2.5 py-1.5 flex items-center justify-between gap-2",
|
|
111
|
+
variants: {
|
|
112
|
+
selected: {
|
|
113
|
+
true: "after:content-[''] after:absolute after:-left-2.5 after:top-0.5 after:bottom-0.5 after:w-0.75 after:rounded-r-md after:bg-brand-saturated"
|
|
114
|
+
},
|
|
115
|
+
hasAction: {
|
|
116
|
+
true: "cursor-pointer rounded-md hover"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
function Navigation() {
|
|
87
121
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
88
122
|
var breadcrumb = props.breadcrumb, sections = props.sections, footerLinks = props.footerLinks;
|
|
89
123
|
var setShowMobileNavigation = (0, _Frame.useFrame)().setShowMobileNavigation;
|
|
@@ -105,7 +139,7 @@ var titleStyles = (0, _tailwindvariants.tv)({
|
|
|
105
139
|
})
|
|
106
140
|
}),
|
|
107
141
|
sections && sections.map(function(section, index) {
|
|
108
|
-
var _section_title, _section_title1;
|
|
142
|
+
var _section_title, _section_title1, _section_title2;
|
|
109
143
|
if (!section.links) return null;
|
|
110
144
|
var titleClasses = titleStyles({
|
|
111
145
|
selected: (_section_title = section.title) === null || _section_title === void 0 ? void 0 : _section_title.selected,
|
|
@@ -121,17 +155,34 @@ var titleStyles = (0, _tailwindvariants.tv)({
|
|
|
121
155
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
122
156
|
className: sectionClasses,
|
|
123
157
|
children: [
|
|
124
|
-
section.title && /*#__PURE__*/ (0, _jsxruntime.
|
|
158
|
+
section.title && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
125
159
|
className: titleClasses,
|
|
126
|
-
onClick: handleTitleClick
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
160
|
+
onClick: handleTitleClick
|
|
161
|
+
}, ((_section_title2 = section.title) === null || _section_title2 === void 0 ? void 0 : _section_title2.onAction) ? {
|
|
162
|
+
role: "button",
|
|
163
|
+
tabIndex: 0,
|
|
164
|
+
onKeyDown: function(e) {
|
|
165
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
handleTitleClick();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} : {}), {
|
|
171
|
+
children: [
|
|
172
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
173
|
+
color: section.title.selected ? "link" : "normal",
|
|
174
|
+
fontWeight: "medium",
|
|
175
|
+
variant: "bodySm",
|
|
176
|
+
truncate: true,
|
|
177
|
+
children: section.title.label
|
|
178
|
+
}),
|
|
179
|
+
section.title.onAction && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
180
|
+
source: _polarisicons.ChevronRightMinor,
|
|
181
|
+
color: "subdued",
|
|
182
|
+
className: "opacity-50"
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
})),
|
|
135
186
|
section.links.map(function(link, index) {
|
|
136
187
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Navigation.Link, _object_spread({}, link), "navigation-link-".concat(index));
|
|
137
188
|
})
|
|
@@ -221,9 +272,19 @@ var linkStyles = (0, _tailwindvariants.tv)({
|
|
|
221
272
|
showDividerAbove && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
222
273
|
className: "h-px w-full bg-tint-3 dark:bg-tint-alt-3 my-3"
|
|
223
274
|
}),
|
|
224
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
275
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
225
276
|
className: linkClasses,
|
|
226
|
-
onClick: handleClick
|
|
277
|
+
onClick: handleClick
|
|
278
|
+
}, onAction ? {
|
|
279
|
+
role: "link",
|
|
280
|
+
tabIndex: 0,
|
|
281
|
+
onKeyDown: function(e) {
|
|
282
|
+
if (e.key === "Enter") {
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
handleClick();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} : {}), {
|
|
227
288
|
children: [
|
|
228
289
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
229
290
|
className: "flex items-center gap-2 truncate",
|
|
@@ -253,7 +314,7 @@ var linkStyles = (0, _tailwindvariants.tv)({
|
|
|
253
314
|
className: "opacity-50"
|
|
254
315
|
}) : accessory ? accessory : null
|
|
255
316
|
]
|
|
256
|
-
}),
|
|
317
|
+
})),
|
|
257
318
|
(expanded || selected || subLinkIsSelected || grandChildLinkIsSelected) && !disclosure && subLinks && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
258
319
|
className: "flex flex-col mb-3",
|
|
259
320
|
children: subLinks.map(function(subLink, index) {
|
|
@@ -311,9 +372,19 @@ var subLinkStyles = (0, _tailwindvariants.tv)({
|
|
|
311
372
|
setShowMobileNavigation(false);
|
|
312
373
|
}
|
|
313
374
|
};
|
|
314
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
375
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
315
376
|
className: subLinkClasses,
|
|
316
|
-
onClick: handleClick
|
|
377
|
+
onClick: handleClick
|
|
378
|
+
}, onAction ? {
|
|
379
|
+
role: "link",
|
|
380
|
+
tabIndex: 0,
|
|
381
|
+
onKeyDown: function(e) {
|
|
382
|
+
if (e.key === "Enter") {
|
|
383
|
+
e.preventDefault();
|
|
384
|
+
handleClick();
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
} : {}), {
|
|
317
388
|
children: [
|
|
318
389
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
319
390
|
className: "flex items-center gap-2",
|
|
@@ -336,7 +407,7 @@ var subLinkStyles = (0, _tailwindvariants.tv)({
|
|
|
336
407
|
})),
|
|
337
408
|
accessory
|
|
338
409
|
]
|
|
339
|
-
});
|
|
410
|
+
}));
|
|
340
411
|
}
|
|
341
412
|
Navigation.SubLink = SubLink;
|
|
342
413
|
var _default = Navigation;
|
|
@@ -162,7 +162,46 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
162
162
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
163
163
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
/**
|
|
166
|
+
* @component Page
|
|
167
|
+
*
|
|
168
|
+
* @description A top-level page container that renders a title bar with heading, breadcrumbs, actions, and a content area.
|
|
169
|
+
*
|
|
170
|
+
* @usage
|
|
171
|
+
* - DO: Use as the root container for each page view with title and primary/secondary actions.
|
|
172
|
+
* - DON'T: Nest Page inside another Page.
|
|
173
|
+
*
|
|
174
|
+
* @accessibility
|
|
175
|
+
* - Page title renders as the main heading; ensure it accurately describes the page content.
|
|
176
|
+
*
|
|
177
|
+
* @alternative
|
|
178
|
+
* - If you need a simple container without page-level chrome, use `Card` or `Layout`.
|
|
179
|
+
*
|
|
180
|
+
* @param {Object} props - Props for the component.
|
|
181
|
+
* @param {string|React.ReactNode} props.title - The title of the page. Can be a string or React element.
|
|
182
|
+
* @param {string|React.ReactNode} props.subtitle - The subtitle of the page. Can be a string or React element.
|
|
183
|
+
* @param {Object} [props.backAction] - Configuration for the back action button.
|
|
184
|
+
* @param {Function} [props.backAction.onAction] - Callback when the back action is triggered.
|
|
185
|
+
* @param {string} [props.backAction.accessibilityLabel] - Accessibility label for the back action button.
|
|
186
|
+
* @param {boolean} [props.narrowWidth=false] - Whether to use a narrow width layout.
|
|
187
|
+
* @param {boolean} [props.fullWidth=false] - Whether to use a full-width layout.
|
|
188
|
+
* @param {boolean} [props.showTitleInTopBar=true] - Whether to show the title in the top bar area.
|
|
189
|
+
* @param {boolean} [props.wrapInContentContainer=true] - Whether to wrap the content in a container with padding.
|
|
190
|
+
* @param {Object} [props.primaryAction] - Configuration for the primary action button.
|
|
191
|
+
* @param {Function} [props.primaryAction.onAction] - Callback when the primary action is triggered.
|
|
192
|
+
* @param {boolean} [props.primaryAction.loading] - Whether the primary action button is in a loading state.
|
|
193
|
+
* @param {boolean} [props.primaryAction.disabled] - Whether the primary action button is disabled.
|
|
194
|
+
* @param {boolean} [props.primaryAction.destructive] - Whether the primary action button is styled as destructive.
|
|
195
|
+
* @param {string} [props.primaryAction.tooltip] - Tooltip to show when hovering over the primary action button.
|
|
196
|
+
* @param {React.ReactNode} [props.primaryAction.content="Save"] - Content for the primary action button.
|
|
197
|
+
* @param {Object[]} [props.secondaryActions=[]] - List of secondary actions.
|
|
198
|
+
* @param {string} [props.moreActionsLabel="Actions"] - Label for the "More Actions" button in mobile view.
|
|
199
|
+
* @param {React.ReactNode} [props.titleMetadata] - Metadata displayed alongside the title.
|
|
200
|
+
* @param {React.ReactNode} [props.children] - Content for the main section of the page.
|
|
201
|
+
* @param {Object} [props.footerActions] - Configuration for the footer actions.
|
|
202
|
+
* @param {string} [props.className] - Additional CSS classes for the Page.
|
|
203
|
+
* @returns {React.ReactElement} Rendered Page component.
|
|
204
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
166
205
|
base: "Litho-Page w-full mx-auto",
|
|
167
206
|
variants: {
|
|
168
207
|
narrowWidth: {
|
|
@@ -234,36 +273,7 @@ var contentStyles = (0, _tailwindvariants.tv)({
|
|
|
234
273
|
wrapInContentContainer: true
|
|
235
274
|
}
|
|
236
275
|
});
|
|
237
|
-
|
|
238
|
-
* Page component that provides a structured layout with a header, primary and secondary actions, and content.
|
|
239
|
-
*
|
|
240
|
-
* @component
|
|
241
|
-
*
|
|
242
|
-
* @param {Object} props - Props for the component.
|
|
243
|
-
* @param {string|React.ReactNode} props.title - The title of the page. Can be a string or React element.
|
|
244
|
-
* @param {string|React.ReactNode} props.subtitle - The subtitle of the page. Can be a string or React element.
|
|
245
|
-
* @param {Object} [props.backAction] - Configuration for the back action button.
|
|
246
|
-
* @param {Function} [props.backAction.onAction] - Callback when the back action is triggered.
|
|
247
|
-
* @param {string} [props.backAction.accessibilityLabel] - Accessibility label for the back action button.
|
|
248
|
-
* @param {boolean} [props.narrowWidth=false] - Whether to use a narrow width layout.
|
|
249
|
-
* @param {boolean} [props.fullWidth=false] - Whether to use a full-width layout.
|
|
250
|
-
* @param {boolean} [props.showTitleInTopBar=true] - Whether to show the title in the top bar area.
|
|
251
|
-
* @param {boolean} [props.wrapInContentContainer=true] - Whether to wrap the content in a container with padding.
|
|
252
|
-
* @param {Object} [props.primaryAction] - Configuration for the primary action button.
|
|
253
|
-
* @param {Function} [props.primaryAction.onAction] - Callback when the primary action is triggered.
|
|
254
|
-
* @param {boolean} [props.primaryAction.loading] - Whether the primary action button is in a loading state.
|
|
255
|
-
* @param {boolean} [props.primaryAction.disabled] - Whether the primary action button is disabled.
|
|
256
|
-
* @param {boolean} [props.primaryAction.destructive] - Whether the primary action button is styled as destructive.
|
|
257
|
-
* @param {string} [props.primaryAction.tooltip] - Tooltip to show when hovering over the primary action button.
|
|
258
|
-
* @param {React.ReactNode} [props.primaryAction.content="Save"] - Content for the primary action button.
|
|
259
|
-
* @param {Object[]} [props.secondaryActions=[]] - List of secondary actions.
|
|
260
|
-
* @param {string} [props.moreActionsLabel="Actions"] - Label for the "More Actions" button in mobile view.
|
|
261
|
-
* @param {React.ReactNode} [props.titleMetadata] - Metadata displayed alongside the title.
|
|
262
|
-
* @param {React.ReactNode} [props.children] - Content for the main section of the page.
|
|
263
|
-
* @param {Object} [props.footerActions] - Configuration for the footer actions.
|
|
264
|
-
* @param {string} [props.className] - Additional CSS classes for the Page.
|
|
265
|
-
* @returns {React.ReactElement} Rendered Page component.
|
|
266
|
-
*/ function Page() {
|
|
276
|
+
function Page() {
|
|
267
277
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
268
278
|
var title = props.title, subtitle = props.subtitle, _props_showTitleInTopBar = props.showTitleInTopBar, showTitleInTopBar = _props_showTitleInTopBar === void 0 ? true : _props_showTitleInTopBar, tmp = props.backAction, _backAction = tmp === void 0 ? null : tmp, children = props.children, narrowWidth = props.narrowWidth, fullWidth = props.fullWidth, primaryAction = props.primaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, titleMetadata = props.titleMetadata, _props_moreActionsLabel = props.moreActionsLabel, moreActionsLabel = _props_moreActionsLabel === void 0 ? "Actions" : _props_moreActionsLabel, _props_wrapInContentContainer = props.wrapInContentContainer, wrapInContentContainer = _props_wrapInContentContainer === void 0 ? true : _props_wrapInContentContainer, footerActions = props.footerActions, className = props.className;
|
|
269
279
|
var paneIsOpen = (0, _Frame.useFrame)().paneIsOpen;
|
|
@@ -424,6 +434,7 @@ var contentStyles = (0, _tailwindvariants.tv)({
|
|
|
424
434
|
disclosure: true,
|
|
425
435
|
insight: action.insight,
|
|
426
436
|
icon: action.icon,
|
|
437
|
+
pressed: action.pressed,
|
|
427
438
|
onClick: function() {
|
|
428
439
|
return togglePopover(index);
|
|
429
440
|
},
|
|
@@ -440,6 +451,7 @@ var contentStyles = (0, _tailwindvariants.tv)({
|
|
|
440
451
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
441
452
|
plain: !action.destructive && !action.insight,
|
|
442
453
|
onClick: action.onAction || action.onClick,
|
|
454
|
+
pressed: action.pressed,
|
|
443
455
|
disabled: action.disabled,
|
|
444
456
|
icon: action.icon,
|
|
445
457
|
loading: action.loading,
|
|
@@ -462,6 +474,7 @@ var contentStyles = (0, _tailwindvariants.tv)({
|
|
|
462
474
|
url: primaryAction.url,
|
|
463
475
|
loading: primaryAction.loading,
|
|
464
476
|
disabled: primaryAction.disabled,
|
|
477
|
+
pressed: primaryAction.pressed,
|
|
465
478
|
destructive: primaryAction.destructive,
|
|
466
479
|
tooltip: primaryAction.tooltip,
|
|
467
480
|
connectedDisclosure: primaryAction.connectedDisclosure,
|
|
@@ -47,10 +47,20 @@ function _object_spread(target) {
|
|
|
47
47
|
return target;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* @component Pagination
|
|
51
|
+
*
|
|
52
|
+
* @description A page navigation component with previous/next controls and optional page number display for paginated content.
|
|
53
|
+
*
|
|
54
|
+
* @usage
|
|
55
|
+
* - DO: Use for navigating between pages of paginated content.
|
|
56
|
+
* - DON'T: Use for in-page section navigation (use Tabs).
|
|
57
|
+
*
|
|
58
|
+
* @accessibility
|
|
59
|
+
* - Pagination buttons should have descriptive labels ("Previous page", "Next page"); disabled states are communicated to screen readers.
|
|
60
|
+
*
|
|
61
|
+
* @alternative
|
|
62
|
+
* - If you need tab-based content switching, use `Tabs`. If you need infinite scroll, implement custom scroll handling.
|
|
52
63
|
*
|
|
53
|
-
* @component
|
|
54
64
|
* @param {Object} props - The properties for the Pagination component.
|
|
55
65
|
* @param {boolean} [props.hasNext] - Indicates whether there is a next page/step.
|
|
56
66
|
* @param {boolean} [props.hasPrevious] - Indicates whether there is a previous page/step.
|
|
@@ -74,7 +84,7 @@ function _object_spread(target) {
|
|
|
74
84
|
* />
|
|
75
85
|
*/ function Pagination() {
|
|
76
86
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
77
|
-
var hasNext = props.hasNext, hasPrevious = props.hasPrevious, nextURL = props.nextURL, previousURL = props.previousURL, onNext = props.onNext, onPrevious = props.onPrevious, nextTooltip = props.nextTooltip, previousTooltip = props.previousTooltip;
|
|
87
|
+
var hasNext = props.hasNext, hasPrevious = props.hasPrevious, nextURL = props.nextURL, previousURL = props.previousURL, onNext = props.onNext, onPrevious = props.onPrevious, nextTooltip = props.nextTooltip, previousTooltip = props.previousTooltip, _props_segmented = props.segmented, segmented = _props_segmented === void 0 ? true : _props_segmented, _props_plain = props.plain, plain = _props_plain === void 0 ? false : _props_plain, _props_link = props.link, link = _props_link === void 0 ? false : _props_link;
|
|
78
88
|
var renderButtonWithTooltip = function(tooltip, buttonProps) {
|
|
79
89
|
var button = /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, _object_spread({}, buttonProps));
|
|
80
90
|
return tooltip ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Tooltip.default, {
|
|
@@ -85,11 +95,14 @@ function _object_spread(target) {
|
|
|
85
95
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
86
96
|
className: "Litho-Pagination",
|
|
87
97
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_ButtonGroup.default, {
|
|
88
|
-
segmented:
|
|
98
|
+
segmented: segmented,
|
|
99
|
+
gap: "0",
|
|
89
100
|
children: [
|
|
90
101
|
renderButtonWithTooltip(previousTooltip, {
|
|
91
102
|
icon: _polarisicons.ChevronLeftMinor,
|
|
92
103
|
disabled: !hasPrevious,
|
|
104
|
+
plain: plain,
|
|
105
|
+
link: link,
|
|
93
106
|
onClick: hasPrevious ? function() {
|
|
94
107
|
if (onPrevious) {
|
|
95
108
|
onPrevious();
|
|
@@ -101,6 +114,8 @@ function _object_spread(target) {
|
|
|
101
114
|
renderButtonWithTooltip(nextTooltip, {
|
|
102
115
|
icon: _polarisicons.ChevronRightMinor,
|
|
103
116
|
disabled: !hasNext,
|
|
117
|
+
plain: plain,
|
|
118
|
+
link: link,
|
|
104
119
|
onClick: hasNext ? function() {
|
|
105
120
|
if (onNext) {
|
|
106
121
|
onNext();
|