@timmbr/ui 1.0.0-beta
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/README.md +151 -0
- package/dist/components/Accordion/Accordion.d.ts +8 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.js +52 -0
- package/dist/components/Accordion/Accordion.styles.d.ts +4 -0
- package/dist/components/Accordion/Accordion.styles.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.styles.js +11 -0
- package/dist/components/Accordion/Accordion.types.d.ts +12 -0
- package/dist/components/Accordion/Accordion.types.d.ts.map +1 -0
- package/dist/components/Accordion/index.d.ts +4 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/Alert/Alert.d.ts +6 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/Alert.js +99 -0
- package/dist/components/Alert/Alert.styles.d.ts +11 -0
- package/dist/components/Alert/Alert.styles.d.ts.map +1 -0
- package/dist/components/Alert/Alert.styles.js +47 -0
- package/dist/components/Alert/Alert.types.d.ts +30 -0
- package/dist/components/Alert/Alert.types.d.ts.map +1 -0
- package/dist/components/Alert/index.d.ts +4 -0
- package/dist/components/Alert/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +4 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.js +74 -0
- package/dist/components/Avatar/Avatar.styles.d.ts +11 -0
- package/dist/components/Avatar/Avatar.styles.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.styles.js +55 -0
- package/dist/components/Avatar/Avatar.types.d.ts +26 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -0
- package/dist/components/Avatar/index.d.ts +4 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +4 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +50 -0
- package/dist/components/Badge/Badge.styles.d.ts +7 -0
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/components/Badge/Badge.styles.js +30 -0
- package/dist/components/Badge/Badge.types.d.ts +21 -0
- package/dist/components/Badge/Badge.types.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +4 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +89 -0
- package/dist/components/Button/Button.styles.d.ts +7 -0
- package/dist/components/Button/Button.styles.d.ts.map +1 -0
- package/dist/components/Button/Button.styles.js +31 -0
- package/dist/components/Button/Button.types.d.ts +30 -0
- package/dist/components/Button/Button.types.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +4 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +9 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.js +90 -0
- package/dist/components/Card/Card.styles.d.ts +12 -0
- package/dist/components/Card/Card.styles.d.ts.map +1 -0
- package/dist/components/Card/Card.styles.js +33 -0
- package/dist/components/Card/Card.types.d.ts +24 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +4 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Center/Center.d.ts +4 -0
- package/dist/components/Center/Center.d.ts.map +1 -0
- package/dist/components/Center/Center.js +26 -0
- package/dist/components/Center/Center.styles.d.ts +6 -0
- package/dist/components/Center/Center.styles.d.ts.map +1 -0
- package/dist/components/Center/Center.styles.js +18 -0
- package/dist/components/Center/Center.types.d.ts +9 -0
- package/dist/components/Center/Center.types.d.ts.map +1 -0
- package/dist/components/Center/index.d.ts +4 -0
- package/dist/components/Center/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +88 -0
- package/dist/components/Checkbox/Checkbox.styles.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.styles.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.styles.js +41 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +4 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Chip/Chip.d.ts +4 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +74 -0
- package/dist/components/Chip/Chip.styles.d.ts +10 -0
- package/dist/components/Chip/Chip.styles.d.ts.map +1 -0
- package/dist/components/Chip/Chip.styles.js +43 -0
- package/dist/components/Chip/Chip.types.d.ts +26 -0
- package/dist/components/Chip/Chip.types.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +4 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/Container/Container.d.ts +4 -0
- package/dist/components/Container/Container.d.ts.map +1 -0
- package/dist/components/Container/Container.js +35 -0
- package/dist/components/Container/Container.styles.d.ts +7 -0
- package/dist/components/Container/Container.styles.d.ts.map +1 -0
- package/dist/components/Container/Container.styles.js +24 -0
- package/dist/components/Container/Container.types.d.ts +9 -0
- package/dist/components/Container/Container.types.d.ts.map +1 -0
- package/dist/components/Container/index.d.ts +4 -0
- package/dist/components/Container/index.d.ts.map +1 -0
- package/dist/components/DataList/DataList.d.ts +7 -0
- package/dist/components/DataList/DataList.d.ts.map +1 -0
- package/dist/components/DataList/DataList.js +95 -0
- package/dist/components/DataList/DataList.styles.d.ts +14 -0
- package/dist/components/DataList/DataList.styles.d.ts.map +1 -0
- package/dist/components/DataList/DataList.styles.js +49 -0
- package/dist/components/DataList/DataList.types.d.ts +59 -0
- package/dist/components/DataList/DataList.types.d.ts.map +1 -0
- package/dist/components/DataList/index.d.ts +4 -0
- package/dist/components/DataList/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +14 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +86 -0
- package/dist/components/Dialog/Dialog.styles.d.ts +7 -0
- package/dist/components/Dialog/Dialog.styles.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.styles.js +22 -0
- package/dist/components/Dialog/Dialog.types.d.ts +16 -0
- package/dist/components/Dialog/Dialog.types.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +4 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/Divider.js +74 -0
- package/dist/components/Divider/Divider.styles.d.ts +9 -0
- package/dist/components/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/components/Divider/Divider.styles.js +48 -0
- package/dist/components/Divider/Divider.types.d.ts +47 -0
- package/dist/components/Divider/Divider.types.d.ts.map +1 -0
- package/dist/components/Divider/index.d.ts +4 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +14 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +69 -0
- package/dist/components/Drawer/Drawer.styles.d.ts +9 -0
- package/dist/components/Drawer/Drawer.styles.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.styles.js +29 -0
- package/dist/components/Drawer/Drawer.types.d.ts +17 -0
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -0
- package/dist/components/Drawer/index.d.ts +4 -0
- package/dist/components/Drawer/index.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +22 -0
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +133 -0
- package/dist/components/Dropdown/Dropdown.styles.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.styles.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.styles.js +10 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts +15 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts.map +1 -0
- package/dist/components/Dropdown/index.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +4 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.js +82 -0
- package/dist/components/EmptyState/EmptyState.styles.d.ts +10 -0
- package/dist/components/EmptyState/EmptyState.styles.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.styles.js +40 -0
- package/dist/components/EmptyState/EmptyState.types.d.ts +30 -0
- package/dist/components/EmptyState/EmptyState.types.d.ts.map +1 -0
- package/dist/components/EmptyState/index.d.ts +4 -0
- package/dist/components/EmptyState/index.d.ts.map +1 -0
- package/dist/components/FormField/FormField.d.ts +4 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -0
- package/dist/components/FormField/FormField.js +58 -0
- package/dist/components/FormField/FormField.styles.d.ts +2 -0
- package/dist/components/FormField/FormField.styles.d.ts.map +1 -0
- package/dist/components/FormField/FormField.styles.js +5 -0
- package/dist/components/FormField/FormField.types.d.ts +28 -0
- package/dist/components/FormField/FormField.types.d.ts.map +1 -0
- package/dist/components/FormField/index.d.ts +4 -0
- package/dist/components/FormField/index.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +4 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/Grid.js +58 -0
- package/dist/components/Grid/Grid.styles.d.ts +7 -0
- package/dist/components/Grid/Grid.styles.d.ts.map +1 -0
- package/dist/components/Grid/Grid.styles.js +75 -0
- package/dist/components/Grid/Grid.types.d.ts +41 -0
- package/dist/components/Grid/Grid.types.d.ts.map +1 -0
- package/dist/components/Grid/index.d.ts +4 -0
- package/dist/components/Grid/index.d.ts.map +1 -0
- package/dist/components/Heading/Heading.d.ts +4 -0
- package/dist/components/Heading/Heading.d.ts.map +1 -0
- package/dist/components/Heading/Heading.js +47 -0
- package/dist/components/Heading/Heading.styles.d.ts +9 -0
- package/dist/components/Heading/Heading.styles.d.ts.map +1 -0
- package/dist/components/Heading/Heading.styles.js +42 -0
- package/dist/components/Heading/Heading.types.d.ts +34 -0
- package/dist/components/Heading/Heading.types.d.ts.map +1 -0
- package/dist/components/Heading/index.d.ts +4 -0
- package/dist/components/Heading/index.d.ts.map +1 -0
- package/dist/components/Icon/Icon.d.ts +4 -0
- package/dist/components/Icon/Icon.d.ts.map +1 -0
- package/dist/components/Icon/Icon.js +78 -0
- package/dist/components/Icon/Icon.styles.d.ts +8 -0
- package/dist/components/Icon/Icon.styles.d.ts.map +1 -0
- package/dist/components/Icon/Icon.styles.js +37 -0
- package/dist/components/Icon/Icon.types.d.ts +39 -0
- package/dist/components/Icon/Icon.types.d.ts.map +1 -0
- package/dist/components/Icon/index.d.ts +4 -0
- package/dist/components/Icon/index.d.ts.map +1 -0
- package/dist/components/Inline/Inline.d.ts +4 -0
- package/dist/components/Inline/Inline.d.ts.map +1 -0
- package/dist/components/Inline/Inline.js +48 -0
- package/dist/components/Inline/Inline.styles.d.ts +8 -0
- package/dist/components/Inline/Inline.styles.d.ts.map +1 -0
- package/dist/components/Inline/Inline.styles.js +31 -0
- package/dist/components/Inline/Inline.types.d.ts +17 -0
- package/dist/components/Inline/Inline.types.d.ts.map +1 -0
- package/dist/components/Inline/index.d.ts +4 -0
- package/dist/components/Inline/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.js +194 -0
- package/dist/components/Input/Input.styles.d.ts +10 -0
- package/dist/components/Input/Input.styles.d.ts.map +1 -0
- package/dist/components/Input/Input.styles.js +39 -0
- package/dist/components/Input/Input.types.d.ts +55 -0
- package/dist/components/Input/Input.types.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Label/Label.d.ts +4 -0
- package/dist/components/Label/Label.d.ts.map +1 -0
- package/dist/components/Label/Label.js +29 -0
- package/dist/components/Label/Label.styles.d.ts +6 -0
- package/dist/components/Label/Label.styles.d.ts.map +1 -0
- package/dist/components/Label/Label.styles.js +20 -0
- package/dist/components/Label/Label.types.d.ts +14 -0
- package/dist/components/Label/Label.types.d.ts.map +1 -0
- package/dist/components/Label/index.d.ts +4 -0
- package/dist/components/Label/index.d.ts.map +1 -0
- package/dist/components/List/List.d.ts +8 -0
- package/dist/components/List/List.d.ts.map +1 -0
- package/dist/components/List/List.js +82 -0
- package/dist/components/List/List.styles.d.ts +14 -0
- package/dist/components/List/List.styles.d.ts.map +1 -0
- package/dist/components/List/List.styles.js +41 -0
- package/dist/components/List/List.types.d.ts +16 -0
- package/dist/components/List/List.types.d.ts.map +1 -0
- package/dist/components/List/index.d.ts +4 -0
- package/dist/components/List/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +19 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +100 -0
- package/dist/components/Pagination/Pagination.styles.d.ts +5 -0
- package/dist/components/Pagination/Pagination.styles.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.styles.js +24 -0
- package/dist/components/Pagination/Pagination.types.d.ts +98 -0
- package/dist/components/Pagination/Pagination.types.d.ts.map +1 -0
- package/dist/components/Pagination/index.d.ts +4 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +9 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +36 -0
- package/dist/components/Popover/Popover.styles.d.ts +2 -0
- package/dist/components/Popover/Popover.styles.d.ts.map +1 -0
- package/dist/components/Popover/Popover.styles.js +7 -0
- package/dist/components/Popover/Popover.types.d.ts +12 -0
- package/dist/components/Popover/Popover.types.d.ts.map +1 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Progress/Progress.d.ts +4 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/Progress.js +66 -0
- package/dist/components/Progress/Progress.styles.d.ts +9 -0
- package/dist/components/Progress/Progress.styles.d.ts.map +1 -0
- package/dist/components/Progress/Progress.styles.js +36 -0
- package/dist/components/Progress/Progress.types.d.ts +30 -0
- package/dist/components/Progress/Progress.types.d.ts.map +1 -0
- package/dist/components/Progress/index.d.ts +4 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Radio/Radio.d.ts +6 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/Radio.js +128 -0
- package/dist/components/Radio/Radio.styles.d.ts +9 -0
- package/dist/components/Radio/Radio.styles.d.ts.map +1 -0
- package/dist/components/Radio/Radio.styles.js +36 -0
- package/dist/components/Radio/Radio.types.d.ts +51 -0
- package/dist/components/Radio/Radio.types.d.ts.map +1 -0
- package/dist/components/Radio/index.d.ts +4 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts +4 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -0
- package/dist/components/RangeSlider/RangeSlider.js +138 -0
- package/dist/components/RangeSlider/RangeSlider.styles.d.ts +7 -0
- package/dist/components/RangeSlider/RangeSlider.styles.d.ts.map +1 -0
- package/dist/components/RangeSlider/RangeSlider.styles.js +16 -0
- package/dist/components/RangeSlider/RangeSlider.types.d.ts +68 -0
- package/dist/components/RangeSlider/RangeSlider.types.d.ts.map +1 -0
- package/dist/components/RangeSlider/index.d.ts +4 -0
- package/dist/components/RangeSlider/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +13 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/Select.js +128 -0
- package/dist/components/Select/Select.styles.d.ts +10 -0
- package/dist/components/Select/Select.styles.d.ts.map +1 -0
- package/dist/components/Select/Select.styles.js +36 -0
- package/dist/components/Select/Select.types.d.ts +53 -0
- package/dist/components/Select/Select.types.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +4 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +62 -0
- package/dist/components/Skeleton/Skeleton.styles.d.ts +7 -0
- package/dist/components/Skeleton/Skeleton.styles.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.styles.js +26 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +22 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts.map +1 -0
- package/dist/components/Skeleton/index.d.ts +4 -0
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +4 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +44 -0
- package/dist/components/Spinner/Spinner.styles.d.ts +7 -0
- package/dist/components/Spinner/Spinner.styles.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.styles.js +29 -0
- package/dist/components/Spinner/Spinner.types.d.ts +13 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -0
- package/dist/components/Spinner/index.d.ts +4 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Stack/Stack.d.ts +4 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/Stack.js +47 -0
- package/dist/components/Stack/Stack.styles.d.ts +7 -0
- package/dist/components/Stack/Stack.styles.d.ts.map +1 -0
- package/dist/components/Stack/Stack.styles.js +27 -0
- package/dist/components/Stack/Stack.types.d.ts +17 -0
- package/dist/components/Stack/Stack.types.d.ts.map +1 -0
- package/dist/components/Stack/index.d.ts +4 -0
- package/dist/components/Stack/index.d.ts.map +1 -0
- package/dist/components/Stat/Stat.d.ts +8 -0
- package/dist/components/Stat/Stat.d.ts.map +1 -0
- package/dist/components/Stat/Stat.js +87 -0
- package/dist/components/Stat/Stat.styles.d.ts +13 -0
- package/dist/components/Stat/Stat.styles.d.ts.map +1 -0
- package/dist/components/Stat/Stat.styles.js +42 -0
- package/dist/components/Stat/Stat.types.d.ts +16 -0
- package/dist/components/Stat/Stat.types.d.ts.map +1 -0
- package/dist/components/Stat/index.d.ts +4 -0
- package/dist/components/Stat/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +70 -0
- package/dist/components/Switch/Switch.styles.d.ts +9 -0
- package/dist/components/Switch/Switch.styles.d.ts.map +1 -0
- package/dist/components/Switch/Switch.styles.js +36 -0
- package/dist/components/Switch/Switch.types.d.ts +18 -0
- package/dist/components/Switch/Switch.types.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +4 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +12 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +104 -0
- package/dist/components/Table/Table.styles.d.ts +15 -0
- package/dist/components/Table/Table.styles.d.ts.map +1 -0
- package/dist/components/Table/Table.styles.js +53 -0
- package/dist/components/Table/Table.types.d.ts +57 -0
- package/dist/components/Table/Table.types.d.ts.map +1 -0
- package/dist/components/Table/TablePagination.d.ts +4 -0
- package/dist/components/Table/TablePagination.d.ts.map +1 -0
- package/dist/components/Table/TablePagination.js +107 -0
- package/dist/components/Table/index.d.ts +5 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +7 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +177 -0
- package/dist/components/Tabs/Tabs.styles.d.ts +13 -0
- package/dist/components/Tabs/Tabs.styles.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.styles.js +51 -0
- package/dist/components/Tabs/Tabs.types.d.ts +35 -0
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Text/Text.d.ts +4 -0
- package/dist/components/Text/Text.d.ts.map +1 -0
- package/dist/components/Text/Text.js +46 -0
- package/dist/components/Text/Text.styles.d.ts +9 -0
- package/dist/components/Text/Text.styles.d.ts.map +1 -0
- package/dist/components/Text/Text.styles.js +45 -0
- package/dist/components/Text/Text.types.d.ts +28 -0
- package/dist/components/Text/Text.types.d.ts.map +1 -0
- package/dist/components/Text/index.d.ts +4 -0
- package/dist/components/Text/index.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +4 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.js +170 -0
- package/dist/components/Textarea/Textarea.styles.d.ts +9 -0
- package/dist/components/Textarea/Textarea.styles.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.styles.js +38 -0
- package/dist/components/Textarea/Textarea.types.d.ts +38 -0
- package/dist/components/Textarea/Textarea.types.d.ts.map +1 -0
- package/dist/components/Textarea/index.d.ts +4 -0
- package/dist/components/Textarea/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +11 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +107 -0
- package/dist/components/Toast/Toast.styles.d.ts +6 -0
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -0
- package/dist/components/Toast/Toast.styles.js +21 -0
- package/dist/components/Toast/Toast.types.d.ts +27 -0
- package/dist/components/Toast/Toast.types.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +56 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.styles.js +7 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +32 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/providers/AnimationProvider.d.ts +15 -0
- package/dist/providers/AnimationProvider.d.ts.map +1 -0
- package/dist/providers/AnimationProvider.js +35 -0
- package/dist/providers/TimmbrConfigProvider.d.ts +38 -0
- package/dist/providers/TimmbrConfigProvider.d.ts.map +1 -0
- package/dist/providers/TimmbrConfigProvider.js +76 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/types/motion.d.ts +99 -0
- package/dist/types/motion.d.ts.map +1 -0
- package/dist/types/motion.js +73 -0
- package/dist/utils/gap.d.ts +2 -0
- package/dist/utils/gap.d.ts.map +1 -0
- package/dist/utils/gap.js +55 -0
- package/package.json +81 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
|
+
import { cn } from '@timmbr/utils';
|
|
6
|
+
import { motion } from '@timmbr/motion';
|
|
7
|
+
import { resolveMotion } from '../../types/motion.js';
|
|
8
|
+
import { tabsContentVariants, tabsListVariants, tabsTriggerVariants } from './Tabs.styles.js';
|
|
9
|
+
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
10
|
+
|
|
11
|
+
const TabsContext = React.createContext({
|
|
12
|
+
variant: "pills",
|
|
13
|
+
size: "default",
|
|
14
|
+
setActiveTab: () => {
|
|
15
|
+
},
|
|
16
|
+
shouldAnimate: true,
|
|
17
|
+
instanceId: "default"
|
|
18
|
+
});
|
|
19
|
+
const Tabs = React.forwardRef(
|
|
20
|
+
({
|
|
21
|
+
className,
|
|
22
|
+
variant = "pills",
|
|
23
|
+
size = "default",
|
|
24
|
+
motion: localMotion,
|
|
25
|
+
value: controlledValue,
|
|
26
|
+
defaultValue,
|
|
27
|
+
onValueChange,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}, ref) => {
|
|
31
|
+
const [internalValue, setInternalValue] = React.useState(
|
|
32
|
+
controlledValue ?? defaultValue ?? ""
|
|
33
|
+
);
|
|
34
|
+
const activeTab = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
35
|
+
const globalMotion = useGlobalAnimation();
|
|
36
|
+
const { shouldAnimate } = resolveMotion(localMotion, globalMotion);
|
|
37
|
+
const rawId = React.useId();
|
|
38
|
+
const instanceId = React.useMemo(() => rawId.replace(/[^a-zA-Z0-9_-]/g, ""), [rawId]);
|
|
39
|
+
const handleValueChange = (val) => {
|
|
40
|
+
if (controlledValue === void 0) {
|
|
41
|
+
setInternalValue(val);
|
|
42
|
+
}
|
|
43
|
+
onValueChange?.(val);
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
TabsContext.Provider,
|
|
47
|
+
{
|
|
48
|
+
value: {
|
|
49
|
+
variant,
|
|
50
|
+
size,
|
|
51
|
+
activeTab,
|
|
52
|
+
setActiveTab: handleValueChange,
|
|
53
|
+
shouldAnimate,
|
|
54
|
+
instanceId
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
TabsPrimitive.Root,
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
value: activeTab || void 0,
|
|
61
|
+
defaultValue,
|
|
62
|
+
onValueChange: handleValueChange,
|
|
63
|
+
"data-slot": "tabs",
|
|
64
|
+
className: cn("w-full font-sans", className),
|
|
65
|
+
...props,
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
74
|
+
const TabsList = React.forwardRef(({ className, variant: localVariant, size: localSize, ...props }, ref) => {
|
|
75
|
+
const context = React.useContext(TabsContext);
|
|
76
|
+
const variant = localVariant ?? context.variant;
|
|
77
|
+
const size = localSize ?? context.size;
|
|
78
|
+
return /* @__PURE__ */ jsx(
|
|
79
|
+
TabsPrimitive.List,
|
|
80
|
+
{
|
|
81
|
+
ref,
|
|
82
|
+
"data-slot": "tabs-list",
|
|
83
|
+
className: cn(tabsListVariants({ variant, size }), className),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
89
|
+
const TabsTrigger = React.forwardRef(
|
|
90
|
+
({
|
|
91
|
+
className,
|
|
92
|
+
value,
|
|
93
|
+
variant: localVariant,
|
|
94
|
+
size: localSize,
|
|
95
|
+
motion: triggerMotion,
|
|
96
|
+
children,
|
|
97
|
+
...props
|
|
98
|
+
}, ref) => {
|
|
99
|
+
const context = React.useContext(TabsContext);
|
|
100
|
+
const variant = localVariant ?? context.variant;
|
|
101
|
+
const size = localSize ?? context.size;
|
|
102
|
+
const globalMotion = useGlobalAnimation();
|
|
103
|
+
const { shouldAnimate: triggerShouldAnimate, motionClass } = resolveMotion(
|
|
104
|
+
triggerMotion,
|
|
105
|
+
globalMotion
|
|
106
|
+
);
|
|
107
|
+
const shouldAnimate = context.shouldAnimate && triggerShouldAnimate;
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
if (!context.activeTab && value) {
|
|
110
|
+
context.setActiveTab(value);
|
|
111
|
+
}
|
|
112
|
+
}, []);
|
|
113
|
+
const isActive = context.activeTab === value;
|
|
114
|
+
return /* @__PURE__ */ jsxs(
|
|
115
|
+
TabsPrimitive.Trigger,
|
|
116
|
+
{
|
|
117
|
+
ref,
|
|
118
|
+
value,
|
|
119
|
+
"data-slot": "tabs-trigger",
|
|
120
|
+
className: cn(
|
|
121
|
+
"relative",
|
|
122
|
+
tabsTriggerVariants({ variant, size }),
|
|
123
|
+
!shouldAnimate && "transition-none active:scale-100",
|
|
124
|
+
// Static active styles when animation is disabled
|
|
125
|
+
!shouldAnimate && isActive && variant === "pills" && "bg-primary text-white shadow-sm",
|
|
126
|
+
!shouldAnimate && isActive && variant === "underline" && "border-b-2 border-primary text-primary font-semibold",
|
|
127
|
+
!shouldAnimate && isActive && variant === "outline" && "bg-grey-200 dark:bg-grey-700 text-foreground",
|
|
128
|
+
// Text styling when active with animation
|
|
129
|
+
shouldAnimate && isActive && variant === "pills" && "text-white",
|
|
130
|
+
shouldAnimate && isActive && variant === "underline" && "text-primary font-semibold",
|
|
131
|
+
shouldAnimate && isActive && variant === "outline" && "text-foreground",
|
|
132
|
+
motionClass,
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
...props,
|
|
136
|
+
children: [
|
|
137
|
+
isActive && shouldAnimate && /* @__PURE__ */ jsx(
|
|
138
|
+
motion.div,
|
|
139
|
+
{
|
|
140
|
+
layoutId: `tabs-indicator-${context.instanceId}`,
|
|
141
|
+
transition: { type: "spring", stiffness: 500, damping: 35 },
|
|
142
|
+
className: cn(
|
|
143
|
+
"absolute inset-0 pointer-events-none z-0",
|
|
144
|
+
variant === "pills" && "rounded-sm bg-primary shadow-sm",
|
|
145
|
+
variant === "underline" && "bottom-0 top-auto h-0.5 bg-primary rounded-none",
|
|
146
|
+
variant === "outline" && "rounded-sm bg-grey-200 dark:bg-grey-700"
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "relative z-10 flex items-center justify-center gap-1.5", children })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
157
|
+
const TabsContent = React.forwardRef(({ className, motion: contentMotion, ...props }, ref) => {
|
|
158
|
+
const globalMotion = useGlobalAnimation();
|
|
159
|
+
const { shouldAnimate, motionClass } = resolveMotion(contentMotion, globalMotion);
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
TabsPrimitive.Content,
|
|
162
|
+
{
|
|
163
|
+
ref,
|
|
164
|
+
"data-slot": "tabs-content",
|
|
165
|
+
className: cn(
|
|
166
|
+
tabsContentVariants(),
|
|
167
|
+
!shouldAnimate && "transition-none animate-none",
|
|
168
|
+
motionClass,
|
|
169
|
+
className
|
|
170
|
+
),
|
|
171
|
+
...props
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
176
|
+
|
|
177
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const tabsListVariants: (props?: ({
|
|
3
|
+
variant?: "outline" | "underline" | "pills" | null | undefined;
|
|
4
|
+
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const tabsTriggerVariants: (props?: ({
|
|
7
|
+
variant?: "outline" | "underline" | "pills" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const tabsContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export type TabsListVariants = VariantProps<typeof tabsListVariants>;
|
|
12
|
+
export type TabsTriggerVariants = VariantProps<typeof tabsTriggerVariants>;
|
|
13
|
+
//# sourceMappingURL=Tabs.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;8EAwB5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;8EAwB/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,oFAE/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
const tabsListVariants = cva(
|
|
4
|
+
"inline-flex items-center justify-center font-sans select-none",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
pills: "rounded-md bg-grey-100 dark:bg-grey-800 p-1 text-muted-foreground",
|
|
9
|
+
underline: "border-b border-grey-200 dark:border-grey-700 bg-transparent p-0 gap-6 w-full justify-start",
|
|
10
|
+
outline: "rounded-md border border-grey-200 dark:border-grey-700 bg-transparent p-1 gap-1"
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
sm: "h-8 text-xs",
|
|
14
|
+
default: "h-10 text-sm",
|
|
15
|
+
md: "h-10 text-sm",
|
|
16
|
+
lg: "h-12 text-base"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "pills",
|
|
21
|
+
size: "default"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const tabsTriggerVariants = cva(
|
|
26
|
+
"inline-flex items-center justify-center whitespace-nowrap font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
pills: "rounded-sm px-3 py-1.5 data-[state=inactive]:text-muted-foreground hover:text-foreground",
|
|
31
|
+
underline: "pb-3 pt-2 px-1 rounded-none data-[state=inactive]:text-muted-foreground hover:text-foreground",
|
|
32
|
+
outline: "rounded-sm px-3 py-1.5 data-[state=inactive]:text-muted-foreground hover:text-foreground"
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
sm: "px-2.5 py-1 text-xs",
|
|
36
|
+
default: "px-3 py-1.5 text-sm",
|
|
37
|
+
md: "px-3 py-1.5 text-sm",
|
|
38
|
+
lg: "px-4 py-2 text-base"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "pills",
|
|
43
|
+
size: "default"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const tabsContentVariants = cva(
|
|
48
|
+
"mt-3 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary font-sans text-foreground data-[state=active]:animate-tab-slide"
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export { tabsContentVariants, tabsListVariants, tabsTriggerVariants };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
import type { TabsListVariants, TabsTriggerVariants } from './Tabs.styles';
|
|
4
|
+
import type { MotionProp } from '../../types/motion';
|
|
5
|
+
export interface TabsProps extends TabsPrimitive.TabsProps {
|
|
6
|
+
/**
|
|
7
|
+
* Visual variant style for the tab strip.
|
|
8
|
+
* @default 'pills'
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'underline' | 'pills' | 'outline';
|
|
11
|
+
/**
|
|
12
|
+
* Tab size.
|
|
13
|
+
* @default 'default'
|
|
14
|
+
*/
|
|
15
|
+
size?: 'sm' | 'default' | 'md' | 'lg';
|
|
16
|
+
/**
|
|
17
|
+
* Motion transition control.
|
|
18
|
+
*/
|
|
19
|
+
motion?: MotionProp;
|
|
20
|
+
}
|
|
21
|
+
export interface TabsListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>, TabsListVariants {
|
|
22
|
+
}
|
|
23
|
+
export interface TabsTriggerProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, TabsTriggerVariants {
|
|
24
|
+
/**
|
|
25
|
+
* Motion transition control.
|
|
26
|
+
*/
|
|
27
|
+
motion?: MotionProp;
|
|
28
|
+
}
|
|
29
|
+
export interface TabsContentProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
|
|
30
|
+
/**
|
|
31
|
+
* Motion transition control.
|
|
32
|
+
*/
|
|
33
|
+
motion?: MotionProp;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Tabs.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.types.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,SAAU,SAAQ,aAAa,CAAC,SAAS;IACxD;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;IAC5C;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,EAC/D,gBAAgB;CAAG;AAEvB,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,EAClE,mBAAmB;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC;IACpE;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,IAAI,+EAuChB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import { cn } from '@timmbr/utils';
|
|
6
|
+
import { textVariants } from './Text.styles.js';
|
|
7
|
+
|
|
8
|
+
const Text = React.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
className,
|
|
11
|
+
style,
|
|
12
|
+
as = "p",
|
|
13
|
+
variant = "body-1",
|
|
14
|
+
foreground = "default",
|
|
15
|
+
weight,
|
|
16
|
+
italic,
|
|
17
|
+
asChild = false,
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}, ref) => {
|
|
21
|
+
const Component = asChild ? Slot : as;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Component,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-slot": "text",
|
|
27
|
+
"data-testid": "timmbr-text",
|
|
28
|
+
style,
|
|
29
|
+
className: cn(
|
|
30
|
+
textVariants({
|
|
31
|
+
variant,
|
|
32
|
+
foreground,
|
|
33
|
+
weight,
|
|
34
|
+
italic,
|
|
35
|
+
className
|
|
36
|
+
})
|
|
37
|
+
),
|
|
38
|
+
...props,
|
|
39
|
+
children
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Text.displayName = "Text";
|
|
45
|
+
|
|
46
|
+
export { Text };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const textVariants: (props?: ({
|
|
3
|
+
variant?: "caption" | "body-1" | "body-2" | "body-2-medium" | "body-2-semibold" | "body-2-light" | "body-3" | "body-3-light" | "subtitle-1" | "subtitle-2" | null | undefined;
|
|
4
|
+
foreground?: "default" | "inherit" | "white" | "subtle" | "primary" | "secondary" | "destructive" | "muted" | null | undefined;
|
|
5
|
+
weight?: "bold" | "light" | "normal" | "medium" | "semibold" | null | undefined;
|
|
6
|
+
italic?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type TextVariants = VariantProps<typeof textVariants>;
|
|
9
|
+
//# sourceMappingURL=Text.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,YAAY;;;;;8EAwCvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
const textVariants = cva("font-sans transition-colors leading-[1.3]", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
"body-1": "text-[16px] font-normal",
|
|
7
|
+
"body-2": "text-[14px] font-normal",
|
|
8
|
+
"body-2-medium": "text-[14px] font-medium",
|
|
9
|
+
"body-2-semibold": "text-[14px] font-semibold",
|
|
10
|
+
"body-2-light": "text-[14px] font-light",
|
|
11
|
+
"body-3": "text-[12px] font-normal",
|
|
12
|
+
"body-3-light": "text-[12px] font-light",
|
|
13
|
+
"subtitle-1": "text-[18px] font-semibold",
|
|
14
|
+
"subtitle-2": "text-[18px] font-semibold",
|
|
15
|
+
caption: "text-[11px] font-normal tracking-wide"
|
|
16
|
+
},
|
|
17
|
+
foreground: {
|
|
18
|
+
default: "text-foreground",
|
|
19
|
+
muted: "text-grey-600 dark:text-grey-400",
|
|
20
|
+
subtle: "text-grey-500 dark:text-grey-500",
|
|
21
|
+
primary: "text-primary",
|
|
22
|
+
secondary: "text-secondary-foreground",
|
|
23
|
+
destructive: "text-destructive",
|
|
24
|
+
white: "text-white",
|
|
25
|
+
inherit: "text-inherit"
|
|
26
|
+
},
|
|
27
|
+
weight: {
|
|
28
|
+
light: "font-light",
|
|
29
|
+
normal: "font-normal",
|
|
30
|
+
medium: "font-medium",
|
|
31
|
+
semibold: "font-semibold",
|
|
32
|
+
bold: "font-bold"
|
|
33
|
+
},
|
|
34
|
+
italic: {
|
|
35
|
+
true: "italic",
|
|
36
|
+
false: "not-italic"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
variant: "body-1",
|
|
41
|
+
foreground: "default"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { textVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { TextVariants } from './Text.styles';
|
|
3
|
+
export type TextTag = 'p' | 'span';
|
|
4
|
+
export interface TextProps extends React.HTMLAttributes<HTMLElement>, TextVariants {
|
|
5
|
+
/**
|
|
6
|
+
* Allowed HTML tags for Text elements (strictly 'p' or 'span').
|
|
7
|
+
* @default 'p'
|
|
8
|
+
*/
|
|
9
|
+
as?: TextTag;
|
|
10
|
+
/**
|
|
11
|
+
* If true, renders child element via Radix Slot while applying text styles.
|
|
12
|
+
*/
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Font weight override.
|
|
16
|
+
*/
|
|
17
|
+
weight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold';
|
|
18
|
+
/**
|
|
19
|
+
* Toggles italic styling.
|
|
20
|
+
*/
|
|
21
|
+
italic?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Foreground color token.
|
|
24
|
+
* @default 'default'
|
|
25
|
+
*/
|
|
26
|
+
foreground?: 'default' | 'muted' | 'subtle' | 'primary' | 'secondary' | 'destructive' | 'white' | 'inherit';
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Text.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.types.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC;AAEnC,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACvC,YAAY;IACd;;;OAGG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IAC7D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EACP,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,GACT,WAAW,GACX,aAAa,GACb,OAAO,GACP,SAAS,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,QAAQ,2FAkLpB,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '@timmbr/utils';
|
|
5
|
+
import { AlertCircle, Info } from '@timmbr/icons';
|
|
6
|
+
import { resolveMotion } from '../../types/motion.js';
|
|
7
|
+
import { textareaVariants } from './Textarea.styles.js';
|
|
8
|
+
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
9
|
+
|
|
10
|
+
const Textarea = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
className,
|
|
13
|
+
containerClassName,
|
|
14
|
+
style,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
resize = "vertical",
|
|
18
|
+
label,
|
|
19
|
+
floating = false,
|
|
20
|
+
helperText,
|
|
21
|
+
error,
|
|
22
|
+
maxLength,
|
|
23
|
+
showCount = false,
|
|
24
|
+
autoResize = false,
|
|
25
|
+
rows = 4,
|
|
26
|
+
disabled,
|
|
27
|
+
value,
|
|
28
|
+
defaultValue,
|
|
29
|
+
onChange,
|
|
30
|
+
onFocus,
|
|
31
|
+
onBlur,
|
|
32
|
+
placeholder,
|
|
33
|
+
motion,
|
|
34
|
+
id: customId,
|
|
35
|
+
...props
|
|
36
|
+
}, ref) => {
|
|
37
|
+
const generatedId = React.useId();
|
|
38
|
+
const id = customId || generatedId;
|
|
39
|
+
const isError = Boolean(error);
|
|
40
|
+
const errorMessage = typeof error === "string" ? error : void 0;
|
|
41
|
+
const globalMotion = useGlobalAnimation();
|
|
42
|
+
const { shouldAnimate, motionClass } = resolveMotion(motion, globalMotion);
|
|
43
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
44
|
+
const [internalValue, setInternalValue] = React.useState(
|
|
45
|
+
defaultValue !== void 0 ? String(defaultValue) : ""
|
|
46
|
+
);
|
|
47
|
+
const isControlled = value !== void 0;
|
|
48
|
+
const currentValue = isControlled ? String(value ?? "") : internalValue;
|
|
49
|
+
const isFloatingActive = isFocused || currentValue.length > 0;
|
|
50
|
+
const internalRef = React.useRef(null);
|
|
51
|
+
const handleResize = React.useCallback(() => {
|
|
52
|
+
if (autoResize && internalRef.current) {
|
|
53
|
+
internalRef.current.style.height = "auto";
|
|
54
|
+
internalRef.current.style.height = `${internalRef.current.scrollHeight}px`;
|
|
55
|
+
}
|
|
56
|
+
}, [autoResize]);
|
|
57
|
+
const handleChange = (e) => {
|
|
58
|
+
if (!isControlled) {
|
|
59
|
+
setInternalValue(e.target.value);
|
|
60
|
+
}
|
|
61
|
+
handleResize();
|
|
62
|
+
onChange?.(e);
|
|
63
|
+
};
|
|
64
|
+
const handleFocus = (e) => {
|
|
65
|
+
setIsFocused(true);
|
|
66
|
+
onFocus?.(e);
|
|
67
|
+
};
|
|
68
|
+
const handleBlur = (e) => {
|
|
69
|
+
setIsFocused(false);
|
|
70
|
+
onBlur?.(e);
|
|
71
|
+
};
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (autoResize) {
|
|
74
|
+
handleResize();
|
|
75
|
+
}
|
|
76
|
+
}, [autoResize, currentValue, handleResize]);
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: cn("flex flex-col gap-1.5 w-full font-sans", containerClassName),
|
|
81
|
+
style,
|
|
82
|
+
children: [
|
|
83
|
+
label && !floating && /* @__PURE__ */ jsx(
|
|
84
|
+
"label",
|
|
85
|
+
{
|
|
86
|
+
htmlFor: id,
|
|
87
|
+
className: "text-xs font-semibold text-foreground tracking-wide select-none text-left",
|
|
88
|
+
children: label
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
92
|
+
label && floating && /* @__PURE__ */ jsx(
|
|
93
|
+
"label",
|
|
94
|
+
{
|
|
95
|
+
htmlFor: id,
|
|
96
|
+
className: cn(
|
|
97
|
+
"absolute pointer-events-none transition-all duration-200 select-none z-10 truncate max-w-[calc(100%-24px)]",
|
|
98
|
+
isFloatingActive ? "-top-2.5 left-2.5 px-1 bg-white dark:bg-grey-900 text-[11px] font-semibold leading-none rounded-xs" : "top-3 left-3 text-sm text-muted-foreground leading-none"
|
|
99
|
+
),
|
|
100
|
+
style: {
|
|
101
|
+
color: isFloatingActive ? isError ? "var(--color-destructive)" : "var(--color-primary)" : void 0
|
|
102
|
+
},
|
|
103
|
+
children: label
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
"textarea",
|
|
108
|
+
{
|
|
109
|
+
ref: (node) => {
|
|
110
|
+
internalRef.current = node;
|
|
111
|
+
if (typeof ref === "function") ref(node);
|
|
112
|
+
else if (ref) ref.current = node;
|
|
113
|
+
},
|
|
114
|
+
id,
|
|
115
|
+
rows,
|
|
116
|
+
maxLength,
|
|
117
|
+
value,
|
|
118
|
+
defaultValue,
|
|
119
|
+
disabled,
|
|
120
|
+
onChange: handleChange,
|
|
121
|
+
onFocus: handleFocus,
|
|
122
|
+
onBlur: handleBlur,
|
|
123
|
+
placeholder: floating && !isFloatingActive ? void 0 : placeholder,
|
|
124
|
+
"aria-invalid": isError ? "true" : void 0,
|
|
125
|
+
"aria-describedby": errorMessage || helperText ? `${id}-desc` : void 0,
|
|
126
|
+
className: cn(
|
|
127
|
+
textareaVariants({
|
|
128
|
+
variant,
|
|
129
|
+
size,
|
|
130
|
+
resize: autoResize ? "none" : resize,
|
|
131
|
+
isError
|
|
132
|
+
}),
|
|
133
|
+
floating && "pt-3 pb-2",
|
|
134
|
+
!shouldAnimate && "transition-none",
|
|
135
|
+
motionClass,
|
|
136
|
+
className
|
|
137
|
+
),
|
|
138
|
+
...props
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
143
|
+
errorMessage || helperText ? /* @__PURE__ */ jsxs(
|
|
144
|
+
"p",
|
|
145
|
+
{
|
|
146
|
+
id: `${id}-desc`,
|
|
147
|
+
className: cn(
|
|
148
|
+
"text-xs mt-0.5 flex items-center gap-1.5 flex-1",
|
|
149
|
+
isError ? "text-destructive font-medium" : "text-muted"
|
|
150
|
+
),
|
|
151
|
+
children: [
|
|
152
|
+
isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Info, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }),
|
|
153
|
+
/* @__PURE__ */ jsx("span", { children: errorMessage || helperText })
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
) : /* @__PURE__ */ jsx("span", {}),
|
|
157
|
+
showCount && maxLength && /* @__PURE__ */ jsxs("span", { className: "text-[11px] font-mono text-muted shrink-0 select-none", children: [
|
|
158
|
+
currentValue.length,
|
|
159
|
+
"/",
|
|
160
|
+
maxLength
|
|
161
|
+
] })
|
|
162
|
+
] })
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
Textarea.displayName = "Textarea";
|
|
169
|
+
|
|
170
|
+
export { Textarea };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const textareaVariants: (props?: ({
|
|
3
|
+
variant?: "outline" | "filled" | "subtle" | null | undefined;
|
|
4
|
+
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
5
|
+
resize?: "none" | "both" | "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
isError?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type TextareaVariants = VariantProps<typeof textareaVariants>;
|
|
9
|
+
//# sourceMappingURL=Textarea.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;8EAoC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|