@byldpartners/ui 0.0.1
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 +284 -0
- package/dist/chunk-464G63BO.cjs +224 -0
- package/dist/chunk-464G63BO.cjs.map +1 -0
- package/dist/chunk-JFJY6DZZ.js +224 -0
- package/dist/chunk-JFJY6DZZ.js.map +1 -0
- package/dist/index.cjs +3894 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1543 -0
- package/dist/index.d.ts +1543 -0
- package/dist/index.js +3894 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/web.cjs +16 -0
- package/dist/theme/web.cjs.map +1 -0
- package/dist/theme/web.d.cts +81 -0
- package/dist/theme/web.d.ts +81 -0
- package/dist/theme/web.js +16 -0
- package/dist/theme/web.js.map +1 -0
- package/package.json +117 -0
- package/src/components/Accordion/Accordion.native.tsx +195 -0
- package/src/components/Accordion/Accordion.stories.tsx +49 -0
- package/src/components/Accordion/Accordion.types.ts +28 -0
- package/src/components/Accordion/Accordion.web.tsx +61 -0
- package/src/components/Accordion/index.native.ts +12 -0
- package/src/components/Accordion/index.ts +12 -0
- package/src/components/Accordion/useAccordion.test.ts +114 -0
- package/src/components/Accordion/useAccordion.ts +65 -0
- package/src/components/Alert/Alert.native.tsx +86 -0
- package/src/components/Alert/Alert.stories.tsx +43 -0
- package/src/components/Alert/Alert.types.ts +17 -0
- package/src/components/Alert/Alert.web.test.tsx +49 -0
- package/src/components/Alert/Alert.web.tsx +59 -0
- package/src/components/Alert/index.native.ts +2 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Alert/useAlert.test.ts +19 -0
- package/src/components/Alert/useAlert.ts +10 -0
- package/src/components/AlertDialog/AlertDialog.native.tsx +281 -0
- package/src/components/AlertDialog/AlertDialog.stories.tsx +49 -0
- package/src/components/AlertDialog/AlertDialog.types.ts +49 -0
- package/src/components/AlertDialog/AlertDialog.web.tsx +138 -0
- package/src/components/AlertDialog/index.native.ts +22 -0
- package/src/components/AlertDialog/index.ts +24 -0
- package/src/components/AlertDialog/useAlertDialog.test.ts +40 -0
- package/src/components/AlertDialog/useAlertDialog.ts +36 -0
- package/src/components/AspectRatio/AspectRatio.native.tsx +37 -0
- package/src/components/AspectRatio/AspectRatio.stories.tsx +44 -0
- package/src/components/AspectRatio/AspectRatio.types.ts +5 -0
- package/src/components/AspectRatio/AspectRatio.web.tsx +5 -0
- package/src/components/AspectRatio/index.native.ts +2 -0
- package/src/components/AspectRatio/index.ts +2 -0
- package/src/components/AspectRatio/useAspectRatio.test.ts +40 -0
- package/src/components/AspectRatio/useAspectRatio.ts +12 -0
- package/src/components/Avatar/Avatar.native.tsx +95 -0
- package/src/components/Avatar/Avatar.stories.tsx +31 -0
- package/src/components/Avatar/Avatar.types.ts +17 -0
- package/src/components/Avatar/Avatar.web.tsx +47 -0
- package/src/components/Avatar/index.native.ts +2 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Avatar/useAvatarImage.test.ts +66 -0
- package/src/components/Avatar/useAvatarImage.ts +31 -0
- package/src/components/Badge/Badge.native.tsx +64 -0
- package/src/components/Badge/Badge.stories.tsx +42 -0
- package/src/components/Badge/Badge.types.ts +7 -0
- package/src/components/Badge/Badge.web.test.tsx +40 -0
- package/src/components/Badge/Badge.web.tsx +41 -0
- package/src/components/Badge/index.native.ts +2 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Breadcrumb/Breadcrumb.native.tsx +158 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +41 -0
- package/src/components/Breadcrumb/Breadcrumb.types.ts +37 -0
- package/src/components/Breadcrumb/Breadcrumb.web.tsx +125 -0
- package/src/components/Breadcrumb/index.native.ts +18 -0
- package/src/components/Breadcrumb/index.ts +18 -0
- package/src/components/Button/Button.native.tsx +118 -0
- package/src/components/Button/Button.stories.tsx +97 -0
- package/src/components/Button/Button.types.ts +19 -0
- package/src/components/Button/Button.web.test.tsx +69 -0
- package/src/components/Button/Button.web.tsx +55 -0
- package/src/components/Button/index.native.ts +2 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Calendar/Calendar.native.tsx +108 -0
- package/src/components/Calendar/Calendar.stories.tsx +18 -0
- package/src/components/Calendar/Calendar.types.ts +8 -0
- package/src/components/Calendar/Calendar.web.tsx +143 -0
- package/src/components/Calendar/index.native.ts +2 -0
- package/src/components/Calendar/index.ts +2 -0
- package/src/components/Calendar/useCalendar.test.ts +145 -0
- package/src/components/Calendar/useCalendar.ts +94 -0
- package/src/components/Card/Card.native.tsx +42 -0
- package/src/components/Card/Card.stories.tsx +41 -0
- package/src/components/Card/Card.types.ts +4 -0
- package/src/components/Card/Card.web.test.tsx +29 -0
- package/src/components/Card/Card.web.tsx +23 -0
- package/src/components/Card/index.native.ts +2 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Carousel/Carousel.native.tsx +193 -0
- package/src/components/Carousel/Carousel.stories.tsx +51 -0
- package/src/components/Carousel/Carousel.types.ts +29 -0
- package/src/components/Carousel/Carousel.web.tsx +272 -0
- package/src/components/Carousel/index.native.ts +2 -0
- package/src/components/Carousel/index.ts +2 -0
- package/src/components/Carousel/useCarousel.test.ts +111 -0
- package/src/components/Carousel/useCarousel.ts +48 -0
- package/src/components/Chart/Chart.native.tsx +7 -0
- package/src/components/Chart/Chart.stories.tsx +57 -0
- package/src/components/Chart/Chart.types.ts +13 -0
- package/src/components/Chart/Chart.web.tsx +36 -0
- package/src/components/Chart/index.native.ts +2 -0
- package/src/components/Chart/index.ts +3 -0
- package/src/components/Checkbox/Checkbox.native.tsx +47 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +30 -0
- package/src/components/Checkbox/Checkbox.types.ts +12 -0
- package/src/components/Checkbox/Checkbox.web.tsx +37 -0
- package/src/components/Checkbox/index.native.ts +2 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Checkbox/useCheckbox.test.ts +66 -0
- package/src/components/Checkbox/useCheckbox.ts +37 -0
- package/src/components/Collapsible/Collapsible.native.tsx +111 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +35 -0
- package/src/components/Collapsible/Collapsible.types.ts +19 -0
- package/src/components/Collapsible/Collapsible.web.tsx +9 -0
- package/src/components/Collapsible/index.native.ts +2 -0
- package/src/components/Collapsible/index.ts +2 -0
- package/src/components/Collapsible/useCollapsible.test.ts +53 -0
- package/src/components/Collapsible/useCollapsible.ts +38 -0
- package/src/components/Combobox/Combobox.native.tsx +146 -0
- package/src/components/Combobox/Combobox.stories.tsx +43 -0
- package/src/components/Combobox/Combobox.types.ts +15 -0
- package/src/components/Combobox/Combobox.web.tsx +145 -0
- package/src/components/Combobox/index.native.ts +2 -0
- package/src/components/Combobox/index.ts +2 -0
- package/src/components/Combobox/useCombobox.test.ts +59 -0
- package/src/components/Combobox/useCombobox.ts +42 -0
- package/src/components/Command/Command.native.tsx +7 -0
- package/src/components/Command/Command.stories.tsx +37 -0
- package/src/components/Command/Command.types.ts +43 -0
- package/src/components/Command/Command.web.tsx +134 -0
- package/src/components/Command/index.native.ts +2 -0
- package/src/components/Command/index.ts +18 -0
- package/src/components/ContextMenu/ContextMenu.native.tsx +241 -0
- package/src/components/ContextMenu/ContextMenu.stories.tsx +43 -0
- package/src/components/ContextMenu/ContextMenu.types.ts +69 -0
- package/src/components/ContextMenu/ContextMenu.web.tsx +220 -0
- package/src/components/ContextMenu/index.native.ts +28 -0
- package/src/components/ContextMenu/index.ts +2 -0
- package/src/components/ContextMenu/useContextMenu.test.ts +44 -0
- package/src/components/ContextMenu/useContextMenu.ts +36 -0
- package/src/components/DataTable/DataTable.native.tsx +85 -0
- package/src/components/DataTable/DataTable.stories.tsx +72 -0
- package/src/components/DataTable/DataTable.types.ts +16 -0
- package/src/components/DataTable/DataTable.web.tsx +135 -0
- package/src/components/DataTable/index.native.ts +2 -0
- package/src/components/DataTable/index.ts +3 -0
- package/src/components/DataTable/useDataTable.test.ts +98 -0
- package/src/components/DataTable/useDataTable.ts +68 -0
- package/src/components/DatePicker/DatePicker.native.tsx +82 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +68 -0
- package/src/components/DatePicker/DatePicker.types.ts +7 -0
- package/src/components/DatePicker/DatePicker.web.tsx +85 -0
- package/src/components/DatePicker/index.native.ts +2 -0
- package/src/components/DatePicker/index.ts +2 -0
- package/src/components/DatePicker/useDatePicker.test.ts +62 -0
- package/src/components/DatePicker/useDatePicker.ts +54 -0
- package/src/components/Dialog/Dialog.native.tsx +188 -0
- package/src/components/Dialog/Dialog.stories.tsx +42 -0
- package/src/components/Dialog/Dialog.types.ts +45 -0
- package/src/components/Dialog/Dialog.web.tsx +126 -0
- package/src/components/Dialog/index.native.ts +2 -0
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Dialog/useDialog.test.ts +44 -0
- package/src/components/Dialog/useDialog.ts +36 -0
- package/src/components/Drawer/Drawer.native.tsx +244 -0
- package/src/components/Drawer/Drawer.stories.tsx +39 -0
- package/src/components/Drawer/Drawer.types.ts +44 -0
- package/src/components/Drawer/Drawer.web.tsx +133 -0
- package/src/components/Drawer/index.native.ts +2 -0
- package/src/components/Drawer/index.ts +2 -0
- package/src/components/Drawer/useDrawer.test.ts +33 -0
- package/src/components/Drawer/useDrawer.ts +19 -0
- package/src/components/DropdownMenu/DropdownMenu.native.tsx +272 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +36 -0
- package/src/components/DropdownMenu/DropdownMenu.types.ts +73 -0
- package/src/components/DropdownMenu/DropdownMenu.web.tsx +225 -0
- package/src/components/DropdownMenu/index.native.ts +2 -0
- package/src/components/DropdownMenu/index.ts +2 -0
- package/src/components/DropdownMenu/useDropdownMenu.test.ts +44 -0
- package/src/components/DropdownMenu/useDropdownMenu.ts +36 -0
- package/src/components/Form/Form.native.tsx +98 -0
- package/src/components/Form/Form.stories.tsx +83 -0
- package/src/components/Form/Form.types.ts +35 -0
- package/src/components/Form/Form.web.test.tsx +73 -0
- package/src/components/Form/Form.web.tsx +111 -0
- package/src/components/Form/index.native.ts +18 -0
- package/src/components/Form/index.ts +18 -0
- package/src/components/Form/useFormField.test.ts +25 -0
- package/src/components/Form/useFormField.ts +22 -0
- package/src/components/HoverCard/HoverCard.native.tsx +15 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +34 -0
- package/src/components/HoverCard/HoverCard.types.ts +18 -0
- package/src/components/HoverCard/HoverCard.web.test.tsx +35 -0
- package/src/components/HoverCard/HoverCard.web.tsx +26 -0
- package/src/components/HoverCard/index.native.ts +2 -0
- package/src/components/HoverCard/index.ts +2 -0
- package/src/components/Icon/Icon.native.tsx +27 -0
- package/src/components/Icon/index.native.ts +2 -0
- package/src/components/Input/Input.native.tsx +32 -0
- package/src/components/Input/Input.stories.tsx +42 -0
- package/src/components/Input/Input.types.ts +10 -0
- package/src/components/Input/Input.web.test.tsx +39 -0
- package/src/components/Input/Input.web.tsx +21 -0
- package/src/components/Input/index.native.ts +2 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/InputOTP/InputOTP.native.tsx +93 -0
- package/src/components/InputOTP/InputOTP.stories.tsx +56 -0
- package/src/components/InputOTP/InputOTP.types.ts +14 -0
- package/src/components/InputOTP/InputOTP.web.tsx +128 -0
- package/src/components/InputOTP/index.native.ts +2 -0
- package/src/components/InputOTP/index.ts +2 -0
- package/src/components/InputOTP/useInputOTP.test.ts +97 -0
- package/src/components/InputOTP/useInputOTP.ts +69 -0
- package/src/components/Label/Label.native.tsx +25 -0
- package/src/components/Label/Label.stories.tsx +20 -0
- package/src/components/Label/Label.types.ts +6 -0
- package/src/components/Label/Label.web.test.tsx +27 -0
- package/src/components/Label/Label.web.tsx +23 -0
- package/src/components/Label/index.native.ts +2 -0
- package/src/components/Label/index.ts +2 -0
- package/src/components/Menubar/Menubar.native.tsx +287 -0
- package/src/components/Menubar/Menubar.stories.tsx +46 -0
- package/src/components/Menubar/Menubar.types.ts +70 -0
- package/src/components/Menubar/Menubar.web.tsx +256 -0
- package/src/components/Menubar/index.native.ts +28 -0
- package/src/components/Menubar/index.ts +2 -0
- package/src/components/Menubar/useMenubar.test.ts +35 -0
- package/src/components/Menubar/useMenubar.ts +19 -0
- package/src/components/NavigationMenu/NavigationMenu.native.tsx +128 -0
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +35 -0
- package/src/components/NavigationMenu/NavigationMenu.types.ts +35 -0
- package/src/components/NavigationMenu/NavigationMenu.web.test.tsx +56 -0
- package/src/components/NavigationMenu/NavigationMenu.web.tsx +134 -0
- package/src/components/NavigationMenu/index.native.ts +16 -0
- package/src/components/NavigationMenu/index.ts +2 -0
- package/src/components/Pagination/Pagination.native.tsx +192 -0
- package/src/components/Pagination/Pagination.stories.tsx +49 -0
- package/src/components/Pagination/Pagination.types.ts +41 -0
- package/src/components/Pagination/Pagination.web.test.tsx +101 -0
- package/src/components/Pagination/Pagination.web.tsx +185 -0
- package/src/components/Pagination/index.native.ts +19 -0
- package/src/components/Pagination/index.ts +2 -0
- package/src/components/Popover/Popover.native.tsx +97 -0
- package/src/components/Popover/Popover.stories.tsx +25 -0
- package/src/components/Popover/Popover.types.ts +20 -0
- package/src/components/Popover/Popover.web.tsx +30 -0
- package/src/components/Popover/index.native.ts +2 -0
- package/src/components/Popover/index.ts +2 -0
- package/src/components/Popover/usePopover.test.ts +40 -0
- package/src/components/Popover/usePopover.ts +36 -0
- package/src/components/Progress/Progress.native.tsx +65 -0
- package/src/components/Progress/Progress.stories.tsx +36 -0
- package/src/components/Progress/Progress.types.ts +6 -0
- package/src/components/Progress/Progress.web.test.tsx +27 -0
- package/src/components/Progress/Progress.web.tsx +30 -0
- package/src/components/Progress/index.native.ts +2 -0
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Progress/useProgress.test.ts +44 -0
- package/src/components/Progress/useProgress.ts +11 -0
- package/src/components/RadioGroup/RadioGroup.native.tsx +96 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +31 -0
- package/src/components/RadioGroup/RadioGroup.types.ts +16 -0
- package/src/components/RadioGroup/RadioGroup.web.tsx +47 -0
- package/src/components/RadioGroup/index.native.ts +2 -0
- package/src/components/RadioGroup/index.ts +2 -0
- package/src/components/RadioGroup/useRadioGroup.test.ts +50 -0
- package/src/components/RadioGroup/useRadioGroup.ts +40 -0
- package/src/components/ResizablePanel/ResizablePanel.native.tsx +75 -0
- package/src/components/ResizablePanel/ResizablePanel.stories.tsx +84 -0
- package/src/components/ResizablePanel/ResizablePanel.types.ts +20 -0
- package/src/components/ResizablePanel/ResizablePanel.web.test.tsx +52 -0
- package/src/components/ResizablePanel/ResizablePanel.web.tsx +77 -0
- package/src/components/ResizablePanel/index.native.ts +2 -0
- package/src/components/ResizablePanel/index.ts +2 -0
- package/src/components/ScrollArea/ScrollArea.native.tsx +43 -0
- package/src/components/ScrollArea/ScrollArea.stories.tsx +46 -0
- package/src/components/ScrollArea/ScrollArea.types.ts +11 -0
- package/src/components/ScrollArea/ScrollArea.web.test.tsx +19 -0
- package/src/components/ScrollArea/ScrollArea.web.tsx +45 -0
- package/src/components/ScrollArea/index.native.ts +2 -0
- package/src/components/ScrollArea/index.ts +2 -0
- package/src/components/Select/Select.native.tsx +203 -0
- package/src/components/Select/Select.stories.tsx +33 -0
- package/src/components/Select/Select.types.ts +14 -0
- package/src/components/Select/Select.web.tsx +204 -0
- package/src/components/Select/index.native.ts +11 -0
- package/src/components/Select/index.ts +2 -0
- package/src/components/Select/useSelect.test.ts +38 -0
- package/src/components/Select/useSelect.ts +33 -0
- package/src/components/Separator/Separator.native.tsx +38 -0
- package/src/components/Separator/Separator.stories.tsx +34 -0
- package/src/components/Separator/Separator.types.ts +7 -0
- package/src/components/Separator/Separator.web.test.tsx +32 -0
- package/src/components/Separator/Separator.web.tsx +38 -0
- package/src/components/Separator/index.native.ts +2 -0
- package/src/components/Separator/index.ts +2 -0
- package/src/components/Sheet/Sheet.native.tsx +246 -0
- package/src/components/Sheet/Sheet.stories.tsx +43 -0
- package/src/components/Sheet/Sheet.types.ts +47 -0
- package/src/components/Sheet/Sheet.web.tsx +144 -0
- package/src/components/Sheet/index.native.ts +2 -0
- package/src/components/Sheet/index.ts +2 -0
- package/src/components/Sheet/useSheet.test.ts +40 -0
- package/src/components/Sheet/useSheet.ts +19 -0
- package/src/components/Sidebar/Sidebar.native.tsx +7 -0
- package/src/components/Sidebar/Sidebar.stories.tsx +100 -0
- package/src/components/Sidebar/Sidebar.types.ts +30 -0
- package/src/components/Sidebar/Sidebar.web.test.tsx +74 -0
- package/src/components/Sidebar/Sidebar.web.tsx +200 -0
- package/src/components/Sidebar/index.native.ts +2 -0
- package/src/components/Sidebar/index.ts +2 -0
- package/src/components/Sidebar/useSidebar.test.ts +51 -0
- package/src/components/Sidebar/useSidebar.ts +26 -0
- package/src/components/Skeleton/Skeleton.native.tsx +45 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +32 -0
- package/src/components/Skeleton/Skeleton.types.ts +6 -0
- package/src/components/Skeleton/Skeleton.web.test.tsx +35 -0
- package/src/components/Skeleton/Skeleton.web.tsx +18 -0
- package/src/components/Skeleton/index.native.ts +2 -0
- package/src/components/Skeleton/index.ts +2 -0
- package/src/components/Slider/Slider.native.tsx +98 -0
- package/src/components/Slider/Slider.stories.tsx +23 -0
- package/src/components/Slider/Slider.types.ts +10 -0
- package/src/components/Slider/Slider.web.tsx +25 -0
- package/src/components/Slider/index.native.ts +2 -0
- package/src/components/Slider/index.ts +2 -0
- package/src/components/Slider/useSlider.test.ts +68 -0
- package/src/components/Slider/useSlider.ts +55 -0
- package/src/components/Switch/Switch.native.tsx +36 -0
- package/src/components/Switch/Switch.stories.tsx +28 -0
- package/src/components/Switch/Switch.types.ts +7 -0
- package/src/components/Switch/Switch.web.test.tsx +44 -0
- package/src/components/Switch/Switch.web.tsx +26 -0
- package/src/components/Switch/index.native.ts +2 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/Table.native.tsx +165 -0
- package/src/components/Table/Table.stories.tsx +54 -0
- package/src/components/Table/Table.types.ts +41 -0
- package/src/components/Table/Table.web.test.tsx +77 -0
- package/src/components/Table/Table.web.tsx +119 -0
- package/src/components/Table/index.native.ts +2 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Tabs/Tabs.native.tsx +136 -0
- package/src/components/Tabs/Tabs.stories.tsx +35 -0
- package/src/components/Tabs/Tabs.types.ts +25 -0
- package/src/components/Tabs/Tabs.web.tsx +52 -0
- package/src/components/Tabs/index.native.ts +2 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/Tabs/useTabs.test.ts +40 -0
- package/src/components/Tabs/useTabs.ts +20 -0
- package/src/components/Textarea/Textarea.native.tsx +33 -0
- package/src/components/Textarea/Textarea.stories.tsx +27 -0
- package/src/components/Textarea/Textarea.types.ts +10 -0
- package/src/components/Textarea/Textarea.web.test.tsx +33 -0
- package/src/components/Textarea/Textarea.web.tsx +21 -0
- package/src/components/Textarea/index.native.ts +2 -0
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Toast/Toast.native.tsx +267 -0
- package/src/components/Toast/Toast.stories.tsx +34 -0
- package/src/components/Toast/Toast.types.ts +50 -0
- package/src/components/Toast/Toast.web.tsx +282 -0
- package/src/components/Toast/index.native.ts +17 -0
- package/src/components/Toast/index.ts +11 -0
- package/src/components/Toast/useToast.test.ts +122 -0
- package/src/components/Toast/useToast.ts +64 -0
- package/src/components/Toggle/Toggle.native.tsx +70 -0
- package/src/components/Toggle/Toggle.stories.tsx +34 -0
- package/src/components/Toggle/Toggle.types.ts +13 -0
- package/src/components/Toggle/Toggle.web.tsx +42 -0
- package/src/components/Toggle/index.native.ts +2 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Toggle/useToggle.test.ts +48 -0
- package/src/components/Toggle/useToggle.ts +37 -0
- package/src/components/ToggleGroup/ToggleGroup.native.tsx +103 -0
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +24 -0
- package/src/components/ToggleGroup/ToggleGroup.types.ts +22 -0
- package/src/components/ToggleGroup/ToggleGroup.web.tsx +56 -0
- package/src/components/ToggleGroup/index.native.ts +2 -0
- package/src/components/ToggleGroup/index.ts +2 -0
- package/src/components/ToggleGroup/useToggleGroup.test.ts +79 -0
- package/src/components/ToggleGroup/useToggleGroup.ts +63 -0
- package/src/components/Tooltip/Tooltip.native.tsx +7 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +32 -0
- package/src/components/Tooltip/Tooltip.types.ts +27 -0
- package/src/components/Tooltip/Tooltip.web.test.tsx +42 -0
- package/src/components/Tooltip/Tooltip.web.tsx +29 -0
- package/src/components/Tooltip/index.native.ts +2 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/index.native.ts +50 -0
- package/src/components/index.ts +49 -0
- package/src/hooks/useControllableState.test.ts +89 -0
- package/src/hooks/useControllableState.ts +37 -0
- package/src/index.native.ts +20 -0
- package/src/index.ts +12 -0
- package/src/theme/native.ts +211 -0
- package/src/theme/presets/aurora.ts +56 -0
- package/src/theme/presets/dark.ts +30 -0
- package/src/theme/presets/default.ts +30 -0
- package/src/theme/theme.types.ts +64 -0
- package/src/theme/tokens.ts +31 -0
- package/src/theme/web.ts +123 -0
- package/src/uniwind.d.ts +38 -0
- package/src/utils/cn.native.ts +10 -0
- package/src/utils/cn.test.ts +28 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/glass.native.ts +22 -0
- package/src/utils/withGlass.native.tsx +59 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { Label } from "./Label.web";
|
|
4
|
+
|
|
5
|
+
describe("Label", () => {
|
|
6
|
+
it("renders a label element", () => {
|
|
7
|
+
render(<Label>Username</Label>);
|
|
8
|
+
const el = screen.getByText("Username");
|
|
9
|
+
expect(el.tagName).toBe("LABEL");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("applies base styling", () => {
|
|
13
|
+
render(<Label>Username</Label>);
|
|
14
|
+
expect(screen.getByText("Username").className).toContain("text-sm");
|
|
15
|
+
expect(screen.getByText("Username").className).toContain("font-medium");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("merges custom className", () => {
|
|
19
|
+
render(<Label className="my-label">Username</Label>);
|
|
20
|
+
expect(screen.getByText("Username").className).toContain("my-label");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("forwards htmlFor prop", () => {
|
|
24
|
+
render(<Label htmlFor="email-input">Email</Label>);
|
|
25
|
+
expect(screen.getByText("Email").getAttribute("for")).toBe("email-input");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../utils/cn";
|
|
5
|
+
|
|
6
|
+
const labelVariants = cva(
|
|
7
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const Label = forwardRef<
|
|
11
|
+
React.ComponentRef<typeof LabelPrimitive.Root>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
13
|
+
VariantProps<typeof labelVariants>
|
|
14
|
+
>(({ className, ...props }, ref) => (
|
|
15
|
+
<LabelPrimitive.Root
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn(labelVariants(), className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
));
|
|
21
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
22
|
+
|
|
23
|
+
export { Label };
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
} from "react";
|
|
5
|
+
import {
|
|
6
|
+
View,
|
|
7
|
+
Text,
|
|
8
|
+
Modal,
|
|
9
|
+
Pressable,
|
|
10
|
+
ScrollView,
|
|
11
|
+
type ViewProps,
|
|
12
|
+
} from "react-native";
|
|
13
|
+
import { cn } from "../../utils/cn";
|
|
14
|
+
import type {
|
|
15
|
+
MenubarProps,
|
|
16
|
+
MenubarMenuProps,
|
|
17
|
+
MenubarTriggerProps,
|
|
18
|
+
MenubarContentProps,
|
|
19
|
+
MenubarItemProps,
|
|
20
|
+
MenubarSeparatorProps,
|
|
21
|
+
MenubarSubProps,
|
|
22
|
+
MenubarSubTriggerProps,
|
|
23
|
+
MenubarSubContentProps,
|
|
24
|
+
MenubarCheckboxItemProps,
|
|
25
|
+
MenubarRadioGroupProps,
|
|
26
|
+
MenubarRadioItemProps,
|
|
27
|
+
} from "./Menubar.types";
|
|
28
|
+
import { useMenubarMenu } from "./useMenubar";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Menubar - Native implementation
|
|
32
|
+
*
|
|
33
|
+
* Note: Menubars are inherently web-heavy. This provides a basic horizontal
|
|
34
|
+
* row of menu triggers with modal-based dropdown content.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
interface MenubarMenuContextValue {
|
|
38
|
+
open: boolean;
|
|
39
|
+
onOpenChange: (open: boolean) => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const MenubarMenuContext = createContext<MenubarMenuContextValue>({
|
|
43
|
+
open: false,
|
|
44
|
+
onOpenChange: () => {},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
interface MenubarNativeProps extends MenubarProps {}
|
|
48
|
+
|
|
49
|
+
function Menubar({ children, className }: MenubarNativeProps) {
|
|
50
|
+
return (
|
|
51
|
+
<View
|
|
52
|
+
className={cn(
|
|
53
|
+
"flex-row items-center border-[0.5px] border-border rounded-md bg-background p-1 gap-1 shadow-sm elevation-1",
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</View>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
Menubar.displayName = "Menubar";
|
|
62
|
+
|
|
63
|
+
function MenubarMenu({ children }: MenubarMenuProps) {
|
|
64
|
+
const { open, onOpenChange } = useMenubarMenu();
|
|
65
|
+
return (
|
|
66
|
+
<MenubarMenuContext.Provider value={{ open, onOpenChange }}>
|
|
67
|
+
{children}
|
|
68
|
+
</MenubarMenuContext.Provider>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
MenubarMenu.displayName = "MenubarMenu";
|
|
72
|
+
|
|
73
|
+
interface MenubarTriggerNativeProps extends MenubarTriggerProps {}
|
|
74
|
+
|
|
75
|
+
function MenubarTrigger({ children, className }: MenubarTriggerNativeProps) {
|
|
76
|
+
const { open, onOpenChange } = useContext(MenubarMenuContext);
|
|
77
|
+
return (
|
|
78
|
+
<Pressable
|
|
79
|
+
className={cn(
|
|
80
|
+
"px-3 py-1.5 rounded-sm",
|
|
81
|
+
open && "bg-accent",
|
|
82
|
+
className,
|
|
83
|
+
)}
|
|
84
|
+
onPress={() => onOpenChange(!open)}
|
|
85
|
+
>
|
|
86
|
+
{typeof children === "string" ? (
|
|
87
|
+
<Text className="text-sm font-medium text-foreground">{children}</Text>
|
|
88
|
+
) : (
|
|
89
|
+
children
|
|
90
|
+
)}
|
|
91
|
+
</Pressable>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
95
|
+
|
|
96
|
+
interface MenubarContentNativeProps extends MenubarContentProps {}
|
|
97
|
+
|
|
98
|
+
function MenubarContent({ children, className }: MenubarContentNativeProps) {
|
|
99
|
+
const { open, onOpenChange } = useContext(MenubarMenuContext);
|
|
100
|
+
|
|
101
|
+
if (!open) return null;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<Modal
|
|
105
|
+
visible={open}
|
|
106
|
+
transparent
|
|
107
|
+
animationType="fade"
|
|
108
|
+
onRequestClose={() => onOpenChange(false)}
|
|
109
|
+
>
|
|
110
|
+
<Pressable
|
|
111
|
+
className="flex-1 bg-black/30 justify-center items-center"
|
|
112
|
+
onPress={() => onOpenChange(false)}
|
|
113
|
+
>
|
|
114
|
+
<View
|
|
115
|
+
className={cn(
|
|
116
|
+
"bg-popover rounded-lg p-1 min-w-[200px] max-w-[280px] max-h-[400px] shadow-md elevation-3",
|
|
117
|
+
className,
|
|
118
|
+
)}
|
|
119
|
+
>
|
|
120
|
+
<ScrollView bounces={false}>{children}</ScrollView>
|
|
121
|
+
</View>
|
|
122
|
+
</Pressable>
|
|
123
|
+
</Modal>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
MenubarContent.displayName = "MenubarContent";
|
|
127
|
+
|
|
128
|
+
interface MenubarItemNativeProps extends MenubarItemProps {}
|
|
129
|
+
|
|
130
|
+
function MenubarItem({
|
|
131
|
+
children,
|
|
132
|
+
onSelect,
|
|
133
|
+
disabled,
|
|
134
|
+
className,
|
|
135
|
+
}: MenubarItemNativeProps) {
|
|
136
|
+
const { onOpenChange } = useContext(MenubarMenuContext);
|
|
137
|
+
return (
|
|
138
|
+
<Pressable
|
|
139
|
+
className={cn(
|
|
140
|
+
"flex-row items-center px-3 py-2.5 rounded-sm",
|
|
141
|
+
disabled && "opacity-50",
|
|
142
|
+
className,
|
|
143
|
+
)}
|
|
144
|
+
disabled={disabled}
|
|
145
|
+
onPress={() => {
|
|
146
|
+
onSelect?.();
|
|
147
|
+
onOpenChange(false);
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{typeof children === "string" ? (
|
|
151
|
+
<Text
|
|
152
|
+
className={cn(
|
|
153
|
+
"text-sm text-popover-foreground",
|
|
154
|
+
disabled && "text-muted-foreground",
|
|
155
|
+
)}
|
|
156
|
+
>
|
|
157
|
+
{children}
|
|
158
|
+
</Text>
|
|
159
|
+
) : (
|
|
160
|
+
children
|
|
161
|
+
)}
|
|
162
|
+
</Pressable>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
MenubarItem.displayName = "MenubarItem";
|
|
166
|
+
|
|
167
|
+
interface MenubarSeparatorNativeProps extends MenubarSeparatorProps {}
|
|
168
|
+
|
|
169
|
+
function MenubarSeparator({ className }: MenubarSeparatorNativeProps) {
|
|
170
|
+
return (
|
|
171
|
+
<View
|
|
172
|
+
className={cn("bg-border my-1 -mx-1 h-[0.5px]", className)}
|
|
173
|
+
/>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
MenubarSeparator.displayName = "MenubarSeparator";
|
|
177
|
+
|
|
178
|
+
function MenubarSub({ children }: MenubarSubProps) {
|
|
179
|
+
return <>{children}</>;
|
|
180
|
+
}
|
|
181
|
+
MenubarSub.displayName = "MenubarSub";
|
|
182
|
+
|
|
183
|
+
interface MenubarSubTriggerNativeProps extends MenubarSubTriggerProps {}
|
|
184
|
+
|
|
185
|
+
function MenubarSubTrigger({ children, className }: MenubarSubTriggerNativeProps) {
|
|
186
|
+
return (
|
|
187
|
+
<View
|
|
188
|
+
className={cn(
|
|
189
|
+
"flex-row items-center px-3 py-2.5 rounded-sm",
|
|
190
|
+
className,
|
|
191
|
+
)}
|
|
192
|
+
>
|
|
193
|
+
{typeof children === "string" ? (
|
|
194
|
+
<Text className="text-sm text-popover-foreground">{children}</Text>
|
|
195
|
+
) : (
|
|
196
|
+
children
|
|
197
|
+
)}
|
|
198
|
+
<Text className="ml-auto text-base text-muted-foreground">›</Text>
|
|
199
|
+
</View>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
MenubarSubTrigger.displayName = "MenubarSubTrigger";
|
|
203
|
+
|
|
204
|
+
function MenubarSubContent({ children }: MenubarSubContentProps) {
|
|
205
|
+
return <View>{children}</View>;
|
|
206
|
+
}
|
|
207
|
+
MenubarSubContent.displayName = "MenubarSubContent";
|
|
208
|
+
|
|
209
|
+
interface MenubarCheckboxItemNativeProps extends MenubarCheckboxItemProps {}
|
|
210
|
+
|
|
211
|
+
function MenubarCheckboxItem({
|
|
212
|
+
children,
|
|
213
|
+
checked,
|
|
214
|
+
onCheckedChange,
|
|
215
|
+
disabled,
|
|
216
|
+
className,
|
|
217
|
+
}: MenubarCheckboxItemNativeProps) {
|
|
218
|
+
return (
|
|
219
|
+
<Pressable
|
|
220
|
+
className={cn(
|
|
221
|
+
"flex-row items-center px-3 py-2.5 rounded-sm pl-9",
|
|
222
|
+
disabled && "opacity-50",
|
|
223
|
+
className,
|
|
224
|
+
)}
|
|
225
|
+
disabled={disabled}
|
|
226
|
+
onPress={() => onCheckedChange?.(!checked)}
|
|
227
|
+
>
|
|
228
|
+
<View className="absolute left-3 w-4 h-4 justify-center items-center">
|
|
229
|
+
{checked && <Text className="text-xs text-popover-foreground">✓</Text>}
|
|
230
|
+
</View>
|
|
231
|
+
{typeof children === "string" ? (
|
|
232
|
+
<Text className="text-sm text-popover-foreground">{children}</Text>
|
|
233
|
+
) : (
|
|
234
|
+
children
|
|
235
|
+
)}
|
|
236
|
+
</Pressable>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
MenubarCheckboxItem.displayName = "MenubarCheckboxItem";
|
|
240
|
+
|
|
241
|
+
function MenubarRadioGroup({
|
|
242
|
+
children,
|
|
243
|
+
}: MenubarRadioGroupProps) {
|
|
244
|
+
return <>{children}</>;
|
|
245
|
+
}
|
|
246
|
+
MenubarRadioGroup.displayName = "MenubarRadioGroup";
|
|
247
|
+
|
|
248
|
+
interface MenubarRadioItemNativeProps extends MenubarRadioItemProps {}
|
|
249
|
+
|
|
250
|
+
function MenubarRadioItem({
|
|
251
|
+
children,
|
|
252
|
+
className,
|
|
253
|
+
}: MenubarRadioItemNativeProps) {
|
|
254
|
+
return (
|
|
255
|
+
<View
|
|
256
|
+
className={cn(
|
|
257
|
+
"flex-row items-center px-3 py-2.5 rounded-sm pl-9",
|
|
258
|
+
className,
|
|
259
|
+
)}
|
|
260
|
+
>
|
|
261
|
+
<View className="absolute left-3 w-4 h-4 justify-center items-center">
|
|
262
|
+
<View className="w-1.5 h-1.5 rounded-full bg-popover-foreground" />
|
|
263
|
+
</View>
|
|
264
|
+
{typeof children === "string" ? (
|
|
265
|
+
<Text className="text-sm text-popover-foreground">{children}</Text>
|
|
266
|
+
) : (
|
|
267
|
+
children
|
|
268
|
+
)}
|
|
269
|
+
</View>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
MenubarRadioItem.displayName = "MenubarRadioItem";
|
|
273
|
+
|
|
274
|
+
export {
|
|
275
|
+
Menubar,
|
|
276
|
+
MenubarMenu,
|
|
277
|
+
MenubarTrigger,
|
|
278
|
+
MenubarContent,
|
|
279
|
+
MenubarItem,
|
|
280
|
+
MenubarSeparator,
|
|
281
|
+
MenubarSub,
|
|
282
|
+
MenubarSubTrigger,
|
|
283
|
+
MenubarSubContent,
|
|
284
|
+
MenubarCheckboxItem,
|
|
285
|
+
MenubarRadioGroup,
|
|
286
|
+
MenubarRadioItem,
|
|
287
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import {
|
|
3
|
+
Menubar,
|
|
4
|
+
MenubarMenu,
|
|
5
|
+
MenubarTrigger,
|
|
6
|
+
MenubarContent,
|
|
7
|
+
MenubarItem,
|
|
8
|
+
MenubarSeparator,
|
|
9
|
+
} from "./Menubar.web";
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Menubar> = {
|
|
12
|
+
title: "Components/Menubar",
|
|
13
|
+
component: Menubar,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
parameters: { layout: "centered" },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof Menubar>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<Menubar>
|
|
24
|
+
<MenubarMenu>
|
|
25
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
26
|
+
<MenubarContent>
|
|
27
|
+
<MenubarItem>New File</MenubarItem>
|
|
28
|
+
<MenubarItem>Open File</MenubarItem>
|
|
29
|
+
<MenubarSeparator />
|
|
30
|
+
<MenubarItem>Save</MenubarItem>
|
|
31
|
+
</MenubarContent>
|
|
32
|
+
</MenubarMenu>
|
|
33
|
+
<MenubarMenu>
|
|
34
|
+
<MenubarTrigger>Edit</MenubarTrigger>
|
|
35
|
+
<MenubarContent>
|
|
36
|
+
<MenubarItem>Undo</MenubarItem>
|
|
37
|
+
<MenubarItem>Redo</MenubarItem>
|
|
38
|
+
<MenubarSeparator />
|
|
39
|
+
<MenubarItem>Cut</MenubarItem>
|
|
40
|
+
<MenubarItem>Copy</MenubarItem>
|
|
41
|
+
<MenubarItem>Paste</MenubarItem>
|
|
42
|
+
</MenubarContent>
|
|
43
|
+
</MenubarMenu>
|
|
44
|
+
</Menubar>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export interface MenubarProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface MenubarMenuProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MenubarTriggerProps {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface MenubarContentProps {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
align?: "start" | "center" | "end";
|
|
21
|
+
alignOffset?: number;
|
|
22
|
+
sideOffset?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface MenubarItemProps {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
inset?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
onSelect?: () => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface MenubarSeparatorProps {
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface MenubarSubProps {
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface MenubarSubTriggerProps {
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
inset?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface MenubarSubContentProps {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface MenubarCheckboxItemProps {
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
className?: string;
|
|
55
|
+
checked?: boolean;
|
|
56
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface MenubarRadioGroupProps {
|
|
61
|
+
children?: ReactNode;
|
|
62
|
+
value?: string;
|
|
63
|
+
onValueChange?: (value: string) => void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface MenubarRadioItemProps {
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}
|