@nexub/react 3.0.0 → 3.2.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/dist/components/Accordion/Accordion.d.ts +10 -0
- package/dist/{chunk-DOVZNUSH.js → components/Accordion/Accordion.js} +12 -17
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +1 -5
- package/dist/components/Alert/Alert.d.ts +14 -0
- package/dist/{chunk-U422B6UE.js → components/Alert/Alert.js} +8 -15
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/index.js +1 -7
- package/dist/components/AlertDialog/AlertDialog.d.ts +15 -0
- package/dist/{chunk-PDQTKE2C.js → components/AlertDialog/AlertDialog.js} +32 -42
- package/dist/components/AlertDialog/index.d.ts +1 -0
- package/dist/components/AlertDialog/index.js +1 -9
- package/dist/components/Amount/Amount.d.ts +22 -0
- package/dist/{chunk-IBBICKEZ.js → components/Amount/Amount.js} +10 -21
- package/dist/components/Amount/index.d.ts +2 -0
- package/dist/components/Amount/index.js +1 -8
- package/dist/components/AppShell/AppShell.d.ts +8 -0
- package/dist/{chunk-EPJ4CMZP.js → components/AppShell/AppShell.js} +8 -14
- package/dist/components/AppShell/index.d.ts +1 -0
- package/dist/components/AppShell/index.js +1 -5
- package/dist/components/AspectRatio/AspectRatio.d.ts +5 -0
- package/dist/{chunk-52CXVN3U.js → components/AspectRatio/AspectRatio.js} +4 -10
- package/dist/components/AspectRatio/index.d.ts +2 -0
- package/dist/components/AspectRatio/index.js +1 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +18 -0
- package/dist/{chunk-E7RLUHG3.js → components/Autocomplete/Autocomplete.js} +4 -11
- package/dist/components/Autocomplete/index.d.ts +2 -0
- package/dist/components/Autocomplete/index.js +1 -7
- package/dist/components/Avatar/Avatar.d.ts +13 -0
- package/dist/{chunk-AYG7HBDZ.js → components/Avatar/Avatar.js} +8 -13
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +1 -7
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +12 -0
- package/dist/{chunk-BMUAR6H2.js → components/AvatarGroup/AvatarGroup.js} +9 -18
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/AvatarGroup/index.js +1 -8
- package/dist/components/Badge/Badge.d.ts +12 -0
- package/dist/{chunk-FBUKWIWR.js → components/Badge/Badge.js} +7 -13
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +1 -6
- package/dist/components/Box/Box.d.ts +5 -0
- package/dist/{chunk-ZCHZNGWU.js → components/Box/Box.js} +3 -9
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Box/index.js +1 -5
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +21 -0
- package/dist/{chunk-SQGRT72E.js → components/Breadcrumb/Breadcrumb.js} +12 -19
- package/dist/components/Breadcrumb/index.d.ts +1 -0
- package/dist/components/Breadcrumb/index.js +1 -6
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/{chunk-GHLMHKMV.js → components/Button/Button.js} +19 -37
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +1 -9
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +6 -0
- package/dist/{chunk-7EQ2LIYD.js → components/ButtonGroup/ButtonGroup.js} +3 -9
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/ButtonGroup/index.js +1 -6
- package/dist/components/Card/Card.d.ts +27 -0
- package/dist/{chunk-T466ZB34.js → components/Card/Card.js} +18 -46
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/index.js +1 -8
- package/dist/components/Chart/Chart.d.ts +81 -0
- package/dist/components/Chart/Chart.js +174 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/Chart/index.js +9 -0
- package/dist/components/CheckList/CheckList.d.ts +10 -0
- package/dist/{chunk-T3RBFJML.js → components/CheckList/CheckList.js} +4 -10
- package/dist/components/CheckList/index.d.ts +2 -0
- package/dist/components/CheckList/index.js +1 -6
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/{chunk-JOOKMCAF.js → components/Checkbox/Checkbox.js} +4 -9
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.js +1 -5
- package/dist/components/CheckboxCard/CheckboxCard.d.ts +9 -0
- package/dist/{chunk-EYGT5IX4.js → components/CheckboxCard/CheckboxCard.js} +7 -12
- package/dist/components/CheckboxCard/index.d.ts +2 -0
- package/dist/components/CheckboxCard/index.js +1 -6
- package/dist/components/Chip/Chip.d.ts +12 -0
- package/dist/{chunk-PFDUHXT5.js → components/Chip/Chip.js} +8 -15
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.js +1 -7
- package/dist/components/Citation/Citation.d.ts +44 -0
- package/dist/{chunk-IA2362SO.js → components/Citation/Citation.js} +12 -21
- package/dist/components/Citation/index.d.ts +2 -0
- package/dist/components/Citation/index.js +1 -11
- package/dist/components/Code/Code.d.ts +6 -0
- package/dist/{chunk-NX44VGON.js → components/Code/Code.js} +3 -9
- package/dist/components/Code/index.d.ts +2 -0
- package/dist/components/Code/index.js +1 -5
- package/dist/components/Collapsible/Collapsible.d.ts +7 -0
- package/dist/{chunk-4WIUGX5Z.js → components/Collapsible/Collapsible.js} +10 -15
- package/dist/components/Collapsible/index.d.ts +1 -0
- package/dist/components/Collapsible/index.js +1 -5
- package/dist/components/Combobox/Combobox.d.ts +75 -0
- package/dist/{chunk-XWELMPYD.js → components/Combobox/Combobox.js} +11 -16
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Combobox/index.js +1 -6
- package/dist/components/CommandPalette/CommandPalette.d.ts +73 -0
- package/dist/{chunk-LASPHHH6.js → components/CommandPalette/CommandPalette.js} +16 -28
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/CommandPalette/index.js +1 -8
- package/dist/components/Container/Container.d.ts +10 -0
- package/dist/{chunk-EQ5ASTJM.js → components/Container/Container.js} +7 -12
- package/dist/components/Container/index.d.ts +2 -0
- package/dist/components/Container/index.js +1 -6
- package/dist/components/ContextMenu/ContextMenu.d.ts +18 -0
- package/dist/{chunk-CUCTSWR2.js → components/ContextMenu/ContextMenu.js} +42 -53
- package/dist/components/ContextMenu/index.d.ts +1 -0
- package/dist/components/ContextMenu/index.js +1 -6
- package/dist/components/CountryBadge/CountryBadge.d.ts +8 -0
- package/dist/{chunk-JZCZ2SDT.js → components/CountryBadge/CountryBadge.js} +5 -13
- package/dist/components/CountryBadge/index.d.ts +2 -0
- package/dist/components/CountryBadge/index.js +1 -6
- package/dist/components/DataTable/DataTable.d.ts +24 -0
- package/dist/{chunk-A7PS3EZO.js → components/DataTable/DataTable.js} +15 -27
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +1 -8
- package/dist/components/DatePicker/DatePicker.d.ts +39 -0
- package/dist/{chunk-OY5CWWIM.js → components/DatePicker/DatePicker.js} +11 -24
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +1 -9
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +20 -0
- package/dist/{chunk-YYAXXJH3.js → components/DateRangePicker/DateRangePicker.js} +9 -23
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/index.js +1 -9
- package/dist/components/Dialog/Dialog.d.ts +21 -0
- package/dist/{chunk-CEFGILJY.js → components/Dialog/Dialog.js} +28 -38
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +1 -7
- package/dist/components/Drawer/Drawer.d.ts +94 -0
- package/dist/components/Drawer/Drawer.js +131 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +1 -9
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +18 -0
- package/dist/{chunk-GWFIMQBC.js → components/DropdownMenu/DropdownMenu.js} +42 -53
- package/dist/components/DropdownMenu/index.d.ts +1 -0
- package/dist/components/DropdownMenu/index.js +1 -7
- package/dist/components/EmptyState/EmptyState.d.ts +8 -0
- package/dist/{chunk-AWTSLASB.js → components/EmptyState/EmptyState.js} +8 -14
- package/dist/components/EmptyState/index.d.ts +1 -0
- package/dist/components/EmptyState/index.js +1 -5
- package/dist/components/ErrorState/ErrorState.d.ts +10 -0
- package/dist/{chunk-NX5ZJSRU.js → components/ErrorState/ErrorState.js} +6 -13
- package/dist/components/ErrorState/index.d.ts +2 -0
- package/dist/components/ErrorState/index.js +1 -6
- package/dist/components/EyebrowChip/EyebrowChip.d.ts +11 -0
- package/dist/{chunk-MXXJOAWQ.js → components/EyebrowChip/EyebrowChip.js} +7 -13
- package/dist/components/EyebrowChip/index.d.ts +2 -0
- package/dist/components/EyebrowChip/index.js +1 -8
- package/dist/components/FileUpload/FileUpload.d.ts +16 -0
- package/dist/{chunk-LR6KNEKL.js → components/FileUpload/FileUpload.js} +12 -19
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/FileUpload/index.js +1 -6
- package/dist/components/FilterChip/FilterChip.d.ts +8 -0
- package/dist/{chunk-36QSSD7I.js → components/FilterChip/FilterChip.js} +6 -15
- package/dist/components/FilterChip/index.d.ts +2 -0
- package/dist/components/FilterChip/index.js +1 -7
- package/dist/components/Flag/Flag.d.ts +7 -0
- package/dist/{chunk-HOQPHAGW.js → components/Flag/Flag.js} +4 -10
- package/dist/components/Flag/index.d.ts +2 -0
- package/dist/components/Flag/index.js +1 -6
- package/dist/components/Flex/Flex.d.ts +10 -0
- package/dist/{chunk-BOO4VH3M.js → components/Flex/Flex.js} +5 -13
- package/dist/components/Flex/index.d.ts +2 -0
- package/dist/components/Flex/index.js +1 -6
- package/dist/components/FormError/FormError.d.ts +3 -0
- package/dist/{chunk-H2X6MSNY.js → components/FormError/FormError.js} +3 -9
- package/dist/components/FormError/index.d.ts +2 -0
- package/dist/components/FormError/index.js +1 -6
- package/dist/components/FormField/FormField.d.ts +46 -0
- package/dist/{chunk-FT73REUG.js → components/FormField/FormField.js} +9 -20
- package/dist/components/FormField/index.d.ts +2 -0
- package/dist/components/FormField/index.js +1 -11
- package/dist/components/GradientDivider/GradientDivider.d.ts +6 -0
- package/dist/{chunk-FDRAGYDV.js → components/GradientDivider/GradientDivider.js} +7 -13
- package/dist/components/GradientDivider/index.d.ts +2 -0
- package/dist/components/GradientDivider/index.js +1 -5
- package/dist/components/Grid/Grid.d.ts +9 -0
- package/dist/{chunk-F5S2KP3Z.js → components/Grid/Grid.js} +5 -13
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Grid/index.js +1 -6
- package/dist/components/Heading/Heading.d.ts +17 -0
- package/dist/{chunk-Z7OR2LYG.js → components/Heading/Heading.js} +8 -16
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Heading/index.js +1 -9
- package/dist/components/HelperText/HelperText.d.ts +6 -0
- package/dist/{chunk-QKGQBJ4U.js → components/HelperText/HelperText.js} +4 -12
- package/dist/components/HelperText/index.d.ts +2 -0
- package/dist/components/HelperText/index.js +1 -9
- package/dist/components/HoverCard/HoverCard.d.ts +10 -0
- package/dist/{chunk-KL55E5PE.js → components/HoverCard/HoverCard.js} +15 -22
- package/dist/components/HoverCard/index.d.ts +1 -0
- package/dist/components/HoverCard/index.js +1 -7
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/{chunk-RH2HEPC7.js → components/IconButton/IconButton.js} +7 -17
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/index.js +1 -8
- package/dist/components/Input/Input.d.ts +21 -0
- package/dist/{chunk-G7VMAWAX.js → components/Input/Input.js} +10 -21
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +1 -10
- package/dist/components/Kbd/Kbd.d.ts +4 -0
- package/dist/{chunk-OM62PQSE.js → components/Kbd/Kbd.js} +3 -9
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/Kbd/index.js +1 -6
- package/dist/components/KeyboardShortcut/KeyboardShortcut.d.ts +5 -0
- package/dist/{chunk-PR3CEPFG.js → components/KeyboardShortcut/KeyboardShortcut.js} +4 -12
- package/dist/components/KeyboardShortcut/index.d.ts +2 -0
- package/dist/components/KeyboardShortcut/index.js +1 -6
- package/dist/components/Label/Label.d.ts +15 -0
- package/dist/{chunk-BM5PGGK2.js → components/Label/Label.js} +7 -15
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/Label/index.js +1 -10
- package/dist/components/Link/Link.d.ts +11 -0
- package/dist/{chunk-QCLE5VQW.js → components/Link/Link.js} +6 -12
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Link/index.js +1 -6
- package/dist/components/Logo/Logo.d.ts +15 -0
- package/dist/{chunk-ZGJF4HAT.js → components/Logo/Logo.js} +8 -14
- package/dist/components/Logo/index.d.ts +2 -0
- package/dist/components/Logo/index.js +1 -6
- package/dist/components/MediaCard/MediaCard.d.ts +24 -0
- package/dist/{chunk-5DHLFPC4.js → components/MediaCard/MediaCard.js} +5 -13
- package/dist/components/MediaCard/index.d.ts +2 -0
- package/dist/components/MediaCard/index.js +1 -6
- package/dist/components/Menubar/Menubar.d.ts +1 -0
- package/dist/{chunk-PPECMYKJ.js → components/Menubar/Menubar.js} +50 -61
- package/dist/components/Menubar/index.d.ts +1 -0
- package/dist/components/Menubar/index.js +1 -6
- package/dist/components/MessageBubble/MessageBubble.d.ts +43 -0
- package/dist/{chunk-RNS35DNZ.js → components/MessageBubble/MessageBubble.js} +13 -27
- package/dist/components/MessageBubble/index.d.ts +2 -0
- package/dist/components/MessageBubble/index.js +1 -13
- package/dist/components/MoneyInput/MoneyInput.d.ts +19 -0
- package/dist/{chunk-FOFNTKCK.js → components/MoneyInput/MoneyInput.js} +8 -24
- package/dist/components/MoneyInput/index.d.ts +2 -0
- package/dist/components/MoneyInput/index.js +1 -11
- package/dist/components/Motion/Collapse.d.ts +29 -0
- package/dist/components/Motion/Collapse.js +103 -0
- package/dist/components/Motion/Fade.d.ts +16 -0
- package/dist/components/Motion/Fade.js +42 -0
- package/dist/components/Motion/Float.d.ts +8 -0
- package/dist/components/Motion/Float.js +14 -0
- package/dist/components/Motion/ListTransition.d.ts +46 -0
- package/dist/components/Motion/ListTransition.js +110 -0
- package/dist/components/Motion/Marquee.d.ts +13 -0
- package/dist/components/Motion/Marquee.js +13 -0
- package/dist/components/Motion/Reveal.d.ts +12 -0
- package/dist/components/Motion/Reveal.js +32 -0
- package/dist/components/Motion/Scale.d.ts +22 -0
- package/dist/components/Motion/Scale.js +45 -0
- package/dist/components/Motion/Slide.d.ts +22 -0
- package/dist/components/Motion/Slide.js +59 -0
- package/dist/components/Motion/index.d.ts +18 -0
- package/dist/components/Motion/index.js +12 -10
- package/dist/components/Motion/motion.types.d.ts +25 -0
- package/dist/components/Motion/motion.types.js +1 -0
- package/dist/components/Motion/useMotion.d.ts +41 -0
- package/dist/components/Motion/useMotion.js +102 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +12 -0
- package/dist/{chunk-FXVI4RCJ.js → components/NavigationMenu/NavigationMenu.js} +21 -28
- package/dist/components/NavigationMenu/index.d.ts +1 -0
- package/dist/components/NavigationMenu/index.js +1 -6
- package/dist/components/NavigationRail/NavigationRail.d.ts +19 -0
- package/dist/{chunk-5MGCYR4G.js → components/NavigationRail/NavigationRail.js} +7 -14
- package/dist/components/NavigationRail/index.d.ts +2 -0
- package/dist/components/NavigationRail/index.js +1 -6
- package/dist/components/NexubProvider/NexubProvider.d.ts +34 -0
- package/dist/{chunk-VMSWIC3O.js → components/NexubProvider/NexubProvider.js} +7 -9
- package/dist/components/NexubProvider/index.d.ts +2 -0
- package/dist/components/NexubProvider/index.js +1 -8
- package/dist/components/NumberInput/NumberInput.d.ts +15 -0
- package/dist/{chunk-V3EWVSVI.js → components/NumberInput/NumberInput.js} +9 -20
- package/dist/components/NumberInput/index.d.ts +2 -0
- package/dist/components/NumberInput/index.js +1 -8
- package/dist/components/NumberTicker/NumberTicker.d.ts +25 -0
- package/dist/{chunk-2G3XUIQZ.js → components/NumberTicker/NumberTicker.js} +30 -19
- package/dist/components/NumberTicker/index.d.ts +2 -0
- package/dist/components/NumberTicker/index.js +1 -7
- package/dist/components/PageHeader/PageHeader.d.ts +10 -0
- package/dist/{chunk-SEW66BU7.js → components/PageHeader/PageHeader.js} +3 -9
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.js +1 -5
- package/dist/components/Pagination/Pagination.d.ts +9 -0
- package/dist/{chunk-NLVP74RX.js → components/Pagination/Pagination.js} +7 -17
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/index.js +1 -7
- package/dist/components/PasswordInput/PasswordInput.d.ts +9 -0
- package/dist/{chunk-OGHOT6XN.js → components/PasswordInput/PasswordInput.js} +7 -18
- package/dist/components/PasswordInput/index.d.ts +2 -0
- package/dist/components/PasswordInput/index.js +1 -10
- package/dist/components/Popover/Popover.d.ts +13 -0
- package/dist/{chunk-MPJG4WFP.js → components/Popover/Popover.js} +20 -29
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +1 -7
- package/dist/components/Progress/Progress.d.ts +17 -0
- package/dist/{chunk-HXNUIIXB.js → components/Progress/Progress.js} +9 -16
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.js +1 -8
- package/dist/components/PromptInput/PromptInput.d.ts +33 -0
- package/dist/{chunk-ZUMC7SX5.js → components/PromptInput/PromptInput.js} +12 -30
- package/dist/components/PromptInput/index.d.ts +2 -0
- package/dist/components/PromptInput/index.js +1 -12
- package/dist/components/RadioCard/RadioCard.d.ts +11 -0
- package/dist/{chunk-YNLXG574.js → components/RadioCard/RadioCard.js} +11 -16
- package/dist/components/RadioCard/index.d.ts +2 -0
- package/dist/components/RadioCard/index.js +1 -7
- package/dist/components/RadioCard/selectableCard.d.ts +29 -0
- package/dist/{chunk-6SPCGCDG.js → components/RadioCard/selectableCard.js} +6 -11
- package/dist/components/RadioGroup/RadioGroup.d.ts +6 -0
- package/dist/{chunk-QQR4PPF3.js → components/RadioGroup/RadioGroup.js} +8 -13
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/index.js +1 -5
- package/dist/components/Rating/Rating.d.ts +12 -0
- package/dist/{chunk-VCCQ64G7.js → components/Rating/Rating.js} +9 -18
- package/dist/components/Rating/index.d.ts +2 -0
- package/dist/components/Rating/index.js +1 -9
- package/dist/components/ScrollArea/ScrollArea.d.ts +6 -0
- package/dist/{chunk-2DZWTBDL.js → components/ScrollArea/ScrollArea.js} +4 -9
- package/dist/components/ScrollArea/index.d.ts +2 -0
- package/dist/components/ScrollArea/index.js +1 -5
- package/dist/components/SearchInput/SearchInput.d.ts +6 -0
- package/dist/{chunk-YVS6AVPD.js → components/SearchInput/SearchInput.js} +7 -18
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.js +1 -10
- package/dist/components/Section/Section.d.ts +10 -0
- package/dist/{chunk-EIV37DAQ.js → components/Section/Section.js} +6 -12
- package/dist/components/Section/index.d.ts +2 -0
- package/dist/components/Section/index.js +1 -6
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +12 -0
- package/dist/{chunk-KRIRCSUB.js → components/SegmentedControl/SegmentedControl.js} +12 -21
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/SegmentedControl/index.js +1 -8
- package/dist/components/Select/Select.d.ts +16 -0
- package/dist/{chunk-M5PDVHFN.js → components/Select/Select.js} +35 -48
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +1 -7
- package/dist/components/Separator/Separator.d.ts +12 -0
- package/dist/{chunk-YVCUKIAC.js → components/Separator/Separator.js} +6 -12
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/Separator/index.js +1 -6
- package/dist/components/Sidebar/Sidebar.d.ts +25 -0
- package/dist/{chunk-NAESV7K3.js → components/Sidebar/Sidebar.js} +11 -18
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/index.js +1 -6
- package/dist/components/Skeleton/Skeleton.d.ts +14 -0
- package/dist/{chunk-3C4WVTAN.js → components/Skeleton/Skeleton.js} +7 -13
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/index.js +1 -6
- package/dist/components/Slider/Slider.d.ts +7 -0
- package/dist/{chunk-5QWRBJSZ.js → components/Slider/Slider.js} +4 -9
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/index.js +1 -5
- package/dist/components/Spinner/Spinner.d.ts +12 -0
- package/dist/{chunk-P3SAE4T2.js → components/Spinner/Spinner.js} +8 -15
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/index.js +1 -7
- package/dist/components/SplitButton/SplitButton.d.ts +15 -0
- package/dist/{chunk-ILIM4BLN.js → components/SplitButton/SplitButton.js} +7 -18
- package/dist/components/SplitButton/index.d.ts +2 -0
- package/dist/components/SplitButton/index.js +1 -11
- package/dist/components/Stack/Stack.d.ts +11 -0
- package/dist/{chunk-ST4O3EQ3.js → components/Stack/Stack.js} +4 -12
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/Stack/index.js +1 -6
- package/dist/components/StreamingText/StreamingText.d.ts +19 -0
- package/dist/{chunk-4ESZQDPB.js → components/StreamingText/StreamingText.js} +5 -10
- package/dist/components/StreamingText/index.d.ts +2 -0
- package/dist/components/StreamingText/index.js +1 -5
- package/dist/components/Switch/Switch.d.ts +12 -0
- package/dist/{chunk-EWW6PWTK.js → components/Switch/Switch.js} +9 -12
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +1 -5
- package/dist/components/Table/Table.d.ts +18 -0
- package/dist/{chunk-KA6RZ7VN.js → components/Table/Table.js} +13 -18
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +1 -6
- package/dist/components/Tabs/Tabs.d.ts +8 -0
- package/dist/{chunk-BIWSXGTZ.js → components/Tabs/Tabs.js} +14 -23
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +1 -8
- package/dist/components/Text/Text.d.ts +13 -0
- package/dist/{chunk-UYINKNCI.js → components/Text/Text.js} +7 -13
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/index.js +1 -6
- package/dist/components/TextGradient/TextGradient.d.ts +4 -0
- package/dist/{chunk-IDPRAXCG.js → components/TextGradient/TextGradient.js} +3 -9
- package/dist/components/TextGradient/index.d.ts +2 -0
- package/dist/components/TextGradient/index.js +1 -5
- package/dist/components/Textarea/Textarea.d.ts +13 -0
- package/dist/{chunk-HL64PWVQ.js → components/Textarea/Textarea.js} +8 -17
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/index.js +1 -7
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +69 -0
- package/dist/{chunk-ZBRRQHZG.js → components/ThemeProvider/ThemeProvider.js} +11 -15
- package/dist/components/ThemeProvider/index.d.ts +2 -0
- package/dist/components/ThemeProvider/index.js +1 -7
- package/dist/components/ThinkingIndicator/ThinkingIndicator.d.ts +18 -0
- package/dist/{chunk-VX56VQMF.js → components/ThinkingIndicator/ThinkingIndicator.js} +6 -13
- package/dist/components/ThinkingIndicator/index.d.ts +2 -0
- package/dist/components/ThinkingIndicator/index.js +1 -6
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/Toast.js +82 -0
- package/dist/components/Toast/Toaster.d.ts +21 -0
- package/dist/{chunk-MQGBAWSJ.js → components/Toast/Toaster.js} +27 -189
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Toast/index.js +3 -10
- package/dist/components/Toast/useToast.d.ts +45 -0
- package/dist/components/Toast/useToast.js +74 -0
- package/dist/components/Toggle/Toggle.d.ts +10 -0
- package/dist/{chunk-NMSQDI4A.js → components/Toggle/Toggle.js} +7 -12
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/index.js +1 -7
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +16 -0
- package/dist/{chunk-UOBWHPXG.js → components/ToggleGroup/ToggleGroup.js} +10 -17
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +1 -6
- package/dist/components/Toolbar/Toolbar.d.ts +18 -0
- package/dist/{chunk-WGW7TZOV.js → components/Toolbar/Toolbar.js} +15 -22
- package/dist/components/Toolbar/index.d.ts +2 -0
- package/dist/components/Toolbar/index.js +1 -6
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/{chunk-6SWOLUMF.js → components/Tooltip/Tooltip.js} +16 -21
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +1 -10
- package/dist/components/TopNav/TopNav.d.ts +20 -0
- package/dist/{chunk-BNG3Y5I7.js → components/TopNav/TopNav.js} +11 -20
- package/dist/components/TopNav/index.d.ts +2 -0
- package/dist/components/TopNav/index.js +1 -7
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +2 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +5 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/components/VisuallyHidden/index.js +2 -5
- package/dist/hooks/useClassScrollLock.d.ts +6 -0
- package/dist/{chunk-47UGX37F.js → hooks/useClassScrollLock.js} +2 -5
- package/dist/hooks/useControllableState.d.ts +7 -0
- package/dist/{chunk-JLUCMNVS.js → hooks/useControllableState.js} +2 -7
- package/dist/hooks/useDisclosure.d.ts +6 -0
- package/dist/hooks/useDisclosure.js +12 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/hooks/useIsomorphicLayoutEffect.js +5 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useMediaQuery.js +17 -0
- package/dist/hooks/useMergedRefs.d.ts +2 -0
- package/dist/{chunk-MNEXMMLM.js → hooks/useMergedRefs.js} +1 -4
- package/dist/hooks/usePointerSheen.d.ts +8 -0
- package/dist/hooks/usePointerSheen.js +25 -0
- package/dist/hooks/useSlidingIndicator.d.ts +8 -0
- package/dist/{chunk-6UKNUI46.js → hooks/useSlidingIndicator.js} +2 -7
- package/dist/index.d.ts +198 -1849
- package/dist/index.js +123 -413
- package/dist/styles.css +1 -1
- package/dist/utils/cn.d.ts +2 -0
- package/dist/{chunk-WRVFNYO3.js → utils/cn.js} +8 -11
- package/dist/utils/control.d.ts +20 -0
- package/dist/utils/control.js +41 -0
- package/dist/utils/deprecated.d.ts +6 -0
- package/dist/utils/deprecated.js +16 -0
- package/dist/utils/glass.d.ts +9 -0
- package/dist/utils/glass.js +4 -0
- package/dist/utils/layout.d.ts +14 -0
- package/dist/{chunk-VLQGQFW7.js → utils/layout.js} +5 -9
- package/dist/utils/money.d.ts +1 -0
- package/dist/{chunk-R3SUPKKI.js → utils/money.js} +3 -6
- package/dist/utils/surface.d.ts +11 -0
- package/dist/{chunk-5FWJXSXT.js → utils/surface.js} +9 -13
- package/dist/utils/viewTransition.d.ts +5 -0
- package/dist/utils/viewTransition.js +8 -0
- package/dist/{chunk-PZL6AJH5.js → vendor/vaul.js} +2 -140
- package/package.json +15 -7
- package/dist/chunk-4B4XWDAH.js +0 -1
- package/dist/chunk-4GVGS5N4.js +0 -468
- package/dist/chunk-52ZVJPF7.js +0 -1
- package/dist/chunk-A3O23F2B.js +0 -1
- package/dist/chunk-ADO2DB6Q.js +0 -1
- package/dist/chunk-BV3U3ATL.js +0 -1
- package/dist/chunk-CAOLGXA5.js +0 -1
- package/dist/chunk-DEIBF3P7.js +0 -8
- package/dist/chunk-EV43I5J6.js +0 -1
- package/dist/chunk-HI7GBSW2.js +0 -1
- package/dist/chunk-HY3JWSG4.js +0 -1
- package/dist/chunk-IZ6ZPEZ2.js +0 -1
- package/dist/chunk-KLTQJZOX.js +0 -1
- package/dist/chunk-LVPU7455.js +0 -1
- package/dist/chunk-NHUQLIHL.js +0 -9
- package/dist/chunk-NZ7UK3G6.js +0 -1
- package/dist/chunk-P26VJEIW.js +0 -1
- package/dist/chunk-PICMOOAZ.js +0 -1
- package/dist/chunk-VALIDQXU.js +0 -31
- package/dist/chunk-WLRRMT6W.js +0 -1
- package/dist/chunk-XYXMPHND.js +0 -1
- package/dist/chunk-YJU4ZRQZ.js +0 -1
- package/dist/chunk-ZT3NWE5U.js +0 -1
- package/dist/chunk-ZXLACKEB.js +0 -8
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GlassMode } from '@nexub/core';
|
|
3
|
+
export type ThemeMode = 'light' | 'dark' | 'system';
|
|
4
|
+
/** Glass intensity dial (user preference, like iOS 27's clear → tinted slider).
|
|
5
|
+
* 'off' makes every glass surface solid. Set as `data-glass` on <html>. */
|
|
6
|
+
export type { GlassMode };
|
|
7
|
+
export interface ThemeContextValue {
|
|
8
|
+
/** The resolved theme actually applied (never 'system'). */
|
|
9
|
+
resolvedTheme: 'light' | 'dark';
|
|
10
|
+
/** The mode set by the consumer — may be 'system'. */
|
|
11
|
+
theme: ThemeMode;
|
|
12
|
+
/** Change the active theme. */
|
|
13
|
+
setTheme: (mode: ThemeMode) => void;
|
|
14
|
+
/** Glass intensity. */
|
|
15
|
+
glass: GlassMode;
|
|
16
|
+
/** Change (and persist) the glass intensity. */
|
|
17
|
+
setGlass: (mode: GlassMode) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface ThemeProviderProps {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Initial theme. Defaults to 'system'.
|
|
23
|
+
*/
|
|
24
|
+
defaultTheme?: ThemeMode;
|
|
25
|
+
/**
|
|
26
|
+
* localStorage key used to persist the user's choice.
|
|
27
|
+
* Defaults to 'nexub-theme'.
|
|
28
|
+
*/
|
|
29
|
+
storageKey?: string;
|
|
30
|
+
/** Initial glass intensity. Defaults to 'balanced'. */
|
|
31
|
+
defaultGlass?: GlassMode;
|
|
32
|
+
/** localStorage key for the glass intensity. Defaults to 'nexub-glass'. */
|
|
33
|
+
glassStorageKey?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Brand seed colour (`#rgb` / `#rrggbb`) for white-label theming. The accent
|
|
36
|
+
* family named by `seedTarget` is regenerated from it (same HCT tones as the
|
|
37
|
+
* built-in roles, so WCAG pairs hold) and set on `<html>` via the CSSOM
|
|
38
|
+
* (strict-CSP safe), following the current `data-contrast` level.
|
|
39
|
+
*
|
|
40
|
+
* Runs on the client after `@nexub/tokens/seed` loads (a lazy chunk with
|
|
41
|
+
* the colour library), so server-rendered pages paint the default brand
|
|
42
|
+
* first. To avoid that flash, emit `createSeedThemeCss(seed)` from
|
|
43
|
+
* `@nexub/tokens/seed` into a server-rendered stylesheet instead.
|
|
44
|
+
*/
|
|
45
|
+
seed?: string;
|
|
46
|
+
/** Accent family the seed recolours: 'primary' (default) or 'tertiary' (product brand). */
|
|
47
|
+
seedTarget?: 'primary' | 'tertiary';
|
|
48
|
+
}
|
|
49
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, defaultGlass, glassStorageKey, seed, seedTarget, }: ThemeProviderProps): React.JSX.Element;
|
|
50
|
+
export declare function useTheme(): ThemeContextValue;
|
|
51
|
+
export interface ThemeScriptProps {
|
|
52
|
+
/** Must match ThemeProvider's `storageKey`. Defaults to 'nexub-theme'. */
|
|
53
|
+
storageKey?: string;
|
|
54
|
+
/** If set, a stored product brand (e.g. 'bookub') is applied as `data-product`. */
|
|
55
|
+
productStorageKey?: string;
|
|
56
|
+
/** Must match ThemeProvider's `glassStorageKey`. Defaults to 'nexub-glass'. */
|
|
57
|
+
glassStorageKey?: string;
|
|
58
|
+
/** If set, a stored contrast level ('standard' | 'medium' | 'high') is applied as `data-contrast`. */
|
|
59
|
+
contrastStorageKey?: string;
|
|
60
|
+
/** CSP nonce for pages whose script-src disallows inline scripts. */
|
|
61
|
+
nonce?: string;
|
|
62
|
+
}
|
|
63
|
+
/** @internal Exported for tests. */
|
|
64
|
+
export declare function themeScriptSource(storageKey: string, productStorageKey?: string, glassStorageKey?: string, contrastStorageKey?: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Applies the stored theme before first paint, so there is no light/dark flash.
|
|
67
|
+
* Render it in `<head>` (or at the top of `<body>`) on server-rendered pages.
|
|
68
|
+
*/
|
|
69
|
+
export declare function ThemeScript({ storageKey, productStorageKey, glassStorageKey, contrastStorageKey, nonce, }: ThemeScriptProps): React.JSX.Element;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
useIsomorphicLayoutEffect
|
|
4
|
-
} from "./chunk-NHUQLIHL.js";
|
|
5
|
-
|
|
6
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7
|
-
import * as React from "react";
|
|
1
|
+
"use client";
|
|
8
2
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useIsomorphicLayoutEffect } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
5
|
+
const GLASS_MODES = ["clear", "balanced", "tinted", "off"];
|
|
6
|
+
const ThemeContext = React.createContext(void 0);
|
|
11
7
|
ThemeContext.displayName = "ThemeContext";
|
|
12
|
-
|
|
8
|
+
const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
13
9
|
function applyTheme(theme) {
|
|
14
10
|
if (typeof document === "undefined") return;
|
|
15
11
|
const root = document.documentElement;
|
|
@@ -36,7 +32,7 @@ function readGlass(key, fallback) {
|
|
|
36
32
|
}
|
|
37
33
|
return fallback;
|
|
38
34
|
}
|
|
39
|
-
|
|
35
|
+
const CONTRAST_QUERY = "(prefers-contrast: more)";
|
|
40
36
|
function readContrast(root) {
|
|
41
37
|
const attr = root.getAttribute("data-contrast");
|
|
42
38
|
if (attr === "standard" || attr === "medium" || attr === "high") return attr;
|
|
@@ -161,7 +157,7 @@ function useTheme() {
|
|
|
161
157
|
}
|
|
162
158
|
return ctx;
|
|
163
159
|
}
|
|
164
|
-
|
|
160
|
+
const jsString = (s) => JSON.stringify(s).replace(/</g, "\\u003c");
|
|
165
161
|
function themeScriptSource(storageKey, productStorageKey, glassStorageKey = "nexub-glass", contrastStorageKey) {
|
|
166
162
|
const contrast = contrastStorageKey ? `var c=localStorage.getItem(${jsString(contrastStorageKey)});if(['standard','medium','high'].indexOf(c)>-1)d.setAttribute('data-contrast',c);` : "";
|
|
167
163
|
const product = productStorageKey ? `var b=localStorage.getItem(${jsString(productStorageKey)});if(b&&b!=='base')d.setAttribute('data-product',b);` : "";
|
|
@@ -184,9 +180,9 @@ function ThemeScript({
|
|
|
184
180
|
}
|
|
185
181
|
);
|
|
186
182
|
}
|
|
187
|
-
|
|
188
183
|
export {
|
|
189
184
|
ThemeProvider,
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
ThemeScript,
|
|
186
|
+
themeScriptSource,
|
|
187
|
+
useTheme
|
|
192
188
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
ThemeProvider,
|
|
4
|
-
ThemeScript,
|
|
5
|
-
useTheme
|
|
6
|
-
} from "../../chunk-ZBRRQHZG.js";
|
|
7
|
-
import "../../chunk-NHUQLIHL.js";
|
|
1
|
+
import { ThemeProvider, ThemeScript, useTheme } from "./ThemeProvider.js";
|
|
8
2
|
export {
|
|
9
3
|
ThemeProvider,
|
|
10
4
|
ThemeScript,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ThinkingIndicatorMessages {
|
|
3
|
+
thinking: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ThinkingIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Visible text. Pass `null` to hide it (it is still announced). @default messages.thinking */
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
/** @default 'md' */
|
|
9
|
+
size?: 'sm' | 'md';
|
|
10
|
+
/** Local overrides for this component's strings. */
|
|
11
|
+
messages?: Partial<ThinkingIndicatorMessages>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Shows the assistant is working before tokens arrive: a primary-tinted shape
|
|
15
|
+
* morphing between a circle and a soft four-lobed squircle (.nx-morph), and a
|
|
16
|
+
* label with a decorative shimmer (.nx-shimmer). Reduced motion: both static.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ThinkingIndicator: React.ForwardRefExoticComponent<ThinkingIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
useNexubMessages
|
|
4
|
-
} from "./chunk-VMSWIC3O.js";
|
|
5
|
-
import {
|
|
6
|
-
cn
|
|
7
|
-
} from "./chunk-WRVFNYO3.js";
|
|
8
|
-
|
|
9
|
-
// src/components/ThinkingIndicator/ThinkingIndicator.tsx
|
|
10
|
-
import * as React from "react";
|
|
1
|
+
"use client";
|
|
11
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { useNexubMessages } from "../NexubProvider/NexubProvider.js";
|
|
6
|
+
const fallbackMessages = { thinking: "Thinking" };
|
|
7
|
+
const ThinkingIndicator = React.forwardRef(
|
|
14
8
|
({ label, size = "md", messages: messagesProp, className, ...props }, ref) => {
|
|
15
9
|
const m = {
|
|
16
10
|
...fallbackMessages,
|
|
@@ -48,7 +42,6 @@ var ThinkingIndicator = React.forwardRef(
|
|
|
48
42
|
}
|
|
49
43
|
);
|
|
50
44
|
ThinkingIndicator.displayName = "ThinkingIndicator";
|
|
51
|
-
|
|
52
45
|
export {
|
|
53
46
|
ThinkingIndicator
|
|
54
47
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadixToast from '@radix-ui/react-toast';
|
|
3
|
+
/** Swipe to dismiss toward the viewport's inline-end edge: right, or left in RTL. */
|
|
4
|
+
declare function Provider({ swipeDirection, ...props }: RadixToast.ToastProviderProps): React.JSX.Element;
|
|
5
|
+
declare namespace Provider {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Toast: {
|
|
9
|
+
Provider: typeof Provider;
|
|
10
|
+
Viewport: React.ForwardRefExoticComponent<RadixToast.ToastViewportProps & React.RefAttributes<HTMLOListElement>>;
|
|
11
|
+
Root: React.ForwardRefExoticComponent<RadixToast.ToastProps & React.RefAttributes<HTMLLIElement>>;
|
|
12
|
+
Title: React.ForwardRefExoticComponent<RadixToast.ToastTitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Description: React.ForwardRefExoticComponent<RadixToast.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Action: React.ForwardRefExoticComponent<RadixToast.ToastActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
Close: React.ForwardRefExoticComponent<RadixToast.ToastCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as RadixToast from "@radix-ui/react-toast";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { useLocale } from "../NexubProvider/NexubProvider.js";
|
|
7
|
+
function Provider({ swipeDirection, ...props }) {
|
|
8
|
+
const { dir } = useLocale();
|
|
9
|
+
return /* @__PURE__ */ jsx(RadixToast.Provider, { swipeDirection: swipeDirection ?? (dir === "rtl" ? "left" : "right"), ...props });
|
|
10
|
+
}
|
|
11
|
+
Provider.displayName = "Toast.Provider";
|
|
12
|
+
const Viewport = React.forwardRef(
|
|
13
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
14
|
+
RadixToast.Viewport,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn(
|
|
18
|
+
"fixed top-0 end-0 z-[var(--z-toast,2000)] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-sm gap-2",
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
Viewport.displayName = "Toast.Viewport";
|
|
26
|
+
const Root = React.forwardRef(
|
|
27
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
28
|
+
RadixToast.Root,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: cn(
|
|
32
|
+
// Snackbar: the inverse surface stands out from any page, light or dark.
|
|
33
|
+
"group pointer-events-auto relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-shape-container bg-[var(--color-inverse-surface)] py-3 ps-4 pe-2 text-[var(--color-inverse-on-surface)] shadow-elevation-2",
|
|
34
|
+
"duration-spatial-default ease-spatial-default data-[state=closed]:duration-effects-fast",
|
|
35
|
+
// Follow the finger (Radix's signed swipe offsets), snap back on cancel, leave from where it was let go.
|
|
36
|
+
"data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none",
|
|
37
|
+
// Enter/exit slide from the right edge, where the viewport sits.
|
|
38
|
+
"nx-motion [--nx-x:calc(100%+1rem)] rtl:[--nx-x:calc(-100%-1rem)]",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
Root.displayName = "Toast.Root";
|
|
46
|
+
const Title = React.forwardRef(
|
|
47
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Title, { ref, className: cn("text-title-sm", className), ...props })
|
|
48
|
+
);
|
|
49
|
+
Title.displayName = "Toast.Title";
|
|
50
|
+
const Description = React.forwardRef(
|
|
51
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
52
|
+
RadixToast.Description,
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
className: cn("text-body-sm text-[color-mix(in_srgb,var(--color-inverse-on-surface)_80%,transparent)]", className),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
Description.displayName = "Toast.Description";
|
|
61
|
+
const Action = React.forwardRef(
|
|
62
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
63
|
+
RadixToast.Action,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
className: cn(
|
|
67
|
+
"nx-state-layer relative inline-flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-shape-control px-3 text-label-lg text-[var(--color-inverse-primary)]",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
Action.displayName = "Toast.Action";
|
|
75
|
+
const Close = React.forwardRef(
|
|
76
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Close, { ref, className: cn("nx-state-layer relative grid h-8 w-8 place-items-center rounded-full", className), ...props })
|
|
77
|
+
);
|
|
78
|
+
Close.displayName = "Toast.Close";
|
|
79
|
+
const Toast = { Provider, Viewport, Root, Title, Description, Action, Close };
|
|
80
|
+
export {
|
|
81
|
+
Toast
|
|
82
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ToasterProps {
|
|
3
|
+
/** Always show the toasts as a list instead of a collapsed stack. */
|
|
4
|
+
expand?: boolean;
|
|
5
|
+
/** How many toasts are visible at once; older ones are visually hidden. Default 3. */
|
|
6
|
+
visibleToasts?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Sonner-style stack. Collapsed: the newest toast in front, older ones peek
|
|
10
|
+
* out below it, scaled down. Hovering or focusing the viewport fans them out
|
|
11
|
+
* into a list. Radix pauses every toast's timer while the viewport is hovered
|
|
12
|
+
* or focused — the same condition that expands the stack.
|
|
13
|
+
*
|
|
14
|
+
* Measured heights reach CSS as custom properties set through the CSSOM
|
|
15
|
+
* (--nx-toast-index / --nx-toast-offset per toast, --nx-front-height and
|
|
16
|
+
* --nx-stack-height on the viewport), never a style attribute (strict CSP).
|
|
17
|
+
*/
|
|
18
|
+
export declare function Toaster({ expand, visibleToasts }: ToasterProps): React.JSX.Element;
|
|
19
|
+
export declare namespace Toaster {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
@@ -1,192 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
useIsomorphicLayoutEffect
|
|
4
|
-
} from "./chunk-NHUQLIHL.js";
|
|
5
|
-
import {
|
|
6
|
-
useLocale,
|
|
7
|
-
useNexubMessages
|
|
8
|
-
} from "./chunk-VMSWIC3O.js";
|
|
9
|
-
import {
|
|
10
|
-
cn
|
|
11
|
-
} from "./chunk-WRVFNYO3.js";
|
|
12
|
-
|
|
13
|
-
// src/components/Toast/Toast.tsx
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
3
|
import * as React from "react";
|
|
15
4
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
16
|
-
import { jsx } from "react/jsx-runtime";
|
|
17
|
-
function Provider2({ swipeDirection, ...props }) {
|
|
18
|
-
const { dir } = useLocale();
|
|
19
|
-
return /* @__PURE__ */ jsx(RadixToast.Provider, { swipeDirection: swipeDirection ?? (dir === "rtl" ? "left" : "right"), ...props });
|
|
20
|
-
}
|
|
21
|
-
Provider2.displayName = "Toast.Provider";
|
|
22
|
-
var Viewport2 = React.forwardRef(
|
|
23
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
24
|
-
RadixToast.Viewport,
|
|
25
|
-
{
|
|
26
|
-
ref,
|
|
27
|
-
className: cn(
|
|
28
|
-
"fixed top-0 end-0 z-[var(--z-toast,2000)] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-sm gap-2",
|
|
29
|
-
className
|
|
30
|
-
),
|
|
31
|
-
...props
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
Viewport2.displayName = "Toast.Viewport";
|
|
36
|
-
var Root2 = React.forwardRef(
|
|
37
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
38
|
-
RadixToast.Root,
|
|
39
|
-
{
|
|
40
|
-
ref,
|
|
41
|
-
className: cn(
|
|
42
|
-
// Snackbar: the inverse surface stands out from any page, light or dark.
|
|
43
|
-
"group pointer-events-auto relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-shape-container bg-[var(--color-inverse-surface)] py-3 ps-4 pe-2 text-[var(--color-inverse-on-surface)] shadow-elevation-2",
|
|
44
|
-
"duration-spatial-default ease-spatial-default data-[state=closed]:duration-effects-fast",
|
|
45
|
-
// Follow the finger (Radix's signed swipe offsets), snap back on cancel, leave from where it was let go.
|
|
46
|
-
"data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none",
|
|
47
|
-
// Enter/exit slide from the right edge, where the viewport sits.
|
|
48
|
-
"nx-motion [--nx-x:calc(100%+1rem)] rtl:[--nx-x:calc(-100%-1rem)]",
|
|
49
|
-
className
|
|
50
|
-
),
|
|
51
|
-
...props
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
Root2.displayName = "Toast.Root";
|
|
56
|
-
var Title2 = React.forwardRef(
|
|
57
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Title, { ref, className: cn("text-title-sm", className), ...props })
|
|
58
|
-
);
|
|
59
|
-
Title2.displayName = "Toast.Title";
|
|
60
|
-
var Description2 = React.forwardRef(
|
|
61
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
-
RadixToast.Description,
|
|
63
|
-
{
|
|
64
|
-
ref,
|
|
65
|
-
className: cn("text-body-sm text-[color-mix(in_srgb,var(--color-inverse-on-surface)_80%,transparent)]", className),
|
|
66
|
-
...props
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
Description2.displayName = "Toast.Description";
|
|
71
|
-
var Action2 = React.forwardRef(
|
|
72
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
73
|
-
RadixToast.Action,
|
|
74
|
-
{
|
|
75
|
-
ref,
|
|
76
|
-
className: cn(
|
|
77
|
-
"nx-state-layer relative inline-flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-shape-control px-3 text-label-lg text-[var(--color-inverse-primary)]",
|
|
78
|
-
className
|
|
79
|
-
),
|
|
80
|
-
...props
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
);
|
|
84
|
-
Action2.displayName = "Toast.Action";
|
|
85
|
-
var Close2 = React.forwardRef(
|
|
86
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixToast.Close, { ref, className: cn("nx-state-layer relative grid h-8 w-8 place-items-center rounded-full", className), ...props })
|
|
87
|
-
);
|
|
88
|
-
Close2.displayName = "Toast.Close";
|
|
89
|
-
var Toast = { Provider: Provider2, Viewport: Viewport2, Root: Root2, Title: Title2, Description: Description2, Action: Action2, Close: Close2 };
|
|
90
|
-
|
|
91
|
-
// src/components/Toast/Toaster.tsx
|
|
92
|
-
import * as React2 from "react";
|
|
93
|
-
import * as RadixToast2 from "@radix-ui/react-toast";
|
|
94
5
|
import { X } from "@nexub/icons";
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
_g.__nexub_toast_items ??= [];
|
|
101
|
-
_g.__nexub_toast_listeners ??= /* @__PURE__ */ new Set();
|
|
102
|
-
_g.__nexub_toast_counter ??= 0;
|
|
103
|
-
return _g;
|
|
104
|
-
})() : { __nexub_toast_items: [], __nexub_toast_listeners: /* @__PURE__ */ new Set(), __nexub_toast_counter: 0 };
|
|
105
|
-
function notify() {
|
|
106
|
-
g.__nexub_toast_listeners.forEach((l) => l([...g.__nexub_toast_items]));
|
|
107
|
-
}
|
|
108
|
-
function add(item) {
|
|
109
|
-
const id = String(++g.__nexub_toast_counter);
|
|
110
|
-
g.__nexub_toast_items = [...g.__nexub_toast_items, { ...item, id }];
|
|
111
|
-
notify();
|
|
112
|
-
return id;
|
|
113
|
-
}
|
|
114
|
-
function useToastStore() {
|
|
115
|
-
const [state, setState] = useState([...g.__nexub_toast_items]);
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
g.__nexub_toast_listeners.add(setState);
|
|
118
|
-
return () => {
|
|
119
|
-
g.__nexub_toast_listeners.delete(setState);
|
|
120
|
-
};
|
|
121
|
-
}, []);
|
|
122
|
-
return state;
|
|
123
|
-
}
|
|
124
|
-
var closeFired = /* @__PURE__ */ new Set();
|
|
125
|
-
function fireToastClose(item) {
|
|
126
|
-
if (closeFired.has(item.id)) return;
|
|
127
|
-
closeFired.add(item.id);
|
|
128
|
-
item.onClose?.();
|
|
129
|
-
}
|
|
130
|
-
function dismiss(id) {
|
|
131
|
-
const removed = id ? g.__nexub_toast_items.filter((i) => i.id === id) : g.__nexub_toast_items;
|
|
132
|
-
g.__nexub_toast_items = id ? g.__nexub_toast_items.filter((i) => i.id !== id) : [];
|
|
133
|
-
notify();
|
|
134
|
-
for (const item of removed) {
|
|
135
|
-
fireToastClose(item);
|
|
136
|
-
closeFired.delete(item.id);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
function undoable(title, { onUndo, onCommit, undoLabel, description, duration }) {
|
|
140
|
-
let undone = false;
|
|
141
|
-
return add({
|
|
142
|
-
title,
|
|
143
|
-
tone: "neutral",
|
|
144
|
-
description,
|
|
145
|
-
duration,
|
|
146
|
-
undo: { label: undoLabel, onUndo: () => {
|
|
147
|
-
undone = true;
|
|
148
|
-
onUndo();
|
|
149
|
-
} },
|
|
150
|
-
onClose: () => {
|
|
151
|
-
if (!undone) onCommit?.();
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
var toast = {
|
|
156
|
-
success: (title, opts) => add({ title, tone: "success", ...opts }),
|
|
157
|
-
error: (title, opts) => add({ title, tone: "error", ...opts }),
|
|
158
|
-
info: (title, opts) => add({ title, tone: "info", ...opts }),
|
|
159
|
-
warning: (title, opts) => add({ title, tone: "warning", ...opts }),
|
|
160
|
-
custom: (title, opts) => add({ title, tone: "neutral", ...opts }),
|
|
161
|
-
/** A toast with an Undo action: Undo calls `onUndo`; any other close calls `onCommit`, once. */
|
|
162
|
-
undoable,
|
|
163
|
-
dismiss
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// src/components/Toast/Toaster.tsx
|
|
167
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
168
|
-
var toneMap = {
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { useIsomorphicLayoutEffect } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
8
|
+
import { useLocale, useNexubMessages } from "../NexubProvider/NexubProvider.js";
|
|
9
|
+
import { fireToastClose, toast, useToastStore } from "./useToast.js";
|
|
10
|
+
const toneMap = {
|
|
169
11
|
success: "border-s-4 border-[var(--color-success)]",
|
|
170
12
|
error: "border-s-4 border-[var(--color-error)]",
|
|
171
13
|
warning: "border-s-4 border-[var(--color-warning)]",
|
|
172
14
|
info: "border-s-4 border-[var(--color-info)]",
|
|
173
15
|
neutral: ""
|
|
174
16
|
};
|
|
175
|
-
|
|
17
|
+
const GAP = 8;
|
|
176
18
|
function Toaster({ expand = false, visibleToasts = 3 }) {
|
|
177
19
|
const toasts = useToastStore();
|
|
178
20
|
const messages = useNexubMessages();
|
|
179
21
|
const { dir } = useLocale();
|
|
180
|
-
const [closed, setClosed] =
|
|
181
|
-
const [hovered, setHovered] =
|
|
182
|
-
const [focused, setFocused] =
|
|
22
|
+
const [closed, setClosed] = React.useState(() => /* @__PURE__ */ new Set());
|
|
23
|
+
const [hovered, setHovered] = React.useState(false);
|
|
24
|
+
const [focused, setFocused] = React.useState(false);
|
|
183
25
|
const order = toasts.filter((t) => !closed.has(t.id)).map((t) => t.id).reverse();
|
|
184
26
|
const expanded = expand || order.length > 0 && (hovered || focused);
|
|
185
|
-
const viewportRef =
|
|
186
|
-
const heights =
|
|
187
|
-
const state =
|
|
27
|
+
const viewportRef = React.useRef(null);
|
|
28
|
+
const heights = React.useRef(/* @__PURE__ */ new Map());
|
|
29
|
+
const state = React.useRef({ order, expanded, visibleToasts });
|
|
188
30
|
state.current = { order, expanded, visibleToasts };
|
|
189
|
-
const layout =
|
|
31
|
+
const layout = React.useCallback(() => {
|
|
190
32
|
const ol = viewportRef.current;
|
|
191
33
|
if (!ol) return;
|
|
192
34
|
const { order: order2, expanded: expanded2, visibleToasts: visibleToasts2 } = state.current;
|
|
@@ -239,18 +81,18 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
|
|
|
239
81
|
region.removeEventListener("focusout", focusOut);
|
|
240
82
|
};
|
|
241
83
|
}, [layout]);
|
|
242
|
-
|
|
84
|
+
React.useEffect(() => {
|
|
243
85
|
if (order.length === 0) {
|
|
244
86
|
setHovered(false);
|
|
245
87
|
setFocused(false);
|
|
246
88
|
}
|
|
247
89
|
}, [order.length]);
|
|
248
|
-
return /* @__PURE__ */ jsxs(
|
|
90
|
+
return /* @__PURE__ */ jsxs(RadixToast.Provider, { swipeDirection: dir === "rtl" ? "left" : "right", children: [
|
|
249
91
|
toasts.map((t) => {
|
|
250
92
|
const i = order.indexOf(t.id);
|
|
251
93
|
const action = t.action ?? (t.undo && { label: t.undo.label ?? messages.undo, onClick: t.undo.onUndo });
|
|
252
94
|
return /* @__PURE__ */ jsxs(
|
|
253
|
-
|
|
95
|
+
RadixToast.Root,
|
|
254
96
|
{
|
|
255
97
|
"data-toast-id": t.id,
|
|
256
98
|
"data-front": i === -1 ? void 0 : i === 0,
|
|
@@ -292,11 +134,11 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
|
|
|
292
134
|
duration: t.duration ?? 5e3,
|
|
293
135
|
children: [
|
|
294
136
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
t.description && /* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ jsx(RadixToast.Title, { className: "text-title-sm", children: t.title }),
|
|
138
|
+
t.description && /* @__PURE__ */ jsx(RadixToast.Description, { className: "text-body-sm text-[color-mix(in_srgb,var(--color-inverse-on-surface)_80%,transparent)]", children: t.description })
|
|
297
139
|
] }),
|
|
298
|
-
action && /* @__PURE__ */
|
|
299
|
-
|
|
140
|
+
action && /* @__PURE__ */ jsx(
|
|
141
|
+
RadixToast.Action,
|
|
300
142
|
{
|
|
301
143
|
altText: action.label,
|
|
302
144
|
onClick: action.onClick,
|
|
@@ -304,17 +146,17 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
|
|
|
304
146
|
children: action.label
|
|
305
147
|
}
|
|
306
148
|
),
|
|
307
|
-
/* @__PURE__ */ jsxs(
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ jsxs(RadixToast.Close, { className: "nx-state-layer relative grid h-8 w-8 place-items-center rounded-full transition-opacity [@media(hover:hover)]:opacity-0 group-hover:opacity-100 focus-visible:opacity-100", children: [
|
|
150
|
+
/* @__PURE__ */ jsx(X, { size: "sm", "aria-hidden": "true" }),
|
|
151
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: messages.close })
|
|
310
152
|
] })
|
|
311
153
|
]
|
|
312
154
|
},
|
|
313
155
|
t.id
|
|
314
156
|
);
|
|
315
157
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
RadixToast.Viewport,
|
|
318
160
|
{
|
|
319
161
|
ref: viewportRef,
|
|
320
162
|
label: messages.notifications,
|
|
@@ -330,10 +172,6 @@ function Toaster({ expand = false, visibleToasts = 3 }) {
|
|
|
330
172
|
] });
|
|
331
173
|
}
|
|
332
174
|
Toaster.displayName = "Toaster";
|
|
333
|
-
|
|
334
175
|
export {
|
|
335
|
-
Toast,
|
|
336
|
-
useToastStore,
|
|
337
|
-
toast,
|
|
338
176
|
Toaster
|
|
339
177
|
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Toaster,
|
|
5
|
-
toast,
|
|
6
|
-
useToastStore
|
|
7
|
-
} from "../../chunk-MQGBAWSJ.js";
|
|
8
|
-
import "../../chunk-NHUQLIHL.js";
|
|
9
|
-
import "../../chunk-VMSWIC3O.js";
|
|
10
|
-
import "../../chunk-WRVFNYO3.js";
|
|
1
|
+
import { Toast } from "./Toast.js";
|
|
2
|
+
import { Toaster } from "./Toaster.js";
|
|
3
|
+
import { toast, useToastStore } from "./useToast.js";
|
|
11
4
|
export {
|
|
12
5
|
Toast,
|
|
13
6
|
Toaster,
|