@optiaxiom/react 0.3.5 → 0.4.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/assets/src/alert-dialog-content/{AlertDialogContent.css.ts.vanilla-CvVkw3cs.css → AlertDialogContent.css.ts.vanilla-Q3NIqlJM.css} +7 -7
- package/dist/assets/src/alert-dialog-footer/AlertDialogFooter.css.ts.vanilla-CwXE2VkG.css +6 -0
- package/dist/assets/src/autocomplete-content/AutocompleteContent.css.ts.vanilla-BSS4gDqH.css +10 -0
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-DBcDsevU.css +27 -0
- package/dist/assets/src/badge/Badge.css.ts.vanilla-v_WxKtkk.css +46 -0
- package/dist/assets/src/box/{Box.css.ts.vanilla-BHZ4bhCx.css → Box.css.ts.vanilla-DlV97In6.css} +23 -23
- package/dist/assets/src/button-base/ButtonBase.css.ts.vanilla-Cdep1j3a.css +140 -0
- package/dist/assets/src/button-loadable/ButtonLoadable.css.ts.vanilla-B3UxIRoe.css +9 -0
- package/dist/assets/src/checkbox/Checkbox.css.ts.vanilla-B4c8nGzf.css +18 -0
- package/dist/assets/src/code/Code.css.ts.vanilla-BE7HUNcL.css +7 -0
- package/dist/assets/src/data-table/DataTable.css.ts.vanilla-BJs_Nl-b.css +24 -0
- package/dist/assets/src/data-table-header/DataTableHeader.css.ts.vanilla-xxkcym9y.css +12 -0
- package/dist/assets/src/dialog-content/{DialogContent.css.ts.vanilla-Ds32MO_e.css → DialogContent.css.ts.vanilla-DysCGMhf.css} +9 -9
- package/dist/assets/src/disclosure-content/DisclosureContent.css.ts.vanilla-DGvnwBsb.css +25 -0
- package/dist/assets/src/disclosure-trigger/{DisclosureTrigger.css.ts.vanilla-C7mcv2PW.css → DisclosureTrigger.css.ts.vanilla-DztATFY8.css} +7 -7
- package/dist/assets/src/drawer/{Drawer.css.ts.vanilla-BiYwxVN6.css → Drawer.css.ts.vanilla-CnCA4xNN.css} +8 -8
- package/dist/assets/src/hover-card-content/{HoverCardContent.css.ts.vanilla-lySj_lUQ.css → HoverCardContent.css.ts.vanilla-B7Unn1_B.css} +3 -3
- package/dist/assets/src/indicator/Indicator.css.ts.vanilla-DT8h6YNZ.css +35 -0
- package/dist/assets/src/input/Input.css.ts.vanilla-BNBpG_wR.css +15 -0
- package/dist/assets/src/input-base/InputBase.css.ts.vanilla-BRh6TDMo.css +87 -0
- package/dist/assets/src/kbd/Kbd.css.ts.vanilla-DI26I3lo.css +9 -0
- package/dist/assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css +1 -0
- package/dist/assets/src/link/{Link.css.ts.vanilla-aDd_bw53.css → Link.css.ts.vanilla-B1rm-mfe.css} +12 -12
- package/dist/assets/src/listbox-base/ListboxBase.css.ts.vanilla-OxyS0fbd.css +21 -0
- package/dist/assets/src/listbox-item-base/ListboxItemBase.css.ts.vanilla-2nkexoSY.css +30 -0
- package/dist/assets/src/pagination/Pagination.css.ts.vanilla-BO2HXPXk.css +6 -0
- package/dist/assets/src/pill/{Pill.css.ts.vanilla-BhiphgSM.css → Pill.css.ts.vanilla-DzzbV1Nh.css} +4 -4
- package/dist/assets/src/radio/Radio.css.ts.vanilla-mURefw5x.css +13 -0
- package/dist/assets/src/search-input/SearchInput.css.ts.vanilla-D53cHAo4.css +6 -0
- package/dist/assets/src/select-content/SelectContent.css.ts.vanilla-MHnZ2e2d.css +7 -0
- package/dist/assets/src/separator/{Separator.css.ts.vanilla-BFxuHRr5.css → Separator.css.ts.vanilla-N8U1QlYl.css} +10 -10
- package/dist/assets/src/sidenav-item/SidenavItem.css.ts.vanilla-BQWU_ImM.css +6 -0
- package/dist/assets/src/skeleton/Skeleton.css.ts.vanilla-Chu8YOX_.css +6 -0
- package/dist/assets/src/sprinkles/{properties.css.ts.vanilla-D0osMMfq.css → properties.css.ts.vanilla-BhPIJGmv.css} +2069 -2069
- package/dist/assets/src/switch/Switch.css.ts.vanilla-CaTyt1Cf.css +26 -0
- package/dist/assets/src/table/{Table.css.ts.vanilla-D6-YaAqO.css → Table.css.ts.vanilla-D_TJfh-t.css} +4 -4
- package/dist/assets/src/table-body/TableBody.css.ts.vanilla-BQo50gJY.css +6 -0
- package/dist/assets/src/table-cell/{TableCell.css.ts.vanilla-moxm-BZ3.css → TableCell.css.ts.vanilla-C1lyvuYS.css} +4 -4
- package/dist/assets/src/table-header-cell/TableHeaderCell.css.ts.vanilla-DhY1s_ZI.css +6 -0
- package/dist/assets/src/table-row/TableRow.css.ts.vanilla-g1JsQVd4.css +4 -0
- package/dist/assets/src/tabs/Tabs.css.ts.vanilla-DvNrc0zR.css +9 -0
- package/dist/assets/src/tabs-list/TabsList.css.ts.vanilla-C4pwOkZI.css +23 -0
- package/dist/assets/src/tabs-trigger/{TabsTrigger.css.ts.vanilla-CDh49ssN.css → TabsTrigger.css.ts.vanilla-_hN0PYnr.css} +10 -10
- package/dist/assets/src/text/{Text.css.ts.vanilla-CGbEhKz7.css → Text.css.ts.vanilla-BCJDfIr0.css} +8 -8
- package/dist/assets/src/textarea-autosize/TextareaAutosize.css.ts.vanilla-BCRMLxRG.css +34 -0
- package/dist/assets/src/toast/Toast.css.ts.vanilla-BmaWJko-.css +92 -0
- package/dist/assets/src/toast-provider/{ToastProvider.css.ts.vanilla-DEMA1i5o.css → ToastProvider.css.ts.vanilla-CqJHVl4p.css} +9 -9
- package/dist/assets/src/toggle-input/ToggleInput.css.ts.vanilla-B-y4RHi9.css +22 -0
- package/dist/assets/src/toggle-input-control/ToggleInputControl.css.ts.vanilla-DM66CPyH.css +10 -0
- package/dist/assets/src/transition/{Transition.css.ts.vanilla-DIc7AOWt.css → Transition.css.ts.vanilla-Cnbq_Zqn.css} +16 -16
- package/dist/index.d.ts +9 -9
- package/dist/index.js +4 -4
- package/dist/package.json.js +1 -1
- package/dist/src/alert/Alert-css.js +1 -1
- package/dist/src/alert-dialog-content/AlertDialogContent-css.js +4 -4
- package/dist/src/alert-dialog-description/AlertDialogDescription-css.js +1 -1
- package/dist/src/alert-dialog-footer/AlertDialogFooter-css.js +3 -3
- package/dist/src/autocomplete-content/AutocompleteContent-css.js +3 -3
- package/dist/src/avatar/Avatar-css.js +4 -4
- package/dist/src/avatar-group/AvatarGroup-css.js +3 -3
- package/dist/src/badge/Badge-css.js +3 -3
- package/dist/src/banner/Banner-css.js +1 -1
- package/dist/src/box/Box-css.js +3 -3
- package/dist/src/button-base/ButtonBase-css.js +5 -5
- package/dist/src/button-group/ButtonGroup-css.js +3 -3
- package/dist/src/button-loadable/ButtonLoadable-css.js +5 -5
- package/dist/src/checkbox/Checkbox-css.js +8 -8
- package/dist/src/code/Code-css.js +3 -3
- package/dist/src/combobox/Combobox.js +3 -55
- package/dist/src/combobox-checkbox-item/ComboboxCheckboxItem.js +6 -0
- package/dist/src/combobox-content/ComboboxContent.js +22 -1
- package/dist/src/combobox-empty/ComboboxEmpty.js +2 -26
- package/dist/src/combobox-footer/ComboboxFooter.js +2 -9
- package/dist/src/combobox-input/ComboboxInput.js +2 -33
- package/dist/src/combobox-item/ComboboxItem.js +2 -45
- package/dist/src/combobox-item-indicator/ComboboxItemIndicator.js +2 -16
- package/dist/src/combobox-list/ComboboxList.js +2 -29
- package/dist/src/combobox-multiple-value/ComboboxMultipleValue.js +5 -2
- package/dist/src/combobox-separator/ComboboxSeparator.js +2 -5
- package/dist/src/combobox-single-value/ComboboxSingleValue.js +2 -2
- package/dist/src/combobox-value/ComboboxValue.js +2 -5
- package/dist/src/command/Command.js +74 -0
- package/dist/src/command-checkbox-item/CommandCheckboxItem.js +31 -0
- package/dist/src/command-context/CommandContext.js +5 -0
- package/dist/src/command-empty/CommandEmpty.js +30 -0
- package/dist/src/{combobox-footer/ComboboxFooter-css.js → command-footer/CommandFooter-css.js} +1 -1
- package/dist/src/command-footer/CommandFooter.js +13 -0
- package/dist/src/command-input/CommandInput.js +37 -0
- package/dist/src/command-item/CommandItem.js +50 -0
- package/dist/src/command-item-context/CommandItemContext.js +5 -0
- package/dist/src/command-item-indicator/CommandItemIndicator.js +20 -0
- package/dist/src/command-list/CommandList.js +33 -0
- package/dist/src/command-separator/CommandSeparator.js +9 -0
- package/dist/src/data-table/DataTable-css.js +7 -7
- package/dist/src/data-table-header/DataTableHeader-css.js +4 -4
- package/dist/src/dialog-body/DialogBody-css.js +1 -1
- package/dist/src/dialog-content/DialogContent-css.js +5 -5
- package/dist/src/dialog-footer/DialogFooter-css.js +1 -1
- package/dist/src/disclosure-content/DisclosureContent-css.js +3 -3
- package/dist/src/disclosure-trigger/DisclosureTrigger-css.js +4 -4
- package/dist/src/drawer/Drawer-css.js +5 -5
- package/dist/src/hover-card-content/HoverCardContent-css.js +3 -3
- package/dist/src/indicator/Indicator-css.js +5 -5
- package/dist/src/input/Input-css.js +3 -3
- package/dist/src/input-base/InputBase-css.js +5 -5
- package/dist/src/kbd/Kbd-css.js +3 -3
- package/dist/src/layers/layers-css.js +3 -3
- package/dist/src/link/Link-css.js +4 -4
- package/dist/src/listbox-base/ListboxBase-css.js +3 -3
- package/dist/src/listbox-item-base/ListboxItemBase-css.js +3 -3
- package/dist/src/pagination/Pagination-css.js +3 -3
- package/dist/src/pill/Pill-css.js +3 -3
- package/dist/src/radio/Radio-css.js +8 -8
- package/dist/src/search-input/SearchInput-css.js +4 -4
- package/dist/src/select-content/SelectContent-css.js +3 -3
- package/dist/src/separator/Separator-css.js +3 -3
- package/dist/src/{side-nav/SideNav.js → sidenav/Sidenav.js} +5 -5
- package/dist/src/{side-nav-account-item/SideNavAccountItem.js → sidenav-account-item/SidenavAccountItem.js} +5 -5
- package/dist/src/sidenav-context/SidenavContext.js +5 -0
- package/dist/src/sidenav-item/SidenavItem-css.js +9 -0
- package/dist/src/{side-nav-item/SideNavItem.js → sidenav-item/SidenavItem.js} +6 -6
- package/dist/src/{side-nav-toggle/SideNavToggle.js → sidenav-toggle/SidenavToggle.js} +7 -7
- package/dist/src/skeleton/Skeleton-css.js +3 -3
- package/dist/src/sprinkles/properties-css.js +4 -4
- package/dist/src/switch/Switch-css.js +8 -8
- package/dist/src/table/Table-css.js +4 -4
- package/dist/src/table-body/TableBody-css.js +3 -3
- package/dist/src/table-cell/TableCell-css.js +4 -4
- package/dist/src/table-header-cell/TableHeaderCell-css.js +3 -3
- package/dist/src/table-row/TableRow-css.js +3 -3
- package/dist/src/tabs/Tabs-css.js +3 -3
- package/dist/src/tabs-list/TabsList-css.js +3 -3
- package/dist/src/tabs-trigger/TabsTrigger-css.js +4 -4
- package/dist/src/text/Text-css.js +3 -3
- package/dist/src/textarea-autosize/TextareaAutosize-css.js +5 -5
- package/dist/src/toast/Toast-css.js +5 -5
- package/dist/src/toast-provider/ToastProvider-css.js +3 -3
- package/dist/src/toggle-input/ToggleInput-css.js +4 -4
- package/dist/src/toggle-input-control/ToggleInputControl-css.js +5 -5
- package/dist/src/toggle-input-hidden-input/ToggleInputHiddenInput-css.js +3 -3
- package/dist/src/tooltip-content/TooltipContent-css.js +1 -1
- package/dist/src/transition/Transition-css.js +3 -3
- package/dist/unstable.d.ts +125 -12
- package/dist/unstable.js +10 -0
- package/package.json +1 -1
- package/dist/assets/src/alert-dialog-footer/AlertDialogFooter.css.ts.vanilla-B2pBflJv.css +0 -6
- package/dist/assets/src/autocomplete-content/AutocompleteContent.css.ts.vanilla-Bbsg7no2.css +0 -10
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-UAC31ujs.css +0 -27
- package/dist/assets/src/badge/Badge.css.ts.vanilla-Dby1HGSv.css +0 -46
- package/dist/assets/src/button-base/ButtonBase.css.ts.vanilla-BHtcSNLa.css +0 -140
- package/dist/assets/src/button-loadable/ButtonLoadable.css.ts.vanilla-CnyGW7JN.css +0 -9
- package/dist/assets/src/checkbox/Checkbox.css.ts.vanilla-BP-IS8uM.css +0 -18
- package/dist/assets/src/code/Code.css.ts.vanilla-Di85g701.css +0 -7
- package/dist/assets/src/data-table/DataTable.css.ts.vanilla-Dr8prppO.css +0 -24
- package/dist/assets/src/data-table-header/DataTableHeader.css.ts.vanilla-DqnDDweC.css +0 -12
- package/dist/assets/src/disclosure-content/DisclosureContent.css.ts.vanilla-C97DPRK_.css +0 -25
- package/dist/assets/src/indicator/Indicator.css.ts.vanilla-BB2KNGqT.css +0 -35
- package/dist/assets/src/input/Input.css.ts.vanilla-BmTJx0jV.css +0 -15
- package/dist/assets/src/input-base/InputBase.css.ts.vanilla-DFLR3BqU.css +0 -87
- package/dist/assets/src/kbd/Kbd.css.ts.vanilla-DGV6V8U_.css +0 -9
- package/dist/assets/src/layers/layers.css.ts.vanilla-BQxl5Oc4.css +0 -1
- package/dist/assets/src/listbox-base/ListboxBase.css.ts.vanilla-DGeZ_R0t.css +0 -21
- package/dist/assets/src/listbox-item-base/ListboxItemBase.css.ts.vanilla-C1JB1FI6.css +0 -30
- package/dist/assets/src/pagination/Pagination.css.ts.vanilla-DbNkwf0Z.css +0 -6
- package/dist/assets/src/radio/Radio.css.ts.vanilla-B-Wp17XI.css +0 -13
- package/dist/assets/src/search-input/SearchInput.css.ts.vanilla-oc3OrG46.css +0 -6
- package/dist/assets/src/select-content/SelectContent.css.ts.vanilla-VyK_Ftq8.css +0 -7
- package/dist/assets/src/side-nav-item/SideNavItem.css.ts.vanilla-BPtTByKU.css +0 -6
- package/dist/assets/src/skeleton/Skeleton.css.ts.vanilla-B2F2J-1K.css +0 -6
- package/dist/assets/src/switch/Switch.css.ts.vanilla-CcWtFhhC.css +0 -26
- package/dist/assets/src/table-body/TableBody.css.ts.vanilla-DvElLAAk.css +0 -6
- package/dist/assets/src/table-header-cell/TableHeaderCell.css.ts.vanilla-BwRY6BfC.css +0 -6
- package/dist/assets/src/table-row/TableRow.css.ts.vanilla-DkygPBaI.css +0 -4
- package/dist/assets/src/tabs/Tabs.css.ts.vanilla-eDWe_QTH.css +0 -9
- package/dist/assets/src/tabs-list/TabsList.css.ts.vanilla-7xdw9CeT.css +0 -23
- package/dist/assets/src/textarea-autosize/TextareaAutosize.css.ts.vanilla-B8N-ZjBS.css +0 -34
- package/dist/assets/src/toast/Toast.css.ts.vanilla-CHiwYBgv.css +0 -92
- package/dist/assets/src/toggle-input/ToggleInput.css.ts.vanilla-CYG8X4be.css +0 -22
- package/dist/assets/src/toggle-input-control/ToggleInputControl.css.ts.vanilla-BuJ2mQgD.css +0 -10
- package/dist/src/combobox-item-context/ComboboxItemContext.js +0 -5
- package/dist/src/side-nav-context/SideNavContext.js +0 -5
- package/dist/src/side-nav-item/SideNavItem-css.js +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/badge/Badge.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/badge/Badge.css.ts.vanilla-v_WxKtkk.css';
|
|
3
3
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
4
|
|
|
5
|
-
var badge = recipeRuntime({base:[{display:'inline-flex',fontSize:'sm',fontWeight:'500',justifyContent:'center',px:'xs',py:'2',rounded:'full'},'
|
|
5
|
+
var badge = recipeRuntime({base:[{display:'inline-flex',fontSize:'sm',fontWeight:'500',justifyContent:'center',px:'xs',py:'2',rounded:'full'},'_1nc2zx3'],variants:{colorScheme:{danger:'slgk6x',information:'j5os2w',neutral:'_8p5rhv',primary:'i64itj',success:'_1lomvqb',warning:'_1m4x20b'},variant:{light:'_4g7if8',solid:'_1ny8n3m'}}});
|
|
6
6
|
|
|
7
7
|
export { badge };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
2
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
3
3
|
|
|
4
4
|
var banner = recipeRuntime({base:[{alignItems:'start',color:'fg.default',flexDirection:'row',fontSize:'md',fontWeight:'500',gap:'sm',justifyContent:'space-between',px:'lg',py:'sm'}],variants:{colorScheme:{danger:{bg:'bg.error.light'},information:{bg:'bg.information.light'},neutral:{bg:'bg.tertiary'},success:{bg:'bg.success.light'},warning:{bg:'bg.warning.light'}}}});
|
package/dist/src/box/Box-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/box/Box.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/box/Box.css.ts.vanilla-DlV97In6.css';
|
|
3
3
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
4
|
|
|
5
|
-
var box = recipeRuntime({base:'
|
|
5
|
+
var box = recipeRuntime({base:'_22gb6j'});
|
|
6
6
|
|
|
7
7
|
export { box };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/table-row/TableRow.css.ts.vanilla-
|
|
3
|
-
import './../../assets/src/button-base/ButtonBase.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/table-row/TableRow.css.ts.vanilla-g1JsQVd4.css';
|
|
3
|
+
import './../../assets/src/button-base/ButtonBase.css.ts.vanilla-Cdep1j3a.css';
|
|
4
4
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
5
5
|
|
|
6
|
-
var buttonBase = recipeRuntime({base:['
|
|
7
|
-
var spinner = recipeRuntime({base:'
|
|
6
|
+
var buttonBase = recipeRuntime({base:['lmxxxn',{alignItems:'center',display:'inline-flex',flexDirection:'row',justifyContent:'center',transition:'colors'},'_1im33aw'],variants:{colorScheme:{danger:'if8skd',neutral:'c4fjjx',primary:'_12vdocu'},iconOnly:{false:'xg4fm5',true:{}},size:{sm:{fontSize:'sm',h:'sm'},md:{fontSize:'md',gap:'2',h:'md'},lg:{fontSize:'md',gap:'4',h:'lg'}},variant:{outline:'_1p96fk1',solid:'pm6twy',subtle:'_1iwd84e'}},variantsCompounded:[{style:{w:'sm'},variants:{iconOnly:true,size:'sm'}},{style:'hnlowv',variants:{iconOnly:false,size:'sm'}},{style:{w:'md'},variants:{iconOnly:true,size:'md'}},{style:'_1syvzmn',variants:{iconOnly:false,size:'md'}},{style:{w:'lg'},variants:{iconOnly:true,size:'lg'}},{style:'_1a8wi93',variants:{iconOnly:false,size:'lg'}}]});
|
|
7
|
+
var spinner = recipeRuntime({base:'_1sgmzw9'});
|
|
8
8
|
|
|
9
9
|
export { buttonBase, spinner };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/table-row/TableRow.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/table-row/TableRow.css.ts.vanilla-g1JsQVd4.css';
|
|
3
3
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
4
|
|
|
5
|
-
var buttonGroup = recipeRuntime({base:'
|
|
5
|
+
var buttonGroup = recipeRuntime({base:'awlold'});
|
|
6
6
|
|
|
7
7
|
export { buttonGroup };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/table-row/TableRow.css.ts.vanilla-
|
|
3
|
-
import './../../assets/src/button-base/ButtonBase.css.ts.vanilla-
|
|
4
|
-
import './../../assets/src/button-loadable/ButtonLoadable.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/table-row/TableRow.css.ts.vanilla-g1JsQVd4.css';
|
|
3
|
+
import './../../assets/src/button-base/ButtonBase.css.ts.vanilla-Cdep1j3a.css';
|
|
4
|
+
import './../../assets/src/button-loadable/ButtonLoadable.css.ts.vanilla-B3UxIRoe.css';
|
|
5
5
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
6
6
|
|
|
7
|
-
var loadable = recipeRuntime({base:[{transition:'opacity'},'
|
|
7
|
+
var loadable = recipeRuntime({base:[{transition:'opacity'},'_1343gin']});
|
|
8
8
|
|
|
9
9
|
export { loadable };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/table-row/TableRow.css.ts.vanilla-
|
|
3
|
-
import './../../assets/src/toggle-input/ToggleInput.css.ts.vanilla-
|
|
4
|
-
import './../../assets/src/checkbox/Checkbox.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/table-row/TableRow.css.ts.vanilla-g1JsQVd4.css';
|
|
3
|
+
import './../../assets/src/toggle-input/ToggleInput.css.ts.vanilla-B-y4RHi9.css';
|
|
4
|
+
import './../../assets/src/checkbox/Checkbox.css.ts.vanilla-B4c8nGzf.css';
|
|
5
5
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
6
6
|
|
|
7
|
-
var checkbox = recipeRuntime({base:'
|
|
8
|
-
var control = recipeRuntime({base:[{color:'fg.default.inverse',mt:'2',rounded:'xs',size:'16'},'
|
|
9
|
-
var icon = recipeRuntime({base:['
|
|
7
|
+
var checkbox = recipeRuntime({base:'_855f5a'});
|
|
8
|
+
var control = recipeRuntime({base:[{color:'fg.default.inverse',mt:'2',rounded:'xs',size:'16'},'_1683711']});
|
|
9
|
+
var icon = recipeRuntime({base:['kv7kfb']});
|
|
10
10
|
var indicator = recipeRuntime({base:[{alignItems:'center',display:'flex',justifyContent:'center',p:'2',size:'full'}]});
|
|
11
|
-
var input = recipeRuntime({base:'
|
|
11
|
+
var input = recipeRuntime({base:'_1jecikf'});
|
|
12
12
|
|
|
13
13
|
export { checkbox, control, icon, indicator, input };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './../../assets/src/layers/layers.css.ts.vanilla-
|
|
2
|
-
import './../../assets/src/code/Code.css.ts.vanilla-
|
|
1
|
+
import './../../assets/src/layers/layers.css.ts.vanilla-B76KCQ9u.css';
|
|
2
|
+
import './../../assets/src/code/Code.css.ts.vanilla-BE7HUNcL.css';
|
|
3
3
|
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
4
|
|
|
5
|
-
var code = recipeRuntime({base:[{bg:'bg.secondary',display:'inline-block',px:'4',rounded:'sm'},'
|
|
5
|
+
var code = recipeRuntime({base:[{bg:'bg.secondary',display:'inline-block',px:'4',rounded:'sm'},'co0rt5']});
|
|
6
6
|
|
|
7
7
|
export { code };
|
|
@@ -1,84 +1,32 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
3
|
-
import { useCombobox } from 'downshift';
|
|
4
|
-
import { useEffect } from 'react';
|
|
5
3
|
import { ComboboxContextProvider } from '../combobox-context/ComboboxContext.js';
|
|
6
4
|
import { Popover } from '../popover/Popover.js';
|
|
7
5
|
|
|
8
6
|
function Combobox({
|
|
9
7
|
children,
|
|
10
8
|
defaultOpen = false,
|
|
11
|
-
|
|
12
|
-
items,
|
|
9
|
+
isItemDisabled = () => false,
|
|
13
10
|
itemToKey = (value) => value,
|
|
14
11
|
itemToString = (value) => value ? String(value) : "",
|
|
15
|
-
mode: modeProp,
|
|
16
|
-
onInputValueChange,
|
|
17
12
|
onOpenChange,
|
|
18
|
-
onValueChange,
|
|
19
13
|
open: openProp,
|
|
20
|
-
value: valueProp,
|
|
21
14
|
...props
|
|
22
15
|
}) {
|
|
23
|
-
const mode = modeProp ?? "single";
|
|
24
16
|
const [open, setOpen] = useControllableState({
|
|
25
17
|
defaultProp: defaultOpen,
|
|
26
18
|
onChange: onOpenChange,
|
|
27
19
|
prop: openProp
|
|
28
20
|
});
|
|
29
|
-
const [value, setValue] = useControllableState({
|
|
30
|
-
defaultProp: defaultValue ?? (mode === "multiple" ? [] : void 0),
|
|
31
|
-
onChange: onValueChange,
|
|
32
|
-
prop: valueProp
|
|
33
|
-
});
|
|
34
|
-
const [inputValue, setInputValue] = useControllableState({
|
|
35
|
-
defaultProp: "",
|
|
36
|
-
onChange: onInputValueChange
|
|
37
|
-
});
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!open) {
|
|
40
|
-
setInputValue("");
|
|
41
|
-
}
|
|
42
|
-
}, [open, setInputValue]);
|
|
43
|
-
const downshift = useCombobox({
|
|
44
|
-
...props,
|
|
45
|
-
inputValue,
|
|
46
|
-
isOpen: open,
|
|
47
|
-
items,
|
|
48
|
-
itemToKey,
|
|
49
|
-
itemToString,
|
|
50
|
-
onSelectedItemChange({ selectedItem, type }) {
|
|
51
|
-
if (type !== useCombobox.stateChangeTypes.InputBlur) {
|
|
52
|
-
if (mode === "single" || !Array.isArray(value)) {
|
|
53
|
-
setValue(selectedItem);
|
|
54
|
-
} else {
|
|
55
|
-
setValue(
|
|
56
|
-
value.includes(selectedItem) ? value.filter((v) => v !== selectedItem) : [...value, selectedItem]
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (mode === "single" || type === useCombobox.stateChangeTypes.InputKeyDownEnter) {
|
|
61
|
-
setOpen(false);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
selectedItem: mode === "multiple" ? null : value ?? null
|
|
65
|
-
});
|
|
66
|
-
downshift.getInputProps({}, { suppressRefError: true });
|
|
67
|
-
downshift.getMenuProps({}, { suppressRefError: true });
|
|
68
21
|
return /* @__PURE__ */ jsx(Popover, { onOpenChange: setOpen, open, children: /* @__PURE__ */ jsx(
|
|
69
22
|
ComboboxContextProvider,
|
|
70
23
|
{
|
|
71
|
-
|
|
72
|
-
highlightedItem: items[downshift.highlightedIndex],
|
|
73
|
-
items,
|
|
24
|
+
isItemDisabled,
|
|
74
25
|
itemToKey,
|
|
75
26
|
itemToString,
|
|
76
|
-
mode,
|
|
77
27
|
open,
|
|
78
|
-
setInputValue,
|
|
79
28
|
setOpen,
|
|
80
|
-
|
|
81
|
-
value,
|
|
29
|
+
...props,
|
|
82
30
|
children
|
|
83
31
|
}
|
|
84
32
|
) });
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
4
|
+
import { Command } from '../command/Command.js';
|
|
3
5
|
import '../field-context/FieldContext.js';
|
|
4
6
|
import { useFieldContext } from '../field-context/useFieldContext.js';
|
|
5
7
|
import { PopoverContent } from '../popover-content/PopoverContent.js';
|
|
@@ -7,6 +9,14 @@ import { PopoverContent } from '../popover-content/PopoverContent.js';
|
|
|
7
9
|
const ComboboxContent = forwardRef(
|
|
8
10
|
({ children, ...props }, ref) => {
|
|
9
11
|
const { labelId } = useFieldContext();
|
|
12
|
+
const {
|
|
13
|
+
isItemDisabled,
|
|
14
|
+
items,
|
|
15
|
+
itemToKey,
|
|
16
|
+
itemToString,
|
|
17
|
+
onInputValueChange,
|
|
18
|
+
onSelect
|
|
19
|
+
} = useComboboxContext("ComboboxContent");
|
|
10
20
|
return /* @__PURE__ */ jsx(
|
|
11
21
|
PopoverContent,
|
|
12
22
|
{
|
|
@@ -15,7 +25,18 @@ const ComboboxContent = forwardRef(
|
|
|
15
25
|
p: "4",
|
|
16
26
|
ref,
|
|
17
27
|
...props,
|
|
18
|
-
children
|
|
28
|
+
children: /* @__PURE__ */ jsx(
|
|
29
|
+
Command,
|
|
30
|
+
{
|
|
31
|
+
isItemDisabled,
|
|
32
|
+
items,
|
|
33
|
+
itemToKey,
|
|
34
|
+
itemToString,
|
|
35
|
+
onInputValueChange,
|
|
36
|
+
onSelect,
|
|
37
|
+
children
|
|
38
|
+
}
|
|
39
|
+
)
|
|
19
40
|
}
|
|
20
41
|
);
|
|
21
42
|
}
|
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Box } from '../box/Box.js';
|
|
4
|
-
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
1
|
+
import { CommandEmpty } from '../command-empty/CommandEmpty.js';
|
|
5
2
|
|
|
6
|
-
const ComboboxEmpty =
|
|
7
|
-
({ children, ...props }, ref) => {
|
|
8
|
-
const { items } = useComboboxContext("ComboboxEmpty");
|
|
9
|
-
if (items.length > 0) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
Box,
|
|
14
|
-
{
|
|
15
|
-
alignItems: "center",
|
|
16
|
-
color: "fg.disabled",
|
|
17
|
-
display: "flex",
|
|
18
|
-
fontSize: "md",
|
|
19
|
-
justifyContent: "center",
|
|
20
|
-
p: "md",
|
|
21
|
-
ref,
|
|
22
|
-
...props,
|
|
23
|
-
children: children || "No options"
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
);
|
|
3
|
+
const ComboboxEmpty = CommandEmpty;
|
|
28
4
|
ComboboxEmpty.displayName = "@optiaxiom/react/ComboboxEmpty";
|
|
29
5
|
|
|
30
6
|
export { ComboboxEmpty };
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Flex } from '../flex/Flex.js';
|
|
4
|
-
import { footer } from './ComboboxFooter-css.js';
|
|
1
|
+
import { CommandFooter } from '../command-footer/CommandFooter.js';
|
|
5
2
|
|
|
6
|
-
const ComboboxFooter =
|
|
7
|
-
({ children, className, ...props }, ref) => {
|
|
8
|
-
return /* @__PURE__ */ jsx(Flex, { asChild: true, ref, ...footer({}, className), ...props, children: /* @__PURE__ */ jsx("li", { children }) });
|
|
9
|
-
}
|
|
10
|
-
);
|
|
3
|
+
const ComboboxFooter = CommandFooter;
|
|
11
4
|
ComboboxFooter.displayName = "@optiaxiom/react/ComboboxFooter";
|
|
12
5
|
|
|
13
6
|
export { ComboboxFooter };
|
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
4
|
-
import { Input } from '../input/Input.js';
|
|
5
|
-
import { extractSprinkles } from '../sprinkles/extractSprinkles.js';
|
|
6
|
-
import '../sprinkles/sprinkles.js';
|
|
7
|
-
import '../sprinkles/sprinklesMerge.js';
|
|
1
|
+
import { CommandInput } from '../command-input/CommandInput.js';
|
|
8
2
|
|
|
9
|
-
const ComboboxInput =
|
|
10
|
-
(props, ref) => {
|
|
11
|
-
const { restProps, sprinkleProps } = extractSprinkles(props);
|
|
12
|
-
const { downshift, highlightedItem, setInputValue } = useComboboxContext("ComboboxInput");
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
Input,
|
|
15
|
-
{
|
|
16
|
-
m: "4",
|
|
17
|
-
...sprinkleProps,
|
|
18
|
-
...downshift.getInputProps({
|
|
19
|
-
...restProps,
|
|
20
|
-
onChange: (event) => {
|
|
21
|
-
setInputValue("value" in event.target ? event.target.value : "");
|
|
22
|
-
},
|
|
23
|
-
onKeyDown: (event) => {
|
|
24
|
-
if (event.key === " " && highlightedItem) {
|
|
25
|
-
event.preventDefault();
|
|
26
|
-
downshift.selectItem(highlightedItem);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
ref
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
);
|
|
3
|
+
const ComboboxInput = CommandInput;
|
|
35
4
|
ComboboxInput.displayName = "@optiaxiom/react/ComboboxInput";
|
|
36
5
|
|
|
37
6
|
export { ComboboxInput };
|
|
@@ -1,49 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Checkbox } from '../checkbox/Checkbox.js';
|
|
4
|
-
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
5
|
-
import { ComboboxItemContextProvider } from '../combobox-item-context/ComboboxItemContext.js';
|
|
6
|
-
import { ListboxItemBase } from '../listbox-item-base/ListboxItemBase.js';
|
|
7
|
-
import { extractSprinkles } from '../sprinkles/extractSprinkles.js';
|
|
8
|
-
import '../sprinkles/sprinkles.js';
|
|
9
|
-
import '../sprinkles/sprinklesMerge.js';
|
|
1
|
+
import { CommandItem } from '../command-item/CommandItem.js';
|
|
10
2
|
|
|
11
|
-
const ComboboxItem =
|
|
12
|
-
({ addonAfter, addonBefore, children, description, icon, item, ...props }, ref) => {
|
|
13
|
-
const { restProps, sprinkleProps } = extractSprinkles(props);
|
|
14
|
-
const { downshift, highlightedItem, mode, value } = useComboboxContext("ComboboxItem");
|
|
15
|
-
const itemProps = downshift.getItemProps({ item });
|
|
16
|
-
return /* @__PURE__ */ jsx(ComboboxItemContextProvider, { active: value === item, item, children: /* @__PURE__ */ jsx(
|
|
17
|
-
ListboxItemBase,
|
|
18
|
-
{
|
|
19
|
-
addonAfter,
|
|
20
|
-
addonBefore: addonBefore ?? (mode === "multiple" && /* @__PURE__ */ jsx(
|
|
21
|
-
Checkbox,
|
|
22
|
-
{
|
|
23
|
-
checked: Array.isArray(value) ? value.includes(item) : value === item,
|
|
24
|
-
disabled: itemProps["aria-disabled"],
|
|
25
|
-
tabIndex: -1
|
|
26
|
-
}
|
|
27
|
-
)),
|
|
28
|
-
description,
|
|
29
|
-
icon,
|
|
30
|
-
...sprinkleProps,
|
|
31
|
-
children: /* @__PURE__ */ jsx(
|
|
32
|
-
"li",
|
|
33
|
-
{
|
|
34
|
-
"data-disabled": itemProps["aria-disabled"] ? "" : void 0,
|
|
35
|
-
"data-highlighted": highlightedItem === item ? "" : void 0,
|
|
36
|
-
"data-selected": downshift.selectedItem === item ? "" : void 0,
|
|
37
|
-
ref,
|
|
38
|
-
...restProps,
|
|
39
|
-
...itemProps,
|
|
40
|
-
children
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
) });
|
|
45
|
-
}
|
|
46
|
-
);
|
|
3
|
+
const ComboboxItem = CommandItem;
|
|
47
4
|
ComboboxItem.displayName = "@optiaxiom/react/ComboboxItem";
|
|
48
5
|
|
|
49
6
|
export { ComboboxItem };
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Box } from '../box/Box.js';
|
|
4
|
-
import { useComboboxItemContext } from '../combobox-item-context/ComboboxItemContext.js';
|
|
5
|
-
import { IconCheck } from '../icons/IconCheck.js';
|
|
6
|
-
import { extractSprinkles } from '../sprinkles/extractSprinkles.js';
|
|
7
|
-
import '../sprinkles/sprinkles.js';
|
|
8
|
-
import '../sprinkles/sprinklesMerge.js';
|
|
1
|
+
import { CommandItemIndicator } from '../command-item-indicator/CommandItemIndicator.js';
|
|
9
2
|
|
|
10
|
-
const ComboboxItemIndicator =
|
|
11
|
-
const { restProps, sprinkleProps } = extractSprinkles(props);
|
|
12
|
-
const { active } = useComboboxItemContext("ComboboxItemIndicator");
|
|
13
|
-
if (!active) {
|
|
14
|
-
return /* @__PURE__ */ jsx(Box, { w: "12" });
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsx(Box, { asChild: true, ...sprinkleProps, children: children ?? /* @__PURE__ */ jsx(IconCheck, { ref, ...restProps }) });
|
|
17
|
-
});
|
|
3
|
+
const ComboboxItemIndicator = CommandItemIndicator;
|
|
18
4
|
ComboboxItemIndicator.displayName = "@optiaxiom/react/ComboboxItemIndicator";
|
|
19
5
|
|
|
20
6
|
export { ComboboxItemIndicator };
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Box } from '../box/Box.js';
|
|
4
|
-
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
5
|
-
import { extractSprinkles } from '../sprinkles/extractSprinkles.js';
|
|
6
|
-
import '../sprinkles/sprinkles.js';
|
|
7
|
-
import '../sprinkles/sprinklesMerge.js';
|
|
1
|
+
import { CommandList } from '../command-list/CommandList.js';
|
|
8
2
|
|
|
9
|
-
const ComboboxList =
|
|
10
|
-
({ children, ...props }, ref) => {
|
|
11
|
-
const { restProps, sprinkleProps } = extractSprinkles(props);
|
|
12
|
-
const { downshift, items } = useComboboxContext("ComboboxList");
|
|
13
|
-
if (!items.length) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
Box,
|
|
18
|
-
{
|
|
19
|
-
asChild: true,
|
|
20
|
-
display: "flex",
|
|
21
|
-
flex: "1",
|
|
22
|
-
flexDirection: "column",
|
|
23
|
-
gap: "2",
|
|
24
|
-
overflow: "auto",
|
|
25
|
-
...sprinkleProps,
|
|
26
|
-
children: /* @__PURE__ */ jsx("ul", { ...downshift.getMenuProps({ ref, ...restProps }), children })
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
);
|
|
3
|
+
const ComboboxList = CommandList;
|
|
31
4
|
ComboboxList.displayName = "@optiaxiom/react/ComboboxList";
|
|
32
5
|
|
|
33
6
|
export { ComboboxList };
|
|
@@ -5,10 +5,13 @@ import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
|
5
5
|
import { Flex } from '../flex/Flex.js';
|
|
6
6
|
|
|
7
7
|
const maxDisplayedItems = 2;
|
|
8
|
-
const ComboboxMultipleValue = forwardRef(({ children, placeholder, ...props }, ref) => {
|
|
9
|
-
const { itemToKey, itemToString
|
|
8
|
+
const ComboboxMultipleValue = forwardRef(({ children, placeholder, value, ...props }, ref) => {
|
|
9
|
+
const { itemToKey, itemToString } = useComboboxContext(
|
|
10
10
|
"ComboboxMultipleValue"
|
|
11
11
|
);
|
|
12
|
+
if (value instanceof Set) {
|
|
13
|
+
value = [...value];
|
|
14
|
+
}
|
|
12
15
|
return /* @__PURE__ */ jsx(Flex, { flexDirection: "row", flexWrap: "wrap", gap: "2", ref, ...props, children: Array.isArray(value) && value.length > 0 ? children ?? /* @__PURE__ */ jsx(Fragment, { children: value.length > maxDisplayedItems ? /* @__PURE__ */ jsxs(Badge, { children: [
|
|
13
16
|
value.length,
|
|
14
17
|
" selected"
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Box } from '../box/Box.js';
|
|
4
|
-
import { Separator } from '../separator/Separator.js';
|
|
1
|
+
import { CommandSeparator } from '../command-separator/CommandSeparator.js';
|
|
5
2
|
|
|
6
|
-
const ComboboxSeparator =
|
|
3
|
+
const ComboboxSeparator = CommandSeparator;
|
|
7
4
|
ComboboxSeparator.displayName = "@optiaxiom/react/ComboboxSeparator";
|
|
8
5
|
|
|
9
6
|
export { ComboboxSeparator };
|
|
@@ -3,8 +3,8 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { Box } from '../box/Box.js';
|
|
4
4
|
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
5
5
|
|
|
6
|
-
const ComboboxSingleValue = forwardRef(({ children, placeholder, ...props }, ref) => {
|
|
7
|
-
const { itemToString
|
|
6
|
+
const ComboboxSingleValue = forwardRef(({ children, placeholder, value, ...props }, ref) => {
|
|
7
|
+
const { itemToString } = useComboboxContext("ComboboxSingleValue");
|
|
8
8
|
return /* @__PURE__ */ jsx(Box, { ref, ...props, children: value ? children ?? itemToString(value) : placeholder });
|
|
9
9
|
});
|
|
10
10
|
ComboboxSingleValue.displayName = "@optiaxiom/react/ComboboxSingleValue";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { useComboboxContext } from '../combobox-context/ComboboxContext.js';
|
|
4
3
|
import { ComboboxMultipleValue } from '../combobox-multiple-value/ComboboxMultipleValue.js';
|
|
5
4
|
import { ComboboxSingleValue } from '../combobox-single-value/ComboboxSingleValue.js';
|
|
6
5
|
|
|
7
6
|
const ComboboxValue = forwardRef(
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
const Comp = mode === "single" ? ComboboxSingleValue : ComboboxMultipleValue;
|
|
11
|
-
return /* @__PURE__ */ jsx(Comp, { placeholder, ref, ...props });
|
|
7
|
+
(props, ref) => {
|
|
8
|
+
return props.type === "multiple" ? /* @__PURE__ */ jsx(ComboboxMultipleValue, { ref, ...props }) : /* @__PURE__ */ jsx(ComboboxSingleValue, { ref, ...props });
|
|
12
9
|
}
|
|
13
10
|
);
|
|
14
11
|
ComboboxValue.displayName = "@optiaxiom/react/ComboboxValue";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
3
|
+
import { useCombobox } from 'downshift';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { CommandContextProvider } from '../command-context/CommandContext.js';
|
|
6
|
+
|
|
7
|
+
function Command({
|
|
8
|
+
children,
|
|
9
|
+
isItemDisabled = () => false,
|
|
10
|
+
items,
|
|
11
|
+
itemToKey = (value) => value,
|
|
12
|
+
itemToString = (value) => value ? String(value) : "",
|
|
13
|
+
onInputValueChange,
|
|
14
|
+
onOpenChange,
|
|
15
|
+
onSelect
|
|
16
|
+
}) {
|
|
17
|
+
const [inputValue, setInputValue] = useControllableState({
|
|
18
|
+
defaultProp: "",
|
|
19
|
+
onChange: onInputValueChange
|
|
20
|
+
});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
return () => {
|
|
23
|
+
setInputValue("");
|
|
24
|
+
};
|
|
25
|
+
}, [setInputValue]);
|
|
26
|
+
const downshift = useCombobox({
|
|
27
|
+
inputValue,
|
|
28
|
+
isItemDisabled,
|
|
29
|
+
isOpen: true,
|
|
30
|
+
items,
|
|
31
|
+
itemToKey,
|
|
32
|
+
itemToString,
|
|
33
|
+
onSelectedItemChange({ selectedItem, type }) {
|
|
34
|
+
if (type !== useCombobox.stateChangeTypes.InputBlur) {
|
|
35
|
+
onSelect?.(selectedItem);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
selectedItem: null,
|
|
39
|
+
stateReducer(state, actionAndChanges) {
|
|
40
|
+
const { changes, type } = actionAndChanges;
|
|
41
|
+
switch (type) {
|
|
42
|
+
case useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
43
|
+
case useCombobox.stateChangeTypes.ItemClick:
|
|
44
|
+
return {
|
|
45
|
+
...changes,
|
|
46
|
+
/**
|
|
47
|
+
* Keep the selected option highlighted rather than resetting to -1
|
|
48
|
+
*/
|
|
49
|
+
highlightedIndex: state.highlightedIndex
|
|
50
|
+
};
|
|
51
|
+
default:
|
|
52
|
+
return changes;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
CommandContextProvider,
|
|
58
|
+
{
|
|
59
|
+
downshift,
|
|
60
|
+
highlightedItem: items[downshift.highlightedIndex],
|
|
61
|
+
isItemDisabled,
|
|
62
|
+
items,
|
|
63
|
+
itemToKey,
|
|
64
|
+
itemToString,
|
|
65
|
+
setInputValue,
|
|
66
|
+
setOpen: onOpenChange,
|
|
67
|
+
setValue: onSelect,
|
|
68
|
+
children
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
Command.displayName = "@optiaxiom/react/Command";
|
|
73
|
+
|
|
74
|
+
export { Command };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Checkbox } from '../checkbox/Checkbox.js';
|
|
4
|
+
import { useCommandContext } from '../command-context/CommandContext.js';
|
|
5
|
+
import { CommandItem } from '../command-item/CommandItem.js';
|
|
6
|
+
import { Flex } from '../flex/Flex.js';
|
|
7
|
+
|
|
8
|
+
const CommandCheckboxItem = forwardRef(({ addonBefore, ...props }, ref) => {
|
|
9
|
+
const { isItemDisabled, items } = useCommandContext("CommandCheckboxItem");
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
CommandItem,
|
|
12
|
+
{
|
|
13
|
+
addonBefore: /* @__PURE__ */ jsxs(Flex, { flexDirection: "row", gap: "xs", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
Checkbox,
|
|
16
|
+
{
|
|
17
|
+
checked: props.active,
|
|
18
|
+
disabled: isItemDisabled(props.item, items.indexOf(props.item)),
|
|
19
|
+
tabIndex: -1
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
addonBefore
|
|
23
|
+
] }),
|
|
24
|
+
ref,
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
CommandCheckboxItem.displayName = "@optiaxiom/react/CommandCheckboxItem";
|
|
30
|
+
|
|
31
|
+
export { CommandCheckboxItem };
|