@recursica/adapter-mui-v7 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 +582 -0
- package/LICENSE +21 -0
- package/OVERSTYLING.md +59 -0
- package/README.md +70 -0
- package/SETUP.md +92 -0
- package/USAGE.md +57 -0
- package/dist/adapter-mui-v7.cjs +292 -0
- package/dist/adapter-mui-v7.cjs.map +1 -0
- package/dist/adapter-mui-v7.css +1 -0
- package/dist/adapter-mui-v7.js +40757 -0
- package/dist/adapter-mui-v7.js.map +1 -0
- package/dist/index.d.ts +2350 -0
- package/dist/vite.svg +1 -0
- package/docs/PHILOSOPHY.md +39 -0
- package/llms.txt +76 -0
- package/package.json +151 -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 +184 -0
- package/src/OverStyling.tsx +87 -0
- package/src/Version.tsx +37 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +107 -0
- package/src/components/Accordion/Accordion.module.css +362 -0
- package/src/components/Accordion/Accordion.stories.tsx +198 -0
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/Accordion/Accordion.tsx +285 -0
- package/src/components/Accordion/USAGE.md +43 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +59 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +121 -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 +94 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AssistiveElement/index.ts +1 -0
- package/src/components/AutoComplete/AutoComplete.module.css +456 -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 +266 -0
- package/src/components/AutoComplete/IMPLEMENTATION_NOTES.md +37 -0
- package/src/components/AutoComplete/USAGE.md +68 -0
- package/src/components/AutoComplete/index.ts +1 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +36 -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 +88 -0
- package/src/components/Avatar/USAGE.md +38 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/Badge.module.css +115 -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 +61 -0
- package/src/components/Badge/USAGE.md +40 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +51 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +51 -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 +70 -0
- package/src/components/Breadcrumb/USAGE.md +42 -0
- package/src/components/Breadcrumb/index.ts +1 -0
- package/src/components/Button/BUTTON_IMPLEMENTATION_NOTES.md +123 -0
- package/src/components/Button/Button.module.css +413 -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 +156 -0
- package/src/components/Button/USAGE.md +46 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/Card/Card.module.css +155 -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 +202 -0
- package/src/components/Card/USAGE.md +57 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +14 -0
- package/src/components/Checkbox/Checkbox.module.css +286 -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 +259 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +148 -0
- package/src/components/Checkbox/USAGE.md +36 -0
- package/src/components/Checkbox/index.ts +6 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +102 -0
- package/src/components/Chip/Chip.module.css +283 -0
- package/src/components/Chip/Chip.stories.tsx +154 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Chip/Chip.tsx +168 -0
- package/src/components/Chip/USAGE.md +55 -0
- package/src/components/Chip/index.ts +1 -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 +51 -0
- package/src/components/Container/IMPLEMENTATION_NOTES.md +5 -0
- package/src/components/Container/USAGE.md +48 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +29 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +35 -0
- package/src/components/DatePicker/DatePicker.module.css +464 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +163 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.tsx +229 -0
- package/src/components/DatePicker/USAGE.md +49 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/Dropdown/BareDropdown.tsx +168 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/Dropdown/Dropdown.icons.tsx +33 -0
- package/src/components/Dropdown/Dropdown.module.css +535 -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 +319 -0
- package/src/components/Dropdown/USAGE.md +68 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +153 -0
- package/src/components/FileInput/FileInput.module.css +268 -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 +415 -0
- package/src/components/FileInput/USAGE.md +145 -0
- package/src/components/FileInput/index.ts +1 -0
- package/src/components/FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md +249 -0
- package/src/components/FileUpload/FileUpload.module.css +200 -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 +352 -0
- package/src/components/FileUpload/USAGE.md +199 -0
- package/src/components/FileUpload/index.ts +1 -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 +89 -0
- package/src/components/Flex/USAGE.md +41 -0
- package/src/components/Flex/index.ts +1 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +92 -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 +72 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlLayout/index.ts +1 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +35 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +87 -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 +149 -0
- package/src/components/FormControlWrapper/USAGE.md +40 -0
- package/src/components/FormControlWrapper/index.ts +1 -0
- package/src/components/Grid/Grid.module.css +72 -0
- package/src/components/Grid/Grid.stories.tsx +161 -0
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +155 -0
- package/src/components/Grid/IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Grid/USAGE.md +53 -0
- package/src/components/Grid/index.ts +1 -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 +116 -0
- package/src/components/Group/USAGE.md +41 -0
- package/src/components/Group/index.ts +1 -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 +28 -0
- package/src/components/Heading/USAGE.md +36 -0
- package/src/components/Heading/index.ts +1 -0
- package/src/components/HoverCard/HoverCard.module.css +107 -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 +145 -0
- package/src/components/HoverCard/USAGE.md +45 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +27 -0
- package/src/components/Label/Label.module.css +169 -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 +96 -0
- package/src/components/Label/USAGE.md +36 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layer/USAGE.md +50 -0
- package/src/components/Link/LINK_IMPLEMENTATION_NOTES.md +9 -0
- package/src/components/Link/Link.module.css +105 -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 +45 -0
- package/src/components/Link/USAGE.md +40 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Loader/Loader.animate.dom.test.tsx +72 -0
- package/src/components/Loader/Loader.module.css +175 -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 +72 -0
- package/src/components/Loader/USAGE.md +42 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Menu/IMPLEMENTATION_NOTES.md +5 -0
- package/src/components/Menu/Menu.module.css +283 -0
- package/src/components/Menu/Menu.stories.tsx +405 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Menu/Menu.tsx +103 -0
- package/src/components/Menu/USAGE.md +53 -0
- package/src/components/Menu/index.ts +1 -0
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +31 -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 +231 -0
- package/src/components/Modal/USAGE.md +40 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/NumberInput/NUMBER_INPUT_IMPLEMENTATION_NOTES.md +93 -0
- package/src/components/NumberInput/NumberInput.module.css +303 -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 +273 -0
- package/src/components/NumberInput/USAGE.md +36 -0
- package/src/components/NumberInput/index.ts +1 -0
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +40 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +197 -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 +123 -0
- package/src/components/Pagination/USAGE.md +36 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +133 -0
- package/src/components/Panel/Panel.module.css +231 -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 +186 -0
- package/src/components/Panel/USAGE.md +46 -0
- package/src/components/Panel/index.ts +1 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +22 -0
- package/src/components/Popover/Popover.module.css +118 -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 +267 -0
- package/src/components/Popover/USAGE.md +69 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Radio/RADIO_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Radio/Radio.module.css +247 -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 +223 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +122 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/Radio/index.ts +2 -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 +108 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/USAGE.md +36 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +2 -0
- package/src/components/RecursicaThemeProvider/USAGE.md +60 -0
- package/src/components/SegmentedControl/IMPLEMENTATION_NOTES.md +14 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +201 -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 +149 -0
- package/src/components/SegmentedControl/USAGE.md +49 -0
- package/src/components/SegmentedControl/index.ts +1 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +55 -0
- package/src/components/Slider/Slider.module.css +635 -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 +435 -0
- package/src/components/Slider/USAGE.md +56 -0
- package/src/components/Slider/index.ts +1 -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 +43 -0
- package/src/components/Stack/USAGE.md +41 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +120 -0
- package/src/components/Stepper/Stepper.module.css +474 -0
- package/src/components/Stepper/Stepper.stories.tsx +157 -0
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Stepper/Stepper.tsx +240 -0
- package/src/components/Stepper/USAGE.md +45 -0
- package/src/components/Stepper/index.ts +1 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +147 -0
- package/src/components/Switch/Switch.module.css +346 -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 +294 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +156 -0
- package/src/components/Switch/USAGE.md +36 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +75 -0
- package/src/components/Table/Table.module.css +462 -0
- package/src/components/Table/Table.stories.tsx +154 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Table/Table.tsx +250 -0
- package/src/components/Table/USAGE.md +90 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +76 -0
- package/src/components/Tabs/Tabs.module.css +801 -0
- package/src/components/Tabs/Tabs.stories.tsx +174 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +103 -0
- package/src/components/Tabs/USAGE.md +61 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +10 -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 +19 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/TextArea/TextArea.module.css +203 -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 +162 -0
- package/src/components/TextArea/USAGE.md +38 -0
- package/src/components/TextArea/index.ts +1 -0
- package/src/components/TextField/TextField.module.css +271 -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 +182 -0
- package/src/components/TextField/USAGE.md +38 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +89 -0
- package/src/components/TimePicker/TimePicker.module.css +262 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +155 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +277 -0
- package/src/components/TimePicker/USAGE.md +61 -0
- package/src/components/TimePicker/index.ts +1 -0
- package/src/components/Timeline/IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/Timeline/Timeline.module.css +363 -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 +90 -0
- package/src/components/Timeline/TimelineItem.tsx +95 -0
- package/src/components/Timeline/USAGE.md +41 -0
- package/src/components/Timeline/index.ts +2 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +37 -0
- package/src/components/Toast/Toast.module.css +193 -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 +121 -0
- package/src/components/Toast/USAGE.md +42 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.module.css +83 -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 +78 -0
- package/src/components/Tooltip/USAGE.md +40 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +140 -0
- package/src/components/TransferList/TransferList.module.css +174 -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/TransferList/index.ts +1 -0
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +53 -0
- package/src/components/Tree/Tree.module.css +272 -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 +298 -0
- package/src/components/Tree/USAGE.md +99 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/Typography/TYPOGRAPHY_IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Typography/Typography.module.css +13 -0
- package/src/components/Typography/Typography.test.tsx +1 -0
- package/src/components/Typography/Typography.tsx +43 -0
- package/src/components/Typography/USAGE.md +40 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +50 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +194 -0
- package/src/types/index.ts +9 -0
- package/src/types/scss-modules.d.ts +9 -0
- package/src/utils/ColorSchemeWrapper.tsx +23 -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 +143 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/renderRichOption.tsx +51 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--recursica_ui-kit_components_timeline_properties_item-gap);
|
|
5
|
+
margin: 0 !important;
|
|
6
|
+
padding: 0 !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.item {
|
|
10
|
+
/* Mui gives every item a 70px min-height by default; content should drive height instead */
|
|
11
|
+
min-height: 0 !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Mui reserves a flex:1 spacer (via ::before) for the opposite-content column even when none is
|
|
15
|
+
rendered. Recursica's Timeline never uses TimelineOppositeContent, so neutralize it to keep the
|
|
16
|
+
bullet/connector column flush against the left edge. */
|
|
17
|
+
:global(.MuiTimelineItem-root)::before {
|
|
18
|
+
content: none !important;
|
|
19
|
+
flex: 0 !important;
|
|
20
|
+
padding: 0 !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.itemBody {
|
|
24
|
+
padding: 0 0 0
|
|
25
|
+
var(--recursica_ui-kit_components_timeline_properties_bullet-content-gap) !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.itemConnector {
|
|
29
|
+
width: var(
|
|
30
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_connector-size
|
|
31
|
+
) !important;
|
|
32
|
+
background-color: var(
|
|
33
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_connector-color
|
|
34
|
+
) !important;
|
|
35
|
+
/* `.root`'s flex `gap` (item-gap) puts real space between adjacent `<li>`s, but
|
|
36
|
+
this connector is `flex: 1` (MUI default) filling only its own `<li>`'s
|
|
37
|
+
content height — it always ended flush with its own item's bottom edge,
|
|
38
|
+
short of the next item's bullet by exactly `item-gap`. A negative
|
|
39
|
+
margin-bottom the same size as the gap grows the connector's own flex
|
|
40
|
+
size by that amount (flexbox distributes remaining main-size accounting
|
|
41
|
+
for margins, so a negative margin here hands the connector extra grow
|
|
42
|
+
space) while the *container's* own layout size is pulled back in by the
|
|
43
|
+
same amount — net effect: the rendered line visually extends the full
|
|
44
|
+
`item-gap` past its own item, reaching the next bullet. */
|
|
45
|
+
margin-bottom: calc(
|
|
46
|
+
-1 * var(--recursica_ui-kit_components_timeline_properties_item-gap)
|
|
47
|
+
) !important;
|
|
48
|
+
}
|
|
49
|
+
.item[data-active] .itemConnector {
|
|
50
|
+
width: var(
|
|
51
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_connector-size
|
|
52
|
+
) !important;
|
|
53
|
+
background-color: var(
|
|
54
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_connector-color
|
|
55
|
+
) !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.itemBullet {
|
|
59
|
+
display: flex !important;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-self: center !important;
|
|
63
|
+
margin: 0 !important;
|
|
64
|
+
padding: 0 !important;
|
|
65
|
+
box-shadow: none !important;
|
|
66
|
+
|
|
67
|
+
/* Default Variant */
|
|
68
|
+
.item[data-variant="default"] & {
|
|
69
|
+
width: var(
|
|
70
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
71
|
+
) !important;
|
|
72
|
+
height: var(
|
|
73
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
74
|
+
) !important;
|
|
75
|
+
border-radius: var(
|
|
76
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-radius
|
|
77
|
+
) !important;
|
|
78
|
+
border-width: var(
|
|
79
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-size
|
|
80
|
+
) !important;
|
|
81
|
+
|
|
82
|
+
background-color: var(
|
|
83
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_inactive_properties_colors_background-color
|
|
84
|
+
) !important;
|
|
85
|
+
border-color: var(
|
|
86
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_inactive_properties_colors_border-color
|
|
87
|
+
) !important;
|
|
88
|
+
}
|
|
89
|
+
.item[data-variant="default"][data-active] & {
|
|
90
|
+
background-color: var(
|
|
91
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_active_properties_colors_background-color
|
|
92
|
+
) !important;
|
|
93
|
+
border-color: var(
|
|
94
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_variants_selection-states_active_properties_colors_border-color
|
|
95
|
+
) !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Icon Variant */
|
|
99
|
+
.item[data-variant="icon"] & {
|
|
100
|
+
width: var(
|
|
101
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
102
|
+
) !important;
|
|
103
|
+
height: var(
|
|
104
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
105
|
+
) !important;
|
|
106
|
+
border-radius: var(
|
|
107
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-radius
|
|
108
|
+
) !important;
|
|
109
|
+
border-width: var(
|
|
110
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-size
|
|
111
|
+
) !important;
|
|
112
|
+
|
|
113
|
+
background-color: var(
|
|
114
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_background-color
|
|
115
|
+
) !important;
|
|
116
|
+
border-color: var(
|
|
117
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_border-color
|
|
118
|
+
) !important;
|
|
119
|
+
color: var(
|
|
120
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_inactive_properties_colors_icon-color
|
|
121
|
+
) !important;
|
|
122
|
+
|
|
123
|
+
/* Propagate icon size */
|
|
124
|
+
font-size: var(
|
|
125
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
126
|
+
);
|
|
127
|
+
& svg {
|
|
128
|
+
width: var(
|
|
129
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
130
|
+
);
|
|
131
|
+
height: var(
|
|
132
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.item[data-variant="icon"][data-active] & {
|
|
137
|
+
background-color: var(
|
|
138
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_background-color
|
|
139
|
+
) !important;
|
|
140
|
+
border-color: var(
|
|
141
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_border-color
|
|
142
|
+
) !important;
|
|
143
|
+
color: var(
|
|
144
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_variants_selection-states_active_properties_colors_icon-color
|
|
145
|
+
) !important;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Icon Alternative Variant */
|
|
149
|
+
.item[data-variant="icon-alternative"] & {
|
|
150
|
+
width: var(
|
|
151
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
152
|
+
) !important;
|
|
153
|
+
height: var(
|
|
154
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
155
|
+
) !important;
|
|
156
|
+
border-radius: var(
|
|
157
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-radius
|
|
158
|
+
) !important;
|
|
159
|
+
border-width: var(
|
|
160
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-size
|
|
161
|
+
) !important;
|
|
162
|
+
|
|
163
|
+
background-color: var(
|
|
164
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_background-color
|
|
165
|
+
) !important;
|
|
166
|
+
border-color: var(
|
|
167
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_border-color
|
|
168
|
+
) !important;
|
|
169
|
+
color: var(
|
|
170
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_inactive_properties_colors_icon-color
|
|
171
|
+
) !important;
|
|
172
|
+
|
|
173
|
+
font-size: var(
|
|
174
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
175
|
+
);
|
|
176
|
+
& svg {
|
|
177
|
+
width: var(
|
|
178
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
179
|
+
);
|
|
180
|
+
height: var(
|
|
181
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
.item[data-variant="icon-alternative"][data-active] & {
|
|
186
|
+
background-color: var(
|
|
187
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_background-color
|
|
188
|
+
) !important;
|
|
189
|
+
border-color: var(
|
|
190
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_border-color
|
|
191
|
+
) !important;
|
|
192
|
+
color: var(
|
|
193
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_variants_selection-states_active_properties_colors_icon-color
|
|
194
|
+
) !important;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Avatar Variant */
|
|
198
|
+
.item[data-variant="avatar"] & {
|
|
199
|
+
/* Avatar sizing is often governed by the avatar itself, but we'll apply the radius and opacity */
|
|
200
|
+
width: var(
|
|
201
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
202
|
+
) !important;
|
|
203
|
+
height: var(
|
|
204
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
205
|
+
) !important;
|
|
206
|
+
border-radius: var(
|
|
207
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-radius
|
|
208
|
+
) !important;
|
|
209
|
+
border-width: var(
|
|
210
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-size
|
|
211
|
+
) !important;
|
|
212
|
+
opacity: var(
|
|
213
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_avatar-opacity
|
|
214
|
+
) !important;
|
|
215
|
+
|
|
216
|
+
background-color: var(
|
|
217
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_colors_background-color
|
|
218
|
+
) !important;
|
|
219
|
+
border-color: var(
|
|
220
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_inactive_properties_colors_border-color
|
|
221
|
+
) !important;
|
|
222
|
+
}
|
|
223
|
+
.item[data-variant="avatar"][data-active] & {
|
|
224
|
+
opacity: var(
|
|
225
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_avatar-opacity
|
|
226
|
+
) !important;
|
|
227
|
+
background-color: var(
|
|
228
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_colors_background-color
|
|
229
|
+
) !important;
|
|
230
|
+
border-color: var(
|
|
231
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_variants_selection-states_active_properties_colors_border-color
|
|
232
|
+
) !important;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.itemTitle {
|
|
237
|
+
font-family: var(
|
|
238
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-family
|
|
239
|
+
);
|
|
240
|
+
font-size: var(
|
|
241
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-size
|
|
242
|
+
);
|
|
243
|
+
font-style: var(
|
|
244
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-style
|
|
245
|
+
);
|
|
246
|
+
font-weight: var(
|
|
247
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-weight
|
|
248
|
+
);
|
|
249
|
+
letter-spacing: var(
|
|
250
|
+
--recursica_ui-kit_components_timeline_properties_title-text_letter-spacing
|
|
251
|
+
);
|
|
252
|
+
line-height: var(
|
|
253
|
+
--recursica_ui-kit_components_timeline_properties_title-text_line-height
|
|
254
|
+
);
|
|
255
|
+
text-decoration: var(
|
|
256
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-decoration
|
|
257
|
+
);
|
|
258
|
+
text-transform: var(
|
|
259
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-transform
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
/* Title Description Gap */
|
|
263
|
+
margin-bottom: var(
|
|
264
|
+
--recursica_ui-kit_components_timeline_properties_title-description-gap
|
|
265
|
+
) !important;
|
|
266
|
+
|
|
267
|
+
/* Inactive Title Color */
|
|
268
|
+
color: var(
|
|
269
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_title-color
|
|
270
|
+
) !important;
|
|
271
|
+
|
|
272
|
+
/* Active Title Color */
|
|
273
|
+
.item[data-active] & {
|
|
274
|
+
color: var(
|
|
275
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_title-color
|
|
276
|
+
) !important;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.itemContent {
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-direction: column;
|
|
283
|
+
gap: var(
|
|
284
|
+
--recursica_ui-kit_components_timeline_properties_description-timestamp-gap
|
|
285
|
+
);
|
|
286
|
+
max-width: var(
|
|
287
|
+
--recursica_ui-kit_components_timeline_properties_max-text-width
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.description {
|
|
292
|
+
font-family: var(
|
|
293
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-family
|
|
294
|
+
);
|
|
295
|
+
font-size: var(
|
|
296
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-size
|
|
297
|
+
);
|
|
298
|
+
font-style: var(
|
|
299
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-style
|
|
300
|
+
);
|
|
301
|
+
font-weight: var(
|
|
302
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-weight
|
|
303
|
+
);
|
|
304
|
+
letter-spacing: var(
|
|
305
|
+
--recursica_ui-kit_components_timeline_properties_description-text_letter-spacing
|
|
306
|
+
);
|
|
307
|
+
line-height: var(
|
|
308
|
+
--recursica_ui-kit_components_timeline_properties_description-text_line-height
|
|
309
|
+
);
|
|
310
|
+
text-decoration: var(
|
|
311
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-decoration
|
|
312
|
+
);
|
|
313
|
+
text-transform: var(
|
|
314
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-transform
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
color: var(
|
|
318
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_description-color
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
.item[data-active] & {
|
|
322
|
+
color: var(
|
|
323
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_description-color
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.timestamp {
|
|
329
|
+
font-family: var(
|
|
330
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-family
|
|
331
|
+
);
|
|
332
|
+
font-size: var(
|
|
333
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-size
|
|
334
|
+
);
|
|
335
|
+
font-style: var(
|
|
336
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-style
|
|
337
|
+
);
|
|
338
|
+
font-weight: var(
|
|
339
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-weight
|
|
340
|
+
);
|
|
341
|
+
letter-spacing: var(
|
|
342
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_letter-spacing
|
|
343
|
+
);
|
|
344
|
+
line-height: var(
|
|
345
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_line-height
|
|
346
|
+
);
|
|
347
|
+
text-decoration: var(
|
|
348
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-decoration
|
|
349
|
+
);
|
|
350
|
+
text-transform: var(
|
|
351
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-transform
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
color: var(
|
|
355
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_inactive_properties_colors_timestamp-color
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
.item[data-active] & {
|
|
359
|
+
color: var(
|
|
360
|
+
--recursica_ui-kit_components_timeline_variants_selection-states_active_properties_colors_timestamp-color
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -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,90 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MuiTimeline, {
|
|
3
|
+
type TimelineProps as MuiTimelineProps,
|
|
4
|
+
} from "@mui/lab/Timeline";
|
|
5
|
+
import {
|
|
6
|
+
filterStylingProps,
|
|
7
|
+
mergeClassNames,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
} from "../../utils/filterStylingProps";
|
|
10
|
+
import styles from "./Timeline.module.css";
|
|
11
|
+
import { TimelineItem, type TimelineItemProps } from "./TimelineItem";
|
|
12
|
+
|
|
13
|
+
import { type RecursicaTimelineProps } from "@recursica/adapter-common";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Properties for the strictly-tokenized Timeline component.
|
|
17
|
+
* Native Mui abstract properties like `color`, `radius`, `bulletSize`, and `lineWidth`
|
|
18
|
+
* have been stripped out to strictly enforce the structural mappings of the Recursica UI Kit.
|
|
19
|
+
*/
|
|
20
|
+
export type TimelineProps = RecursicaOverStyled<
|
|
21
|
+
Omit<MuiTimelineProps, "color" | "radius" | "bulletSize" | "lineWidth"> &
|
|
22
|
+
RecursicaTimelineProps
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
interface TimelineComponent
|
|
26
|
+
extends React.ForwardRefExoticComponent<
|
|
27
|
+
TimelineProps & React.RefAttributes<HTMLUListElement>
|
|
28
|
+
> {
|
|
29
|
+
Item: typeof TimelineItem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The `Timeline` component displays a list of events in chronological order.
|
|
34
|
+
*
|
|
35
|
+
* **Recursica Abstract:**
|
|
36
|
+
* This component acts as a structural wrapper around Mui's `<Timeline>`, composing
|
|
37
|
+
* `TimelineSeparator`/`TimelineDot`/`TimelineConnector`/`TimelineContent` per item
|
|
38
|
+
* (via `Timeline.Item`) so the bullet marker and connecting line render the same way
|
|
39
|
+
* they do in the Mantine adapter.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Timeline active={1}>
|
|
44
|
+
* <Timeline.Item title="Event 1" timestamp="Yesterday">Description</Timeline.Item>
|
|
45
|
+
* </Timeline>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
const TimelineInner = React.forwardRef<HTMLUListElement, TimelineProps>(
|
|
49
|
+
function Timeline(
|
|
50
|
+
{ overStyled = false, active = -1, children, ...rest },
|
|
51
|
+
ref,
|
|
52
|
+
) {
|
|
53
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
54
|
+
|
|
55
|
+
const mergedClassNames = mergeClassNames(
|
|
56
|
+
{ root: styles.root },
|
|
57
|
+
(sanitizedProps as Record<string, unknown>).classes as
|
|
58
|
+
| Partial<Record<string, string>>
|
|
59
|
+
| undefined,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const items = React.Children.toArray(children);
|
|
63
|
+
const decoratedItems = items.map((item, index) =>
|
|
64
|
+
React.isValidElement(item)
|
|
65
|
+
? React.cloneElement(item as React.ReactElement<TimelineItemProps>, {
|
|
66
|
+
__active: active >= index,
|
|
67
|
+
__isLast: index === items.length - 1,
|
|
68
|
+
})
|
|
69
|
+
: item,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<MuiTimeline
|
|
74
|
+
ref={ref}
|
|
75
|
+
{...(sanitizedProps as unknown as Omit<
|
|
76
|
+
MuiTimelineProps,
|
|
77
|
+
"color" | "radius" | "bulletSize" | "lineWidth"
|
|
78
|
+
>)}
|
|
79
|
+
classes={mergedClassNames}
|
|
80
|
+
>
|
|
81
|
+
{decoratedItems}
|
|
82
|
+
</MuiTimeline>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
TimelineInner.displayName = "Timeline";
|
|
88
|
+
|
|
89
|
+
export const Timeline = TimelineInner as TimelineComponent;
|
|
90
|
+
Timeline.Item = TimelineItem;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MuiTimelineItem, {
|
|
3
|
+
type TimelineItemProps as MuiTimelineItemProps,
|
|
4
|
+
} from "@mui/lab/TimelineItem";
|
|
5
|
+
import TimelineSeparator from "@mui/lab/TimelineSeparator";
|
|
6
|
+
import TimelineDot from "@mui/lab/TimelineDot";
|
|
7
|
+
import TimelineConnector from "@mui/lab/TimelineConnector";
|
|
8
|
+
import TimelineContent from "@mui/lab/TimelineContent";
|
|
9
|
+
import {
|
|
10
|
+
filterStylingProps,
|
|
11
|
+
type RecursicaOverStyled,
|
|
12
|
+
} from "../../utils/filterStylingProps";
|
|
13
|
+
import styles from "./Timeline.module.css";
|
|
14
|
+
|
|
15
|
+
import { type RecursicaTimelineItemProps } from "@recursica/adapter-common";
|
|
16
|
+
|
|
17
|
+
export type TimelineItemProps = RecursicaOverStyled<
|
|
18
|
+
Omit<MuiTimelineItemProps, "radius" | "color" | "lineVariant" | "title"> &
|
|
19
|
+
RecursicaTimelineItemProps & {
|
|
20
|
+
/** Heading rendered above the item's description/timestamp */
|
|
21
|
+
title?: React.ReactNode;
|
|
22
|
+
/** @internal injected by `Timeline` to mark items up to `active` */
|
|
23
|
+
__active?: boolean;
|
|
24
|
+
/** @internal injected by `Timeline`; suppresses the trailing connector on the last item */
|
|
25
|
+
__isLast?: boolean;
|
|
26
|
+
}
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The individual item component for the Timeline.
|
|
31
|
+
*
|
|
32
|
+
* **Recursica Abstract:**
|
|
33
|
+
* The `Timeline.Item` has been extended to support a `timestamp` string natively,
|
|
34
|
+
* rendering it below the body content. It also accepts a `bulletVariant` to morph
|
|
35
|
+
* the structural dimensions of the node circle automatically.
|
|
36
|
+
*
|
|
37
|
+
* Internally it composes Mui's `TimelineSeparator`/`TimelineDot`/`TimelineConnector`/
|
|
38
|
+
* `TimelineContent` primitives (Mui has no single "item" abstraction like Mantine's
|
|
39
|
+
* `Timeline.Item` that renders a bullet + connector on its own).
|
|
40
|
+
*/
|
|
41
|
+
export const TimelineItem = React.forwardRef<HTMLLIElement, TimelineItemProps>(
|
|
42
|
+
function TimelineItem(
|
|
43
|
+
{
|
|
44
|
+
overStyled = false,
|
|
45
|
+
timestamp,
|
|
46
|
+
bulletVariant = "default",
|
|
47
|
+
bullet,
|
|
48
|
+
title,
|
|
49
|
+
children,
|
|
50
|
+
__active = false,
|
|
51
|
+
__isLast = false,
|
|
52
|
+
...rest
|
|
53
|
+
},
|
|
54
|
+
ref,
|
|
55
|
+
) {
|
|
56
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
57
|
+
const { className: userClassName, ...restSanitizedProps } =
|
|
58
|
+
sanitizedProps as Record<string, unknown> & { className?: string };
|
|
59
|
+
|
|
60
|
+
const content = timestamp ? (
|
|
61
|
+
<>
|
|
62
|
+
{children && <div className={styles.description}>{children}</div>}
|
|
63
|
+
<div className={styles.timestamp}>{timestamp}</div>
|
|
64
|
+
</>
|
|
65
|
+
) : (
|
|
66
|
+
children
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<MuiTimelineItem
|
|
71
|
+
ref={ref}
|
|
72
|
+
{...(restSanitizedProps as unknown as Omit<
|
|
73
|
+
MuiTimelineItemProps,
|
|
74
|
+
"radius" | "color" | "lineVariant" | "title"
|
|
75
|
+
>)}
|
|
76
|
+
data-variant={bulletVariant}
|
|
77
|
+
data-active={__active || undefined}
|
|
78
|
+
className={
|
|
79
|
+
userClassName ? `${styles.item} ${userClassName}` : styles.item
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<TimelineSeparator>
|
|
83
|
+
<TimelineDot className={styles.itemBullet}>{bullet}</TimelineDot>
|
|
84
|
+
{!__isLast && <TimelineConnector className={styles.itemConnector} />}
|
|
85
|
+
</TimelineSeparator>
|
|
86
|
+
<TimelineContent className={styles.itemBody}>
|
|
87
|
+
{title && <div className={styles.itemTitle}>{title}</div>}
|
|
88
|
+
<div className={styles.itemContent}>{content}</div>
|
|
89
|
+
</TimelineContent>
|
|
90
|
+
</MuiTimelineItem>
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
TimelineItem.displayName = "TimelineItem";
|