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