@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
|
@@ -2,19 +2,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
import Spinner from "./Spinner.js";
|
|
4
4
|
import Stack from "./Stack.js";
|
|
5
|
-
var styles = tv({
|
|
6
|
-
base: "Litho-ResourceList flex flex-col min-w-72",
|
|
7
|
-
variants: {
|
|
8
|
-
divider: {
|
|
9
|
-
true: "divide-y divide-edge-default",
|
|
10
|
-
false: ""
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
5
|
/**
|
|
15
|
-
*
|
|
6
|
+
* @component ResourceList
|
|
7
|
+
*
|
|
8
|
+
* @description A structured list component for displaying collections of similar resources with optional selection, bulk actions, and pagination.
|
|
9
|
+
*
|
|
10
|
+
* @usage
|
|
11
|
+
* - DO: Display collections of similar resources with selection and bulk actions.
|
|
12
|
+
* - DON'T: Use for simple text lists (use List).
|
|
13
|
+
*
|
|
14
|
+
* @accessibility
|
|
15
|
+
* - Supports keyboard selection; ensure each item has a descriptive label for screen readers.
|
|
16
|
+
*
|
|
17
|
+
* @alternative
|
|
18
|
+
* - If you need a data table with sorting and columns, use `Table`.
|
|
19
|
+
* - If you need a simple list, use `List`.
|
|
16
20
|
*
|
|
17
|
-
* @component
|
|
18
21
|
* @param {Object} props - The component props.
|
|
19
22
|
* @param {Array} [props.items=[]] - List of items to display.
|
|
20
23
|
* @param {boolean} [props.loading=false] - Whether the list is in a loading state.
|
|
@@ -26,7 +29,16 @@ var styles = tv({
|
|
|
26
29
|
* @param {boolean} [props.divider=true] - Whether to show dividers between items.
|
|
27
30
|
* @param {"none"|"small"|"large"} [props.gap="none"] - Gap size between items.
|
|
28
31
|
* @returns {JSX.Element} The rendered component.
|
|
29
|
-
*/
|
|
32
|
+
*/ var styles = tv({
|
|
33
|
+
base: "Litho-ResourceList flex flex-col min-w-72",
|
|
34
|
+
variants: {
|
|
35
|
+
divider: {
|
|
36
|
+
true: "divide-y divide-edge-default",
|
|
37
|
+
false: ""
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
function ResourceList() {
|
|
30
42
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
31
43
|
var _props_items = props.items, items = _props_items === void 0 ? [] : _props_items, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_emptyState = props.emptyState, emptyState = _props_emptyState === void 0 ? "No results found." : _props_emptyState, renderItem = props.renderItem, _props_resourceName = props.resourceName, resourceName = _props_resourceName === void 0 ? {
|
|
32
44
|
singular: "item",
|
|
@@ -65,9 +77,11 @@ var itemStyles = tv({
|
|
|
65
77
|
}
|
|
66
78
|
});
|
|
67
79
|
/**
|
|
68
|
-
*
|
|
80
|
+
* @component ResourceList.Item
|
|
81
|
+
*
|
|
82
|
+
* @usage
|
|
83
|
+
* - DO: Use as direct children of ResourceList for each resource entry.
|
|
69
84
|
*
|
|
70
|
-
* @component
|
|
71
85
|
* @param {Object} props - The component props.
|
|
72
86
|
* @param {string} [props.id] - The ID of the item.
|
|
73
87
|
* @param {string} [props.accessibilityLabel] - Accessibility label for the item.
|
|
@@ -53,7 +53,43 @@ import Label from "./Label.js";
|
|
|
53
53
|
import Link from "./Link.js";
|
|
54
54
|
import Text from "./Text.js";
|
|
55
55
|
import { CaretDownMinor, CircleAlertMajor, MagicMajor } from "@shopify/polaris-icons";
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @component Select
|
|
58
|
+
*
|
|
59
|
+
* @description A dropdown select input that renders native HTML select with label, help text, and error state support.
|
|
60
|
+
*
|
|
61
|
+
* @usage
|
|
62
|
+
* - DO: Use for choosing one option from a predefined list.
|
|
63
|
+
* - DON'T: Use when the list is very long or needs filtering (use Autocomplete).
|
|
64
|
+
*
|
|
65
|
+
* @accessibility
|
|
66
|
+
* - Renders a native `<select>` element with full keyboard and screen reader support. Always provide a `label`.
|
|
67
|
+
*
|
|
68
|
+
* @alternative
|
|
69
|
+
* - If you need searchable/filterable selection, use `Autocomplete`. If you need multi-select, use `ChoiceList`.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} props - The properties for the Select component.
|
|
72
|
+
* @param {Array} props.options - Array of option objects for the select dropdown. Options can include groups.
|
|
73
|
+
* @param {string} [props.label] - Label for the select input.
|
|
74
|
+
* @param {Object} [props.labelAction] - An action object for the label. Includes `onAction` and `content`.
|
|
75
|
+
* @param {boolean} [props.labelHidden] - Whether to hide the label visually.
|
|
76
|
+
* @param {boolean} [props.labelInline] - Whether to display the label inline with the select.
|
|
77
|
+
* @param {boolean} [props.disabled=false] - Whether the select is disabled.
|
|
78
|
+
* @param {string} [props.helpText] - Optional help text displayed below the select.
|
|
79
|
+
* @param {string} [props.placeholder] - Placeholder text for the select input.
|
|
80
|
+
* @param {string} props.id - The ID for the select input.
|
|
81
|
+
* @param {string} props.name - The name for the select input.
|
|
82
|
+
* @param {string} props.value - The selected value.
|
|
83
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} props.tooltip - Tooltip content for the select.
|
|
84
|
+
* @param {string|boolean} [props.error] - Error message or flag indicating the select has an error.
|
|
85
|
+
* @param {function} props.onChange - Callback for when the selected value changes.
|
|
86
|
+
* @param {function} props.onFocus - Callback for when the select gains focus.
|
|
87
|
+
* @param {function} props.onBlur - Callback for when the select loses focus.
|
|
88
|
+
* @param {boolean} [props.requiredIndicator] - Whether to show a required indicator next to the label.
|
|
89
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the select container.
|
|
90
|
+
* @param {string} [props.contentClassName] - Additional CSS classes to apply to the select content area.
|
|
91
|
+
* @returns {JSX.Element} The rendered Select component.
|
|
92
|
+
*/ var styles = tv({
|
|
57
93
|
base: "Litho-Select relative border border-form-border rounded-md",
|
|
58
94
|
variants: {
|
|
59
95
|
disabled: {
|
|
@@ -101,31 +137,7 @@ var styles = tv({
|
|
|
101
137
|
var contentStyles = tv({
|
|
102
138
|
base: "Litho-Select__Content min-h-7.5 pl-3 pr-2 flex items-center justify-between gap-2"
|
|
103
139
|
});
|
|
104
|
-
|
|
105
|
-
* @function Select
|
|
106
|
-
* @description A dropdown component that allows users to select an option from a list.
|
|
107
|
-
* @param {Object} props - The properties for the Select component.
|
|
108
|
-
* @param {Array} props.options - Array of option objects for the select dropdown. Options can include groups.
|
|
109
|
-
* @param {string} [props.label] - Label for the select input.
|
|
110
|
-
* @param {Object} [props.labelAction] - An action object for the label. Includes `onAction` and `content`.
|
|
111
|
-
* @param {boolean} [props.labelHidden] - Whether to hide the label visually.
|
|
112
|
-
* @param {boolean} [props.labelInline] - Whether to display the label inline with the select.
|
|
113
|
-
* @param {boolean} [props.disabled=false] - Whether the select is disabled.
|
|
114
|
-
* @param {string} [props.helpText] - Optional help text displayed below the select.
|
|
115
|
-
* @param {string} [props.placeholder] - Placeholder text for the select input.
|
|
116
|
-
* @param {string} props.id - The ID for the select input.
|
|
117
|
-
* @param {string} props.name - The name for the select input.
|
|
118
|
-
* @param {string} props.value - The selected value.
|
|
119
|
-
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} props.tooltip - Tooltip content for the select.
|
|
120
|
-
* @param {string|boolean} [props.error] - Error message or flag indicating the select has an error.
|
|
121
|
-
* @param {function} props.onChange - Callback for when the selected value changes.
|
|
122
|
-
* @param {function} props.onFocus - Callback for when the select gains focus.
|
|
123
|
-
* @param {function} props.onBlur - Callback for when the select loses focus.
|
|
124
|
-
* @param {boolean} [props.requiredIndicator] - Whether to show a required indicator next to the label.
|
|
125
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the select container.
|
|
126
|
-
* @param {string} [props.contentClassName] - Additional CSS classes to apply to the select content area.
|
|
127
|
-
* @returns {JSX.Element} The rendered Select component.
|
|
128
|
-
*/ function Select() {
|
|
140
|
+
function Select() {
|
|
129
141
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
130
142
|
var options = props.options, label = props.label, tooltip = props.tooltip, labelAction = props.labelAction, labelHidden = props.labelHidden, labelInline = props.labelInline, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, helpText = props.helpText, placeholder = props.placeholder, id = props.id, name = props.name, value = props.value, error = props.error, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, requiredIndicator = props.requiredIndicator, className = props.className, contentClassName = props.contentClassName;
|
|
131
143
|
var _useState = _sliced_to_array(useState(false), 2), focused = _useState[0], setFocused = _useState[1];
|
|
@@ -1,7 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { tv } from "tailwind-variants";
|
|
3
4
|
import { useMemo } from "react";
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @component SkeletonText
|
|
7
|
+
*
|
|
8
|
+
* @description A placeholder component that renders animated skeleton lines to represent loading text content.
|
|
9
|
+
*
|
|
10
|
+
* @usage
|
|
11
|
+
* - DO: Use as a content placeholder while text data is loading, matching the expected layout with `lines` and `type`.
|
|
12
|
+
* - DON'T: Use for non-text placeholders like images or charts; build custom skeleton layouts for those.
|
|
13
|
+
*
|
|
14
|
+
* @accessibility
|
|
15
|
+
* - Skeleton content is decorative; ensure the parent loading region has `aria-busy="true"`.
|
|
16
|
+
* - Do not use skeleton text as a replacement for meaningful content once data is available.
|
|
17
|
+
*
|
|
18
|
+
* @alternative
|
|
19
|
+
* - If you need a spinning indicator rather than a content placeholder, use `Spinner` instead.
|
|
20
|
+
* - If you need a page-level loading bar, use `Loading` instead.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} props - The component properties.
|
|
23
|
+
* @param {number} [props.lines=3] - The number of lines to render. Defaults to 3 for body text.
|
|
24
|
+
* @param {"body"|"heading"} [props.type="body"] - The type of skeleton text
|
|
25
|
+
* @param {"xs"|"sm"|"md"|"lg"|"xl"} [props.size="md"] - The size of the skeleton text
|
|
26
|
+
* @param {number} [props.width] - The width of the skeleton text lines. If not provided, random widths are generated.
|
|
27
|
+
* @param {boolean} [props.fullWidth=false] - Whether the skeleton text lines should be full width.
|
|
28
|
+
* @param {"start"|"center"|"end"} [props.align="start"] - The alignment of the skeleton text lines.
|
|
29
|
+
* @param {string} [props.className] - Additional class names to apply to the root element.
|
|
30
|
+
*
|
|
31
|
+
* @returns {JSX.Element} A JSX element rendering a skeleton placeholder text block.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <SkeletonText lines={5} type="heading" size="lg" width={80} className="custom-class" />
|
|
35
|
+
*/ var styles = tv({
|
|
5
36
|
base: "Litho-SkeletonText flex flex-col",
|
|
6
37
|
variants: {
|
|
7
38
|
gap: {
|
|
@@ -61,23 +92,7 @@ var lineStyles = tv({
|
|
|
61
92
|
}
|
|
62
93
|
]
|
|
63
94
|
});
|
|
64
|
-
|
|
65
|
-
* SkeletonText component for displaying placeholder text content.
|
|
66
|
-
*
|
|
67
|
-
* @param {Object} props - The component properties.
|
|
68
|
-
* @param {number} [props.lines=3] - The number of lines to render. Defaults to 3 for body text.
|
|
69
|
-
* @param {"body"|"heading"} [props.type="body"] - The type of skeleton text
|
|
70
|
-
* @param {"xs"|"sm"|"md"|"lg"|"xl"} [props.size="md"] - The size of the skeleton text
|
|
71
|
-
* @param {number} [props.width] - The width of the skeleton text lines. If not provided, random widths are generated.
|
|
72
|
-
* @param {boolean} [props.fullWidth=false] - Whether the skeleton text lines should be full width.
|
|
73
|
-
* @param {"start"|"center"|"end"} [props.align="start"] - The alignment of the skeleton text lines.
|
|
74
|
-
* @param {string} [props.className] - Additional class names to apply to the root element.
|
|
75
|
-
*
|
|
76
|
-
* @returns {JSX.Element} A JSX element rendering a skeleton placeholder text block.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* <SkeletonText lines={5} type="heading" size="lg" width={80} className="custom-class" />
|
|
80
|
-
*/ function SkeletonText() {
|
|
95
|
+
function SkeletonText() {
|
|
81
96
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
82
97
|
var tmp = props.lines, _lines = tmp === void 0 ? 3 : tmp, _props_type = props.type, type = _props_type === void 0 ? "body" : _props_type, _props_size = props.size, size = _props_size === void 0 ? "md" : _props_size, _width = props.width, _props_fullWidth = props.fullWidth, fullWidth = _props_fullWidth === void 0 ? false : _props_fullWidth, className = props.className, _props_gap = props.gap, gap = _props_gap === void 0 ? "medium" : _props_gap, _props_align = props.align, align = _props_align === void 0 ? "start" : _props_align;
|
|
83
98
|
var lines = type === "heading" ? 1 : _lines;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @component Spinner
|
|
5
|
+
*
|
|
6
|
+
* @description An animated loading indicator for inline use within buttons, cards, or sections during asynchronous operations.
|
|
7
|
+
*
|
|
8
|
+
* @usage
|
|
9
|
+
* - DO: Use inline within buttons, cards, or sections to indicate localized loading.
|
|
10
|
+
* - DON'T: Use as a full-page loading indicator; use `Loading` for page-level progress bars.
|
|
11
|
+
*
|
|
12
|
+
* @accessibility
|
|
13
|
+
* - Renders with `role="status"` and an `aria-label`; always provide a descriptive `accessibilityLabel`.
|
|
14
|
+
* - Avoid relying on the animation alone; the `role="status"` ensures screen readers announce loading state.
|
|
15
|
+
*
|
|
16
|
+
* @alternative
|
|
17
|
+
* - If you need a page-level progress bar, use `Loading` instead.
|
|
18
|
+
* - If you need placeholder content while data loads, use `SkeletonText` instead.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} props - The props object.
|
|
21
|
+
* @param {('small'|'large')} [props.size='large'] - The size of the spinner, either "small" or "large".
|
|
22
|
+
* @param {('default'|'subdued')} [props.color='default'] - The color variant of the spinner.
|
|
23
|
+
* @param {string} [props.accessibilityLabel='Loading...'] - The accessible label for screen readers, describing the spinner's purpose.
|
|
24
|
+
* @returns {JSX.Element} The rendered Spinner component.
|
|
25
|
+
*/ var styles = tv({
|
|
4
26
|
base: "Litho-Spinner",
|
|
5
27
|
variants: {
|
|
6
28
|
size: {
|
|
@@ -19,17 +41,7 @@ var svgStyles = tv({
|
|
|
19
41
|
}
|
|
20
42
|
}
|
|
21
43
|
});
|
|
22
|
-
|
|
23
|
-
* Spinner Component
|
|
24
|
-
*
|
|
25
|
-
* This component renders a loading spinner with customizable size, color, and accessibility label.
|
|
26
|
-
*
|
|
27
|
-
* @param {Object} props - The props object.
|
|
28
|
-
* @param {('small'|'large')} [props.size='large'] - The size of the spinner, either "small" or "large".
|
|
29
|
-
* @param {('default'|'subdued')} [props.color='default'] - The color variant of the spinner.
|
|
30
|
-
* @param {string} [props.accessibilityLabel='Loading...'] - The accessible label for screen readers, describing the spinner's purpose.
|
|
31
|
-
* @returns {JSX.Element} The rendered Spinner component.
|
|
32
|
-
*/ function Spinner() {
|
|
44
|
+
function Spinner() {
|
|
33
45
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
34
46
|
var _props_size = props.size, size = _props_size === void 0 ? "large" : _props_size, _props_color = props.color, color = _props_color === void 0 ? "default" : _props_color, _props_accessibilityLabel = props.accessibilityLabel, accessibilityLabel = _props_accessibilityLabel === void 0 ? "Loading..." : _props_accessibilityLabel;
|
|
35
47
|
var classes = styles({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
function _define_property(obj, key, value) {
|
|
3
2
|
if (key in obj) {
|
|
4
3
|
Object.defineProperty(obj, key, {
|
|
@@ -80,7 +79,62 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
80
79
|
}
|
|
81
80
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
82
81
|
import { tv } from "tailwind-variants";
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @component Stack
|
|
84
|
+
*
|
|
85
|
+
* @description A flex layout component that arranges children in a row or column with configurable gap, alignment, and wrapping.
|
|
86
|
+
*
|
|
87
|
+
* @usage
|
|
88
|
+
* - DO: Arrange child elements with consistent spacing using the `gap` prop.
|
|
89
|
+
* - DON'T: Use for grid-based layouts (use `Grid` instead).
|
|
90
|
+
*
|
|
91
|
+
* @accessibility
|
|
92
|
+
* - Stack is a layout utility; ensure child content maintains logical reading order.
|
|
93
|
+
*
|
|
94
|
+
* @alternative
|
|
95
|
+
* - If you need explicit horizontal layout, use `Stack` with `horizontal` prop.
|
|
96
|
+
* - If you need responsive layout that switches from vertical to horizontal at a breakpoint, use `Stack` with `horizontal="md"` (or `"sm"`, `"lg"`, etc.).
|
|
97
|
+
* - If you need 2D grid layout, use `Grid`.
|
|
98
|
+
*
|
|
99
|
+
* @param {Object} [props={}] - Component props.
|
|
100
|
+
* @param {string} [props.as='div'] - The HTML element to render. Defaults to `div`.
|
|
101
|
+
* @param {React.ReactNode} [props.children] - Child elements to render inside the stack.
|
|
102
|
+
* @param {boolean|'xs'|'sm'|'md'|'lg'|'xl'} [props.horizontal=false] - Direction control. When `true`, always horizontal (flex-row). When a breakpoint string is passed (e.g. `"md"`), the stack is vertical below that breakpoint and horizontal at/above it. Defaults to `false` (vertical).
|
|
103
|
+
* @param {('none'|'xs'|'sm'|'md'|'lg'|'0'|'px'|'0.5'|'1'|'1.5'|'2'|'3'|'4'|'5'|'6'|'8'|'10')} [props.gap='md'] - Spacing between children. Semantic options: 'none' (0), 'xs' (1), 'sm' (2), 'md' (4), 'lg' (8). Numeric options: '0', 'px', '0.5', '1', '2', '3', '4', '5', '6', '8', '10'. Defaults to 'md'.
|
|
104
|
+
* @param {string} [props.id] - Optional ID for the component.
|
|
105
|
+
* @param {string} [props.className] - Additional custom class names to apply to the component.
|
|
106
|
+
* @param {('start'|'center'|'end'|'stretch'|'baseline')} [props.align='stretch'] - Cross-axis alignment (maps to CSS `align-items`). Controls vertical alignment for horizontal stacks and horizontal alignment for vertical stacks.
|
|
107
|
+
* @param {boolean} [props.wrap=false] - Whether children should wrap to the next line if necessary. Defaults to false.
|
|
108
|
+
* @param {('start'|'center'|'end'|'between'|'evenly'|'around')} [props.justify='start'] - Main axis justification. Controls horizontal justification for horizontal stacks and vertical justification for vertical stacks.
|
|
109
|
+
* @param {boolean} [props.fill=false] - When true and horizontal is active, direct children fill equal space (flex: 1 1 0%). Set to false to let children size naturally. Defaults to false.
|
|
110
|
+
* @param {('1'|'2'|'3'|'4'|'5'|'6'|null)} [props.flex=null] - Flex grow value. Sets `flex-1` through `flex-6` on the stack. Defaults to null (no flex).
|
|
111
|
+
* @param {boolean} [props.fullWidth=false] - When true, applies width: 100% (w-full). Defaults to false.
|
|
112
|
+
* @param {Object} [restProps] - Additional props passed to the root element.
|
|
113
|
+
*
|
|
114
|
+
* @returns {JSX.Element} The rendered Stack component.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* // Vertical stack (default)
|
|
118
|
+
* <Stack gap="sm" align="center">
|
|
119
|
+
* <div>Item 1</div>
|
|
120
|
+
* <div>Item 2</div>
|
|
121
|
+
* </Stack>
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* // Horizontal stack
|
|
125
|
+
* <Stack horizontal>
|
|
126
|
+
* <div>Item 1</div>
|
|
127
|
+
* <div>Item 2</div>
|
|
128
|
+
* </Stack>
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* // Responsive: vertical on mobile, horizontal at md breakpoint
|
|
132
|
+
* <Stack horizontal="md">
|
|
133
|
+
* <div>Column 1</div>
|
|
134
|
+
* <div>Column 2</div>
|
|
135
|
+
* <div>Column 3</div>
|
|
136
|
+
* </Stack>
|
|
137
|
+
*/ var styles = tv({
|
|
84
138
|
base: "Litho-Stack flex",
|
|
85
139
|
variants: {
|
|
86
140
|
direction: {
|
|
@@ -99,6 +153,7 @@ var styles = tv({
|
|
|
99
153
|
"px": "gap-px",
|
|
100
154
|
"0.5": "gap-0.5",
|
|
101
155
|
"1": "gap-1",
|
|
156
|
+
"1.5": "gap-1.5",
|
|
102
157
|
"2": "gap-2",
|
|
103
158
|
"3": "gap-3",
|
|
104
159
|
"4": "gap-4",
|
|
@@ -107,75 +162,66 @@ var styles = tv({
|
|
|
107
162
|
"8": "gap-8",
|
|
108
163
|
"10": "gap-10"
|
|
109
164
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
spaceBetween: "justify-between"
|
|
165
|
+
flex: {
|
|
166
|
+
"1": "flex-1",
|
|
167
|
+
"2": "flex-2",
|
|
168
|
+
"3": "flex-3",
|
|
169
|
+
"4": "flex-4",
|
|
170
|
+
"5": "flex-5",
|
|
171
|
+
"6": "flex-6"
|
|
118
172
|
},
|
|
119
|
-
|
|
173
|
+
align: {
|
|
120
174
|
start: "items-start",
|
|
121
175
|
center: "items-center",
|
|
122
176
|
end: "items-end",
|
|
123
|
-
stretch: "items-stretch"
|
|
177
|
+
stretch: "items-stretch",
|
|
178
|
+
baseline: "items-baseline"
|
|
124
179
|
},
|
|
125
|
-
|
|
126
|
-
start: "
|
|
127
|
-
center: "
|
|
128
|
-
end: "
|
|
129
|
-
|
|
180
|
+
justify: {
|
|
181
|
+
start: "justify-start",
|
|
182
|
+
center: "justify-center",
|
|
183
|
+
end: "justify-end",
|
|
184
|
+
between: "justify-between",
|
|
185
|
+
evenly: "justify-evenly",
|
|
186
|
+
stretch: "justify-stretch",
|
|
187
|
+
around: "justify-around"
|
|
130
188
|
},
|
|
131
189
|
wrap: {
|
|
132
190
|
true: "flex-wrap",
|
|
133
191
|
false: "flex-nowrap"
|
|
192
|
+
},
|
|
193
|
+
fullWidth: {
|
|
194
|
+
true: "w-full",
|
|
195
|
+
false: ""
|
|
134
196
|
}
|
|
135
197
|
},
|
|
136
198
|
defaultVariants: {
|
|
137
199
|
direction: "vertical",
|
|
138
200
|
gap: "md",
|
|
139
|
-
align: "
|
|
201
|
+
align: "stretch",
|
|
202
|
+
justify: "start",
|
|
203
|
+
fullWidth: false
|
|
140
204
|
}
|
|
141
205
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
* @param {Object} [restProps] - Additional props passed to the root element.
|
|
160
|
-
*
|
|
161
|
-
* @returns {JSX.Element} The rendered Stack component.
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* // Vertical stack (default)
|
|
165
|
-
* <Stack gap="sm" inlineAlign="center">
|
|
166
|
-
* <div>Item 1</div>
|
|
167
|
-
* <div>Item 2</div>
|
|
168
|
-
* </Stack>
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* // Horizontal stack
|
|
172
|
-
* <Stack horizontal gap="md" blockAlign="center" wrap={true}>
|
|
173
|
-
* <div>Item 1</div>
|
|
174
|
-
* <div>Item 2</div>
|
|
175
|
-
* </Stack>
|
|
176
|
-
*/ function Stack() {
|
|
206
|
+
// Static maps for Tailwind JIT scanability — do not construct dynamically
|
|
207
|
+
var responsiveDirectionClasses = {
|
|
208
|
+
xs: "flex-col xs:flex-row",
|
|
209
|
+
sm: "flex-col sm:flex-row",
|
|
210
|
+
md: "flex-col md:flex-row",
|
|
211
|
+
lg: "flex-col lg:flex-row",
|
|
212
|
+
xl: "flex-col xl:flex-row"
|
|
213
|
+
};
|
|
214
|
+
var fillModifierClasses = {
|
|
215
|
+
true: "Litho-Stack--fill",
|
|
216
|
+
xs: "Litho-Stack--fill-xs",
|
|
217
|
+
sm: "Litho-Stack--fill-sm",
|
|
218
|
+
md: "Litho-Stack--fill-md",
|
|
219
|
+
lg: "Litho-Stack--fill-lg",
|
|
220
|
+
xl: "Litho-Stack--fill-xl"
|
|
221
|
+
};
|
|
222
|
+
function Stack() {
|
|
177
223
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
178
|
-
var _props_as = props.as, as = _props_as === void 0 ? "div" : _props_as, children = props.children, _props_horizontal = props.horizontal, horizontal = _props_horizontal === void 0 ? false : _props_horizontal, _props_gap = props.gap, gap = _props_gap === void 0 ? "md" : _props_gap, id = props.id, className = props.className, align = props.align,
|
|
224
|
+
var _props_as = props.as, as = _props_as === void 0 ? "div" : _props_as, children = props.children, _props_horizontal = props.horizontal, horizontal = _props_horizontal === void 0 ? false : _props_horizontal, _props_gap = props.gap, gap = _props_gap === void 0 ? "md" : _props_gap, id = props.id, className = props.className, align = props.align, justify = props.justify, _props_wrap = props.wrap, wrap = _props_wrap === void 0 ? false : _props_wrap, _props_flex = props.flex, flex = _props_flex === void 0 ? null : _props_flex, _props_fill = props.fill, fill = _props_fill === void 0 ? false : _props_fill, _props_fullWidth = props.fullWidth, fullWidth = _props_fullWidth === void 0 ? false : _props_fullWidth, restProps = _object_without_properties(props, [
|
|
179
225
|
"as",
|
|
180
226
|
"children",
|
|
181
227
|
"horizontal",
|
|
@@ -183,29 +229,43 @@ var styles = tv({
|
|
|
183
229
|
"id",
|
|
184
230
|
"className",
|
|
185
231
|
"align",
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
232
|
+
"justify",
|
|
233
|
+
"wrap",
|
|
234
|
+
"flex",
|
|
235
|
+
"fill",
|
|
236
|
+
"fullWidth"
|
|
189
237
|
]);
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
238
|
+
var isResponsive = typeof horizontal === "string";
|
|
239
|
+
var isHorizontal = horizontal === true;
|
|
240
|
+
var effectivelyHorizontal = isHorizontal || isResponsive;
|
|
241
|
+
// For boolean horizontal, use tv direction variant
|
|
242
|
+
// For responsive, tv gets "vertical" (flex-col) and responsive classes override at breakpoint
|
|
243
|
+
var direction = isHorizontal ? "horizontal" : "vertical";
|
|
244
|
+
// Horizontal stacks default to center (items-center), vertical to stretch (items-stretch)
|
|
245
|
+
var effectiveAlign = align !== undefined ? align : effectivelyHorizontal ? "center" : "stretch";
|
|
246
|
+
var classes = styles({
|
|
195
247
|
direction: direction,
|
|
196
248
|
gap: gap,
|
|
197
|
-
align:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
249
|
+
align: effectiveAlign,
|
|
250
|
+
justify: justify,
|
|
251
|
+
wrap: wrap,
|
|
252
|
+
flex: flex,
|
|
253
|
+
fullWidth: fullWidth
|
|
254
|
+
});
|
|
255
|
+
// Responsive direction classes (e.g. "flex-col md:flex-row")
|
|
256
|
+
var responsiveClasses = isResponsive ? responsiveDirectionClasses[horizontal] : "";
|
|
257
|
+
// Fill modifier class for CSS child targeting
|
|
258
|
+
var fillClass = fill && effectivelyHorizontal ? fillModifierClasses[horizontal] || fillModifierClasses["true"] : "";
|
|
205
259
|
var Element = as;
|
|
260
|
+
var allClasses = [
|
|
261
|
+
classes,
|
|
262
|
+
responsiveClasses,
|
|
263
|
+
fillClass,
|
|
264
|
+
className
|
|
265
|
+
].filter(Boolean).join(" ");
|
|
206
266
|
return /*#__PURE__*/ _jsx(Element, _object_spread_props(_object_spread({
|
|
207
267
|
id: id,
|
|
208
|
-
className:
|
|
268
|
+
className: allClasses
|
|
209
269
|
}, restProps), {
|
|
210
270
|
children: children
|
|
211
271
|
}));
|
|
@@ -53,7 +53,33 @@ import Button from "./Button.js";
|
|
|
53
53
|
import Text from "./Text.js";
|
|
54
54
|
import Spinner from "./Spinner.js";
|
|
55
55
|
import Tooltip from "./Tooltip.js";
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @component TabNavigation
|
|
58
|
+
*
|
|
59
|
+
* @description A URL-based tab navigation component that renders tabs as links, supporting closeable tabs and route-driven active states.
|
|
60
|
+
*
|
|
61
|
+
* @usage
|
|
62
|
+
* - DO: Use for navigation tabs that change the URL/route.
|
|
63
|
+
* - DON'T: Use for in-page content switching without URL changes (use Tabs).
|
|
64
|
+
*
|
|
65
|
+
* @accessibility
|
|
66
|
+
* - Renders as navigation links; ensure each tab link has descriptive text.
|
|
67
|
+
*
|
|
68
|
+
* @alternative
|
|
69
|
+
* - If you need in-page content tabs without URL routing, use `Tabs`. If you need a sidebar nav, use `Navigation`.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} props - Component properties.
|
|
72
|
+
* @param {Array<Object>} [props.tabs=[]] - Array of tab objects to display.
|
|
73
|
+
* @param {string} props.tabs[].id - Unique identifier for the tab.
|
|
74
|
+
* @param {string} props.tabs[].title - Display title for the tab.
|
|
75
|
+
* @param {boolean} [props.tabs[].loading] - Whether the tab is in a loading state.
|
|
76
|
+
* @param {Object} [props.tabs[].readStatus] - Read status indicator for the tab.
|
|
77
|
+
* @param {string} [props.activeTabId] - The ID of the currently active tab.
|
|
78
|
+
* @param {Function} [props.onTabClick] - Callback fired when a tab is clicked, receives the tab ID.
|
|
79
|
+
* @param {Function} [props.onTabClose] - Callback fired when a tab's close button is clicked, receives the tab ID.
|
|
80
|
+
* @param {string} [props.className=""] - Additional CSS class names for the container.
|
|
81
|
+
* @returns {JSX.Element} The rendered TabNavigation component.
|
|
82
|
+
*/ var AVG_CHAR_WIDTH = 5.5;
|
|
57
83
|
var tabStyles = tv({
|
|
58
84
|
base: "relative group cursor-pointer rounded-t-sm items-center px-2 pt-2 gap-0.5 overflow-hidden min-w-[60px] max-w-[160px] pointer-coarse:pb-1 pointer-coarse:pt-3 transition-colors",
|
|
59
85
|
variants: {
|