@heymantle/litho 0.0.15 → 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/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 +35 -22
- package/dist/cjs/components/Divider.js +82 -18
- package/dist/cjs/components/DropZone.js +111 -37
- 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 +33 -24
- 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 +22 -40
- 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 +37 -21
- 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 +58 -18
- package/dist/cjs/components/Tabs.js +52 -23
- 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/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/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 +35 -22
- package/dist/esm/components/Divider.js +78 -20
- package/dist/esm/components/DropZone.js +111 -37
- 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 +58 -25
- 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 +69 -41
- 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 +37 -21
- 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 +58 -18
- package/dist/esm/components/Tabs.js +52 -23
- 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/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/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 +1 -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 -37
- 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 +3 -41
- 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/index.css +76 -14
- package/package.json +4 -3
|
@@ -7,6 +7,19 @@ function _array_like_to_array(arr, len) {
|
|
|
7
7
|
function _array_with_holes(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
10
23
|
function _iterable_to_array_limit(arr, i) {
|
|
11
24
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
25
|
if (_i == null) return;
|
|
@@ -34,6 +47,21 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
34
47
|
function _non_iterable_rest() {
|
|
35
48
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
49
|
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
37
65
|
function _sliced_to_array(arr, i) {
|
|
38
66
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
67
|
}
|
|
@@ -45,28 +73,27 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
45
73
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
46
74
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
47
75
|
}
|
|
48
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
-
import { useState } from "react";
|
|
76
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
77
|
+
import { useRef, useState } from "react";
|
|
50
78
|
import Sketch from "@uiw/react-color-sketch";
|
|
51
79
|
import { tv } from "tailwind-variants";
|
|
52
80
|
import Text from "./Text.js";
|
|
53
|
-
|
|
54
|
-
base: "Litho-ColorField relative flex items-center gap-2 cursor-pointer px-1 py-1 rounded-md w-full-plus-2 -left-1",
|
|
55
|
-
variants: {
|
|
56
|
-
hoverable: {
|
|
57
|
-
true: "hover"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
var colorCell = tv({
|
|
62
|
-
base: "w-8 h-8 min-w-8 min-h-8 rounded-md border border-tint-5"
|
|
63
|
-
});
|
|
81
|
+
import TextField from "./TextField.js";
|
|
64
82
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
83
|
+
* @component ColorField
|
|
84
|
+
*
|
|
85
|
+
* @description A color picker input that displays a swatch preview and a text field for entering hex color values.
|
|
86
|
+
*
|
|
87
|
+
* @usage
|
|
88
|
+
* - DO: Use for selecting colors in theme or design settings.
|
|
89
|
+
* - DON'T: Use for text input (use TextField).
|
|
90
|
+
*
|
|
91
|
+
* @accessibility
|
|
92
|
+
* - Ensure the color input has a descriptive label; provide text representation of selected color for screen readers.
|
|
93
|
+
*
|
|
94
|
+
* @alternative
|
|
95
|
+
* - If you need a text input, use `TextField`. If you need a select from predefined options, use `Select`.
|
|
68
96
|
*
|
|
69
|
-
* @component
|
|
70
97
|
* @example
|
|
71
98
|
* <ColorField
|
|
72
99
|
* label="Primary Color"
|
|
@@ -77,23 +104,139 @@ var colorCell = tv({
|
|
|
77
104
|
* presetColors={['#ff0000', '#00ff00', '#0000ff']}
|
|
78
105
|
* />
|
|
79
106
|
*
|
|
107
|
+
* @example
|
|
108
|
+
* // Textfield variant with inline editing and color swatch
|
|
109
|
+
* <ColorField
|
|
110
|
+
* variant="textfield"
|
|
111
|
+
* label="Brand Color"
|
|
112
|
+
* name="brand"
|
|
113
|
+
* value="#ff0000"
|
|
114
|
+
* onChange={(newColor) => setColor(newColor)}
|
|
115
|
+
* placeholder="#000000"
|
|
116
|
+
* />
|
|
117
|
+
*
|
|
80
118
|
* @param {Object} props - Component props
|
|
119
|
+
* @param {('default'|'textfield')} [props.variant='default'] - Visual variant; "textfield" renders an editable TextField with color swatch
|
|
81
120
|
* @param {string} props.label - The label displayed above the color value
|
|
82
121
|
* @param {string} props.name - The name associated with the color field, used as a key
|
|
83
122
|
* @param {string} props.value - The currently selected color value; can be a hex string or CSS variable
|
|
84
123
|
* @param {function} props.onChange - Callback function that receives the new color value when changed
|
|
85
124
|
* @param {number} [props.zIndexOverride] - Optional z-index value to override the default popover z-index
|
|
86
125
|
* @param {string[]} [props.presetColors=[]] - Optional array of preset colors shown in the picker
|
|
126
|
+
* @param {string} [props.placeholder] - Placeholder text (textfield variant only)
|
|
127
|
+
* @param {string} [props.helpText] - Help text below the field (textfield variant only)
|
|
128
|
+
* @param {string} [props.error] - Error message (textfield variant only)
|
|
129
|
+
* @param {boolean} [props.disabled] - Whether the field is disabled (textfield variant only)
|
|
87
130
|
*
|
|
88
131
|
* @returns {JSX.Element} A color picker field with label and current value preview
|
|
89
|
-
*/ var
|
|
90
|
-
|
|
91
|
-
|
|
132
|
+
*/ var colorContainer = tv({
|
|
133
|
+
base: "Litho-ColorField relative flex items-center gap-2 cursor-pointer px-1 py-1 rounded-md w-full-plus-2 -left-1",
|
|
134
|
+
variants: {
|
|
135
|
+
hoverable: {
|
|
136
|
+
true: "hover"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
var colorCell = tv({
|
|
141
|
+
base: "w-8 h-8 min-w-8 min-h-8 rounded-md border border-tint-5"
|
|
142
|
+
});
|
|
143
|
+
var ColorField = function(param) {
|
|
144
|
+
var label = param.label, name = param.name, _value = param.value, onChange = param.onChange, zIndexOverride = param.zIndexOverride, _param_presetColors = param.presetColors, presetColors = _param_presetColors === void 0 ? [] : _param_presetColors, _param_variant = param.variant, variant = _param_variant === void 0 ? "default" : _param_variant, placeholder = param.placeholder, helpText = param.helpText, error = param.error, disabled = param.disabled;
|
|
145
|
+
var value = (_value === null || _value === void 0 ? void 0 : _value.startsWith("var(--")) ? getComputedStyle(document.documentElement).getPropertyValue(_value.replace("var(", "").replace(")", "")).trim() : _value;
|
|
146
|
+
var containerRef = useRef(null);
|
|
92
147
|
var _useState = _sliced_to_array(useState(false), 2), displayColorPicker = _useState[0], setDisplayColorPicker = _useState[1];
|
|
148
|
+
var _useState1 = _sliced_to_array(useState({
|
|
149
|
+
top: 0,
|
|
150
|
+
left: 0
|
|
151
|
+
}), 2), popoverPosition = _useState1[0], setPopoverPosition = _useState1[1];
|
|
93
152
|
var toggleDisplayColorPicker = function() {
|
|
94
|
-
|
|
153
|
+
if (!displayColorPicker && containerRef.current) {
|
|
154
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
155
|
+
setPopoverPosition({
|
|
156
|
+
top: rect.top,
|
|
157
|
+
left: rect.left
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
setDisplayColorPicker(!displayColorPicker);
|
|
95
161
|
};
|
|
162
|
+
var colorPickerPopover = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
163
|
+
children: [
|
|
164
|
+
displayColorPicker && /*#__PURE__*/ _jsx("div", {
|
|
165
|
+
className: "Litho-ColorField__Activator fixed inset-0",
|
|
166
|
+
onClick: toggleDisplayColorPicker
|
|
167
|
+
}),
|
|
168
|
+
displayColorPicker && /*#__PURE__*/ _jsx("div", {
|
|
169
|
+
className: "Litho-ColorField__Popover fixed",
|
|
170
|
+
style: _object_spread({
|
|
171
|
+
top: popoverPosition.top,
|
|
172
|
+
left: popoverPosition.left
|
|
173
|
+
}, zIndexOverride ? {
|
|
174
|
+
zIndex: zIndexOverride
|
|
175
|
+
} : {}),
|
|
176
|
+
children: /*#__PURE__*/ _jsx(Sketch, {
|
|
177
|
+
color: value,
|
|
178
|
+
onChange: function(param) {
|
|
179
|
+
var hex = param.hex;
|
|
180
|
+
return onChange(hex);
|
|
181
|
+
},
|
|
182
|
+
disableAlpha: true,
|
|
183
|
+
presetColors: presetColors
|
|
184
|
+
}, name)
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
});
|
|
188
|
+
if (variant === "textfield") {
|
|
189
|
+
var openPicker = function() {
|
|
190
|
+
if (!displayColorPicker && containerRef.current) {
|
|
191
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
192
|
+
setPopoverPosition({
|
|
193
|
+
top: rect.bottom + 4,
|
|
194
|
+
left: rect.left
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
setDisplayColorPicker(true);
|
|
198
|
+
};
|
|
199
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
200
|
+
ref: containerRef,
|
|
201
|
+
className: "Litho-ColorField",
|
|
202
|
+
children: [
|
|
203
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
204
|
+
label: label,
|
|
205
|
+
name: name,
|
|
206
|
+
value: value ? value.toUpperCase() : "",
|
|
207
|
+
onChange: onChange,
|
|
208
|
+
onFocus: openPicker,
|
|
209
|
+
placeholder: placeholder,
|
|
210
|
+
helpText: helpText,
|
|
211
|
+
error: error,
|
|
212
|
+
disabled: disabled,
|
|
213
|
+
suffix: /*#__PURE__*/ _jsx("span", {
|
|
214
|
+
className: "relative left-1.5 block w-5 h-5 rounded border border-tint-5 cursor-pointer pointer-events-auto",
|
|
215
|
+
style: {
|
|
216
|
+
backgroundColor: value
|
|
217
|
+
},
|
|
218
|
+
onClick: function(e) {
|
|
219
|
+
e.stopPropagation();
|
|
220
|
+
toggleDisplayColorPicker();
|
|
221
|
+
},
|
|
222
|
+
role: "button",
|
|
223
|
+
tabIndex: 0,
|
|
224
|
+
"aria-label": "Open color picker",
|
|
225
|
+
onKeyDown: function(e) {
|
|
226
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
e.stopPropagation();
|
|
229
|
+
toggleDisplayColorPicker();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
}),
|
|
234
|
+
colorPickerPopover
|
|
235
|
+
]
|
|
236
|
+
});
|
|
237
|
+
}
|
|
96
238
|
return /*#__PURE__*/ _jsxs("div", {
|
|
239
|
+
ref: containerRef,
|
|
97
240
|
className: colorContainer({
|
|
98
241
|
hoverable: true
|
|
99
242
|
}),
|
|
@@ -124,25 +267,7 @@ var colorCell = tv({
|
|
|
124
267
|
})
|
|
125
268
|
]
|
|
126
269
|
}),
|
|
127
|
-
|
|
128
|
-
className: "Litho-ColorField__Activator fixed inset-0",
|
|
129
|
-
onClick: toggleDisplayColorPicker
|
|
130
|
-
}),
|
|
131
|
-
displayColorPicker && /*#__PURE__*/ _jsx("div", {
|
|
132
|
-
className: "Litho-ColorField__Popover absolute z-10 left-0 top-0",
|
|
133
|
-
style: zIndexOverride ? {
|
|
134
|
-
zIndex: zIndexOverride
|
|
135
|
-
} : {},
|
|
136
|
-
children: /*#__PURE__*/ _jsx(Sketch, {
|
|
137
|
-
color: value,
|
|
138
|
-
onChange: function(param) {
|
|
139
|
-
var hex = param.hex;
|
|
140
|
-
return onChange(hex);
|
|
141
|
-
},
|
|
142
|
-
disableAlpha: true,
|
|
143
|
-
presetColors: presetColors
|
|
144
|
-
}, name)
|
|
145
|
-
})
|
|
270
|
+
colorPickerPopover
|
|
146
271
|
]
|
|
147
272
|
});
|
|
148
273
|
};
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
import { useContext, useEffect } from "react";
|
|
3
3
|
import { FormContext } from "./AppProvider.js";
|
|
4
4
|
/**
|
|
5
|
-
* ContextualSaveBar
|
|
5
|
+
* @component ContextualSaveBar
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* @description A floating save bar that appears when a form has unsaved changes, providing save and discard actions.
|
|
8
|
+
*
|
|
9
|
+
* @usage
|
|
10
|
+
* - DO: Display at the top of a page when a form has unsaved changes with save/discard actions.
|
|
11
|
+
* - DON'T: Use inside a modal (use modal's own actions).
|
|
12
|
+
*
|
|
13
|
+
* @accessibility
|
|
14
|
+
* - Save bar should be keyboard accessible; ensure save and discard buttons have clear labels.
|
|
15
|
+
*
|
|
16
|
+
* @alternative
|
|
17
|
+
* - If you need a save bar integrated with the Frame layout, use `FrameSaveBar`.
|
|
18
|
+
* - If you need form-level submit, use `Form`.
|
|
11
19
|
*
|
|
12
|
-
* @component
|
|
13
20
|
* @param {Object} props - Component properties.
|
|
14
21
|
* @param {Object} [props.saveAction] - The action for the "Save" button. Contains `onAction`, `loading`, `accessibilityLabel`, and `disabled`.
|
|
15
22
|
* @param {Object} [props.discardAction] - The action for the "Discard" button. Contains `onAction`, `loading`, `accessibilityLabel`, and `disabled`.
|
|
@@ -127,7 +127,52 @@ import TimePicker from "./TimePicker.js";
|
|
|
127
127
|
import { CalendarMinor, CalendarTimeMinor, ChevronLeftMinor, ChevronRightMinor } from "@shopify/polaris-icons";
|
|
128
128
|
import { enUS } from "date-fns/locale";
|
|
129
129
|
import { NOW_TODAY, DAY_FORMAT, DAY_TIME_FORMAT, TIME_FORMAT, MONTHS, RANGE_PRESETS, HOURLY_RANGE_PRESETS, DATE_LOCALE_MAP, isValidDate } from "../utilities/dates.js";
|
|
130
|
-
|
|
130
|
+
/**
|
|
131
|
+
* @component DatePicker
|
|
132
|
+
*
|
|
133
|
+
* @description A date selection input with calendar popup, powered by react-datepicker, supporting single date and date range selection.
|
|
134
|
+
*
|
|
135
|
+
* @usage
|
|
136
|
+
* - DO: Use for selecting dates with a visual calendar interface.
|
|
137
|
+
* - DON'T: Use for time-only selection (use TimePicker).
|
|
138
|
+
*
|
|
139
|
+
* @accessibility
|
|
140
|
+
* - Supports keyboard navigation within the calendar; ensure the input has a descriptive label.
|
|
141
|
+
*
|
|
142
|
+
* @alternative
|
|
143
|
+
* - If you need time selection, use `TimePicker`. If you need a plain text date input, use `TextField` with date validation.
|
|
144
|
+
*
|
|
145
|
+
* @param {Object} props - Component properties.
|
|
146
|
+
* @param {string} [props.label] - Label for the DatePicker.
|
|
147
|
+
* @param {Object|null} [props.labelAction] - Action button for the label.
|
|
148
|
+
* @param {function} [props.onBlur] - Callback function for when the field loses focus.
|
|
149
|
+
* @param {string} [props.placeholder="Select date..."] - Placeholder text.
|
|
150
|
+
* @param {string} [props.displayFormat] - Date format for displaying the value.
|
|
151
|
+
* @param {string} [props.helpText] - Help text displayed under the field.
|
|
152
|
+
* @param {JSX.Element|null} [props.suffix=null] - Icon or text displayed at the end of the input.
|
|
153
|
+
* @param {boolean} [props.isClearable=false] - Whether the input can be cleared.
|
|
154
|
+
* @param {string|null} [props.tooltip] - Tooltip text for the field.
|
|
155
|
+
* @param {string} [props.locale="en-US"] - Locale used for formatting.
|
|
156
|
+
* @param {Object|string|Date|null} [props.value] - Current value of the DatePicker.
|
|
157
|
+
* @param {boolean} [props.allowRange=false] - Whether date range selection is enabled.
|
|
158
|
+
* @param {JSX.Element|null} [props.activator] - Custom activator for the popover.
|
|
159
|
+
* @param {Date|string|null} [props.disableDatesAfter] - Dates after this value are disabled.
|
|
160
|
+
* @param {Date|string|null} [props.disableDatesBefore] - Dates before this value are disabled.
|
|
161
|
+
* @param {function} [props.onChange] - Callback function called when the date changes.
|
|
162
|
+
* @param {boolean} [props.multiMonth=false] - Whether multiple months are shown.
|
|
163
|
+
* @param {boolean} [props.disabled=false] - Whether the DatePicker is disabled.
|
|
164
|
+
* @param {boolean} [props.showTimePicker=false] - Whether a time picker is displayed.
|
|
165
|
+
* @param {boolean} [props.autoFocus=false] - Whether the input is focused automatically.
|
|
166
|
+
* @param {Date|null} [props.maxDate] - Maximum selectable date.
|
|
167
|
+
* @param {Date|null} [props.minDate] - Minimum selectable date.
|
|
168
|
+
* @param {boolean} [props.inline=false] - Whether the calendar is displayed inline.
|
|
169
|
+
* @param {string} [props.preferredAlignment="left"] - Alignment of the popover.
|
|
170
|
+
* @param {string} [props.preferredPosition="below"] - Position of the popover.
|
|
171
|
+
* @param {boolean} [props.includeHourlyPresets=false] - Whether hourly (last 30 minutes, last hour) presets are included.
|
|
172
|
+
* @param {Array} [props.customPresets=[]] - Custom presets to include.
|
|
173
|
+
* @param {JSX.Element|null} [props.footer] - An optional footer component to display at the bottom of the DatePicker.
|
|
174
|
+
* @returns {JSX.Element} The rendered DatePicker component.
|
|
175
|
+
*/ var calendarStyles = tv({
|
|
131
176
|
base: "Litho-DatePicker__Calendar relative"
|
|
132
177
|
});
|
|
133
178
|
var dayStyles = tv({
|
|
@@ -227,8 +272,7 @@ var getDateRange = function(param) {
|
|
|
227
272
|
var start = dayjs(startDate);
|
|
228
273
|
var end = dayjs(endDate);
|
|
229
274
|
return _to_consumable_array(RANGE_PRESETS).concat(_to_consumable_array(HOURLY_RANGE_PRESETS)).find(function(preset) {
|
|
230
|
-
|
|
231
|
-
return start.isSame(presetStart, "day") && end.isSame(presetEnd, "day") && dateRange === preset.id;
|
|
275
|
+
return dateRange === preset.id;
|
|
232
276
|
}) || {
|
|
233
277
|
id: "custom",
|
|
234
278
|
value: {
|
|
@@ -237,40 +281,7 @@ var getDateRange = function(param) {
|
|
|
237
281
|
}
|
|
238
282
|
};
|
|
239
283
|
};
|
|
240
|
-
|
|
241
|
-
* DatePicker component for selecting dates and date ranges.
|
|
242
|
-
*
|
|
243
|
-
* @param {Object} props - Component properties.
|
|
244
|
-
* @param {string} [props.label] - Label for the DatePicker.
|
|
245
|
-
* @param {Object|null} [props.labelAction] - Action button for the label.
|
|
246
|
-
* @param {function} [props.onBlur] - Callback function for when the field loses focus.
|
|
247
|
-
* @param {string} [props.placeholder="Select date..."] - Placeholder text.
|
|
248
|
-
* @param {string} [props.displayFormat] - Date format for displaying the value.
|
|
249
|
-
* @param {string} [props.helpText] - Help text displayed under the field.
|
|
250
|
-
* @param {JSX.Element|null} [props.suffix=null] - Icon or text displayed at the end of the input.
|
|
251
|
-
* @param {boolean} [props.isClearable=false] - Whether the input can be cleared.
|
|
252
|
-
* @param {string|null} [props.tooltip] - Tooltip text for the field.
|
|
253
|
-
* @param {string} [props.locale="en-US"] - Locale used for formatting.
|
|
254
|
-
* @param {Object|string|Date|null} [props.value] - Current value of the DatePicker.
|
|
255
|
-
* @param {boolean} [props.allowRange=false] - Whether date range selection is enabled.
|
|
256
|
-
* @param {JSX.Element|null} [props.activator] - Custom activator for the popover.
|
|
257
|
-
* @param {Date|string|null} [props.disableDatesAfter] - Dates after this value are disabled.
|
|
258
|
-
* @param {Date|string|null} [props.disableDatesBefore] - Dates before this value are disabled.
|
|
259
|
-
* @param {function} [props.onChange] - Callback function called when the date changes.
|
|
260
|
-
* @param {boolean} [props.multiMonth=false] - Whether multiple months are shown.
|
|
261
|
-
* @param {boolean} [props.disabled=false] - Whether the DatePicker is disabled.
|
|
262
|
-
* @param {boolean} [props.showTimePicker=false] - Whether a time picker is displayed.
|
|
263
|
-
* @param {boolean} [props.autoFocus=false] - Whether the input is focused automatically.
|
|
264
|
-
* @param {Date|null} [props.maxDate] - Maximum selectable date.
|
|
265
|
-
* @param {Date|null} [props.minDate] - Minimum selectable date.
|
|
266
|
-
* @param {boolean} [props.inline=false] - Whether the calendar is displayed inline.
|
|
267
|
-
* @param {string} [props.preferredAlignment="left"] - Alignment of the popover.
|
|
268
|
-
* @param {string} [props.preferredPosition="below"] - Position of the popover.
|
|
269
|
-
* @param {boolean} [props.includeHourlyPresets=false] - Whether hourly (last 30 minutes, last hour) presets are included.
|
|
270
|
-
* @param {Array} [props.customPresets=[]] - Custom presets to include.
|
|
271
|
-
* @param {JSX.Element|null} [props.footer] - An optional footer component to display at the bottom of the DatePicker.
|
|
272
|
-
* @returns {JSX.Element} The rendered DatePicker component.
|
|
273
|
-
*/ function DatePicker() {
|
|
284
|
+
function DatePicker() {
|
|
274
285
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
275
286
|
var label = props.label, _props_labelAction = props.labelAction, labelAction = _props_labelAction === void 0 ? null : _props_labelAction, onBlur = props.onBlur, _props_placeholder = props.placeholder, placeholder = _props_placeholder === void 0 ? "Select date..." : _props_placeholder, _props_displayFormat = props.displayFormat, displayFormat = _props_displayFormat === void 0 ? props.showTimePicker && !props.allowRange ? DAY_TIME_FORMAT : DAY_FORMAT : _props_displayFormat, helpText = props.helpText, _props_suffix = props.suffix, suffix = _props_suffix === void 0 ? null : _props_suffix, isClearable = props.isClearable, tooltip = props.tooltip, tmp = props.locale, _locale = tmp === void 0 ? "en-US" : tmp, _value = props.value, _props_allowRange = props.allowRange, allowRange = _props_allowRange === void 0 ? false : _props_allowRange, activator = props.activator, disableDatesAfter = props.disableDatesAfter, disableDatesBefore = props.disableDatesBefore, onChange = props.onChange, multiMonth = props.multiMonth, disabled = props.disabled, showTimePicker = props.showTimePicker, autoFocus = props.autoFocus, _maxDate = props.maxDate, _minDate = props.minDate, _props_inline = props.inline, inline = _props_inline === void 0 ? false : _props_inline, _props_closeAfterDateSelection = props.closeAfterDateSelection, closeAfterDateSelection = _props_closeAfterDateSelection === void 0 ? true : _props_closeAfterDateSelection, _props_preferredAlignment = props.preferredAlignment, preferredAlignment = _props_preferredAlignment === void 0 ? "left" : _props_preferredAlignment, _props_preferredPosition = props.preferredPosition, preferredPosition = _props_preferredPosition === void 0 ? "below" : _props_preferredPosition, _props_includeHourlyPresets = props.includeHourlyPresets, includeHourlyPresets = _props_includeHourlyPresets === void 0 ? false : _props_includeHourlyPresets, _props_customPresets = props.customPresets, customPresets = _props_customPresets === void 0 ? [] : _props_customPresets, footer = props.footer;
|
|
276
287
|
var _useState = _sliced_to_array(useState(false), 2), showPopover = _useState[0], setShowPopover = _useState[1];
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @component Disclosure
|
|
5
|
+
*
|
|
6
|
+
* @description A styled container with a vertical border indicator, used to visually denote expandable or nested content sections.
|
|
7
|
+
*
|
|
8
|
+
* @usage
|
|
9
|
+
* - DO: Use to wrap expandable content sections with a consistent bordered container style.
|
|
10
|
+
* - DON'T: Use as a generic container; use `Box` or `Card` for non-disclosure content.
|
|
11
|
+
*
|
|
12
|
+
* @accessibility
|
|
13
|
+
* - Disclosure is a styled container only; the toggle mechanism must be implemented separately with proper `aria-expanded` attributes.
|
|
14
|
+
* - Pair with `Collapsible` for animated show/hide behavior with accessible state management.
|
|
15
|
+
*
|
|
16
|
+
* @alternative
|
|
17
|
+
* - If you need animated expand/collapse behavior, wrap content in `Collapsible` instead.
|
|
18
|
+
* - If you need a general-purpose container, use `Card` or `Box` instead.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} props - Component properties.
|
|
21
|
+
* @param {React.ReactNode} props.children - The content to display within the disclosure.
|
|
22
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the disclosure.
|
|
23
|
+
* @returns {JSX.Element} A styled `<div>` element serving as a disclosure container.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Renders disclosure content
|
|
27
|
+
* <Disclosure>
|
|
28
|
+
* <Text>This is disclosure content</Text>
|
|
29
|
+
* </Disclosure>
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Renders disclosure content with additional classes
|
|
33
|
+
* <Disclosure className="mt-4">
|
|
34
|
+
* <Text>This is disclosure content with margin</Text>
|
|
35
|
+
* </Disclosure>
|
|
36
|
+
*/ var styles = tv({
|
|
4
37
|
base: "Litho-Disclosure relative",
|
|
5
38
|
variants: {
|
|
6
39
|
flush: {
|
|
@@ -24,27 +57,7 @@ var borderStyles = tv({
|
|
|
24
57
|
flush: false
|
|
25
58
|
}
|
|
26
59
|
});
|
|
27
|
-
|
|
28
|
-
* Renders a Disclosure component that displays content with disclosure styling.
|
|
29
|
-
*
|
|
30
|
-
* @component
|
|
31
|
-
* @param {Object} props - Component properties.
|
|
32
|
-
* @param {React.ReactNode} props.children - The content to display within the disclosure.
|
|
33
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the disclosure.
|
|
34
|
-
* @returns {JSX.Element} A styled `<div>` element serving as a disclosure container.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* // Renders disclosure content
|
|
38
|
-
* <Disclosure>
|
|
39
|
-
* <Text>This is disclosure content</Text>
|
|
40
|
-
* </Disclosure>
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* // Renders disclosure content with additional classes
|
|
44
|
-
* <Disclosure className="mt-4">
|
|
45
|
-
* <Text>This is disclosure content with margin</Text>
|
|
46
|
-
* </Disclosure>
|
|
47
|
-
*/ function Disclosure() {
|
|
60
|
+
function Disclosure() {
|
|
48
61
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
49
62
|
var children = props.children, className = props.className, _props_flush = props.flush, flush = _props_flush === void 0 ? false : _props_flush;
|
|
50
63
|
var classes = styles({
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
|
|
4
|
-
base: "Litho-Divider h-px",
|
|
5
|
-
variants: {
|
|
6
|
-
color: {
|
|
7
|
-
default: "bg-edge-default",
|
|
8
|
-
subdued: "bg-edge-subdued"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
defaultVariants: {
|
|
12
|
-
color: "default"
|
|
13
|
-
}
|
|
14
|
-
});
|
|
3
|
+
import Text from "./Text.js";
|
|
15
4
|
/**
|
|
16
|
-
*
|
|
5
|
+
* @component Divider
|
|
6
|
+
*
|
|
7
|
+
* @description A visual separator that creates a horizontal line between content sections, with optional label text and color variants.
|
|
8
|
+
*
|
|
9
|
+
* @usage
|
|
10
|
+
* - DO: Use to visually separate sections of content within a page or card.
|
|
11
|
+
* - DON'T: Use as a decorative border; prefer CSS border utilities for non-semantic separation.
|
|
12
|
+
*
|
|
13
|
+
* @accessibility
|
|
14
|
+
* - Renders as a `<div>` with a visual line; does not convey semantic meaning to screen readers.
|
|
15
|
+
* - When using with a label, ensure the label text provides meaningful context for sighted users.
|
|
16
|
+
*
|
|
17
|
+
* @alternative
|
|
18
|
+
* - If you need spacing without a visible line, use `Stack` with gap instead.
|
|
17
19
|
*
|
|
18
|
-
* @component
|
|
19
20
|
* @param {Object} props - Component properties.
|
|
20
21
|
* @param {'default' | 'subdued'} [props.color='default'] - The color variant to apply to the divider.
|
|
22
|
+
* @param {string} [props.label] - Optional label to display in the divider.
|
|
23
|
+
* @param {'left' | 'center' | 'right'} [props.labelAlignment='center'] - The alignment of the label.
|
|
21
24
|
* @returns {JSX.Element} A styled `<div>` element serving as a divider.
|
|
22
25
|
*
|
|
23
26
|
* @example
|
|
@@ -27,15 +30,70 @@ var styles = tv({
|
|
|
27
30
|
* @example
|
|
28
31
|
* // Renders a subdued color divider
|
|
29
32
|
* <Divider color="subdued" />
|
|
30
|
-
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Renders a divider with a centered label
|
|
36
|
+
* <Divider label="Or continue with" />
|
|
37
|
+
*/ var styles = tv({
|
|
38
|
+
base: "Litho-Divider h-px",
|
|
39
|
+
variants: {
|
|
40
|
+
color: {
|
|
41
|
+
default: "bg-edge-default",
|
|
42
|
+
subdued: "bg-edge-subdued"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
color: "default",
|
|
47
|
+
labelAlignment: "center"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var containerStyles = tv({
|
|
51
|
+
base: "Litho-Divider flex items-center gap-3"
|
|
52
|
+
});
|
|
53
|
+
function Divider() {
|
|
31
54
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
32
|
-
var color = props.color;
|
|
33
|
-
var
|
|
55
|
+
var color = props.color, label = props.label, _props_labelAlignment = props.labelAlignment, labelAlignment = _props_labelAlignment === void 0 ? "center" : _props_labelAlignment, className = props.className;
|
|
56
|
+
var lineClasses = styles({
|
|
34
57
|
color: color
|
|
35
58
|
});
|
|
59
|
+
var containerClasses = containerStyles();
|
|
60
|
+
if (label) {
|
|
61
|
+
if (labelAlignment === "left") {
|
|
62
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
63
|
+
className: "".concat(containerClasses).concat(className ? " ".concat(className) : ""),
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
66
|
+
as: "span",
|
|
67
|
+
variant: "bodySm",
|
|
68
|
+
color: "subdued",
|
|
69
|
+
children: label
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ _jsx("div", {
|
|
72
|
+
className: "".concat(lineClasses, " flex-1")
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
78
|
+
className: "".concat(containerClasses).concat(className ? " ".concat(className) : ""),
|
|
79
|
+
children: [
|
|
80
|
+
/*#__PURE__*/ _jsx("div", {
|
|
81
|
+
className: "".concat(lineClasses, " flex-1")
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
84
|
+
as: "span",
|
|
85
|
+
variant: "bodySm",
|
|
86
|
+
color: "subdued",
|
|
87
|
+
children: label
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx("div", {
|
|
90
|
+
className: "".concat(lineClasses, " flex-1")
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
36
95
|
return /*#__PURE__*/ _jsx("div", {
|
|
37
|
-
className:
|
|
96
|
+
className: lineClasses
|
|
38
97
|
});
|
|
39
98
|
}
|
|
40
|
-
;
|
|
41
99
|
export default Divider;
|