@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
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
get default () {
|
|
9
14
|
return _default;
|
|
15
|
+
},
|
|
16
|
+
get useCard () {
|
|
17
|
+
return useCard;
|
|
10
18
|
}
|
|
11
19
|
});
|
|
12
20
|
var _jsxruntime = require("react/jsx-runtime");
|
|
@@ -18,15 +26,119 @@ var _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
|
18
26
|
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
19
27
|
var _Tooltip = /*#__PURE__*/ _interop_require_default(require("./Tooltip"));
|
|
20
28
|
var _Frame = require("./Frame");
|
|
29
|
+
var _Modal = require("./Modal");
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
21
43
|
function _interop_require_default(obj) {
|
|
22
44
|
return obj && obj.__esModule ? obj : {
|
|
23
45
|
default: obj
|
|
24
46
|
};
|
|
25
47
|
}
|
|
48
|
+
function _object_spread(target) {
|
|
49
|
+
for(var i = 1; i < arguments.length; i++){
|
|
50
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
51
|
+
var ownKeys = Object.keys(source);
|
|
52
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
53
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
54
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
ownKeys.forEach(function(key) {
|
|
58
|
+
_define_property(target, key, source[key]);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return target;
|
|
62
|
+
}
|
|
63
|
+
function ownKeys(object, enumerableOnly) {
|
|
64
|
+
var keys = Object.keys(object);
|
|
65
|
+
if (Object.getOwnPropertySymbols) {
|
|
66
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
67
|
+
if (enumerableOnly) {
|
|
68
|
+
symbols = symbols.filter(function(sym) {
|
|
69
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
keys.push.apply(keys, symbols);
|
|
73
|
+
}
|
|
74
|
+
return keys;
|
|
75
|
+
}
|
|
76
|
+
function _object_spread_props(target, source) {
|
|
77
|
+
source = source != null ? source : {};
|
|
78
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
79
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
80
|
+
} else {
|
|
81
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
82
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
26
87
|
function _type_of(obj) {
|
|
27
88
|
"@swc/helpers - typeof";
|
|
28
89
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
29
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* @component Card
|
|
93
|
+
*
|
|
94
|
+
* @description A bordered container component that groups related content into a visually distinct section with optional header, sections, and actions.
|
|
95
|
+
*
|
|
96
|
+
* @usage
|
|
97
|
+
* - DO: Group related content into a visually distinct, bordered container.
|
|
98
|
+
* - DON'T: Nest Cards inside other Cards.
|
|
99
|
+
*
|
|
100
|
+
* @accessibility
|
|
101
|
+
* - Card uses semantic grouping; ensure heading props render appropriate heading levels.
|
|
102
|
+
*
|
|
103
|
+
* @alternative
|
|
104
|
+
* - If you need a plain container without borders, use `Box`.
|
|
105
|
+
* - If you need a full-page layout, use `Layout`.
|
|
106
|
+
*
|
|
107
|
+
* @param {Object} props - Props for the Card component.
|
|
108
|
+
* @param {boolean} [props.allowOverflow=false] - Allows content to overflow the Card boundaries.
|
|
109
|
+
* @param {React.ReactNode} [props.children] - Child elements to render inside the Card.
|
|
110
|
+
* @param {boolean} [props.hideOnPrint] - Hides the Card when printing.
|
|
111
|
+
* @param {string|React.ReactNode} [props.title] - Title of the Card.
|
|
112
|
+
* @param {string} [props.titleVariant='headingMd'] - Typography variant for the Card title.
|
|
113
|
+
* @param {string} [props.description] - Description of the Card.
|
|
114
|
+
* @param {string} [props.descriptionVariant='bodyMd'] - Typography variant for the Card description.
|
|
115
|
+
* @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
|
|
116
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the title.
|
|
117
|
+
* @param {string} [props.tooltipPreferredPosition='above'] - Preferred position for the tooltip.
|
|
118
|
+
* @param {boolean} [props.outlined=false] - Applies outlined styling to the Card.
|
|
119
|
+
* @param {string} [props.shadow='default'] - Applies a shadow to the Card. Can be 'default', or 'none'.
|
|
120
|
+
* @param {boolean} [props.highlighted=false] - Applies highlighted styling to the Card.
|
|
121
|
+
* @param {boolean} [props.subdued=false] - Applies subdued styling to the Card.
|
|
122
|
+
* @param {boolean} [props.alternate=false] - Applies alternate styling to the Card.
|
|
123
|
+
* @param {boolean} [props.padded=false] - Adds padding to the Card body.
|
|
124
|
+
* @param {boolean} [props.loading=false] - Shows a loading spinner in place of the title.
|
|
125
|
+
* @param {boolean} [props.paddedHalf=false] - Adds half padding to the Card body.
|
|
126
|
+
* @param {boolean} [props.removeHeaderBottomPadding=false] - Removes bottom padding from the header.
|
|
127
|
+
* @param {Function} [props.onClick] - Click handler for the Card, making it clickable.
|
|
128
|
+
* @param {Object} [props.emptyState={}] - Configures the empty state of the Card.
|
|
129
|
+
* @param {Object} [props.action] - Action button or configuration to render in the Card header.
|
|
130
|
+
* @param {string} [props.className] - Additional classes to apply to the Card.
|
|
131
|
+
* @param {string} [props.headerClassName] - Additional classes to apply to the Card header.
|
|
132
|
+
* @param {React.ReactNode} [props.accessory] - Accessory element to render in the header.
|
|
133
|
+
* @param {boolean} [props.fullWidthOnMobile] - Makes the Card full width on mobile. Defaults to `true` for top-level cards, `false` for nested cards.
|
|
134
|
+
* @param {boolean} [props.roundedOnMobile] - Makes the Card rounded on mobile. Defaults to `false` for top-level cards, `true` for nested cards.
|
|
135
|
+
* @returns {React.ReactElement} The rendered Card component.
|
|
136
|
+
*/ var CardContext = /*#__PURE__*/ _react.default.createContext({
|
|
137
|
+
nested: false
|
|
138
|
+
});
|
|
139
|
+
var NESTED_CONTEXT = {
|
|
140
|
+
nested: true
|
|
141
|
+
};
|
|
30
142
|
var styles = (0, _tailwindvariants.tv)({
|
|
31
143
|
base: "Litho-Card relative",
|
|
32
144
|
variants: {
|
|
@@ -63,7 +175,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
63
175
|
false: ""
|
|
64
176
|
},
|
|
65
177
|
highlighted: {
|
|
66
|
-
true: "cursor-pointer
|
|
178
|
+
true: "cursor-pointer outline outline-form-border-focus",
|
|
67
179
|
false: ""
|
|
68
180
|
},
|
|
69
181
|
shadow: {
|
|
@@ -74,6 +186,10 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
74
186
|
embedded: {
|
|
75
187
|
true: "",
|
|
76
188
|
false: ""
|
|
189
|
+
},
|
|
190
|
+
nested: {
|
|
191
|
+
true: "",
|
|
192
|
+
false: ""
|
|
77
193
|
}
|
|
78
194
|
},
|
|
79
195
|
compoundVariants: [
|
|
@@ -97,7 +213,14 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
97
213
|
subdued: false,
|
|
98
214
|
alternate: false,
|
|
99
215
|
highlighted: true,
|
|
100
|
-
className: "bg-surface-
|
|
216
|
+
className: "bg-surface-selected hover:bg-surface-selected dark:border-t dark:border-tint-alt-2"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
nested: true,
|
|
220
|
+
subdued: false,
|
|
221
|
+
alternate: false,
|
|
222
|
+
highlighted: false,
|
|
223
|
+
className: "outline-edge-light @md:outline-edge-light"
|
|
101
224
|
}
|
|
102
225
|
],
|
|
103
226
|
defaultVariants: {
|
|
@@ -107,7 +230,8 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
107
230
|
outlined: false,
|
|
108
231
|
highlighted: false,
|
|
109
232
|
shadow: "default",
|
|
110
|
-
embedded: false
|
|
233
|
+
embedded: false,
|
|
234
|
+
nested: false
|
|
111
235
|
}
|
|
112
236
|
});
|
|
113
237
|
var headerStyles = (0, _tailwindvariants.tv)({
|
|
@@ -154,41 +278,14 @@ var bodyStyles = (0, _tailwindvariants.tv)({
|
|
|
154
278
|
}
|
|
155
279
|
]
|
|
156
280
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*
|
|
160
|
-
* @component
|
|
161
|
-
* @param {Object} props - Props for the Card component.
|
|
162
|
-
* @param {boolean} [props.allowOverflow=false] - Allows content to overflow the Card boundaries.
|
|
163
|
-
* @param {React.ReactNode} [props.children] - Child elements to render inside the Card.
|
|
164
|
-
* @param {boolean} [props.hideOnPrint] - Hides the Card when printing.
|
|
165
|
-
* @param {string|React.ReactNode} [props.title] - Title of the Card.
|
|
166
|
-
* @param {string} [props.titleVariant='headingMd'] - Typography variant for the Card title.
|
|
167
|
-
* @param {string} [props.description] - Description of the Card.
|
|
168
|
-
* @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
|
|
169
|
-
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the title.
|
|
170
|
-
* @param {string} [props.tooltipPreferredPosition='above'] - Preferred position for the tooltip.
|
|
171
|
-
* @param {boolean} [props.outlined=false] - Applies outlined styling to the Card.
|
|
172
|
-
* @param {string} [props.shadow='default'] - Applies a shadow to the Card. Can be 'default', or 'none'.
|
|
173
|
-
* @param {boolean} [props.highlighted=false] - Applies highlighted styling to the Card.
|
|
174
|
-
* @param {boolean} [props.subdued=false] - Applies subdued styling to the Card.
|
|
175
|
-
* @param {boolean} [props.alternate=false] - Applies alternate styling to the Card.
|
|
176
|
-
* @param {boolean} [props.padded=false] - Adds padding to the Card body.
|
|
177
|
-
* @param {boolean} [props.loading=false] - Shows a loading spinner in place of the title.
|
|
178
|
-
* @param {boolean} [props.paddedHalf=false] - Adds half padding to the Card body.
|
|
179
|
-
* @param {boolean} [props.removeHeaderBottomPadding=false] - Removes bottom padding from the header.
|
|
180
|
-
* @param {Function} [props.onClick] - Click handler for the Card, making it clickable.
|
|
181
|
-
* @param {Object} [props.emptyState={}] - Configures the empty state of the Card.
|
|
182
|
-
* @param {Object} [props.action] - Action button or configuration to render in the Card header.
|
|
183
|
-
* @param {string} [props.className] - Additional classes to apply to the Card.
|
|
184
|
-
* @param {string} [props.headerClassName] - Additional classes to apply to the Card header.
|
|
185
|
-
* @param {React.ReactNode} [props.accessory] - Accessory element to render in the header.
|
|
186
|
-
* @param {boolean} [props.fullWidthOnMobile=true] - Makes the Card full width on mobile.
|
|
187
|
-
* @param {boolean} [props.roundedOnMobile=false] - Makes the Card rounded on mobile.
|
|
188
|
-
* @returns {React.ReactElement} The rendered Card component.
|
|
189
|
-
*/ var Card = function(param) {
|
|
190
|
-
var _param_allowOverflow = param.allowOverflow, allowOverflow = _param_allowOverflow === void 0 ? false : _param_allowOverflow, _param_roundedOnMobile = param.roundedOnMobile, roundedOnMobile = _param_roundedOnMobile === void 0 ? false : _param_roundedOnMobile, children = param.children, hideOnPrint = param.hideOnPrint, title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingMd" : _param_titleVariant, description = param.description, icon = param.icon, tooltip = param.tooltip, _param_tooltipPreferredPosition = param.tooltipPreferredPosition, tooltipPreferredPosition = _param_tooltipPreferredPosition === void 0 ? "above" : _param_tooltipPreferredPosition, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? false : _param_outlined, _param_highlighted = param.highlighted, highlighted = _param_highlighted === void 0 ? false : _param_highlighted, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_alternate = param.alternate, alternate = _param_alternate === void 0 ? false : _param_alternate, _param_padded = param.padded, padded = _param_padded === void 0 ? false : _param_padded, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_removeHeaderBottomPadding = param.removeHeaderBottomPadding, removeHeaderBottomPadding = _param_removeHeaderBottomPadding === void 0 ? false : _param_removeHeaderBottomPadding, onClick = param.onClick, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, action = param.action, className = param.className, headerClassName = param.headerClassName, accessory = param.accessory, _param_fullHeightBody = param.fullHeightBody, fullHeightBody = _param_fullHeightBody === void 0 ? false : _param_fullHeightBody, _param_fullWidthOnMobile = param.fullWidthOnMobile, fullWidthOnMobile = _param_fullWidthOnMobile === void 0 ? true : _param_fullWidthOnMobile, _param_shadow = param.shadow, shadow = _param_shadow === void 0 ? "default" : _param_shadow;
|
|
281
|
+
var Card = function(param) {
|
|
282
|
+
var _param_allowOverflow = param.allowOverflow, allowOverflow = _param_allowOverflow === void 0 ? false : _param_allowOverflow, roundedOnMobile = param.roundedOnMobile, children = param.children, hideOnPrint = param.hideOnPrint, title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingMd" : _param_titleVariant, description = param.description, _param_descriptionVariant = param.descriptionVariant, descriptionVariant = _param_descriptionVariant === void 0 ? "bodyMd" : _param_descriptionVariant, icon = param.icon, tooltip = param.tooltip, _param_tooltipPreferredPosition = param.tooltipPreferredPosition, tooltipPreferredPosition = _param_tooltipPreferredPosition === void 0 ? "above" : _param_tooltipPreferredPosition, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? false : _param_outlined, _param_highlighted = param.highlighted, highlighted = _param_highlighted === void 0 ? false : _param_highlighted, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_alternate = param.alternate, alternate = _param_alternate === void 0 ? false : _param_alternate, _param_padded = param.padded, padded = _param_padded === void 0 ? false : _param_padded, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_removeHeaderBottomPadding = param.removeHeaderBottomPadding, removeHeaderBottomPadding = _param_removeHeaderBottomPadding === void 0 ? false : _param_removeHeaderBottomPadding, onClick = param.onClick, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, action = param.action, className = param.className, headerClassName = param.headerClassName, accessory = param.accessory, _param_fullHeightBody = param.fullHeightBody, fullHeightBody = _param_fullHeightBody === void 0 ? false : _param_fullHeightBody, fullWidthOnMobile = param.fullWidthOnMobile, _param_shadow = param.shadow, shadow = _param_shadow === void 0 ? "default" : _param_shadow, nestedProp = param.nested;
|
|
191
283
|
var embedded = (0, _Frame.useFrame)().embedded;
|
|
284
|
+
var _React_useContext = _react.default.useContext(CardContext), cardNested = _React_useContext.nested;
|
|
285
|
+
var isInModal = _react.default.useContext(_Modal.ModalContext);
|
|
286
|
+
var nested = nestedProp !== null && nestedProp !== void 0 ? nestedProp : cardNested || isInModal;
|
|
287
|
+
var resolvedFullWidthOnMobile = fullWidthOnMobile !== null && fullWidthOnMobile !== void 0 ? fullWidthOnMobile : nested ? false : true;
|
|
288
|
+
var resolvedRoundedOnMobile = roundedOnMobile !== null && roundedOnMobile !== void 0 ? roundedOnMobile : nested ? true : false;
|
|
192
289
|
var showHeader = !!(title || action);
|
|
193
290
|
var isClickable = !!onClick;
|
|
194
291
|
var classes = styles({
|
|
@@ -197,12 +294,13 @@ var bodyStyles = (0, _tailwindvariants.tv)({
|
|
|
197
294
|
alternate: alternate,
|
|
198
295
|
allowOverflow: allowOverflow,
|
|
199
296
|
isClickable: isClickable,
|
|
200
|
-
fullWidthOnMobile:
|
|
201
|
-
roundedOnMobile:
|
|
297
|
+
fullWidthOnMobile: resolvedFullWidthOnMobile,
|
|
298
|
+
roundedOnMobile: resolvedRoundedOnMobile,
|
|
202
299
|
outlined: outlined,
|
|
203
|
-
shadow: shadow,
|
|
300
|
+
shadow: nested ? "none" : shadow,
|
|
204
301
|
highlighted: highlighted,
|
|
205
|
-
embedded: embedded
|
|
302
|
+
embedded: embedded,
|
|
303
|
+
nested: nested
|
|
206
304
|
});
|
|
207
305
|
var headerClasses = headerStyles({
|
|
208
306
|
padded: padded,
|
|
@@ -232,89 +330,103 @@ var bodyStyles = (0, _tailwindvariants.tv)({
|
|
|
232
330
|
}
|
|
233
331
|
return _react.default.Children.toArray(children).map(process);
|
|
234
332
|
};
|
|
235
|
-
return /*#__PURE__*/ (0, _jsxruntime.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
|
|
333
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(CardContext.Provider, {
|
|
334
|
+
value: NESTED_CONTEXT,
|
|
335
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
336
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
337
|
+
onClick: isClickable ? onClick : undefined
|
|
338
|
+
}, isClickable ? {
|
|
339
|
+
role: "button",
|
|
340
|
+
tabIndex: 0,
|
|
341
|
+
onKeyDown: function(e) {
|
|
342
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
343
|
+
e.preventDefault();
|
|
344
|
+
onClick();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} : {}), {
|
|
348
|
+
children: [
|
|
349
|
+
showHeader && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
350
|
+
className: "".concat(headerClasses).concat(headerClassName ? " ".concat(headerClassName) : ""),
|
|
351
|
+
children: [
|
|
352
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
353
|
+
className: "w-full flex gap-2 justify-between items-center",
|
|
354
|
+
children: [
|
|
355
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
356
|
+
className: "Litho-Card__HeaderTitle flex items-center gap-2",
|
|
357
|
+
children: [
|
|
358
|
+
loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
359
|
+
size: "small"
|
|
360
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
361
|
+
children: [
|
|
362
|
+
icon && typeof icon === "function" && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
363
|
+
source: icon,
|
|
364
|
+
color: "subdued"
|
|
365
|
+
}),
|
|
366
|
+
icon && (typeof icon === "undefined" ? "undefined" : _type_of(icon)) === "object" && icon
|
|
367
|
+
]
|
|
368
|
+
}),
|
|
369
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
370
|
+
children: [
|
|
371
|
+
title && typeof title === "string" ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
372
|
+
variant: titleVariant,
|
|
373
|
+
children: title
|
|
374
|
+
}) : title,
|
|
375
|
+
description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
376
|
+
color: "subdued",
|
|
377
|
+
variant: descriptionVariant,
|
|
378
|
+
children: description
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
}),
|
|
382
|
+
tooltip && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Tooltip.default, {
|
|
383
|
+
content: tooltip,
|
|
384
|
+
preferredPosition: tooltipPreferredPosition
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
}),
|
|
388
|
+
action && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
389
|
+
className: "Litho-Card__HeaderAction self-start",
|
|
390
|
+
children: action.content ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
391
|
+
link: true,
|
|
392
|
+
onClick: action.onAction || action.onClick,
|
|
393
|
+
primary: action.primary,
|
|
394
|
+
destructive: action.destructive,
|
|
395
|
+
icon: action.icon,
|
|
396
|
+
loading: action.loading,
|
|
397
|
+
disabled: action.disabled,
|
|
398
|
+
connectedDisclosure: action.connectedDisclosure,
|
|
399
|
+
children: action.content
|
|
400
|
+
}) : action
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
}),
|
|
404
|
+
accessory && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
405
|
+
className: "Litho-Card__HeaderAccessory pr-2",
|
|
406
|
+
children: accessory
|
|
407
|
+
})
|
|
408
|
+
]
|
|
409
|
+
}),
|
|
410
|
+
emptyState.showIf ? /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
411
|
+
className: bodyStyles({
|
|
412
|
+
padding: "full",
|
|
413
|
+
showHeader: showHeader,
|
|
414
|
+
fullHeight: fullHeightBody
|
|
292
415
|
}),
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
children:
|
|
416
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
417
|
+
color: "subdued",
|
|
418
|
+
children: emptyState.text
|
|
296
419
|
})
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}),
|
|
305
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
306
|
-
color: "subdued",
|
|
307
|
-
children: emptyState.text
|
|
420
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
421
|
+
className: bodyStyles({
|
|
422
|
+
padding: padded ? "full" : paddedHalf ? "half" : "none",
|
|
423
|
+
showHeader: showHeader,
|
|
424
|
+
fullHeight: fullHeightBody
|
|
425
|
+
}),
|
|
426
|
+
children: processCardChildren(children)
|
|
308
427
|
})
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
padding: padded ? "full" : paddedHalf ? "half" : "none",
|
|
312
|
-
showHeader: showHeader,
|
|
313
|
-
fullHeight: fullHeightBody
|
|
314
|
-
}),
|
|
315
|
-
children: processCardChildren(children)
|
|
316
|
-
})
|
|
317
|
-
]
|
|
428
|
+
]
|
|
429
|
+
}))
|
|
318
430
|
});
|
|
319
431
|
};
|
|
320
432
|
var sectionStyles = (0, _tailwindvariants.tv)({
|
|
@@ -404,9 +516,12 @@ var sectionBodyStyles = (0, _tailwindvariants.tv)({
|
|
|
404
516
|
]
|
|
405
517
|
});
|
|
406
518
|
/**
|
|
407
|
-
*
|
|
519
|
+
* @component Card.Section
|
|
520
|
+
*
|
|
521
|
+
* @usage
|
|
522
|
+
* - DO: Divide a Card into logical content segments.
|
|
523
|
+
* - DON'T: Nest sections within sections.
|
|
408
524
|
*
|
|
409
|
-
* @component
|
|
410
525
|
* @param {Object} props - Props for the Section component.
|
|
411
526
|
* @param {string|React.ReactNode} [props.title] - Title of the Section.
|
|
412
527
|
* @param {string} [props.titleVariant='headingSm'] - Typography variant for the Section title.
|
|
@@ -424,12 +539,13 @@ var sectionBodyStyles = (0, _tailwindvariants.tv)({
|
|
|
424
539
|
* @param {React.ElementType|Object} [props.icon] - Icon to render alongside the title.
|
|
425
540
|
* @param {string} [props.tooltip] - Tooltip content for the title.
|
|
426
541
|
* @param {string} [props.description] - Description text for the Section.
|
|
542
|
+
* @param {string} [props.descriptionVariant='bodyMd'] - Typography variant for the Section description.
|
|
427
543
|
* @param {React.ReactNode} [props.accessory] - Accessory element to render in the Section header.
|
|
428
544
|
* @param {Object} [props.emptyState={}] - Configures the empty state of the Section.
|
|
429
545
|
*
|
|
430
546
|
* @returns {React.ReactElement} The rendered Section component.
|
|
431
547
|
*/ Card.Section = function(param) {
|
|
432
|
-
var title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingSm" : _param_titleVariant, action = param.action, children = param.children, _param_padded = param.padded, padded = _param_padded === void 0 ? true : _param_padded, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_isFirst = param.isFirst, isFirst = _param_isFirst === void 0 ? false : _param_isFirst, _param_cardHasHeader = param.cardHasHeader, cardHasHeader = _param_cardHasHeader === void 0 ? false : _param_cardHasHeader, _param_borderBottom = param.borderBottom, borderBottom = _param_borderBottom === void 0 ? true : _param_borderBottom, _param_borderTop = param.borderTop, borderTop = _param_borderTop === void 0 ? false : _param_borderTop, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_headerGap = param.headerGap, headerGap = _param_headerGap === void 0 ? "0" : _param_headerGap, _param_gap = param.gap, gap = _param_gap === void 0 ? "0" : _param_gap, icon = param.icon, tooltip = param.tooltip, description = param.description, accessory = param.accessory, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, className = param.className, sectionBodyClassName = param.sectionBodyClassName;
|
|
548
|
+
var title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingSm" : _param_titleVariant, action = param.action, children = param.children, _param_padded = param.padded, padded = _param_padded === void 0 ? true : _param_padded, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_isFirst = param.isFirst, isFirst = _param_isFirst === void 0 ? false : _param_isFirst, _param_cardHasHeader = param.cardHasHeader, cardHasHeader = _param_cardHasHeader === void 0 ? false : _param_cardHasHeader, _param_borderBottom = param.borderBottom, borderBottom = _param_borderBottom === void 0 ? true : _param_borderBottom, _param_borderTop = param.borderTop, borderTop = _param_borderTop === void 0 ? false : _param_borderTop, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_headerGap = param.headerGap, headerGap = _param_headerGap === void 0 ? "0" : _param_headerGap, _param_gap = param.gap, gap = _param_gap === void 0 ? "0" : _param_gap, icon = param.icon, tooltip = param.tooltip, description = param.description, _param_descriptionVariant = param.descriptionVariant, descriptionVariant = _param_descriptionVariant === void 0 ? "bodyMd" : _param_descriptionVariant, accessory = param.accessory, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, className = param.className, sectionBodyClassName = param.sectionBodyClassName;
|
|
433
549
|
var showHeader = !!(title || action);
|
|
434
550
|
var sectionClasses = sectionStyles({
|
|
435
551
|
borderBottom: borderBottom,
|
|
@@ -439,7 +555,7 @@ var sectionBodyStyles = (0, _tailwindvariants.tv)({
|
|
|
439
555
|
});
|
|
440
556
|
var sectionHeaderClasses = sectionHeaderStyles();
|
|
441
557
|
var sectionBodyClasses = sectionBodyStyles({
|
|
442
|
-
padding: paddedHalf ? "half" : padded ? "full" : "none",
|
|
558
|
+
padding: paddedHalf || padded === "half" ? "half" : padded ? "full" : "none",
|
|
443
559
|
showHeader: showHeader,
|
|
444
560
|
cardHasHeader: cardHasHeader,
|
|
445
561
|
isFirst: isFirst,
|
|
@@ -494,6 +610,7 @@ var sectionBodyStyles = (0, _tailwindvariants.tv)({
|
|
|
494
610
|
}),
|
|
495
611
|
description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
496
612
|
color: "subdued",
|
|
613
|
+
variant: descriptionVariant,
|
|
497
614
|
children: description
|
|
498
615
|
})
|
|
499
616
|
]
|
|
@@ -516,17 +633,28 @@ var sectionBodyStyles = (0, _tailwindvariants.tv)({
|
|
|
516
633
|
};
|
|
517
634
|
Card.Section.displayName = "Card.Section";
|
|
518
635
|
var clickableRowStyles = (0, _tailwindvariants.tv)({
|
|
519
|
-
base: "Litho-Card__Row py-1.5 px-2
|
|
636
|
+
base: "Litho-Card__Row py-1.5 px-2 @md:px-2.5 rounded-md",
|
|
520
637
|
variants: {
|
|
638
|
+
interactive: {
|
|
639
|
+
true: "cursor-pointer hover:bg-tint-2 active:bg-tint-3"
|
|
640
|
+
},
|
|
521
641
|
disabled: {
|
|
522
642
|
true: "opacity-50 cursor-not-allowed pointer-events-none"
|
|
523
643
|
}
|
|
644
|
+
},
|
|
645
|
+
defaultVariants: {
|
|
646
|
+
interactive: true
|
|
524
647
|
}
|
|
525
648
|
});
|
|
526
649
|
/**
|
|
527
|
-
*
|
|
650
|
+
* @component Card.ClickableRow
|
|
651
|
+
*
|
|
652
|
+
* @usage
|
|
653
|
+
* - DO: Use for rows that navigate or trigger actions.
|
|
654
|
+
*
|
|
655
|
+
* @accessibility
|
|
656
|
+
* - Renders as a clickable element; ensure it is keyboard accessible and has a clear action label.
|
|
528
657
|
*
|
|
529
|
-
* @component
|
|
530
658
|
* @param {Object} props - Props for the ClickableRow component.
|
|
531
659
|
* @param {React.ReactNode} [props.children] - Child elements to render inside the row.
|
|
532
660
|
* @param {Function} [props.onClick] - Click handler for the row.
|
|
@@ -534,24 +662,43 @@ var clickableRowStyles = (0, _tailwindvariants.tv)({
|
|
|
534
662
|
* @param {string} [props.url] - URL to open when the row is clicked.
|
|
535
663
|
* @param {string} [props.className] - Additional classes to apply to the row.
|
|
536
664
|
* @param {boolean} [props.disabled=false] - Disables interaction with the row.
|
|
665
|
+
* @param {string} [props.accessibilityLabel] - Accessible label for the row (aria-label).
|
|
537
666
|
*
|
|
538
667
|
* @returns {React.ReactElement} The rendered ClickableRow component.
|
|
539
668
|
*/ Card.ClickableRow = function(param) {
|
|
540
|
-
var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className;
|
|
669
|
+
var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className, accessibilityLabel = param.accessibilityLabel;
|
|
541
670
|
var classes = clickableRowStyles({
|
|
542
671
|
disabled: disabled
|
|
543
672
|
});
|
|
673
|
+
var handleClick = url ? function() {
|
|
674
|
+
return window.open(url, "_blank");
|
|
675
|
+
} : onClick;
|
|
676
|
+
var handleKeyDown = function(e) {
|
|
677
|
+
if (disabled) return;
|
|
678
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
679
|
+
e.preventDefault();
|
|
680
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(e);
|
|
681
|
+
}
|
|
682
|
+
};
|
|
544
683
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
545
684
|
id: id,
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
685
|
+
role: "button",
|
|
686
|
+
tabIndex: disabled ? -1 : 0,
|
|
687
|
+
"aria-disabled": disabled || undefined,
|
|
688
|
+
"aria-label": accessibilityLabel,
|
|
689
|
+
onClick: disabled ? undefined : handleClick,
|
|
690
|
+
onKeyDown: handleKeyDown,
|
|
549
691
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
550
692
|
children: children
|
|
551
693
|
});
|
|
552
694
|
};
|
|
553
695
|
Card.ClickableRow.displayName = "Card.ClickableRow";
|
|
554
|
-
|
|
696
|
+
/**
|
|
697
|
+
* Rows container component for grouping multiple Card.Row elements.
|
|
698
|
+
*
|
|
699
|
+
* @usage
|
|
700
|
+
* - DO: Use to group multiple `Card.Row` elements with consistent spacing.
|
|
701
|
+
*/ Card.Rows = function(param) {
|
|
555
702
|
var children = param.children;
|
|
556
703
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
557
704
|
className: "px-1.5 pb-1.5 @md:pb-2 @md:px-2",
|
|
@@ -560,9 +707,11 @@ Card.Rows = function(param) {
|
|
|
560
707
|
};
|
|
561
708
|
Card.Rows.displayName = "Card.Rows";
|
|
562
709
|
/**
|
|
563
|
-
*
|
|
710
|
+
* @component Card.Row
|
|
711
|
+
*
|
|
712
|
+
* @usage
|
|
713
|
+
* - DO: Use for individual data rows within `Card.Rows`.
|
|
564
714
|
*
|
|
565
|
-
* @component
|
|
566
715
|
* @param {Object} props - Props for the Row component.
|
|
567
716
|
* @param {React.ReactNode} [props.children] - Child elements to render inside the row.
|
|
568
717
|
* @param {Function} [props.onClick] - Click handler for the row.
|
|
@@ -570,21 +719,40 @@ Card.Rows.displayName = "Card.Rows";
|
|
|
570
719
|
* @param {string} [props.url] - URL to open when the row is clicked.
|
|
571
720
|
* @param {string} [props.className] - Additional classes to apply to the row.
|
|
572
721
|
* @param {boolean} [props.disabled=false] - Disables interaction with the row.
|
|
722
|
+
* @param {string} [props.accessibilityLabel] - Accessible label for the row (aria-label).
|
|
573
723
|
*
|
|
574
724
|
* @returns {React.ReactElement} The rendered Row component.
|
|
575
725
|
*/ Card.Row = function(param) {
|
|
576
|
-
var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className;
|
|
726
|
+
var children = param.children, onClick = param.onClick, id = param.id, url = param.url, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, className = param.className, accessibilityLabel = param.accessibilityLabel;
|
|
727
|
+
var isInteractive = !!(onClick || url);
|
|
577
728
|
var classes = clickableRowStyles({
|
|
578
|
-
disabled: disabled
|
|
729
|
+
disabled: isInteractive ? disabled : false,
|
|
730
|
+
interactive: isInteractive
|
|
579
731
|
});
|
|
732
|
+
var handleClick = url ? function() {
|
|
733
|
+
return window.open(url, "_blank");
|
|
734
|
+
} : onClick;
|
|
735
|
+
var handleKeyDown = function(e) {
|
|
736
|
+
if (!isInteractive || disabled) return;
|
|
737
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
738
|
+
e.preventDefault();
|
|
739
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(e);
|
|
740
|
+
}
|
|
741
|
+
};
|
|
580
742
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
581
743
|
id: id,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
744
|
+
role: isInteractive ? "button" : undefined,
|
|
745
|
+
tabIndex: isInteractive ? disabled ? -1 : 0 : undefined,
|
|
746
|
+
"aria-disabled": isInteractive && disabled ? true : undefined,
|
|
747
|
+
"aria-label": accessibilityLabel,
|
|
748
|
+
onClick: isInteractive && !disabled ? handleClick : undefined,
|
|
749
|
+
onKeyDown: isInteractive ? handleKeyDown : undefined,
|
|
585
750
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
586
751
|
children: children
|
|
587
752
|
});
|
|
588
753
|
};
|
|
589
754
|
Card.Row.displayName = "Card.Row";
|
|
755
|
+
var useCard = function() {
|
|
756
|
+
return _react.default.useContext(CardContext);
|
|
757
|
+
};
|
|
590
758
|
var _default = Card;
|