@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
|
@@ -17,6 +17,7 @@ var _ActionList = /*#__PURE__*/ _interop_require_default(require("./ActionList")
|
|
|
17
17
|
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
18
18
|
var _Popover = /*#__PURE__*/ _interop_require_default(require("./Popover"));
|
|
19
19
|
var _polarisicons = /*#__PURE__*/ _interop_require_wildcard(require("@shopify/polaris-icons"));
|
|
20
|
+
var _Badge = /*#__PURE__*/ _interop_require_default(require("./Badge"));
|
|
20
21
|
function _array_like_to_array(arr, len) {
|
|
21
22
|
if (len == null || len > arr.length) len = arr.length;
|
|
22
23
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -161,30 +162,27 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
161
162
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
162
163
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
163
164
|
}
|
|
164
|
-
var styles = (0, _tailwindvariants.tv)({
|
|
165
|
-
base: "Litho-Tabs flex overflow-x-hidden whitespace-nowrap",
|
|
166
|
-
variants: {
|
|
167
|
-
borderBottom: {
|
|
168
|
-
true: "border-b",
|
|
169
|
-
false: ""
|
|
170
|
-
},
|
|
171
|
-
padded: {
|
|
172
|
-
true: "p-2",
|
|
173
|
-
false: ""
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
var containerStyles = (0, _tailwindvariants.tv)({
|
|
178
|
-
base: "Litho-Tabs__TabContainer flex flex-1 overflow-x-hidden whitespace-nowrap space-x-1"
|
|
179
|
-
});
|
|
180
165
|
/**
|
|
181
|
-
*
|
|
166
|
+
* @component Tabs
|
|
167
|
+
*
|
|
168
|
+
* @description An in-page tab switcher that renders a horizontal tab bar for toggling between content panels without URL changes.
|
|
169
|
+
*
|
|
170
|
+
* @usage
|
|
171
|
+
* - DO: Switch between related content views within the same page.
|
|
172
|
+
* - DON'T: Use for URL-based routing (use TabNavigation).
|
|
173
|
+
*
|
|
174
|
+
* @accessibility
|
|
175
|
+
* - Implements tablist/tab/tabpanel ARIA roles; supports keyboard arrow navigation between tabs.
|
|
176
|
+
*
|
|
177
|
+
* @alternative
|
|
178
|
+
* - If you need URL-based tab navigation, use `TabNavigation`. If you need collapsible sections, use `Collapsible`.
|
|
182
179
|
*
|
|
183
180
|
* @param {Object} props - Component props.
|
|
184
181
|
* @param {Object[]} props.tabs - List of tabs to display.
|
|
185
182
|
* @param {string} props.tabs[].id - Unique identifier for the tab.
|
|
186
183
|
* @param {string} props.tabs[].content - Content or label to display for the tab.
|
|
187
184
|
* @param {string} [props.tabs[].icon] - Optional icon to display for the tab.
|
|
185
|
+
* @param {boolean} [props.tabs[].showIconOnMobile=true] - When false, the tab icon is hidden on mobile and only shown at md (≥800px) breakpoint.
|
|
188
186
|
* @param {boolean} [props.tabs[].disclosure=false] - Whether the tab is part of a "More" disclosure group.
|
|
189
187
|
* @param {number} props.selected - Index of the currently selected tab.
|
|
190
188
|
* @param {Function} props.onSelect - Callback fired when a tab is selected, receives the tab's index.
|
|
@@ -195,8 +193,26 @@ var containerStyles = (0, _tailwindvariants.tv)({
|
|
|
195
193
|
* @param {boolean} [props.padded=true] - If true, applies padding to the Tabs container.
|
|
196
194
|
* @param {boolean} [props.borderBottom=true] - If true, applies a bottom border to the Tabs container.
|
|
197
195
|
* @param {boolean} [props.simpleTabs=false] - If true, simplifies the styling for the selected tab.
|
|
196
|
+
* @param {number} [props.badgeCount] - The number of badges to display for the tab.
|
|
197
|
+
* @param {string} [props.badgeStatus="default"] - The status of the badge.
|
|
198
198
|
* @returns {JSX.Element} The Tabs component.
|
|
199
|
-
*/
|
|
199
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
200
|
+
base: "Litho-Tabs flex overflow-x-hidden whitespace-nowrap",
|
|
201
|
+
variants: {
|
|
202
|
+
borderBottom: {
|
|
203
|
+
true: "border-b",
|
|
204
|
+
false: ""
|
|
205
|
+
},
|
|
206
|
+
padded: {
|
|
207
|
+
true: "p-2",
|
|
208
|
+
false: ""
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
var containerStyles = (0, _tailwindvariants.tv)({
|
|
213
|
+
base: "Litho-Tabs__TabContainer flex flex-1 overflow-x-hidden whitespace-nowrap space-x-1"
|
|
214
|
+
});
|
|
215
|
+
function Tabs() {
|
|
200
216
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
201
217
|
var tmp = props.tabs, _tabs = tmp === void 0 ? [] : tmp, _selectedIndex = props.selected, onSelect = props.onSelect, fullWidth = props.fullWidth, _props_disclosureText = props.disclosureText, disclosureText = _props_disclosureText === void 0 ? "More" : _props_disclosureText, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_activeDisclosure = props.activeDisclosure, activeDisclosure = _props_activeDisclosure === void 0 ? false : _props_activeDisclosure, _props_padded = props.padded, padded = _props_padded === void 0 ? true : _props_padded, _props_borderBottom = props.borderBottom, borderBottom = _props_borderBottom === void 0 ? true : _props_borderBottom, _props_simpleTabs = props.simpleTabs, simpleTabs = _props_simpleTabs === void 0 ? false : _props_simpleTabs;
|
|
202
218
|
var selectedIndex = parseInt(_selectedIndex);
|
|
@@ -305,9 +321,12 @@ var containerStyles = (0, _tailwindvariants.tv)({
|
|
|
305
321
|
},
|
|
306
322
|
disclosure: disclosure && tab.disclosure,
|
|
307
323
|
icon: tab.icon,
|
|
324
|
+
showIconOnMobile: tab.showIconOnMobile,
|
|
308
325
|
fullWidth: fullWidth,
|
|
309
326
|
hidden: tab.hidden,
|
|
310
327
|
simple: simpleTabs,
|
|
328
|
+
badgeCount: tab.badgeCount,
|
|
329
|
+
badgeStatus: tab.badgeStatus,
|
|
311
330
|
children: tab.content
|
|
312
331
|
}, "tab-".concat(tab.originalIndex));
|
|
313
332
|
})
|
|
@@ -400,9 +419,31 @@ var tabStyles = (0, _tailwindvariants.tv)({
|
|
|
400
419
|
}
|
|
401
420
|
]
|
|
402
421
|
});
|
|
403
|
-
|
|
422
|
+
/**
|
|
423
|
+
* Individual tab item component used within the Tabs component.
|
|
424
|
+
*
|
|
425
|
+
* @param {Object} props - Component props.
|
|
426
|
+
* @param {string} [props.id] - Unique identifier for the tab, used to generate the DOM element ID.
|
|
427
|
+
* @param {boolean} [props.active] - Whether the tab's disclosure popover is currently active/open.
|
|
428
|
+
* @param {boolean} [props.selected] - Whether this tab is currently selected.
|
|
429
|
+
* @param {number} [props.index] - The index position of this tab in the tabs array.
|
|
430
|
+
* @param {string|React.ReactNode} [props.icon] - Icon to display. Can be a Polaris icon name string or a custom React node.
|
|
431
|
+
* @param {boolean} [props.showIconOnMobile=true] - When false, the tab icon is hidden on mobile and only shown at md (≥800px) breakpoint.
|
|
432
|
+
* @param {Function} [props.onSelect] - Callback fired when the tab is selected, receives the tab's index.
|
|
433
|
+
* @param {Function} [props.onClick] - Custom click handler that overrides the default onSelect behavior.
|
|
434
|
+
* @param {React.ReactNode} [props.children] - The content/label to display inside the tab.
|
|
435
|
+
* @param {boolean} [props.fullWidth] - Whether the tab should expand to fill available space.
|
|
436
|
+
* @param {boolean} [props.hidden] - Whether the tab should be visually hidden (used for overflow handling).
|
|
437
|
+
* @param {boolean} [props.simple] - Whether to use simplified styling (no background, column layout).
|
|
438
|
+
* @param {boolean} [props.disclosure=false] - Whether to show a disclosure caret icon when selected.
|
|
439
|
+
* @param {boolean} [props.alwaysShowDisclosureIcon=false] - Whether to always show the disclosure icon regardless of selection state.
|
|
440
|
+
* @param {boolean} [props.disabled=false] - Whether the tab is disabled.
|
|
441
|
+
* @param {string} [props.badgeStatus="default"] - The status variant of the badge (e.g., "default", "success", "warning").
|
|
442
|
+
* @param {number} [props.badgeCount] - If provided (>= 0), displays a badge with this count.
|
|
443
|
+
* @returns {JSX.Element} The Tab component.
|
|
444
|
+
*/ function Tab() {
|
|
404
445
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
405
|
-
var id = props.id, active = props.active, selected = props.selected, index = props.index, icon = props.icon, onSelect = props.onSelect, onClick = props.onClick, children = props.children, fullWidth = props.fullWidth, hidden = props.hidden, simple = props.simple, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_alwaysShowDisclosureIcon = props.alwaysShowDisclosureIcon, alwaysShowDisclosureIcon = _props_alwaysShowDisclosureIcon === void 0 ? false : _props_alwaysShowDisclosureIcon, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled;
|
|
446
|
+
var id = props.id, active = props.active, selected = props.selected, index = props.index, icon = props.icon, _props_showIconOnMobile = props.showIconOnMobile, showIconOnMobile = _props_showIconOnMobile === void 0 ? true : _props_showIconOnMobile, onSelect = props.onSelect, onClick = props.onClick, children = props.children, fullWidth = props.fullWidth, hidden = props.hidden, simple = props.simple, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_alwaysShowDisclosureIcon = props.alwaysShowDisclosureIcon, alwaysShowDisclosureIcon = _props_alwaysShowDisclosureIcon === void 0 ? false : _props_alwaysShowDisclosureIcon, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_badgeStatus = props.badgeStatus, badgeStatus = _props_badgeStatus === void 0 ? "default" : _props_badgeStatus, badgeCount = props.badgeCount;
|
|
406
447
|
var polarisIcon = typeof icon === "string" ? _polarisicons[icon] : _polarisicons[icon === null || icon === void 0 ? void 0 : icon.displayName];
|
|
407
448
|
var showDisclosure = disclosure && (selected || alwaysShowDisclosureIcon);
|
|
408
449
|
var tabClasses = tabStyles({
|
|
@@ -419,18 +460,32 @@ function Tab() {
|
|
|
419
460
|
onClick: onClick ? onClick : onSelect ? function() {
|
|
420
461
|
return onSelect(index);
|
|
421
462
|
} : undefined,
|
|
463
|
+
role: "tab",
|
|
464
|
+
tabIndex: disabled ? -1 : 0,
|
|
465
|
+
"aria-selected": selected,
|
|
466
|
+
onKeyDown: function(e) {
|
|
467
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
468
|
+
e.preventDefault();
|
|
469
|
+
if (onClick) onClick();
|
|
470
|
+
else if (onSelect) onSelect(index);
|
|
471
|
+
}
|
|
472
|
+
},
|
|
422
473
|
children: [
|
|
423
474
|
icon && !!polarisIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
424
|
-
className: "Litho-Tabs__Tab-Icon mr-1",
|
|
475
|
+
className: "Litho-Tabs__Tab-Icon mr-1 ".concat(showIconOnMobile ? "" : "hidden @md:inline-flex"),
|
|
425
476
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
426
477
|
source: polarisIcon,
|
|
427
478
|
color: selected && simple ? "default" : selected ? "primary" : "subdued",
|
|
428
479
|
size: simple ? "lg" : undefined
|
|
429
480
|
})
|
|
430
481
|
}),
|
|
431
|
-
icon &&
|
|
432
|
-
className: "Litho-Tabs__Tab-Icon ".concat(simple ? "mr-0" : "mr-1"),
|
|
433
|
-
children:
|
|
482
|
+
icon && !polarisIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
483
|
+
className: "Litho-Tabs__Tab-Icon ".concat(simple ? "mr-0" : "mr-1", " ").concat(showIconOnMobile ? "" : "hidden @md:inline-flex"),
|
|
484
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
485
|
+
source: icon,
|
|
486
|
+
color: selected && simple ? "default" : selected ? "primary" : "subdued",
|
|
487
|
+
size: simple ? "lg" : undefined
|
|
488
|
+
})
|
|
434
489
|
}),
|
|
435
490
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
436
491
|
className: "Litho-Tabs__Tab-Content block min-h-5 leading-5",
|
|
@@ -443,6 +498,11 @@ function Tab() {
|
|
|
443
498
|
color: selected && simple ? "default" : selected ? "active" : "subdued",
|
|
444
499
|
size: simple ? "lg" : undefined
|
|
445
500
|
})
|
|
501
|
+
}),
|
|
502
|
+
badgeCount >= 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Badge.default, {
|
|
503
|
+
status: badgeStatus,
|
|
504
|
+
className: "ml-1",
|
|
505
|
+
children: badgeCount
|
|
446
506
|
})
|
|
447
507
|
]
|
|
448
508
|
});
|
|
@@ -17,7 +17,33 @@ function _interop_require_default(obj) {
|
|
|
17
17
|
default: obj
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @component Tag
|
|
22
|
+
*
|
|
23
|
+
* @description A removable label component used to display active filters, selected categories, or user-applied tags.
|
|
24
|
+
*
|
|
25
|
+
* @usage
|
|
26
|
+
* - DO: Display removable filters, categories, or labels.
|
|
27
|
+
* - DON'T: Use for non-removable status indicators (use Badge).
|
|
28
|
+
*
|
|
29
|
+
* @accessibility
|
|
30
|
+
* - Tag renders a button for removal; ensure the remove action is accessible via keyboard.
|
|
31
|
+
*
|
|
32
|
+
* @alternative
|
|
33
|
+
* - If you need a non-interactive status label, use `Badge`.
|
|
34
|
+
* - If you need a selectable option, use `ChoiceList`.
|
|
35
|
+
*
|
|
36
|
+
* @param {Object} props - The properties for the Tag component.
|
|
37
|
+
* @param {React.ReactNode} props.children - The content to be displayed inside the Tag.
|
|
38
|
+
* @param {boolean} [props.disabled=false] - Whether the tag is disabled.
|
|
39
|
+
* @param {Function} [props.onClick] - The callback function to execute on tag click.
|
|
40
|
+
* @param {Function} [props.onRemove] - The callback function to execute when the remove icon is clicked.
|
|
41
|
+
* @param {string} [props.accessibilityLabel] - The accessibility label for the tag.
|
|
42
|
+
* @param {string} [props.url] - The URL to open when the tag is clicked.
|
|
43
|
+
* @param {string} [props.target="_self"] - Specifies where to open the URL.
|
|
44
|
+
*
|
|
45
|
+
* @returns {JSX.Element} The rendered Tag component.
|
|
46
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
21
47
|
base: "Litho-Tag text-xs rounded-md inline-grid pl-1 whitespace-nowrap",
|
|
22
48
|
variants: {
|
|
23
49
|
disabled: {
|
|
@@ -90,21 +116,7 @@ var actionStyles = (0, _tailwindvariants.tv)({
|
|
|
90
116
|
}
|
|
91
117
|
}
|
|
92
118
|
});
|
|
93
|
-
|
|
94
|
-
* Renders a Tag component with optional interactive and removable features.
|
|
95
|
-
*
|
|
96
|
-
* @function Tag
|
|
97
|
-
* @param {Object} props - The properties for the Tag component.
|
|
98
|
-
* @param {React.ReactNode} props.children - The content to be displayed inside the Tag.
|
|
99
|
-
* @param {boolean} [props.disabled=false] - Whether the tag is disabled.
|
|
100
|
-
* @param {Function} [props.onClick] - The callback function to execute on tag click.
|
|
101
|
-
* @param {Function} [props.onRemove] - The callback function to execute when the remove icon is clicked.
|
|
102
|
-
* @param {string} [props.accessibilityLabel] - The accessibility label for the tag.
|
|
103
|
-
* @param {string} [props.url] - The URL to open when the tag is clicked.
|
|
104
|
-
* @param {string} [props.target="_self"] - Specifies where to open the URL.
|
|
105
|
-
*
|
|
106
|
-
* @returns {JSX.Element} The rendered Tag component.
|
|
107
|
-
*/ function Tag() {
|
|
119
|
+
function Tag() {
|
|
108
120
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
109
121
|
var children = props.children, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, icon = props.icon, onClick = props.onClick, onRemove = props.onRemove, accessibilityLabel = props.accessibilityLabel, url = props.url, _props_target = props.target, target = _props_target === void 0 ? "_self" : _props_target, className = props.className, _props_selected = props.selected, selected = _props_selected === void 0 ? false : _props_selected;
|
|
110
122
|
var interactive = !!url || !!onClick;
|
|
@@ -151,6 +163,15 @@ var actionStyles = (0, _tailwindvariants.tv)({
|
|
|
151
163
|
hasRemoveAction && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
152
164
|
className: actionClasses,
|
|
153
165
|
onClick: onRemove,
|
|
166
|
+
role: "button",
|
|
167
|
+
tabIndex: disabled ? -1 : 0,
|
|
168
|
+
"aria-label": "Remove",
|
|
169
|
+
onKeyDown: function(e) {
|
|
170
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
onRemove === null || onRemove === void 0 ? void 0 : onRemove();
|
|
173
|
+
}
|
|
174
|
+
},
|
|
154
175
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
155
176
|
source: _polarisicons.CancelSmallMinor,
|
|
156
177
|
color: disabled ? "disabled" : "default",
|
|
@@ -89,7 +89,37 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
89
89
|
}
|
|
90
90
|
return target;
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @component Text
|
|
94
|
+
*
|
|
95
|
+
* @description A typography component that renders text content with consistent heading and body variants, alignment, weight, and color options.
|
|
96
|
+
*
|
|
97
|
+
* @usage
|
|
98
|
+
* - DO: Use for all text content with consistent typography variants (headings, body, captions).
|
|
99
|
+
* - DON'T: Use raw HTML heading or paragraph tags; always use Text with the appropriate `variant` prop.
|
|
100
|
+
*
|
|
101
|
+
* @accessibility
|
|
102
|
+
* - Use the `as` prop to render semantically correct heading levels (h1-h6) matching the visual hierarchy.
|
|
103
|
+
* - Use `visuallyHidden` to provide screen-reader-only text without hiding content from assistive tech.
|
|
104
|
+
*
|
|
105
|
+
* @alternative
|
|
106
|
+
* - If you need a code block, use `Code` instead.
|
|
107
|
+
* - If you need a clickable text element, use `Link` or `Button` with `link` variant instead.
|
|
108
|
+
*
|
|
109
|
+
* @param {Object} props - Properties to customize the text component.
|
|
110
|
+
* @param {'left' | 'center' | 'right' | 'end' | 'start'} [props.alignment] - Text alignment.
|
|
111
|
+
* @param {'normal' | 'regular' | 'medium' | 'semibold' | 'bold'} [props.fontWeight] - Font weight.
|
|
112
|
+
* @param {'default' | 'subdued' | 'critical' | 'success' | 'warning' | 'alternate' | 'link' | 'disabled'} [props.color] - Text color variant.
|
|
113
|
+
* @param {boolean} [props.truncate] - Whether to truncate text with ellipsis.
|
|
114
|
+
* @param {'headingXl' | 'headingLg' | 'headingMd' | 'headingSm' | 'headingXs' | 'bodyXl' | 'bodyLg' | 'bodyMd' | 'bodySm' | 'bodyXs'} [props.variant] - Text size and style variant.
|
|
115
|
+
* @param {boolean} [props.visuallyHidden] - Visually hides text for accessibility.
|
|
116
|
+
* @param {string} [props.className] - Additional CSS class names.
|
|
117
|
+
* @param {string} [props.as] - Element type (e.g., 'p' or 'span').
|
|
118
|
+
* @param {number} [props.clampLines] - Number of lines to clamp.
|
|
119
|
+
* @param {boolean} [props.strike] - Whether to strike through the text.
|
|
120
|
+
* @param {React.ReactNode} [props.children] - The content to be displayed within the text component. Defaults to an empty string.
|
|
121
|
+
* @returns {JSX.Element} Rendered text component with applied styles.
|
|
122
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
93
123
|
base: "Litho-Text block",
|
|
94
124
|
variants: {
|
|
95
125
|
alignment: {
|
|
@@ -228,23 +258,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
228
258
|
}
|
|
229
259
|
]
|
|
230
260
|
});
|
|
231
|
-
|
|
232
|
-
* A text component that renders styled text based on provided props.
|
|
233
|
-
*
|
|
234
|
-
* @param {Object} props - Properties to customize the text component.
|
|
235
|
-
* @param {'left' | 'center' | 'right' | 'end' | 'start'} [props.alignment] - Text alignment.
|
|
236
|
-
* @param {'normal' | 'regular' | 'medium' | 'semibold' | 'bold'} [props.fontWeight] - Font weight.
|
|
237
|
-
* @param {'default' | 'subdued' | 'critical' | 'success' | 'warning' | 'alternate' | 'link' | 'disabled'} [props.color] - Text color variant.
|
|
238
|
-
* @param {boolean} [props.truncate] - Whether to truncate text with ellipsis.
|
|
239
|
-
* @param {'headingXl' | 'headingLg' | 'headingMd' | 'headingSm' | 'headingXs' | 'bodyXl' | 'bodyLg' | 'bodyMd' | 'bodySm' | 'bodyXs'} [props.variant] - Text size and style variant.
|
|
240
|
-
* @param {boolean} [props.visuallyHidden] - Visually hides text for accessibility.
|
|
241
|
-
* @param {string} [props.className] - Additional CSS class names.
|
|
242
|
-
* @param {string} [props.as] - Element type (e.g., 'p' or 'span').
|
|
243
|
-
* @param {number} [props.clampLines] - Number of lines to clamp.
|
|
244
|
-
* @param {boolean} [props.strike] - Whether to strike through the text.
|
|
245
|
-
* @param {React.ReactNode} [props.children] - The content to be displayed within the text component. Defaults to an empty string.
|
|
246
|
-
* @returns {JSX.Element} Rendered text component with applied styles.
|
|
247
|
-
*/ function Text() {
|
|
261
|
+
function Text() {
|
|
248
262
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
249
263
|
var alignment = props.alignment, as = props.as, className = props.className, color = props.color, fontWeight = props.fontWeight, truncate = props.truncate, variant = props.variant, visuallyHidden = props.visuallyHidden, clampLines = props.clampLines, strike = props.strike, children = props.children, rest = _object_without_properties(props, [
|
|
250
264
|
"alignment",
|
|
@@ -111,7 +111,78 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
111
111
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
112
112
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
/**
|
|
115
|
+
* @component TextField
|
|
116
|
+
*
|
|
117
|
+
* @description A text input component with label, help text, error handling, prefix/suffix, and character count support.
|
|
118
|
+
*
|
|
119
|
+
* @usage
|
|
120
|
+
* - DO: Use for single-line or multi-line text input with built-in labeling and validation.
|
|
121
|
+
* - DON'T: Use for selection from a fixed list (use Select or Autocomplete).
|
|
122
|
+
*
|
|
123
|
+
* @accessibility
|
|
124
|
+
* - Always provide a `label` prop; the label is programmatically associated with the input via `htmlFor`.
|
|
125
|
+
*
|
|
126
|
+
* @alternative
|
|
127
|
+
* - If you need a dropdown selection, use `Select`. If you need searchable selection, use `Autocomplete`.
|
|
128
|
+
*
|
|
129
|
+
* @param {Object} props - The properties for the TextField component.
|
|
130
|
+
* @param {string} [props.prefix] - Text content to display before the input.
|
|
131
|
+
* @param {string} [props.suffix] - Text content to display after the input.
|
|
132
|
+
* @param {string} [props.placeholder] - Placeholder text for the input.
|
|
133
|
+
* @param {string} [props.value=''] - The current value of the input.
|
|
134
|
+
* @param {string} [props.helpText] - Helper text to display below the input.
|
|
135
|
+
* @param {string} [props.label] - Label text for the input field.
|
|
136
|
+
* @param {string} [props.labelVariant='bodyMd'] - Visual variant for the label text.
|
|
137
|
+
* @param {Object} [props.labelAction] - Action button to display next to the label.
|
|
138
|
+
* @param {boolean} [props.labelHidden] - Whether to visually hide the label.
|
|
139
|
+
* @param {boolean} [props.disabled=false] - Whether the input is disabled. Defaults to false.
|
|
140
|
+
* @param {boolean} [props.clearButton] - Whether to show a clear button.
|
|
141
|
+
* @param {boolean} [props.readOnly] - Whether the input is read-only.
|
|
142
|
+
* @param {boolean} [props.autoFocus] - Whether to focus the input on mount.
|
|
143
|
+
* @param {boolean} [props.focused] - Whether the input is focused.
|
|
144
|
+
* @param {number} [props.multiline=1] - Number of lines for multiline input (1 for single line). Defaults to 1.
|
|
145
|
+
* @param {boolean} [props.autoGrow=false] - Whether textarea should automatically grow with content. Only applies when multiline > 1.
|
|
146
|
+
* @param {number} [props.maxHeight] - Maximum height in pixels before scrolling starts. Only applies when autoGrow is true.
|
|
147
|
+
* @param {string} [props.error] - Error message to display.
|
|
148
|
+
* @param {ReactNode} [props.connectedRight] - React element to connect to the right of the input.
|
|
149
|
+
* @param {ReactNode} [props.connectedLeft] - React element to connect to the left of the input.
|
|
150
|
+
* @param {string} [props.type='text'] - HTML input type. Defaults to 'text'.
|
|
151
|
+
* @param {boolean} [props.subdued=false] - Whether to use subdued styling.
|
|
152
|
+
* @param {string} [props.name] - Name attribute for the input.
|
|
153
|
+
* @param {string} [props.id] - ID for the input element.
|
|
154
|
+
* @param {string} [props.role] - ARIA role.
|
|
155
|
+
* @param {number} [props.step] - Step value for number inputs.
|
|
156
|
+
* @param {number} [props.largeStep=10] - Large step value when using shift + arrows.
|
|
157
|
+
* @param {string} [props.autoComplete] - HTML autocomplete attribute.
|
|
158
|
+
* @param {number} [props.max] - Maximum value for number inputs.
|
|
159
|
+
* @param {number} [props.maxLength] - Maximum length for text input.
|
|
160
|
+
* @param {number} [props.min] - Minimum value for number inputs.
|
|
161
|
+
* @param {number} [props.minLength] - Minimum length for text input.
|
|
162
|
+
* @param {string} [props.pattern] - Input validation pattern.
|
|
163
|
+
* @param {boolean} [props.spellCheck] - Whether to enable spell checking.
|
|
164
|
+
* @param {string} [props.ariaOwns] - ARIA owns attribute.
|
|
165
|
+
* @param {string} [props.ariaControls] - ARIA controls attribute.
|
|
166
|
+
* @param {boolean} [props.ariaExpanded] - ARIA expanded attribute.
|
|
167
|
+
* @param {string} [props.ariaActiveDescendant] - ARIA active descendant attribute.
|
|
168
|
+
* @param {string} [props.ariaAutocomplete] - ARIA autocomplete attribute.
|
|
169
|
+
* @param {('left'|'center'|'right')} [props.align='left'] - Text alignment within the input.
|
|
170
|
+
* @param {boolean} [props.requiredIndicator] - Whether to show a required field indicator.
|
|
171
|
+
* @param {boolean} [props.selectTextOnFocus] - Whether to select all text when focused.
|
|
172
|
+
* @param {Function} [props.onClearButtonClick] - Handler for clear button click.
|
|
173
|
+
* @param {Function} [props.onChange] - Handler for value changes.
|
|
174
|
+
* @param {Function} [props.onFocus] - Handler for input focus.
|
|
175
|
+
* @param {Function} [props.onBlur] - Handler for input blur.
|
|
176
|
+
* @param {Function} [props.onKeyDown] - Handler for key down.
|
|
177
|
+
* @param {ReactNode} [props.tooltip] - Tooltip content for the label.
|
|
178
|
+
* @param {string} [props.className] - Additional CSS classes.
|
|
179
|
+
* @param {string} [props.containerClassName] - Additional CSS classes for the outer container (Litho-TextFieldContainer).
|
|
180
|
+
* @param {ReactNode} [props.icon] - Icon to display before the input.
|
|
181
|
+
* @param {string} [props.iconColor='subdued'] - Color of the icon. Defaults to 'subdued'.
|
|
182
|
+
* @param {boolean} [props.disableFocusStyles=false] - Whether to disable focused styles when the input is focused.
|
|
183
|
+
* @param {boolean} [props.insight=false] - Whether to use insight/AI styling with insight-alt background, border, and text colors.
|
|
184
|
+
* @returns {JSX.Element} The rendered TextField component.
|
|
185
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
115
186
|
base: "Litho-TextField group relative rounded-md border min-h-8 cursor-text",
|
|
116
187
|
variants: {
|
|
117
188
|
disabled: {
|
|
@@ -128,6 +199,10 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
128
199
|
transparent: {
|
|
129
200
|
true: "border-transparent",
|
|
130
201
|
false: ""
|
|
202
|
+
},
|
|
203
|
+
insight: {
|
|
204
|
+
true: "",
|
|
205
|
+
false: ""
|
|
131
206
|
}
|
|
132
207
|
},
|
|
133
208
|
compoundVariants: [
|
|
@@ -175,12 +250,27 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
175
250
|
hasError: false,
|
|
176
251
|
subdued: true,
|
|
177
252
|
class: "bg-form-bg"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
focused: false,
|
|
256
|
+
disabled: false,
|
|
257
|
+
hasError: false,
|
|
258
|
+
insight: true,
|
|
259
|
+
class: "bg-form-bg-insight border-form-border-insight"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
focused: true,
|
|
263
|
+
disabled: false,
|
|
264
|
+
hasError: false,
|
|
265
|
+
insight: true,
|
|
266
|
+
class: "bg-form-bg-insight-low border-form-border-insight ring ring-form-focus-insight"
|
|
178
267
|
}
|
|
179
268
|
],
|
|
180
269
|
defaultVariants: {
|
|
181
270
|
disabled: false,
|
|
182
271
|
hasError: false,
|
|
183
|
-
focused: false
|
|
272
|
+
focused: false,
|
|
273
|
+
insight: false
|
|
184
274
|
}
|
|
185
275
|
});
|
|
186
276
|
var inputStyles = (0, _tailwindvariants.tv)({
|
|
@@ -211,13 +301,23 @@ var inputStyles = (0, _tailwindvariants.tv)({
|
|
|
211
301
|
true: "placeholder-form-placeholder-error",
|
|
212
302
|
false: "placeholder-form-placeholder"
|
|
213
303
|
},
|
|
304
|
+
insight: {
|
|
305
|
+
true: "text-insight-alt-fg placeholder-insight-alt-fg/50",
|
|
306
|
+
false: ""
|
|
307
|
+
},
|
|
214
308
|
type: {
|
|
215
309
|
time: "hide-time-picker"
|
|
216
310
|
}
|
|
217
311
|
}
|
|
218
312
|
});
|
|
219
313
|
var iconStyles = (0, _tailwindvariants.tv)({
|
|
220
|
-
base: "Litho-TextField__Icon pl-0.5"
|
|
314
|
+
base: "Litho-TextField__Icon pl-0.5",
|
|
315
|
+
variants: {
|
|
316
|
+
hasMultiline: {
|
|
317
|
+
true: "self-start pt-1",
|
|
318
|
+
false: ""
|
|
319
|
+
}
|
|
320
|
+
}
|
|
221
321
|
});
|
|
222
322
|
var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
223
323
|
base: "Litho-TextField__ClearButton mr-1 rounded-md h-6 w-6 flex self-center items-center justify-center cursor-pointer bg-btn-outline hover:bg-btn-outline-low active:bg-btn-outline-lower",
|
|
@@ -228,65 +328,11 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
228
328
|
}
|
|
229
329
|
}
|
|
230
330
|
});
|
|
231
|
-
|
|
232
|
-
* Renders a TextField component.
|
|
233
|
-
*
|
|
234
|
-
* @function TextField
|
|
235
|
-
* @param {Object} props - The properties for the TextField component.
|
|
236
|
-
* @param {string} [props.prefix] - Text content to display before the input.
|
|
237
|
-
* @param {string} [props.suffix] - Text content to display after the input.
|
|
238
|
-
* @param {string} [props.placeholder] - Placeholder text for the input.
|
|
239
|
-
* @param {string} [props.value=''] - The current value of the input.
|
|
240
|
-
* @param {string} [props.helpText] - Helper text to display below the input.
|
|
241
|
-
* @param {string} [props.label] - Label text for the input field.
|
|
242
|
-
* @param {string} [props.labelVariant='bodyMd'] - Visual variant for the label text.
|
|
243
|
-
* @param {Object} [props.labelAction] - Action button to display next to the label.
|
|
244
|
-
* @param {boolean} [props.labelHidden] - Whether to visually hide the label.
|
|
245
|
-
* @param {boolean} [props.disabled=false] - Whether the input is disabled. Defaults to false.
|
|
246
|
-
* @param {boolean} [props.clearButton] - Whether to show a clear button.
|
|
247
|
-
* @param {boolean} [props.readOnly] - Whether the input is read-only.
|
|
248
|
-
* @param {boolean} [props.autoFocus] - Whether to focus the input on mount.
|
|
249
|
-
* @param {boolean} [props.focused] - Whether the input is focused.
|
|
250
|
-
* @param {number} [props.multiline=1] - Number of lines for multiline input (1 for single line). Defaults to 1.
|
|
251
|
-
* @param {boolean} [props.autoGrow=false] - Whether textarea should automatically grow with content. Only applies when multiline > 1.
|
|
252
|
-
* @param {number} [props.maxHeight] - Maximum height in pixels before scrolling starts. Only applies when autoGrow is true.
|
|
253
|
-
* @param {string} [props.error] - Error message to display.
|
|
254
|
-
* @param {ReactNode} [props.connectedRight] - React element to connect to the right of the input.
|
|
255
|
-
* @param {ReactNode} [props.connectedLeft] - React element to connect to the left of the input.
|
|
256
|
-
* @param {string} [props.type='text'] - HTML input type. Defaults to 'text'.
|
|
257
|
-
* @param {boolean} [props.subdued=false] - Whether to use subdued styling.
|
|
258
|
-
* @param {string} [props.name] - Name attribute for the input.
|
|
259
|
-
* @param {string} [props.id] - ID for the input element.
|
|
260
|
-
* @param {string} [props.role] - ARIA role.
|
|
261
|
-
* @param {number} [props.step] - Step value for number inputs.
|
|
262
|
-
* @param {number} [props.largeStep=10] - Large step value when using shift + arrows.
|
|
263
|
-
* @param {string} [props.autoComplete] - HTML autocomplete attribute.
|
|
264
|
-
* @param {number} [props.max] - Maximum value for number inputs.
|
|
265
|
-
* @param {number} [props.maxLength] - Maximum length for text input.
|
|
266
|
-
* @param {number} [props.min] - Minimum value for number inputs.
|
|
267
|
-
* @param {number} [props.minLength] - Minimum length for text input.
|
|
268
|
-
* @param {string} [props.pattern] - Input validation pattern.
|
|
269
|
-
* @param {boolean} [props.spellCheck] - Whether to enable spell checking.
|
|
270
|
-
* @param {string} [props.ariaOwns] - ARIA owns attribute.
|
|
271
|
-
* @param {string} [props.ariaControls] - ARIA controls attribute.
|
|
272
|
-
* @param {boolean} [props.ariaExpanded] - ARIA expanded attribute.
|
|
273
|
-
* @param {string} [props.ariaActiveDescendant] - ARIA active descendant attribute.
|
|
274
|
-
* @param {string} [props.ariaAutocomplete] - ARIA autocomplete attribute.
|
|
275
|
-
* @param {('left'|'center'|'right')} [props.align='left'] - Text alignment within the input.
|
|
276
|
-
* @param {boolean} [props.requiredIndicator] - Whether to show a required field indicator.
|
|
277
|
-
* @param {boolean} [props.selectTextOnFocus] - Whether to select all text when focused.
|
|
278
|
-
* @param {Function} [props.onClearButtonClick] - Handler for clear button click.
|
|
279
|
-
* @param {Function} [props.onChange] - Handler for value changes.
|
|
280
|
-
* @param {Function} [props.onFocus] - Handler for input focus.
|
|
281
|
-
* @param {Function} [props.onBlur] - Handler for input blur.
|
|
282
|
-
* @param {Function} [props.onKeyDown] - Handler for key down.
|
|
283
|
-
* @param {ReactNode} [props.tooltip] - Tooltip content for the label.
|
|
284
|
-
* @param {string} [props.className] - Additional CSS classes.
|
|
285
|
-
* @param {boolean} [props.disableFocusStyles=false] - Whether to disable focused styles when the input is focused.
|
|
286
|
-
* @returns {JSX.Element} The rendered TextField component.
|
|
287
|
-
*/ function TextField() {
|
|
331
|
+
function TextField() {
|
|
288
332
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
289
|
-
var prefix = props.prefix, _suffix = props.suffix, placeholder = props.placeholder, _props_value = props.value, value = _props_value === void 0 ? "" : _props_value, helpText = props.helpText, label = props.label, _props_labelVariant = props.labelVariant, labelVariant = _props_labelVariant === void 0 ? "bodyMd" : _props_labelVariant, labelAction = props.labelAction, labelHidden = props.labelHidden, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, clearButton = props.clearButton, readOnly = props.readOnly, autoFocus = props.autoFocus, _focused = props.focused, _props_multiline = props.multiline, multiline = _props_multiline === void 0 ? 1 : _props_multiline, _props_autoGrow = props.autoGrow, autoGrow = _props_autoGrow === void 0 ? false : _props_autoGrow, maxHeight = props.maxHeight, error = props.error, connectedRight = props.connectedRight, connectedLeft = props.connectedLeft, _props_type = props.type, type = _props_type === void 0 ? "text" : _props_type, _props_subdued = props.subdued, subdued = _props_subdued === void 0 ? false : _props_subdued, name = props.name, _id = props.id, role = props.role, step = props.step, _props_largeStep = props.largeStep, largeStep = _props_largeStep === void 0 ? 10 : _props_largeStep, autoComplete = props.autoComplete, max = props.max, maxLength = props.maxLength, min = props.min, minLength = props.minLength, _props_showCharacterCount = props.showCharacterCount, showCharacterCount = _props_showCharacterCount === void 0 ? false : _props_showCharacterCount, pattern = props.pattern, spellCheck = props.spellCheck, ariaOwns = props.ariaOwns, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaActiveDescendant = props.ariaActiveDescendant, ariaAutocomplete = props.ariaAutocomplete, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, requiredIndicator = props.requiredIndicator, selectTextOnFocus = props.selectTextOnFocus, onClearButtonClick = props.onClearButtonClick, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, tooltip = props.tooltip, className = props.className, _inputRef = props.inputRef, icon = props.icon, _props_transparent = props.transparent, transparent = _props_transparent === void 0 ? false : _props_transparent, _props_showNumberSteppers = props.showNumberSteppers, showNumberSteppers = _props_showNumberSteppers === void 0 ? true : _props_showNumberSteppers, onKeyDown = props.onKeyDown, _props_disableFocusStyles = props.disableFocusStyles, disableFocusStyles = _props_disableFocusStyles === void 0 ? false : _props_disableFocusStyles;
|
|
333
|
+
var prefix = props.prefix, _suffix = props.suffix, placeholder = props.placeholder, _props_value = props.value, value = _props_value === void 0 ? "" : _props_value, helpText = props.helpText, label = props.label, _props_labelVariant = props.labelVariant, labelVariant = _props_labelVariant === void 0 ? "bodyMd" : _props_labelVariant, labelAction = props.labelAction, labelHidden = props.labelHidden, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, clearButton = props.clearButton, readOnly = props.readOnly, autoFocus = props.autoFocus, _focused = props.focused, _props_multiline = props.multiline, multiline = _props_multiline === void 0 ? 1 : _props_multiline, _props_autoGrow = props.autoGrow, autoGrow = _props_autoGrow === void 0 ? false : _props_autoGrow, maxHeight = props.maxHeight, error = props.error, connectedRight = props.connectedRight, connectedLeft = props.connectedLeft, _props_type = props.type, type = _props_type === void 0 ? "text" : _props_type, _props_subdued = props.subdued, subdued = _props_subdued === void 0 ? false : _props_subdued, name = props.name, _id = props.id, role = props.role, step = props.step, _props_largeStep = props.largeStep, largeStep = _props_largeStep === void 0 ? 10 : _props_largeStep, autoComplete = props.autoComplete, max = props.max, maxLength = props.maxLength, min = props.min, minLength = props.minLength, _props_showCharacterCount = props.showCharacterCount, showCharacterCount = _props_showCharacterCount === void 0 ? false : _props_showCharacterCount, pattern = props.pattern, spellCheck = props.spellCheck, ariaOwns = props.ariaOwns, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaActiveDescendant = props.ariaActiveDescendant, ariaAutocomplete = props.ariaAutocomplete, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, requiredIndicator = props.requiredIndicator, selectTextOnFocus = props.selectTextOnFocus, onClearButtonClick = props.onClearButtonClick, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, tooltip = props.tooltip, className = props.className, containerClassName = props.containerClassName, _inputRef = props.inputRef, icon = props.icon, _iconColor = props.iconColor, _props_transparent = props.transparent, transparent = _props_transparent === void 0 ? false : _props_transparent, _props_insight = props.insight, insight = _props_insight === void 0 ? false : _props_insight, _props_showNumberSteppers = props.showNumberSteppers, showNumberSteppers = _props_showNumberSteppers === void 0 ? true : _props_showNumberSteppers, onKeyDown = props.onKeyDown, _props_disableFocusStyles = props.disableFocusStyles, disableFocusStyles = _props_disableFocusStyles === void 0 ? false : _props_disableFocusStyles;
|
|
334
|
+
var effectiveIcon = insight && !icon ? _polarisicons.MagicMajor : icon;
|
|
335
|
+
var effectiveIconColor = insight ? _iconColor || "insight-icon" : _iconColor || "subdued";
|
|
290
336
|
var suffix = maxLength && showCharacterCount ? "".concat(value.length, " / ").concat(maxLength) : _suffix;
|
|
291
337
|
var _internalRef = (0, _react.useRef)(null);
|
|
292
338
|
var inputRef = _inputRef || _internalRef;
|
|
@@ -294,7 +340,7 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
294
340
|
var _useState1 = _sliced_to_array((0, _react.useState)(_focused), 2), focused = _useState1[0], setFocused = _useState1[1];
|
|
295
341
|
var hasError = !!error;
|
|
296
342
|
var hasSuffix = !!suffix || maxLength && showCharacterCount;
|
|
297
|
-
var hasPrefix = !!prefix || !!
|
|
343
|
+
var hasPrefix = !!prefix || !!effectiveIcon;
|
|
298
344
|
var hasMultiline = multiline > 1;
|
|
299
345
|
var hasConnectedLeft = !!connectedLeft;
|
|
300
346
|
var hasConnectedRight = !!connectedRight;
|
|
@@ -347,9 +393,12 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
347
393
|
hasError: hasError,
|
|
348
394
|
focused: Boolean(focused && !readOnly && !disableFocusStyles),
|
|
349
395
|
subdued: subdued,
|
|
350
|
-
transparent: transparent
|
|
396
|
+
transparent: transparent,
|
|
397
|
+
insight: insight
|
|
398
|
+
});
|
|
399
|
+
var iconClasses = iconStyles({
|
|
400
|
+
hasMultiline: hasMultiline
|
|
351
401
|
});
|
|
352
|
-
var iconClasses = iconStyles();
|
|
353
402
|
var inputClasses = inputStyles({
|
|
354
403
|
hasSuffix: hasSuffix,
|
|
355
404
|
hasPrefix: hasPrefix,
|
|
@@ -358,7 +407,8 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
358
407
|
hasError: hasError,
|
|
359
408
|
readOnly: readOnly,
|
|
360
409
|
align: align,
|
|
361
|
-
type: type
|
|
410
|
+
type: type,
|
|
411
|
+
insight: insight
|
|
362
412
|
});
|
|
363
413
|
var clearButtonClasses = clearButtonStyles({
|
|
364
414
|
visible: (value === null || value === void 0 ? void 0 : value.length) > 0 && !readOnly && !disabled
|
|
@@ -389,9 +439,9 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
389
439
|
}
|
|
390
440
|
};
|
|
391
441
|
var memoizedIcon = (0, _react.useMemo)(function() {
|
|
392
|
-
return
|
|
442
|
+
return effectiveIcon;
|
|
393
443
|
}, [
|
|
394
|
-
|
|
444
|
+
effectiveIcon
|
|
395
445
|
]);
|
|
396
446
|
(0, _react.useEffect)(function() {
|
|
397
447
|
// Handle auto-growing textarea
|
|
@@ -443,7 +493,7 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
443
493
|
className: iconClasses,
|
|
444
494
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
445
495
|
source: memoizedIcon,
|
|
446
|
-
color:
|
|
496
|
+
color: effectiveIconColor
|
|
447
497
|
})
|
|
448
498
|
}),
|
|
449
499
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(InputElement, {
|
|
@@ -549,7 +599,7 @@ var clearButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
549
599
|
})
|
|
550
600
|
});
|
|
551
601
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
552
|
-
className: "Litho-TextFieldContainer flex flex-col gap-1",
|
|
602
|
+
className: "Litho-TextFieldContainer flex flex-col gap-1".concat(containerClassName ? " ".concat(containerClassName) : ""),
|
|
553
603
|
children: [
|
|
554
604
|
label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
555
605
|
className: "flex justify-between items-end",
|
|
@@ -17,7 +17,30 @@ function _interop_require_default(obj) {
|
|
|
17
17
|
default: obj
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @component Thumbnail
|
|
22
|
+
*
|
|
23
|
+
* @description A small, fixed-size image preview component with automatic placeholder fallback when no source is provided.
|
|
24
|
+
*
|
|
25
|
+
* @usage
|
|
26
|
+
* - DO: Use for small, fixed-size image previews in lists, tables, or resource items.
|
|
27
|
+
* - DON'T: Use for large content images or hero banners; use `Image` for those cases.
|
|
28
|
+
*
|
|
29
|
+
* @accessibility
|
|
30
|
+
* - Always provide an `alt` prop describing the image content for screen readers.
|
|
31
|
+
* - When no image is available, the component renders a placeholder icon automatically.
|
|
32
|
+
*
|
|
33
|
+
* @alternative
|
|
34
|
+
* - If you need a full-size responsive image, use `Image` instead.
|
|
35
|
+
* - If you need an icon without an image container, use `Icon` instead.
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} props - The component props.
|
|
38
|
+
* @param {string} [props.src] - The image source URL.
|
|
39
|
+
* @param {string} [props.alt] - The alternative text for the image.
|
|
40
|
+
* @param {("small"|"medium"|"large"|number)} [props.size="medium"] - The size of the thumbnail. Can be "small", "medium", "large", or a numeric pixel value.
|
|
41
|
+
* @param {boolean} [props.skeleton=false] - Whether to show a skeleton loader instead of the image.
|
|
42
|
+
* @returns {JSX.Element} The rendered Thumbnail component.
|
|
43
|
+
*/ var imageContainerStyles = (0, _tailwindvariants.tv)({
|
|
21
44
|
base: "relative flex items-center justify-center overflow-hidden rounded-lg border border-tint-4 bg-surface-higher group",
|
|
22
45
|
variants: {
|
|
23
46
|
size: {
|
|
@@ -36,16 +59,7 @@ var imageStyles = (0, _tailwindvariants.tv)({
|
|
|
36
59
|
size: "medium"
|
|
37
60
|
}
|
|
38
61
|
});
|
|
39
|
-
|
|
40
|
-
* Thumbnail component to display an image or a placeholder icon.
|
|
41
|
-
*
|
|
42
|
-
* @param {Object} props - The component props.
|
|
43
|
-
* @param {string} [props.src] - The image source URL.
|
|
44
|
-
* @param {string} [props.alt] - The alternative text for the image.
|
|
45
|
-
* @param {("small"|"medium"|"large"|number)} [props.size="medium"] - The size of the thumbnail. Can be "small", "medium", "large", or a numeric pixel value.
|
|
46
|
-
* @param {boolean} [props.skeleton=false] - Whether to show a skeleton loader instead of the image.
|
|
47
|
-
* @returns {JSX.Element} The rendered Thumbnail component.
|
|
48
|
-
*/ function Thumbnail() {
|
|
62
|
+
function Thumbnail() {
|
|
49
63
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
50
64
|
var src = props.src, alt = props.alt, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, _props_skeleton = props.skeleton, skeleton = _props_skeleton === void 0 ? false : _props_skeleton;
|
|
51
65
|
var sizeIsInteger = Number.isInteger(size);
|