@recursica/adapter-mantine-v8 1.0.0
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/.storybook/commonArgTypes.ts +148 -0
- package/ARCHITECTURE.md +18 -0
- package/CHANGELOG.md +688 -0
- package/LICENSE +21 -0
- package/OVERSTYLING.md +56 -0
- package/README.md +70 -0
- package/SETUP.md +93 -0
- package/USAGE.md +57 -0
- package/dist/adapter-mantine-v8.cjs +12 -0
- package/dist/adapter-mantine-v8.cjs.map +1 -0
- package/dist/adapter-mantine-v8.css +1 -0
- package/dist/adapter-mantine-v8.js +5759 -0
- package/dist/adapter-mantine-v8.js.map +1 -0
- package/dist/index.d.ts +2095 -0
- package/dist/test.html +1 -0
- package/dist/vite.svg +1 -0
- package/docs/PHILOSOPHY.md +39 -0
- package/llms.txt +74 -0
- package/package.json +131 -0
- package/recursica_brand.json +2677 -0
- package/recursica_tokens.json +799 -0
- package/recursica_ui-kit.json +14981 -0
- package/recursica_variables_scoped.css +30489 -0
- package/src/GlobalExemptions.modules.css +7 -0
- package/src/Introduction.stories.tsx +154 -0
- package/src/OverStyling.tsx +79 -0
- package/src/Version.tsx +44 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +72 -0
- package/src/components/Accordion/Accordion.module.css +367 -0
- package/src/components/Accordion/Accordion.stories.tsx +189 -0
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/Accordion/Accordion.tsx +220 -0
- package/src/components/Accordion/USAGE.md +51 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +68 -0
- package/src/components/AssistiveElement/AssistiveElement.test.tsx +1 -0
- package/src/components/AssistiveElement/AssistiveElement.tsx +93 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AutoComplete/AUTOCOMPLETE_IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/AutoComplete/AutoComplete.module.css +430 -0
- package/src/components/AutoComplete/AutoComplete.stories.tsx +336 -0
- package/src/components/AutoComplete/AutoComplete.test.tsx +1 -0
- package/src/components/AutoComplete/AutoComplete.tsx +179 -0
- package/src/components/AutoComplete/USAGE.md +80 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +34 -0
- package/src/components/Avatar/Avatar.module.css +336 -0
- package/src/components/Avatar/Avatar.stories.tsx +92 -0
- package/src/components/Avatar/Avatar.test.tsx +1 -0
- package/src/components/Avatar/Avatar.tsx +108 -0
- package/src/components/Avatar/USAGE.md +38 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Badge/Badge.module.css +127 -0
- package/src/components/Badge/Badge.stories.tsx +78 -0
- package/src/components/Badge/Badge.test.tsx +1 -0
- package/src/components/Badge/Badge.tsx +64 -0
- package/src/components/Badge/USAGE.md +56 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +47 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +48 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +114 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +1 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +85 -0
- package/src/components/Breadcrumb/USAGE.md +55 -0
- package/src/components/Breadcrumb/markCurrentPageItem.test.ts +49 -0
- package/src/components/Button/Button.module.css +446 -0
- package/src/components/Button/Button.stories.tsx +196 -0
- package/src/components/Button/Button.styleIsolation.dom.test.tsx +98 -0
- package/src/components/Button/Button.tsx +184 -0
- package/src/components/Button/IMPLEMENTATION_NOTES.md +109 -0
- package/src/components/Button/USAGE.md +80 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Card/Card.module.css +119 -0
- package/src/components/Card/Card.stories.tsx +131 -0
- package/src/components/Card/Card.test.tsx +1 -0
- package/src/components/Card/Card.tsx +248 -0
- package/src/components/Card/USAGE.md +63 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Checkbox/Checkbox.module.css +267 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +97 -0
- package/src/components/Checkbox/Checkbox.test.tsx +1 -0
- package/src/components/Checkbox/Checkbox.tsx +151 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +147 -0
- package/src/components/Checkbox/USAGE.md +48 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +110 -0
- package/src/components/Chip/Chip.module.css +288 -0
- package/src/components/Chip/Chip.stories.tsx +128 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Chip/Chip.tsx +157 -0
- package/src/components/Chip/USAGE.md +55 -0
- package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Container/Container.module.css +7 -0
- package/src/components/Container/Container.stories.tsx +118 -0
- package/src/components/Container/Container.test.tsx +1 -0
- package/src/components/Container/Container.tsx +69 -0
- package/src/components/Container/USAGE.md +47 -0
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +31 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +27 -0
- package/src/components/DatePicker/DatePicker.module.css +566 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +158 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.tsx +218 -0
- package/src/components/DatePicker/USAGE.md +49 -0
- package/src/components/Dropdown/BareDropdown.tsx +97 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Dropdown/Dropdown.module.css +477 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +252 -0
- package/src/components/Dropdown/Dropdown.test.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +213 -0
- package/src/components/Dropdown/USAGE.md +69 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +153 -0
- package/src/components/FileInput/FileInput.module.css +280 -0
- package/src/components/FileInput/FileInput.stories.tsx +313 -0
- package/src/components/FileInput/FileInput.test.tsx +1 -0
- package/src/components/FileInput/FileInput.tsx +417 -0
- package/src/components/FileInput/USAGE.md +145 -0
- package/src/components/FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md +244 -0
- package/src/components/FileUpload/FileUpload.module.css +205 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +362 -0
- package/src/components/FileUpload/FileUpload.test.tsx +1 -0
- package/src/components/FileUpload/FileUpload.tsx +354 -0
- package/src/components/FileUpload/USAGE.md +199 -0
- package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Flex/Flex.module.css +7 -0
- package/src/components/Flex/Flex.stories.tsx +128 -0
- package/src/components/Flex/Flex.test.tsx +1 -0
- package/src/components/Flex/Flex.tsx +75 -0
- package/src/components/Flex/USAGE.md +48 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +90 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +118 -0
- package/src/components/FormControlLayout/FormControlLayout.test.tsx +1 -0
- package/src/components/FormControlLayout/FormControlLayout.tsx +74 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +75 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
- package/src/components/FormControlWrapper/FormControlWrapper.test.tsx +1 -0
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +151 -0
- package/src/components/FormControlWrapper/USAGE.md +47 -0
- package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Grid/Grid.module.css +11 -0
- package/src/components/Grid/Grid.stories.tsx +206 -0
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +140 -0
- package/src/components/Grid/USAGE.md +47 -0
- package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Group/Group.module.css +7 -0
- package/src/components/Group/Group.stories.tsx +120 -0
- package/src/components/Group/Group.test.tsx +1 -0
- package/src/components/Group/Group.tsx +60 -0
- package/src/components/Group/USAGE.md +48 -0
- package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Heading/Heading.module.css +13 -0
- package/src/components/Heading/Heading.stories.tsx +50 -0
- package/src/components/Heading/Heading.test.tsx +1 -0
- package/src/components/Heading/Heading.tsx +52 -0
- package/src/components/Heading/USAGE.md +36 -0
- package/src/components/HoverCard/HOVERCARD_IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/HoverCard/HoverCard.module.css +90 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +172 -0
- package/src/components/HoverCard/HoverCard.test.tsx +1 -0
- package/src/components/HoverCard/HoverCard.tsx +133 -0
- package/src/components/HoverCard/USAGE.md +52 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Label/Label.module.css +141 -0
- package/src/components/Label/Label.stories.tsx +131 -0
- package/src/components/Label/Label.test.tsx +1 -0
- package/src/components/Label/Label.tsx +113 -0
- package/src/components/Label/USAGE.md +47 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layer/USAGE.md +54 -0
- package/src/components/Link/IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/Link/Link.module.css +110 -0
- package/src/components/Link/Link.stories.tsx +58 -0
- package/src/components/Link/Link.test.tsx +1 -0
- package/src/components/Link/Link.tsx +67 -0
- package/src/components/Link/USAGE.md +56 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Loader/Loader.animate.dom.test.tsx +82 -0
- package/src/components/Loader/Loader.module.css +63 -0
- package/src/components/Loader/Loader.stories.tsx +123 -0
- package/src/components/Loader/Loader.test.tsx +1 -0
- package/src/components/Loader/Loader.tsx +69 -0
- package/src/components/Loader/USAGE.md +44 -0
- package/src/components/Menu/MENU_IMPLEMENTATION_NOTES.md +88 -0
- package/src/components/Menu/Menu.module.css +280 -0
- package/src/components/Menu/Menu.stories.tsx +371 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Menu/Menu.tsx +373 -0
- package/src/components/Menu/USAGE.md +55 -0
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/Modal/Modal.module.css +302 -0
- package/src/components/Modal/Modal.stories.tsx +105 -0
- package/src/components/Modal/Modal.test.tsx +1 -0
- package/src/components/Modal/Modal.tsx +368 -0
- package/src/components/Modal/USAGE.md +58 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/NumberInput/NUMBER_INPUT_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/NumberInput/NumberInput.module.css +302 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +96 -0
- package/src/components/NumberInput/NumberInput.test.tsx +1 -0
- package/src/components/NumberInput/NumberInput.tsx +157 -0
- package/src/components/NumberInput/USAGE.md +52 -0
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +16 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +188 -0
- package/src/components/Pagination/Pagination.stories.tsx +48 -0
- package/src/components/Pagination/Pagination.test.tsx +1 -0
- package/src/components/Pagination/Pagination.tsx +265 -0
- package/src/components/Pagination/USAGE.md +36 -0
- package/src/components/Pagination/index.ts +5 -0
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +116 -0
- package/src/components/Panel/Panel.module.css +209 -0
- package/src/components/Panel/Panel.stories.tsx +227 -0
- package/src/components/Panel/Panel.test.tsx +1 -0
- package/src/components/Panel/Panel.tsx +269 -0
- package/src/components/Panel/USAGE.md +56 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/Popover/Popover.module.css +86 -0
- package/src/components/Popover/Popover.stories.tsx +133 -0
- package/src/components/Popover/Popover.test.tsx +1 -0
- package/src/components/Popover/Popover.tsx +142 -0
- package/src/components/Popover/USAGE.md +61 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Radio/Radio.module.css +231 -0
- package/src/components/Radio/Radio.stories.tsx +93 -0
- package/src/components/Radio/Radio.test.tsx +1 -0
- package/src/components/Radio/Radio.tsx +168 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +124 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
- package/src/components/ReadOnlyField/ReadOnlyField.test.tsx +1 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +114 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/USAGE.md +44 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +5 -0
- package/src/components/RecursicaThemeProvider/USAGE.md +60 -0
- package/src/components/SegmentedControl/IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +185 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +106 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +1 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +110 -0
- package/src/components/SegmentedControl/USAGE.md +55 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +92 -0
- package/src/components/Slider/Slider.module.css +588 -0
- package/src/components/Slider/Slider.stories.tsx +282 -0
- package/src/components/Slider/Slider.test.tsx +1 -0
- package/src/components/Slider/Slider.tsx +391 -0
- package/src/components/Slider/USAGE.md +56 -0
- package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stack/Stack.module.css +7 -0
- package/src/components/Stack/Stack.stories.tsx +108 -0
- package/src/components/Stack/Stack.test.tsx +1 -0
- package/src/components/Stack/Stack.tsx +62 -0
- package/src/components/Stack/USAGE.md +48 -0
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +28 -0
- package/src/components/Stepper/Stepper.module.css +404 -0
- package/src/components/Stepper/Stepper.stories.tsx +148 -0
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Stepper/Stepper.tsx +93 -0
- package/src/components/Stepper/USAGE.md +41 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +64 -0
- package/src/components/Switch/Switch.module.css +279 -0
- package/src/components/Switch/Switch.stories.tsx +114 -0
- package/src/components/Switch/Switch.test.tsx +1 -0
- package/src/components/Switch/Switch.tsx +177 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +127 -0
- package/src/components/Switch/USAGE.md +42 -0
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +78 -0
- package/src/components/Table/Table.icons.tsx +40 -0
- package/src/components/Table/Table.module.css +444 -0
- package/src/components/Table/Table.stories.tsx +140 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Table/Table.tsx +243 -0
- package/src/components/Table/USAGE.md +78 -0
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +27 -0
- package/src/components/Tabs/Tabs.module.css +591 -0
- package/src/components/Tabs/Tabs.stories.tsx +154 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +114 -0
- package/src/components/Tabs/USAGE.md +45 -0
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Text/Text.module.css +13 -0
- package/src/components/Text/Text.stories.tsx +75 -0
- package/src/components/Text/Text.test.tsx +1 -0
- package/src/components/Text/Text.tsx +53 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/TextArea/TextArea.module.css +183 -0
- package/src/components/TextArea/TextArea.stories.tsx +94 -0
- package/src/components/TextArea/TextArea.test.tsx +1 -0
- package/src/components/TextArea/TextArea.tsx +137 -0
- package/src/components/TextArea/USAGE.md +48 -0
- package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/TextField/TextField.module.css +264 -0
- package/src/components/TextField/TextField.stories.tsx +162 -0
- package/src/components/TextField/TextField.test.tsx +1 -0
- package/src/components/TextField/TextField.tsx +139 -0
- package/src/components/TextField/USAGE.md +44 -0
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +119 -0
- package/src/components/TimePicker/TimePicker.module.css +291 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +141 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +304 -0
- package/src/components/TimePicker/USAGE.md +57 -0
- package/src/components/Timeline/TIMELINE_IMPLEMENTATION_NOTES.md +13 -0
- package/src/components/Timeline/Timeline.module.css +373 -0
- package/src/components/Timeline/Timeline.stories.tsx +128 -0
- package/src/components/Timeline/Timeline.test.tsx +1 -0
- package/src/components/Timeline/Timeline.tsx +73 -0
- package/src/components/Timeline/TimelineItem.tsx +79 -0
- package/src/components/Timeline/USAGE.md +49 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +39 -0
- package/src/components/Toast/Toast.module.css +184 -0
- package/src/components/Toast/Toast.stories.tsx +67 -0
- package/src/components/Toast/Toast.test.tsx +1 -0
- package/src/components/Toast/Toast.tsx +82 -0
- package/src/components/Toast/USAGE.md +50 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/TOOLTIP_IMPLEMENTATION_NOTES.md +85 -0
- package/src/components/Tooltip/Tooltip.module.css +91 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +165 -0
- package/src/components/Tooltip/Tooltip.test.tsx +1 -0
- package/src/components/Tooltip/Tooltip.tsx +117 -0
- package/src/components/Tooltip/USAGE.md +80 -0
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +111 -0
- package/src/components/TransferList/TransferList.module.css +182 -0
- package/src/components/TransferList/TransferList.stories.tsx +121 -0
- package/src/components/TransferList/TransferList.test.tsx +1 -0
- package/src/components/TransferList/TransferList.tsx +419 -0
- package/src/components/TransferList/USAGE.md +77 -0
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Tree/Tree.module.css +232 -0
- package/src/components/Tree/Tree.stories.tsx +104 -0
- package/src/components/Tree/Tree.test.tsx +1 -0
- package/src/components/Tree/Tree.tsx +220 -0
- package/src/components/Tree/USAGE.md +96 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/index.ts +52 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +179 -0
- package/src/types/index.ts +9 -0
- package/src/types/mantine.d.ts +7 -0
- package/src/types/scss-modules.d.ts +9 -0
- package/src/utils/ColorSchemeWrapper.tsx +27 -0
- package/src/utils/RequireAccessibleLabel.ts +1 -0
- package/src/utils/copyToClipboard.ts +36 -0
- package/src/utils/filterStylingProps.test.ts +85 -0
- package/src/utils/filterStylingProps.ts +150 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/renderRichOption.tsx +65 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
/* Mantine drives item spacing (.item's margin-top) AND the connector line's bridging offset
|
|
5
|
+
(.item::before's negative bottom) off the SAME --mantine-spacing-xl variable. Overriding it
|
|
6
|
+
here (rather than adding a flex gap) keeps both in sync automatically instead of introducing
|
|
7
|
+
a visible break in the connector line. */
|
|
8
|
+
--mantine-spacing-xl: var(
|
|
9
|
+
--recursica_ui-kit_components_timeline_properties_item-gap
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.item {
|
|
14
|
+
/* Mantine uses these vars to calculate the exact left: position of the connector line */
|
|
15
|
+
--tl-line-width: var(
|
|
16
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_connector-size
|
|
17
|
+
) !important;
|
|
18
|
+
|
|
19
|
+
&[data-active] {
|
|
20
|
+
--tl-line-width: var(
|
|
21
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_connector-size
|
|
22
|
+
) !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[data-variant="default"] {
|
|
26
|
+
--tl-bullet-size: var(
|
|
27
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
28
|
+
) !important;
|
|
29
|
+
}
|
|
30
|
+
&[data-variant="icon"] {
|
|
31
|
+
--tl-bullet-size: var(
|
|
32
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
33
|
+
) !important;
|
|
34
|
+
}
|
|
35
|
+
&[data-variant="icon-alternative"] {
|
|
36
|
+
--tl-bullet-size: var(
|
|
37
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
38
|
+
) !important;
|
|
39
|
+
}
|
|
40
|
+
&[data-variant="avatar"] {
|
|
41
|
+
/* Avatar sizing fallback to default to maintain connector alignment */
|
|
42
|
+
--tl-bullet-size: var(
|
|
43
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
44
|
+
) !important;
|
|
45
|
+
}
|
|
46
|
+
/* EXEMPTIONS:
|
|
47
|
+
- The avatar variant's own avatar-size token is ignored — sizing is deliberately pinned to
|
|
48
|
+
the default bullet-size above (not the avatar's own size) to keep the connector line
|
|
49
|
+
aligned across bullet variants; the child Avatar component governs its own visual size. */
|
|
50
|
+
/* recursica-ignore: --recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_avatar-size */
|
|
51
|
+
|
|
52
|
+
/* Control connector lines via the item ::before pseudo-element */
|
|
53
|
+
/* Inactive connector */
|
|
54
|
+
&::before {
|
|
55
|
+
border-left-width: var(
|
|
56
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_connector-size
|
|
57
|
+
) !important;
|
|
58
|
+
border-left-color: var(
|
|
59
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_connector-color
|
|
60
|
+
) !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Active connector */
|
|
64
|
+
&[data-active]::before {
|
|
65
|
+
border-left-width: var(
|
|
66
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_connector-size
|
|
67
|
+
) !important;
|
|
68
|
+
border-left-color: var(
|
|
69
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_connector-color
|
|
70
|
+
) !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.itemBody {
|
|
75
|
+
/* Space between the bullet and the content */
|
|
76
|
+
padding-left: var(
|
|
77
|
+
--recursica_ui-kit_components_timeline_properties_bullet-content-gap
|
|
78
|
+
) !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.itemBullet {
|
|
82
|
+
/* Default Variant */
|
|
83
|
+
:global(.mantine-Timeline-item)[data-variant="default"] & {
|
|
84
|
+
width: var(
|
|
85
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
86
|
+
) !important;
|
|
87
|
+
height: var(
|
|
88
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
89
|
+
) !important;
|
|
90
|
+
border-radius: var(
|
|
91
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-radius
|
|
92
|
+
) !important;
|
|
93
|
+
border-width: var(
|
|
94
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-size
|
|
95
|
+
) !important;
|
|
96
|
+
|
|
97
|
+
background-color: var(
|
|
98
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_inactive_properties_colors_background-color
|
|
99
|
+
) !important;
|
|
100
|
+
border-color: var(
|
|
101
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_inactive_properties_colors_border-color
|
|
102
|
+
) !important;
|
|
103
|
+
}
|
|
104
|
+
:global(.mantine-Timeline-item)[data-variant="default"][data-active] & {
|
|
105
|
+
background-color: var(
|
|
106
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_active_properties_colors_background-color
|
|
107
|
+
) !important;
|
|
108
|
+
border-color: var(
|
|
109
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_active_properties_colors_border-color
|
|
110
|
+
) !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Icon Variant */
|
|
114
|
+
:global(.mantine-Timeline-item)[data-variant="icon"] & {
|
|
115
|
+
width: var(
|
|
116
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
117
|
+
) !important;
|
|
118
|
+
height: var(
|
|
119
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
120
|
+
) !important;
|
|
121
|
+
border-radius: var(
|
|
122
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-radius
|
|
123
|
+
) !important;
|
|
124
|
+
border-width: var(
|
|
125
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-size
|
|
126
|
+
) !important;
|
|
127
|
+
|
|
128
|
+
background-color: var(
|
|
129
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_background-color
|
|
130
|
+
) !important;
|
|
131
|
+
border-color: var(
|
|
132
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_border-color
|
|
133
|
+
) !important;
|
|
134
|
+
color: var(
|
|
135
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_icon-color
|
|
136
|
+
) !important;
|
|
137
|
+
|
|
138
|
+
/* Propagate icon size */
|
|
139
|
+
font-size: var(
|
|
140
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
141
|
+
);
|
|
142
|
+
& svg {
|
|
143
|
+
width: var(
|
|
144
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
145
|
+
);
|
|
146
|
+
height: var(
|
|
147
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
:global(.mantine-Timeline-item)[data-variant="icon"][data-active] & {
|
|
152
|
+
background-color: var(
|
|
153
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_background-color
|
|
154
|
+
) !important;
|
|
155
|
+
border-color: var(
|
|
156
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_border-color
|
|
157
|
+
) !important;
|
|
158
|
+
color: var(
|
|
159
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_icon-color
|
|
160
|
+
) !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Icon Alternative Variant */
|
|
164
|
+
:global(.mantine-Timeline-item)[data-variant="icon-alternative"] & {
|
|
165
|
+
width: var(
|
|
166
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
167
|
+
) !important;
|
|
168
|
+
height: var(
|
|
169
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
170
|
+
) !important;
|
|
171
|
+
border-radius: var(
|
|
172
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-radius
|
|
173
|
+
) !important;
|
|
174
|
+
border-width: var(
|
|
175
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-size
|
|
176
|
+
) !important;
|
|
177
|
+
|
|
178
|
+
background-color: var(
|
|
179
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_background-color
|
|
180
|
+
) !important;
|
|
181
|
+
border-color: var(
|
|
182
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_border-color
|
|
183
|
+
) !important;
|
|
184
|
+
color: var(
|
|
185
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_icon-color
|
|
186
|
+
) !important;
|
|
187
|
+
|
|
188
|
+
font-size: var(
|
|
189
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
190
|
+
);
|
|
191
|
+
& svg {
|
|
192
|
+
width: var(
|
|
193
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
194
|
+
);
|
|
195
|
+
height: var(
|
|
196
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
:global(.mantine-Timeline-item)[data-variant="icon-alternative"][data-active]
|
|
201
|
+
& {
|
|
202
|
+
background-color: var(
|
|
203
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_background-color
|
|
204
|
+
) !important;
|
|
205
|
+
border-color: var(
|
|
206
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_border-color
|
|
207
|
+
) !important;
|
|
208
|
+
color: var(
|
|
209
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_icon-color
|
|
210
|
+
) !important;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Avatar Variant */
|
|
214
|
+
:global(.mantine-Timeline-item)[data-variant="avatar"] & {
|
|
215
|
+
/* Avatar sizing is often governed by the avatar itself, but we'll apply the radius and opacity */
|
|
216
|
+
border-radius: var(
|
|
217
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-radius
|
|
218
|
+
) !important;
|
|
219
|
+
border-width: var(
|
|
220
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-size
|
|
221
|
+
) !important;
|
|
222
|
+
opacity: var(
|
|
223
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_avatar-opacity
|
|
224
|
+
) !important;
|
|
225
|
+
|
|
226
|
+
background-color: var(
|
|
227
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_colors_background-color
|
|
228
|
+
) !important;
|
|
229
|
+
border-color: var(
|
|
230
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_colors_border-color
|
|
231
|
+
) !important;
|
|
232
|
+
}
|
|
233
|
+
:global(.mantine-Timeline-item)[data-variant="avatar"][data-active] & {
|
|
234
|
+
opacity: var(
|
|
235
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_avatar-opacity
|
|
236
|
+
) !important;
|
|
237
|
+
background-color: var(
|
|
238
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_colors_background-color
|
|
239
|
+
) !important;
|
|
240
|
+
border-color: var(
|
|
241
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_colors_border-color
|
|
242
|
+
) !important;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.itemTitle {
|
|
247
|
+
font-family: var(
|
|
248
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-family
|
|
249
|
+
);
|
|
250
|
+
font-size: var(
|
|
251
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-size
|
|
252
|
+
);
|
|
253
|
+
font-style: var(
|
|
254
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-style
|
|
255
|
+
);
|
|
256
|
+
font-weight: var(
|
|
257
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-weight
|
|
258
|
+
);
|
|
259
|
+
letter-spacing: var(
|
|
260
|
+
--recursica_ui-kit_components_timeline_properties_title-text_letter-spacing
|
|
261
|
+
);
|
|
262
|
+
line-height: var(
|
|
263
|
+
--recursica_ui-kit_components_timeline_properties_title-text_line-height
|
|
264
|
+
);
|
|
265
|
+
text-decoration: var(
|
|
266
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-decoration
|
|
267
|
+
);
|
|
268
|
+
text-transform: var(
|
|
269
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-transform
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
/* Title Description Gap */
|
|
273
|
+
margin-bottom: var(
|
|
274
|
+
--recursica_ui-kit_components_timeline_properties_title-description-gap
|
|
275
|
+
) !important;
|
|
276
|
+
|
|
277
|
+
/* Inactive Title Color */
|
|
278
|
+
color: var(
|
|
279
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_title-color
|
|
280
|
+
) !important;
|
|
281
|
+
|
|
282
|
+
/* Active Title Color */
|
|
283
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
284
|
+
color: var(
|
|
285
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_title-color
|
|
286
|
+
) !important;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.itemContent {
|
|
291
|
+
display: flex;
|
|
292
|
+
flex-direction: column;
|
|
293
|
+
gap: var(
|
|
294
|
+
--recursica_ui-kit_components_timeline_properties_description-timestamp-gap
|
|
295
|
+
);
|
|
296
|
+
max-width: var(
|
|
297
|
+
--recursica_ui-kit_components_timeline_properties_max-text-width
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.description {
|
|
302
|
+
font-family: var(
|
|
303
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-family
|
|
304
|
+
);
|
|
305
|
+
font-size: var(
|
|
306
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-size
|
|
307
|
+
);
|
|
308
|
+
font-style: var(
|
|
309
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-style
|
|
310
|
+
);
|
|
311
|
+
font-weight: var(
|
|
312
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-weight
|
|
313
|
+
);
|
|
314
|
+
letter-spacing: var(
|
|
315
|
+
--recursica_ui-kit_components_timeline_properties_description-text_letter-spacing
|
|
316
|
+
);
|
|
317
|
+
line-height: var(
|
|
318
|
+
--recursica_ui-kit_components_timeline_properties_description-text_line-height
|
|
319
|
+
);
|
|
320
|
+
text-decoration: var(
|
|
321
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-decoration
|
|
322
|
+
);
|
|
323
|
+
text-transform: var(
|
|
324
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-transform
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
color: var(
|
|
328
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_description-color
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
332
|
+
color: var(
|
|
333
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_description-color
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.timestamp {
|
|
339
|
+
font-family: var(
|
|
340
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-family
|
|
341
|
+
);
|
|
342
|
+
font-size: var(
|
|
343
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-size
|
|
344
|
+
);
|
|
345
|
+
font-style: var(
|
|
346
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-style
|
|
347
|
+
);
|
|
348
|
+
font-weight: var(
|
|
349
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-weight
|
|
350
|
+
);
|
|
351
|
+
letter-spacing: var(
|
|
352
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_letter-spacing
|
|
353
|
+
);
|
|
354
|
+
line-height: var(
|
|
355
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_line-height
|
|
356
|
+
);
|
|
357
|
+
text-decoration: var(
|
|
358
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-decoration
|
|
359
|
+
);
|
|
360
|
+
text-transform: var(
|
|
361
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-transform
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
color: var(
|
|
365
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_timestamp-color
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
369
|
+
color: var(
|
|
370
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_timestamp-color
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Timeline } from "./Timeline";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Timeline> = {
|
|
5
|
+
title: "UI-Kit/Timeline",
|
|
6
|
+
component: Timeline,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
defaultChecked: { table: { disable: true } },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Timeline>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
active: 1,
|
|
20
|
+
},
|
|
21
|
+
render: (args) => (
|
|
22
|
+
<Timeline {...args}>
|
|
23
|
+
<Timeline.Item
|
|
24
|
+
title="Commit created"
|
|
25
|
+
timestamp="Yesterday"
|
|
26
|
+
bulletVariant="default"
|
|
27
|
+
>
|
|
28
|
+
You pushed 3 new commits to the repository.
|
|
29
|
+
</Timeline.Item>
|
|
30
|
+
<Timeline.Item
|
|
31
|
+
title="Pull request opened"
|
|
32
|
+
timestamp="2 days ago"
|
|
33
|
+
bulletVariant="default"
|
|
34
|
+
>
|
|
35
|
+
You opened a pull request for the feature branch.
|
|
36
|
+
</Timeline.Item>
|
|
37
|
+
<Timeline.Item
|
|
38
|
+
title="Code review completed"
|
|
39
|
+
timestamp="1 week ago"
|
|
40
|
+
bulletVariant="default"
|
|
41
|
+
>
|
|
42
|
+
Your pull request was approved by 2 reviewers.
|
|
43
|
+
</Timeline.Item>
|
|
44
|
+
<Timeline.Item
|
|
45
|
+
title="Branch merged"
|
|
46
|
+
timestamp="2 weeks ago"
|
|
47
|
+
bulletVariant="default"
|
|
48
|
+
>
|
|
49
|
+
Your feature branch was successfully merged into main.
|
|
50
|
+
</Timeline.Item>
|
|
51
|
+
</Timeline>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const BulletVariants: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
active: 1,
|
|
58
|
+
},
|
|
59
|
+
render: (args) => (
|
|
60
|
+
<Timeline {...args}>
|
|
61
|
+
<Timeline.Item
|
|
62
|
+
title="Default Bullet"
|
|
63
|
+
timestamp="Standard configuration"
|
|
64
|
+
bulletVariant="default"
|
|
65
|
+
>
|
|
66
|
+
The default un-configured structural dot.
|
|
67
|
+
</Timeline.Item>
|
|
68
|
+
<Timeline.Item
|
|
69
|
+
title="Icon Bullet"
|
|
70
|
+
timestamp="Standard sized icons"
|
|
71
|
+
bulletVariant="icon"
|
|
72
|
+
bullet={
|
|
73
|
+
<svg
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
strokeWidth="2"
|
|
78
|
+
strokeLinecap="round"
|
|
79
|
+
strokeLinejoin="round"
|
|
80
|
+
>
|
|
81
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
82
|
+
</svg>
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
A standard structural icon node mapping.
|
|
86
|
+
</Timeline.Item>
|
|
87
|
+
<Timeline.Item
|
|
88
|
+
title="Alternative Icon"
|
|
89
|
+
timestamp="Larger structural bounds"
|
|
90
|
+
bulletVariant="icon-alternative"
|
|
91
|
+
bullet={
|
|
92
|
+
<svg
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
fill="none"
|
|
95
|
+
stroke="currentColor"
|
|
96
|
+
strokeWidth="2"
|
|
97
|
+
strokeLinecap="round"
|
|
98
|
+
strokeLinejoin="round"
|
|
99
|
+
>
|
|
100
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
101
|
+
</svg>
|
|
102
|
+
}
|
|
103
|
+
>
|
|
104
|
+
A slightly larger alternative bounding box for specialized icons.
|
|
105
|
+
</Timeline.Item>
|
|
106
|
+
<Timeline.Item
|
|
107
|
+
title="Avatar Bullet"
|
|
108
|
+
timestamp="Profile pictures"
|
|
109
|
+
bulletVariant="avatar"
|
|
110
|
+
bullet={
|
|
111
|
+
<img
|
|
112
|
+
src="https://avatars.githubusercontent.com/u/10353856?s=460&v=4"
|
|
113
|
+
alt="avatar"
|
|
114
|
+
style={{
|
|
115
|
+
width: "100%",
|
|
116
|
+
height: "100%",
|
|
117
|
+
objectFit: "cover",
|
|
118
|
+
borderRadius: "inherit",
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
Avatar mappings inherently drop borders and leverage specific opacity
|
|
124
|
+
states.
|
|
125
|
+
</Timeline.Item>
|
|
126
|
+
</Timeline>
|
|
127
|
+
),
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Timeline component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Timeline as MantineTimeline,
|
|
4
|
+
type TimelineProps as MantineTimelineProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
mergeClassNames,
|
|
9
|
+
type RecursicaOverStyled,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Timeline.module.css";
|
|
12
|
+
import { TimelineItem } from "./TimelineItem";
|
|
13
|
+
|
|
14
|
+
import { type RecursicaTimelineProps } from "@recursica/adapter-common";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Properties for the strictly-tokenized Timeline component.
|
|
18
|
+
* Native Mantine abstract properties like `color`, `radius`, `bulletSize`, and `lineWidth`
|
|
19
|
+
* have been stripped out to strictly enforce the structural mappings of the Recursica UI Kit.
|
|
20
|
+
*/
|
|
21
|
+
export type TimelineProps = RecursicaOverStyled<
|
|
22
|
+
Omit<MantineTimelineProps, "color" | "radius" | "bulletSize" | "lineWidth"> &
|
|
23
|
+
RecursicaTimelineProps
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
interface TimelineComponent
|
|
27
|
+
extends React.ForwardRefExoticComponent<
|
|
28
|
+
TimelineProps & React.RefAttributes<HTMLDivElement>
|
|
29
|
+
> {
|
|
30
|
+
Item: typeof TimelineItem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The `Timeline` component displays a list of events in chronological order.
|
|
35
|
+
*
|
|
36
|
+
* **Recursica Abstract:**
|
|
37
|
+
* This component acts as a structural wrapper around Mantine's `<Timeline>`.
|
|
38
|
+
* It forces alignment and geometry strictly via the UI Kit's `.itemBullet` and connector definitions.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <Timeline active={1}>
|
|
43
|
+
* <Timeline.Item title="Event 1" timestamp="Yesterday">Description</Timeline.Item>
|
|
44
|
+
* </Timeline>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
const TimelineInner = React.forwardRef<HTMLDivElement, TimelineProps>(
|
|
48
|
+
function Timeline({ overStyled = false, ...rest }, ref) {
|
|
49
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
50
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
51
|
+
|
|
52
|
+
const mergedClassNames = mergeClassNames(
|
|
53
|
+
{ root: styles.root },
|
|
54
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<MantineTimeline
|
|
59
|
+
ref={ref}
|
|
60
|
+
{...(sanitizedProps as unknown as Omit<
|
|
61
|
+
MantineTimelineProps,
|
|
62
|
+
"color" | "radius" | "bulletSize" | "lineWidth"
|
|
63
|
+
>)}
|
|
64
|
+
classNames={mergedClassNames}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
TimelineInner.displayName = "Timeline";
|
|
71
|
+
|
|
72
|
+
export const Timeline = TimelineInner as TimelineComponent;
|
|
73
|
+
Timeline.Item = TimelineItem;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
TimelineItem as MantineTimelineItem,
|
|
4
|
+
type TimelineItemProps as MantineTimelineItemProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
mergeClassNames,
|
|
9
|
+
type RecursicaOverStyled,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Timeline.module.css";
|
|
12
|
+
|
|
13
|
+
import { type RecursicaTimelineItemProps } from "@recursica/adapter-common";
|
|
14
|
+
|
|
15
|
+
export type TimelineItemProps = RecursicaOverStyled<
|
|
16
|
+
Omit<MantineTimelineItemProps, "radius" | "color" | "lineVariant"> &
|
|
17
|
+
RecursicaTimelineItemProps
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The individual item component for the Timeline.
|
|
22
|
+
*
|
|
23
|
+
* **Recursica Abstract:**
|
|
24
|
+
* The `Timeline.Item` has been extended to support a `timestamp` string natively,
|
|
25
|
+
* rendering it below the body content. It also accepts a `bulletVariant` to morph
|
|
26
|
+
* the structural dimensions of the node circle automatically.
|
|
27
|
+
*/
|
|
28
|
+
export const TimelineItem = React.forwardRef<HTMLDivElement, TimelineItemProps>(
|
|
29
|
+
function TimelineItem(
|
|
30
|
+
{
|
|
31
|
+
overStyled = false,
|
|
32
|
+
timestamp,
|
|
33
|
+
bulletVariant = "default",
|
|
34
|
+
children,
|
|
35
|
+
...rest
|
|
36
|
+
},
|
|
37
|
+
ref,
|
|
38
|
+
) {
|
|
39
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
40
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
41
|
+
|
|
42
|
+
const mergedClassNames = mergeClassNames(
|
|
43
|
+
{
|
|
44
|
+
item: styles.item,
|
|
45
|
+
itemBody: styles.itemBody,
|
|
46
|
+
itemContent: styles.itemContent,
|
|
47
|
+
itemBullet: styles.itemBullet,
|
|
48
|
+
itemTitle: styles.itemTitle,
|
|
49
|
+
},
|
|
50
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// Embed timestamp inside children if provided, wrapped in a specific class
|
|
54
|
+
const content = timestamp ? (
|
|
55
|
+
<>
|
|
56
|
+
{children && <div className={styles.description}>{children}</div>}
|
|
57
|
+
<div className={styles.timestamp}>{timestamp}</div>
|
|
58
|
+
</>
|
|
59
|
+
) : (
|
|
60
|
+
children
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<MantineTimelineItem
|
|
65
|
+
ref={ref}
|
|
66
|
+
{...(sanitizedProps as unknown as Omit<
|
|
67
|
+
MantineTimelineItemProps,
|
|
68
|
+
"radius" | "color" | "lineVariant"
|
|
69
|
+
>)}
|
|
70
|
+
classNames={mergedClassNames}
|
|
71
|
+
data-variant={bulletVariant}
|
|
72
|
+
>
|
|
73
|
+
{content}
|
|
74
|
+
</MantineTimelineItem>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
TimelineItem.displayName = "TimelineItem";
|