@raystack/apsara 0.56.5 → 1.0.0-rc.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/README.md +3 -3
- package/dist/components/accordion/accordion-content.cjs +3 -3
- package/dist/components/accordion/accordion-content.cjs.map +1 -1
- package/dist/components/accordion/accordion-content.d.ts +1 -7
- package/dist/components/accordion/accordion-content.d.ts.map +1 -1
- package/dist/components/accordion/accordion-content.js +3 -3
- package/dist/components/accordion/accordion-content.js.map +1 -1
- package/dist/components/accordion/accordion-item.cjs +3 -3
- package/dist/components/accordion/accordion-item.cjs.map +1 -1
- package/dist/components/accordion/accordion-item.d.ts +1 -7
- package/dist/components/accordion/accordion-item.d.ts.map +1 -1
- package/dist/components/accordion/accordion-item.js +2 -2
- package/dist/components/accordion/accordion-item.js.map +1 -1
- package/dist/components/accordion/accordion-root.cjs +24 -13
- package/dist/components/accordion/accordion-root.cjs.map +1 -1
- package/dist/components/accordion/accordion-root.d.ts +12 -6
- package/dist/components/accordion/accordion-root.d.ts.map +1 -1
- package/dist/components/accordion/accordion-root.js +24 -13
- package/dist/components/accordion/accordion-root.js.map +1 -1
- package/dist/components/accordion/accordion-trigger.cjs +3 -3
- package/dist/components/accordion/accordion-trigger.cjs.map +1 -1
- package/dist/components/accordion/accordion-trigger.d.ts +1 -7
- package/dist/components/accordion/accordion-trigger.d.ts.map +1 -1
- package/dist/components/accordion/accordion-trigger.js +2 -2
- package/dist/components/accordion/accordion-trigger.js.map +1 -1
- package/dist/components/accordion/accordion.d.ts +14 -4
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.module.css.cjs +1 -1
- package/dist/components/accordion/accordion.module.css.js +1 -1
- package/dist/components/avatar/avatar.cjs +4 -5
- package/dist/components/avatar/avatar.cjs.map +1 -1
- package/dist/components/avatar/avatar.d.ts +4 -5
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +4 -5
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.cjs +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.cjs.map +1 -1
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +3 -3
- package/dist/components/breadcrumb/breadcrumb-item.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb-item.js +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.js.map +1 -1
- package/dist/components/button/button.cjs +3 -4
- package/dist/components/button/button.cjs.map +1 -1
- package/dist/components/button/button.d.ts +12 -11
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +3 -4
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/calendar/calendar.cjs +1 -2
- package/dist/components/calendar/calendar.cjs.map +1 -1
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +2 -3
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/checkbox/__tests__/checkbox-group.test.d.ts +2 -0
- package/dist/components/checkbox/__tests__/checkbox-group.test.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.cjs +10 -21
- package/dist/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +3 -13
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +11 -22
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/checkbox.module.css.cjs +1 -1
- package/dist/components/checkbox/checkbox.module.css.js +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/chip/chip.d.ts +1 -1
- package/dist/components/code-block/code-block-misc.d.ts +15 -15
- package/dist/components/code-block/code-block-misc.d.ts.map +1 -1
- package/dist/components/code-block/code-block.d.ts +100 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/collapsible/__tests__/collapsible.test.d.ts +2 -0
- package/dist/components/collapsible/__tests__/collapsible.test.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.cjs +22 -0
- package/dist/components/collapsible/collapsible.cjs.map +1 -0
- package/dist/components/collapsible/collapsible.d.ts +5 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.js +20 -0
- package/dist/components/collapsible/collapsible.js.map +1 -0
- package/dist/components/collapsible/collapsible.module.css.cjs +8 -0
- package/dist/components/collapsible/collapsible.module.css.cjs.map +1 -0
- package/dist/components/collapsible/collapsible.module.css.js +4 -0
- package/dist/components/collapsible/collapsible.module.css.js.map +1 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker-alpha.cjs +3 -3
- package/dist/components/color-picker/color-picker-alpha.cjs.map +1 -1
- package/dist/components/color-picker/color-picker-alpha.d.ts +2 -3
- package/dist/components/color-picker/color-picker-alpha.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker-alpha.js +4 -4
- package/dist/components/color-picker/color-picker-alpha.js.map +1 -1
- package/dist/components/color-picker/color-picker-hue.cjs +3 -3
- package/dist/components/color-picker/color-picker-hue.cjs.map +1 -1
- package/dist/components/color-picker/color-picker-hue.d.ts +2 -3
- package/dist/components/color-picker/color-picker-hue.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker-hue.js +4 -4
- package/dist/components/color-picker/color-picker-hue.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +8 -0
- package/dist/components/color-picker/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.module.css.cjs +1 -1
- package/dist/components/color-picker/color-picker.module.css.js +1 -1
- package/dist/components/combobox/combobox-content.cjs +5 -26
- package/dist/components/combobox/combobox-content.cjs.map +1 -1
- package/dist/components/combobox/combobox-content.d.ts +3 -4
- package/dist/components/combobox/combobox-content.d.ts.map +1 -1
- package/dist/components/combobox/combobox-content.js +6 -27
- package/dist/components/combobox/combobox-content.js.map +1 -1
- package/dist/components/combobox/combobox-input.cjs +10 -33
- package/dist/components/combobox/combobox-input.cjs.map +1 -1
- package/dist/components/combobox/combobox-input.d.ts.map +1 -1
- package/dist/components/combobox/combobox-input.js +11 -34
- package/dist/components/combobox/combobox-input.js.map +1 -1
- package/dist/components/combobox/combobox-item.cjs +15 -15
- package/dist/components/combobox/combobox-item.cjs.map +1 -1
- package/dist/components/combobox/combobox-item.d.ts +5 -5
- package/dist/components/combobox/combobox-item.d.ts.map +1 -1
- package/dist/components/combobox/combobox-item.js +15 -15
- package/dist/components/combobox/combobox-item.js.map +1 -1
- package/dist/components/combobox/combobox-misc.cjs +13 -13
- package/dist/components/combobox/combobox-misc.cjs.map +1 -1
- package/dist/components/combobox/combobox-misc.d.ts +3 -9
- package/dist/components/combobox/combobox-misc.d.ts.map +1 -1
- package/dist/components/combobox/combobox-misc.js +13 -13
- package/dist/components/combobox/combobox-misc.js.map +1 -1
- package/dist/components/combobox/combobox-root.cjs +23 -42
- package/dist/components/combobox/combobox-root.cjs.map +1 -1
- package/dist/components/combobox/combobox-root.d.ts +19 -26
- package/dist/components/combobox/combobox-root.d.ts.map +1 -1
- package/dist/components/combobox/combobox-root.js +24 -43
- package/dist/components/combobox/combobox-root.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +6 -12
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.module.css.cjs +1 -1
- package/dist/components/combobox/combobox.module.css.js +1 -1
- package/dist/components/data-table/components/content.cjs +30 -22
- package/dist/components/data-table/components/content.cjs.map +1 -1
- package/dist/components/data-table/components/content.d.ts.map +1 -1
- package/dist/components/data-table/components/content.js +30 -22
- package/dist/components/data-table/components/content.js.map +1 -1
- package/dist/components/data-table/components/filters.cjs +3 -3
- package/dist/components/data-table/components/filters.cjs.map +1 -1
- package/dist/components/data-table/components/filters.d.ts.map +1 -1
- package/dist/components/data-table/components/filters.js +4 -4
- package/dist/components/data-table/components/filters.js.map +1 -1
- package/dist/components/data-table/components/virtualized-content.cjs +56 -9
- package/dist/components/data-table/components/virtualized-content.cjs.map +1 -1
- package/dist/components/data-table/components/virtualized-content.d.ts.map +1 -1
- package/dist/components/data-table/components/virtualized-content.js +57 -10
- package/dist/components/data-table/components/virtualized-content.js.map +1 -1
- package/dist/components/data-table/data-table.cjs +30 -21
- package/dist/components/data-table/data-table.cjs.map +1 -1
- package/dist/components/data-table/data-table.d.ts +7 -7
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/data-table.js +31 -22
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/data-table/data-table.module.css.cjs +1 -1
- package/dist/components/data-table/data-table.module.css.js +1 -1
- package/dist/components/data-table/data-table.types.cjs.map +1 -1
- package/dist/components/data-table/data-table.types.d.ts +5 -0
- package/dist/components/data-table/data-table.types.d.ts.map +1 -1
- package/dist/components/data-table/data-table.types.js.map +1 -1
- package/dist/components/data-table/utils/filter-operations.cjs +6 -6
- package/dist/components/data-table/utils/filter-operations.cjs.map +1 -1
- package/dist/components/data-table/utils/filter-operations.d.ts +1 -1
- package/dist/components/data-table/utils/filter-operations.js +6 -6
- package/dist/components/data-table/utils/filter-operations.js.map +1 -1
- package/dist/components/data-table/utils/index.cjs +12 -0
- package/dist/components/data-table/utils/index.cjs.map +1 -1
- package/dist/components/data-table/utils/index.d.ts +5 -0
- package/dist/components/data-table/utils/index.d.ts.map +1 -1
- package/dist/components/data-table/utils/index.js +12 -1
- package/dist/components/data-table/utils/index.js.map +1 -1
- package/dist/components/dialog/dialog-content.cjs +17 -0
- package/dist/components/dialog/dialog-content.cjs.map +1 -0
- package/dist/components/dialog/dialog-content.d.ts +15 -0
- package/dist/components/dialog/dialog-content.d.ts.map +1 -0
- package/dist/components/dialog/dialog-content.js +15 -0
- package/dist/components/dialog/dialog-content.js.map +1 -0
- package/dist/components/dialog/dialog-misc.cjs +37 -0
- package/dist/components/dialog/dialog-misc.cjs.map +1 -0
- package/dist/components/dialog/dialog-misc.d.ts +34 -0
- package/dist/components/dialog/dialog-misc.d.ts.map +1 -0
- package/dist/components/dialog/dialog-misc.js +30 -0
- package/dist/components/dialog/dialog-misc.js.map +1 -0
- package/dist/components/dialog/dialog.cjs +13 -44
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.d.ts +38 -44
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +6 -34
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/dialog.module.css.cjs +1 -1
- package/dist/components/dialog/dialog.module.css.js +1 -1
- package/dist/components/drawer/__tests__/drawer.test.d.ts +2 -0
- package/dist/components/drawer/__tests__/drawer.test.d.ts.map +1 -0
- package/dist/components/drawer/drawer-content.cjs +30 -0
- package/dist/components/drawer/drawer-content.cjs.map +1 -0
- package/dist/components/drawer/drawer-content.d.ts +13 -0
- package/dist/components/drawer/drawer-content.d.ts.map +1 -0
- package/dist/components/drawer/drawer-content.js +28 -0
- package/dist/components/drawer/drawer-content.js.map +1 -0
- package/dist/components/drawer/drawer-misc.cjs +26 -0
- package/dist/components/drawer/drawer-misc.cjs.map +1 -0
- package/dist/components/drawer/drawer-misc.d.ts +13 -0
- package/dist/components/drawer/drawer-misc.d.ts.map +1 -0
- package/dist/components/drawer/drawer-misc.js +20 -0
- package/dist/components/drawer/drawer-misc.js.map +1 -0
- package/dist/components/drawer/drawer-root.cjs +19 -0
- package/dist/components/drawer/drawer-root.cjs.map +1 -0
- package/dist/components/drawer/drawer-root.d.ts +12 -0
- package/dist/components/drawer/drawer-root.d.ts.map +1 -0
- package/dist/components/drawer/drawer-root.js +17 -0
- package/dist/components/drawer/drawer-root.js.map +1 -0
- package/dist/components/drawer/drawer.cjs +20 -0
- package/dist/components/drawer/drawer.cjs.map +1 -0
- package/dist/components/drawer/drawer.d.ts +21 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/drawer.js +18 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/drawer.module.css.cjs +8 -0
- package/dist/components/drawer/drawer.module.css.cjs.map +1 -0
- package/dist/components/drawer/drawer.module.css.js +4 -0
- package/dist/components/drawer/drawer.module.css.js.map +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/flex/flex.cjs +13 -4
- package/dist/components/flex/flex.cjs.map +1 -1
- package/dist/components/flex/flex.d.ts +7 -6
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/flex.js +13 -4
- package/dist/components/flex/flex.js.map +1 -1
- package/dist/components/grid/grid-item.cjs +21 -16
- package/dist/components/grid/grid-item.cjs.map +1 -1
- package/dist/components/grid/grid-item.d.ts +14 -13
- package/dist/components/grid/grid-item.d.ts.map +1 -1
- package/dist/components/grid/grid-item.js +21 -16
- package/dist/components/grid/grid-item.js.map +1 -1
- package/dist/components/grid/grid.cjs +26 -21
- package/dist/components/grid/grid.cjs.map +1 -1
- package/dist/components/grid/grid.d.ts +27 -18
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +26 -21
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/index.d.ts +8 -6
- package/dist/components/grid/index.d.ts.map +1 -1
- package/dist/components/headline/headline.d.ts +1 -1
- package/dist/components/input-field/input-field.cjs +2 -2
- package/dist/components/input-field/input-field.cjs.map +1 -1
- package/dist/components/input-field/input-field.d.ts +2 -1
- package/dist/components/input-field/input-field.d.ts.map +1 -1
- package/dist/components/input-field/input-field.js +2 -2
- package/dist/components/input-field/input-field.js.map +1 -1
- package/dist/components/menu/__tests__/menu.test.d.ts +2 -0
- package/dist/components/menu/__tests__/menu.test.d.ts.map +1 -0
- package/dist/components/menu/cell.cjs +12 -0
- package/dist/components/menu/cell.cjs.map +1 -0
- package/dist/components/{dropdown-menu → menu}/cell.d.ts +2 -2
- package/dist/components/menu/cell.d.ts.map +1 -0
- package/dist/components/menu/cell.js +10 -0
- package/dist/components/menu/cell.js.map +1 -0
- package/dist/components/{dropdown-menu → menu}/cell.module.css.cjs +1 -1
- package/dist/components/menu/cell.module.css.js +4 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/menu-content.cjs +95 -0
- package/dist/components/menu/menu-content.cjs.map +1 -0
- package/dist/components/menu/menu-content.d.ts +7 -0
- package/dist/components/menu/menu-content.d.ts.map +1 -0
- package/dist/components/menu/menu-content.js +92 -0
- package/dist/components/menu/menu-content.js.map +1 -0
- package/dist/components/menu/menu-item.cjs +30 -0
- package/dist/components/menu/menu-item.cjs.map +1 -0
- package/dist/components/menu/menu-item.d.ts +7 -0
- package/dist/components/menu/menu-item.d.ts.map +1 -0
- package/dist/components/menu/menu-item.js +28 -0
- package/dist/components/menu/menu-item.js.map +1 -0
- package/dist/components/menu/menu-misc.cjs +42 -0
- package/dist/components/menu/menu-misc.cjs.map +1 -0
- package/dist/components/menu/menu-misc.d.ts +8 -0
- package/dist/components/menu/menu-misc.d.ts.map +1 -0
- package/dist/components/menu/menu-misc.js +37 -0
- package/dist/components/menu/menu-misc.js.map +1 -0
- package/dist/components/menu/menu-root.cjs +103 -0
- package/dist/components/menu/menu-root.cjs.map +1 -0
- package/dist/components/menu/menu-root.d.ts +71 -0
- package/dist/components/menu/menu-root.d.ts.map +1 -0
- package/dist/components/menu/menu-root.js +98 -0
- package/dist/components/menu/menu-root.js.map +1 -0
- package/dist/components/menu/menu-trigger.cjs +43 -0
- package/dist/components/menu/menu-trigger.cjs.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +11 -0
- package/dist/components/menu/menu-trigger.d.ts.map +1 -0
- package/dist/components/menu/menu-trigger.js +40 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/menu.cjs +23 -0
- package/dist/components/menu/menu.cjs.map +1 -0
- package/dist/components/menu/menu.d.ts +21 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +21 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.module.css.cjs +8 -0
- package/dist/components/menu/menu.module.css.cjs.map +1 -0
- package/dist/components/menu/menu.module.css.js +4 -0
- package/dist/components/menu/menu.module.css.js.map +1 -0
- package/dist/components/menu/utils.cjs +53 -0
- package/dist/components/menu/utils.cjs.map +1 -0
- package/dist/components/menu/utils.d.ts +8 -0
- package/dist/components/menu/utils.d.ts.map +1 -0
- package/dist/components/menu/utils.js +46 -0
- package/dist/components/menu/utils.js.map +1 -0
- package/dist/components/popover/popover.cjs +8 -7
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.d.ts +6 -8
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +7 -6
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/popover/popover.module.css.cjs +1 -1
- package/dist/components/popover/popover.module.css.js +1 -1
- package/dist/components/preview-card/__tests__/preview-card.test.d.ts +2 -0
- package/dist/components/preview-card/__tests__/preview-card.test.d.ts.map +1 -0
- package/dist/components/preview-card/index.d.ts +2 -0
- package/dist/components/preview-card/index.d.ts.map +1 -0
- package/dist/components/preview-card/preview-card.cjs +24 -0
- package/dist/components/preview-card/preview-card.cjs.map +1 -0
- package/dist/components/preview-card/preview-card.d.ts +15 -0
- package/dist/components/preview-card/preview-card.d.ts.map +1 -0
- package/dist/components/preview-card/preview-card.js +22 -0
- package/dist/components/preview-card/preview-card.js.map +1 -0
- package/dist/components/preview-card/preview-card.module.css.cjs +8 -0
- package/dist/components/preview-card/preview-card.module.css.cjs.map +1 -0
- package/dist/components/preview-card/preview-card.module.css.js +4 -0
- package/dist/components/preview-card/preview-card.module.css.js.map +1 -0
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/radio.cjs +8 -11
- package/dist/components/radio/radio.cjs.map +1 -1
- package/dist/components/radio/radio.d.ts +4 -13
- package/dist/components/radio/radio.d.ts.map +1 -1
- package/dist/components/radio/radio.js +10 -12
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -1
- package/dist/components/scroll-area/index.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area-scrollbar.cjs +4 -4
- package/dist/components/scroll-area/scroll-area-scrollbar.cjs.map +1 -1
- package/dist/components/scroll-area/scroll-area-scrollbar.d.ts +5 -6
- package/dist/components/scroll-area/scroll-area-scrollbar.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area-scrollbar.js +4 -4
- package/dist/components/scroll-area/scroll-area-scrollbar.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.cjs +11 -2
- package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts +6 -1
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +11 -2
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.module.css.cjs +1 -1
- package/dist/components/scroll-area/scroll-area.module.css.js +1 -1
- package/dist/components/select/select-content.cjs +9 -18
- package/dist/components/select/select-content.cjs.map +1 -1
- package/dist/components/select/select-content.d.ts +6 -2
- package/dist/components/select/select-content.d.ts.map +1 -1
- package/dist/components/select/select-content.js +11 -20
- package/dist/components/select/select-content.js.map +1 -1
- package/dist/components/select/select-item.cjs +10 -11
- package/dist/components/select/select-item.cjs.map +1 -1
- package/dist/components/select/select-item.d.ts +9 -4
- package/dist/components/select/select-item.d.ts.map +1 -1
- package/dist/components/select/select-item.js +10 -11
- package/dist/components/select/select-item.js.map +1 -1
- package/dist/components/select/select-misc.cjs +19 -10
- package/dist/components/select/select-misc.cjs.map +1 -1
- package/dist/components/select/select-misc.d.ts +15 -4
- package/dist/components/select/select-misc.d.ts.map +1 -1
- package/dist/components/select/select-misc.js +19 -10
- package/dist/components/select/select-misc.js.map +1 -1
- package/dist/components/select/select-multiple-value.cjs +3 -7
- package/dist/components/select/select-multiple-value.cjs.map +1 -1
- package/dist/components/select/select-multiple-value.d.ts +2 -3
- package/dist/components/select/select-multiple-value.d.ts.map +1 -1
- package/dist/components/select/select-multiple-value.js +5 -9
- package/dist/components/select/select-multiple-value.js.map +1 -1
- package/dist/components/select/select-root.cjs +51 -66
- package/dist/components/select/select-root.cjs.map +1 -1
- package/dist/components/select/select-root.d.ts +11 -15
- package/dist/components/select/select-root.d.ts.map +1 -1
- package/dist/components/select/select-root.js +52 -67
- package/dist/components/select/select-root.js.map +1 -1
- package/dist/components/select/select-trigger.cjs +7 -4
- package/dist/components/select/select-trigger.cjs.map +1 -1
- package/dist/components/select/select-trigger.d.ts +2 -3
- package/dist/components/select/select-trigger.d.ts.map +1 -1
- package/dist/components/select/select-trigger.js +7 -4
- package/dist/components/select/select-trigger.js.map +1 -1
- package/dist/components/select/select-value.cjs +17 -8
- package/dist/components/select/select-value.cjs.map +1 -1
- package/dist/components/select/select-value.d.ts +6 -4
- package/dist/components/select/select-value.d.ts.map +1 -1
- package/dist/components/select/select-value.js +17 -8
- package/dist/components/select/select-value.js.map +1 -1
- package/dist/components/select/select.cjs +4 -4
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.d.ts +10 -11
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +4 -4
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/select.module.css.cjs +1 -1
- package/dist/components/select/select.module.css.js +1 -1
- package/dist/components/separator/separator.cjs +3 -3
- package/dist/components/separator/separator.cjs.map +1 -1
- package/dist/components/separator/separator.d.ts +3 -5
- package/dist/components/separator/separator.d.ts.map +1 -1
- package/dist/components/separator/separator.js +3 -3
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/sidebar/sidebar-item.cjs +7 -4
- package/dist/components/sidebar/sidebar-item.cjs.map +1 -1
- package/dist/components/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-item.js +7 -4
- package/dist/components/sidebar/sidebar-item.js.map +1 -1
- package/dist/components/sidebar/sidebar-misc.cjs +1 -1
- package/dist/components/sidebar/sidebar-misc.cjs.map +1 -1
- package/dist/components/sidebar/sidebar-misc.js +1 -1
- package/dist/components/sidebar/sidebar-misc.js.map +1 -1
- package/dist/components/sidebar/sidebar-root.cjs +4 -5
- package/dist/components/sidebar/sidebar-root.cjs.map +1 -1
- package/dist/components/sidebar/sidebar-root.d.ts +5 -3
- package/dist/components/sidebar/sidebar-root.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-root.js +4 -5
- package/dist/components/sidebar/sidebar-root.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/sidebar/sidebar.module.css.cjs +1 -1
- package/dist/components/sidebar/sidebar.module.css.js +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/slider/slider.cjs +10 -22
- package/dist/components/slider/slider.cjs.map +1 -1
- package/dist/components/slider/slider.d.ts +6 -13
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +12 -24
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider/slider.module.css.cjs +1 -1
- package/dist/components/slider/slider.module.css.js +1 -1
- package/dist/components/switch/switch.cjs +2 -3
- package/dist/components/switch/switch.cjs.map +1 -1
- package/dist/components/switch/switch.d.ts +4 -5
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +4 -5
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/tabs.cjs +10 -14
- package/dist/components/tabs/tabs.cjs.map +1 -1
- package/dist/components/tabs/tabs.d.ts +7 -14
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +11 -15
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tabs/tabs.module.css.cjs +1 -1
- package/dist/components/tabs/tabs.module.css.js +1 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/toast/index.d.ts +3 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/toast-manager.cjs +9 -0
- package/dist/components/toast/toast-manager.cjs.map +1 -0
- package/dist/components/toast/toast-manager.d.ts +2 -0
- package/dist/components/toast/toast-manager.d.ts.map +1 -0
- package/dist/components/toast/toast-manager.js +7 -0
- package/dist/components/toast/toast-manager.js.map +1 -0
- package/dist/components/toast/toast-provider.cjs +22 -0
- package/dist/components/toast/toast-provider.cjs.map +1 -0
- package/dist/components/toast/toast-provider.d.ts +11 -0
- package/dist/components/toast/toast-provider.d.ts.map +1 -0
- package/dist/components/toast/toast-provider.js +20 -0
- package/dist/components/toast/toast-provider.js.map +1 -0
- package/dist/components/toast/toast-root.cjs +34 -0
- package/dist/components/toast/toast-root.cjs.map +1 -0
- package/dist/components/toast/toast-root.d.ts +8 -0
- package/dist/components/toast/toast-root.d.ts.map +1 -0
- package/dist/components/toast/toast-root.js +32 -0
- package/dist/components/toast/toast-root.js.map +1 -0
- package/dist/components/toast/toast.cjs +11 -25
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.d.ts +6 -8
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toast/toast.js +10 -24
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toast/toast.module.css.cjs +1 -1
- package/dist/components/toast/toast.module.css.js +1 -1
- package/dist/components/tooltip/tooltip-content.cjs +17 -0
- package/dist/components/tooltip/tooltip-content.cjs.map +1 -0
- package/dist/components/tooltip/tooltip-content.d.ts +10 -0
- package/dist/components/tooltip/tooltip-content.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/components/tooltip/tooltip-content.js.map +1 -0
- package/dist/components/tooltip/tooltip-misc.cjs +19 -0
- package/dist/components/tooltip/tooltip-misc.cjs.map +1 -0
- package/dist/components/tooltip/tooltip-misc.d.ts +9 -0
- package/dist/components/tooltip/tooltip-misc.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip-misc.js +16 -0
- package/dist/components/tooltip/tooltip-misc.js.map +1 -0
- package/dist/components/tooltip/tooltip.cjs +7 -4
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +8 -5
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +7 -4
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tooltip/tooltip.module.css.cjs +1 -1
- package/dist/components/tooltip/tooltip.module.css.js +1 -1
- package/dist/index.cjs +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -7
- package/dist/components/dropdown-menu/__tests__/dropdown-menu.test.d.ts +0 -2
- package/dist/components/dropdown-menu/__tests__/dropdown-menu.test.d.ts.map +0 -1
- package/dist/components/dropdown-menu/cell.cjs +0 -12
- package/dist/components/dropdown-menu/cell.cjs.map +0 -1
- package/dist/components/dropdown-menu/cell.d.ts.map +0 -1
- package/dist/components/dropdown-menu/cell.js +0 -10
- package/dist/components/dropdown-menu/cell.js.map +0 -1
- package/dist/components/dropdown-menu/cell.module.css.js +0 -4
- package/dist/components/dropdown-menu/dropdown-menu-content.cjs +0 -36
- package/dist/components/dropdown-menu/dropdown-menu-content.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +0 -7
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.js +0 -34
- package/dist/components/dropdown-menu/dropdown-menu-content.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.cjs +0 -45
- package/dist/components/dropdown-menu/dropdown-menu-item.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +0 -9
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-item.js +0 -43
- package/dist/components/dropdown-menu/dropdown-menu-item.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-misc.cjs +0 -36
- package/dist/components/dropdown-menu/dropdown-menu-misc.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-misc.d.ts +0 -10
- package/dist/components/dropdown-menu/dropdown-menu-misc.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-misc.js +0 -31
- package/dist/components/dropdown-menu/dropdown-menu-misc.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-root.cjs +0 -52
- package/dist/components/dropdown-menu/dropdown-menu-root.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +0 -40
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-root.js +0 -48
- package/dist/components/dropdown-menu/dropdown-menu-root.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-trigger.cjs +0 -34
- package/dist/components/dropdown-menu/dropdown-menu-trigger.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +0 -14
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu-trigger.js +0 -31
- package/dist/components/dropdown-menu/dropdown-menu-trigger.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.cjs +0 -24
- package/dist/components/dropdown-menu/dropdown-menu.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +0 -16
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +0 -22
- package/dist/components/dropdown-menu/dropdown-menu.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.module.css.cjs +0 -8
- package/dist/components/dropdown-menu/dropdown-menu.module.css.cjs.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.module.css.js +0 -4
- package/dist/components/dropdown-menu/dropdown-menu.module.css.js.map +0 -1
- package/dist/components/dropdown-menu/index.d.ts +0 -2
- package/dist/components/dropdown-menu/index.d.ts.map +0 -1
- package/dist/components/dropdown-menu/types.d.ts +0 -4
- package/dist/components/dropdown-menu/types.d.ts.map +0 -1
- package/dist/components/dropdown-menu/utils.cjs +0 -21
- package/dist/components/dropdown-menu/utils.cjs.map +0 -1
- package/dist/components/dropdown-menu/utils.d.ts +0 -4
- package/dist/components/dropdown-menu/utils.d.ts.map +0 -1
- package/dist/components/dropdown-menu/utils.js +0 -18
- package/dist/components/dropdown-menu/utils.js.map +0 -1
- package/dist/components/scroll-area/scroll-area-root.cjs +0 -17
- package/dist/components/scroll-area/scroll-area-root.cjs.map +0 -1
- package/dist/components/scroll-area/scroll-area-root.d.ts +0 -9
- package/dist/components/scroll-area/scroll-area-root.d.ts.map +0 -1
- package/dist/components/scroll-area/scroll-area-root.js +0 -15
- package/dist/components/scroll-area/scroll-area-root.js.map +0 -1
- package/dist/components/sheet/__tests__/sheet.test.d.ts +0 -2
- package/dist/components/sheet/__tests__/sheet.test.d.ts.map +0 -1
- package/dist/components/sheet/index.d.ts +0 -2
- package/dist/components/sheet/index.d.ts.map +0 -1
- package/dist/components/sheet/sheet.cjs +0 -50
- package/dist/components/sheet/sheet.cjs.map +0 -1
- package/dist/components/sheet/sheet.d.ts +0 -36
- package/dist/components/sheet/sheet.d.ts.map +0 -1
- package/dist/components/sheet/sheet.js +0 -45
- package/dist/components/sheet/sheet.js.map +0 -1
- package/dist/components/sheet/sheet.module.css.cjs +0 -8
- package/dist/components/sheet/sheet.module.css.cjs.map +0 -1
- package/dist/components/sheet/sheet.module.css.js +0 -4
- package/dist/components/sheet/sheet.module.css.js.map +0 -1
- package/dist/components/slider/thumb.cjs +0 -8
- package/dist/components/slider/thumb.cjs.map +0 -1
- package/dist/components/slider/thumb.d.ts +0 -2
- package/dist/components/slider/thumb.d.ts.map +0 -1
- package/dist/components/slider/thumb.js +0 -6
- package/dist/components/slider/thumb.js.map +0 -1
- package/dist/components/tooltip/tooltip-provider.cjs +0 -18
- package/dist/components/tooltip/tooltip-provider.cjs.map +0 -1
- package/dist/components/tooltip/tooltip-provider.d.ts +0 -9
- package/dist/components/tooltip/tooltip-provider.d.ts.map +0 -1
- package/dist/components/tooltip/tooltip-provider.js +0 -15
- package/dist/components/tooltip/tooltip-provider.js.map +0 -1
- package/dist/components/tooltip/tooltip-root.cjs +0 -66
- package/dist/components/tooltip/tooltip-root.cjs.map +0 -1
- package/dist/components/tooltip/tooltip-root.d.ts +0 -29
- package/dist/components/tooltip/tooltip-root.d.ts.map +0 -1
- package/dist/components/tooltip/tooltip-root.js +0 -63
- package/dist/components/tooltip/tooltip-root.js.map +0 -1
- package/dist/components/tooltip/utils.cjs +0 -30
- package/dist/components/tooltip/utils.cjs.map +0 -1
- package/dist/components/tooltip/utils.d.ts +0 -10
- package/dist/components/tooltip/utils.d.ts.map +0 -1
- package/dist/components/tooltip/utils.js +0 -28
- package/dist/components/tooltip/utils.js.map +0 -1
- /package/dist/components/{dropdown-menu → menu}/cell.module.css.cjs.map +0 -0
- /package/dist/components/{dropdown-menu → menu}/cell.module.css.js.map +0 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { Combobox } from '@base-ui/react';
|
|
4
4
|
import { cx } from 'class-variance-authority';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { Checkbox } from '../checkbox/checkbox.js';
|
|
7
|
-
import { getMatch } from '../
|
|
7
|
+
import { getMatch } from '../menu/utils.js';
|
|
8
8
|
import { Text } from '../text/text.js';
|
|
9
9
|
import styles from './combobox.module.css.js';
|
|
10
10
|
import { useComboboxContext } from './combobox-root.js';
|
|
11
11
|
|
|
12
|
-
const ComboboxItem = forwardRef(({ className, children, value: providedValue, leadingIcon, disabled, ...props }, ref) => {
|
|
12
|
+
const ComboboxItem = forwardRef(({ className, children, value: providedValue, leadingIcon, disabled, render, ...props }, ref) => {
|
|
13
13
|
const value = providedValue
|
|
14
|
-
?
|
|
14
|
+
? providedValue
|
|
15
15
|
: typeof children === 'string'
|
|
16
16
|
? children
|
|
17
17
|
: undefined;
|
|
18
|
-
const { multiple,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (inputValue?.length && !isMatched) {
|
|
25
|
-
// Doesn't match search, so don't render at all
|
|
26
|
-
return null;
|
|
18
|
+
const { multiple, inputValue, hasItems } = useComboboxContext();
|
|
19
|
+
// When items prop is not provided on Root, use custom filtering
|
|
20
|
+
if (!hasItems && inputValue?.length) {
|
|
21
|
+
const isMatched = getMatch(value, children, inputValue);
|
|
22
|
+
if (!isMatched)
|
|
23
|
+
return null;
|
|
27
24
|
}
|
|
28
|
-
|
|
25
|
+
const element = typeof children === 'string' ? (jsxs(Fragment, { children: [leadingIcon && jsx("div", { className: styles.itemIcon, children: leadingIcon }), jsx(Text, { children: children })] })) : (children);
|
|
26
|
+
return (jsx(Combobox.Item, { ref: ref, value: value, className: cx(styles.menuitem, className), disabled: disabled, ...props, render: render
|
|
27
|
+
? render
|
|
28
|
+
: (renderProps, state) => (jsxs("div", { ...renderProps, children: [multiple && jsx(Checkbox, { checked: state.selected }), element] })) }));
|
|
29
29
|
});
|
|
30
|
-
ComboboxItem.displayName = '
|
|
30
|
+
ComboboxItem.displayName = 'Combobox.Item';
|
|
31
31
|
|
|
32
32
|
export { ComboboxItem };
|
|
33
33
|
//# sourceMappingURL=combobox-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-item.js","sources":["../../../components/combobox/combobox-item.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"combobox-item.js","sources":["../../../components/combobox/combobox-item.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { cx } from 'class-variance-authority';\nimport { forwardRef, ReactNode } from 'react';\nimport { Checkbox } from '../checkbox';\nimport { getMatch } from '../menu/utils';\nimport { Text } from '../text';\nimport styles from './combobox.module.css';\nimport { useComboboxContext } from './combobox-root';\n\nexport interface ComboboxItemProps extends ComboboxPrimitive.Item.Props {\n leadingIcon?: ReactNode;\n}\n\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(\n (\n {\n className,\n children,\n value: providedValue,\n leadingIcon,\n disabled,\n render,\n ...props\n },\n ref\n ) => {\n const value = providedValue\n ? providedValue\n : typeof children === 'string'\n ? children\n : undefined;\n\n const { multiple, inputValue, hasItems } = useComboboxContext();\n\n // When items prop is not provided on Root, use custom filtering\n if (!hasItems && inputValue?.length) {\n const isMatched = getMatch(value, children, inputValue);\n if (!isMatched) return null;\n }\n\n const element =\n typeof children === 'string' ? (\n <>\n {leadingIcon && <div className={styles.itemIcon}>{leadingIcon}</div>}\n <Text>{children}</Text>\n </>\n ) : (\n children\n );\n\n return (\n <ComboboxPrimitive.Item\n ref={ref}\n value={value}\n className={cx(styles.menuitem, className)}\n disabled={disabled}\n {...props}\n render={\n render\n ? render\n : (renderProps, state) => (\n <div {...renderProps}>\n {multiple && <Checkbox checked={state.selected} />}\n {element}\n </div>\n )\n }\n />\n );\n }\n);\nComboboxItem.displayName = 'Combobox.Item';\n"],"names":[],"mappings":";;;;;;;;;;;AAeO;;AAcD;AACA;AACE;;;;AAMJ;;AAEE;AAAgB;;AAGlB;AAUA;AASQ;AACA;AASV;AAEF;;"}
|
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var react = require('@
|
|
5
|
+
var react = require('@base-ui/react');
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var combobox_module = require('./combobox.module.css.cjs');
|
|
9
9
|
var comboboxRoot = require('./combobox-root.cjs');
|
|
10
10
|
|
|
11
11
|
const ComboboxLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
12
|
-
const { inputValue } = comboboxRoot.useComboboxContext();
|
|
13
|
-
if (inputValue?.length)
|
|
12
|
+
const { inputValue, hasItems } = comboboxRoot.useComboboxContext();
|
|
13
|
+
if (!hasItems && inputValue?.length)
|
|
14
14
|
return null;
|
|
15
|
-
return (jsxRuntime.jsx(react.
|
|
15
|
+
return (jsxRuntime.jsx(react.Combobox.GroupLabel, { ref: ref, className: classVarianceAuthority.cx(combobox_module.default.label, className), ...props }));
|
|
16
16
|
});
|
|
17
|
-
ComboboxLabel.displayName = '
|
|
17
|
+
ComboboxLabel.displayName = 'Combobox.Label';
|
|
18
18
|
const ComboboxGroup = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
19
|
-
const { inputValue } = comboboxRoot.useComboboxContext();
|
|
20
|
-
if (inputValue?.length)
|
|
19
|
+
const { inputValue, hasItems } = comboboxRoot.useComboboxContext();
|
|
20
|
+
if (!hasItems && inputValue?.length)
|
|
21
21
|
return children;
|
|
22
|
-
return (jsxRuntime.jsx(react.
|
|
22
|
+
return (jsxRuntime.jsx(react.Combobox.Group, { ref: ref, className: classVarianceAuthority.cx(combobox_module.default.group, className), ...props, children: children }));
|
|
23
23
|
});
|
|
24
|
-
ComboboxGroup.displayName = '
|
|
24
|
+
ComboboxGroup.displayName = 'Combobox.Group';
|
|
25
25
|
const ComboboxSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
26
|
-
const { inputValue } = comboboxRoot.useComboboxContext();
|
|
27
|
-
if (inputValue?.length)
|
|
26
|
+
const { inputValue, hasItems } = comboboxRoot.useComboboxContext();
|
|
27
|
+
if (!hasItems && inputValue?.length)
|
|
28
28
|
return null;
|
|
29
|
-
return (jsxRuntime.jsx(react.
|
|
29
|
+
return (jsxRuntime.jsx(react.Combobox.Separator, { ref: ref, className: classVarianceAuthority.cx(combobox_module.default.separator, className), ...props }));
|
|
30
30
|
});
|
|
31
|
-
ComboboxSeparator.displayName = '
|
|
31
|
+
ComboboxSeparator.displayName = 'Combobox.Separator';
|
|
32
32
|
|
|
33
33
|
exports.ComboboxGroup = ComboboxGroup;
|
|
34
34
|
exports.ComboboxLabel = ComboboxLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-misc.cjs","sources":["../../../components/combobox/combobox-misc.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"combobox-misc.cjs","sources":["../../../components/combobox/combobox-misc.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport styles from './combobox.module.css';\nimport { useComboboxContext } from './combobox-root';\n\nexport const ComboboxLabel = forwardRef<\n ElementRef<typeof ComboboxPrimitive.GroupLabel>,\n ComboboxPrimitive.GroupLabel.Props\n>(({ className, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return null;\n\n return (\n <ComboboxPrimitive.GroupLabel\n ref={ref}\n className={cx(styles.label, className)}\n {...props}\n />\n );\n});\nComboboxLabel.displayName = 'Combobox.Label';\n\nexport const ComboboxGroup = forwardRef<\n ElementRef<typeof ComboboxPrimitive.Group>,\n ComboboxPrimitive.Group.Props\n>(({ className, children, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return children;\n\n return (\n <ComboboxPrimitive.Group\n ref={ref}\n className={cx(styles.group, className)}\n {...props}\n >\n {children}\n </ComboboxPrimitive.Group>\n );\n});\nComboboxGroup.displayName = 'Combobox.Group';\n\nexport const ComboboxSeparator = forwardRef<\n ElementRef<typeof ComboboxPrimitive.Separator>,\n ComboboxPrimitive.Separator.Props\n>(({ className, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return null;\n\n return (\n <ComboboxPrimitive.Separator\n ref={ref}\n className={cx(styles.separator, className)}\n {...props}\n />\n );\n});\nComboboxSeparator.displayName = 'Combobox.Separator';\n"],"names":[],"mappings":";;;;;;;;;;AAQa;;AAKX;AAAqC;;AASvC;AACA;AAEa;;AAKX;AAAqC;;AAWvC;AACA;AAEa;;AAKX;AAAqC;;AASvC;AACA;;;;"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export declare const ComboboxLabel: import("react").ForwardRefExoticComponent<Omit<import("@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const ComboboxGroup: import("react").ForwardRefExoticComponent<Omit<import("@ariakit/react").ComboboxGroupOptions<"div"> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@ariakit/react").ComboboxGroupOptions<T>> & {
|
|
5
|
-
[index: `data-${string}`]: unknown;
|
|
6
|
-
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export declare const ComboboxSeparator: import("react").ForwardRefExoticComponent<Omit<import("@ariakit/react").ComboboxSeparatorOptions<"hr"> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, keyof import("@ariakit/react").ComboboxSeparatorOptions<T>> & {
|
|
8
|
-
[index: `data-${string}`]: unknown;
|
|
9
|
-
}, "ref"> & import("react").RefAttributes<HTMLHRElement>>;
|
|
1
|
+
export declare const ComboboxLabel: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
2
|
+
export declare const ComboboxGroup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const ComboboxSeparator: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
4
|
//# sourceMappingURL=combobox-misc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-misc.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox-misc.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combobox-misc.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox-misc.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,8JAcxB,CAAC;AAGH,eAAO,MAAM,aAAa,yJAgBxB,CAAC;AAGH,eAAO,MAAM,iBAAiB,iJAc5B,CAAC"}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { Combobox } from '@base-ui/react';
|
|
4
4
|
import { cx } from 'class-variance-authority';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import styles from './combobox.module.css.js';
|
|
7
7
|
import { useComboboxContext } from './combobox-root.js';
|
|
8
8
|
|
|
9
9
|
const ComboboxLabel = forwardRef(({ className, ...props }, ref) => {
|
|
10
|
-
const { inputValue } = useComboboxContext();
|
|
11
|
-
if (inputValue?.length)
|
|
10
|
+
const { inputValue, hasItems } = useComboboxContext();
|
|
11
|
+
if (!hasItems && inputValue?.length)
|
|
12
12
|
return null;
|
|
13
|
-
return (jsx(
|
|
13
|
+
return (jsx(Combobox.GroupLabel, { ref: ref, className: cx(styles.label, className), ...props }));
|
|
14
14
|
});
|
|
15
|
-
ComboboxLabel.displayName = '
|
|
15
|
+
ComboboxLabel.displayName = 'Combobox.Label';
|
|
16
16
|
const ComboboxGroup = forwardRef(({ className, children, ...props }, ref) => {
|
|
17
|
-
const { inputValue } = useComboboxContext();
|
|
18
|
-
if (inputValue?.length)
|
|
17
|
+
const { inputValue, hasItems } = useComboboxContext();
|
|
18
|
+
if (!hasItems && inputValue?.length)
|
|
19
19
|
return children;
|
|
20
|
-
return (jsx(
|
|
20
|
+
return (jsx(Combobox.Group, { ref: ref, className: cx(styles.group, className), ...props, children: children }));
|
|
21
21
|
});
|
|
22
|
-
ComboboxGroup.displayName = '
|
|
22
|
+
ComboboxGroup.displayName = 'Combobox.Group';
|
|
23
23
|
const ComboboxSeparator = forwardRef(({ className, ...props }, ref) => {
|
|
24
|
-
const { inputValue } = useComboboxContext();
|
|
25
|
-
if (inputValue?.length)
|
|
24
|
+
const { inputValue, hasItems } = useComboboxContext();
|
|
25
|
+
if (!hasItems && inputValue?.length)
|
|
26
26
|
return null;
|
|
27
|
-
return (jsx(
|
|
27
|
+
return (jsx(Combobox.Separator, { ref: ref, className: cx(styles.separator, className), ...props }));
|
|
28
28
|
});
|
|
29
|
-
ComboboxSeparator.displayName = '
|
|
29
|
+
ComboboxSeparator.displayName = 'Combobox.Separator';
|
|
30
30
|
|
|
31
31
|
export { ComboboxGroup, ComboboxLabel, ComboboxSeparator };
|
|
32
32
|
//# sourceMappingURL=combobox-misc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-misc.js","sources":["../../../components/combobox/combobox-misc.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"combobox-misc.js","sources":["../../../components/combobox/combobox-misc.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { cx } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport styles from './combobox.module.css';\nimport { useComboboxContext } from './combobox-root';\n\nexport const ComboboxLabel = forwardRef<\n ElementRef<typeof ComboboxPrimitive.GroupLabel>,\n ComboboxPrimitive.GroupLabel.Props\n>(({ className, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return null;\n\n return (\n <ComboboxPrimitive.GroupLabel\n ref={ref}\n className={cx(styles.label, className)}\n {...props}\n />\n );\n});\nComboboxLabel.displayName = 'Combobox.Label';\n\nexport const ComboboxGroup = forwardRef<\n ElementRef<typeof ComboboxPrimitive.Group>,\n ComboboxPrimitive.Group.Props\n>(({ className, children, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return children;\n\n return (\n <ComboboxPrimitive.Group\n ref={ref}\n className={cx(styles.group, className)}\n {...props}\n >\n {children}\n </ComboboxPrimitive.Group>\n );\n});\nComboboxGroup.displayName = 'Combobox.Group';\n\nexport const ComboboxSeparator = forwardRef<\n ElementRef<typeof ComboboxPrimitive.Separator>,\n ComboboxPrimitive.Separator.Props\n>(({ className, ...props }, ref) => {\n const { inputValue, hasItems } = useComboboxContext();\n if (!hasItems && inputValue?.length) return null;\n\n return (\n <ComboboxPrimitive.Separator\n ref={ref}\n className={cx(styles.separator, className)}\n {...props}\n />\n );\n});\nComboboxSeparator.displayName = 'Combobox.Separator';\n"],"names":[],"mappings":";;;;;;;;AAQa;;AAKX;AAAqC;;AASvC;AACA;AAEa;;AAKX;AAAqC;;AAWvC;AACA;AAEa;;AAKX;AAAqC;;AASvC;AACA;;"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var react = require('@
|
|
6
|
-
var radixUi = require('radix-ui');
|
|
5
|
+
var react = require('@base-ui/react');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
|
|
9
8
|
const ComboboxContext = React.createContext(undefined);
|
|
@@ -14,51 +13,33 @@ const useComboboxContext = () => {
|
|
|
14
13
|
}
|
|
15
14
|
return context;
|
|
16
15
|
};
|
|
17
|
-
const ComboboxRoot = ({
|
|
18
|
-
const [
|
|
19
|
-
const [
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
16
|
+
const ComboboxRoot = ({ multiple = false, children, onValueChange, onInputValueChange, value: providedValue, defaultValue, items, ...props }) => {
|
|
17
|
+
const [inputValue, setInputValue] = React.useState('');
|
|
18
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue ?? null);
|
|
19
|
+
const inputContainerRef = React.useRef(null);
|
|
20
|
+
const computedValue = providedValue ?? internalValue;
|
|
21
|
+
const handleInputValueChange = React.useCallback((value, eventDetails) => {
|
|
22
|
+
setInputValue(value);
|
|
23
|
+
onInputValueChange?.(value);
|
|
24
|
+
}, [onInputValueChange]);
|
|
25
|
+
const handleValueChange = React.useCallback((value, eventDetails) => {
|
|
26
|
+
setInternalValue(value);
|
|
27
27
|
if (multiple) {
|
|
28
|
-
|
|
29
|
-
? Array.isArray(newValue)
|
|
30
|
-
? newValue
|
|
31
|
-
: [newValue]
|
|
32
|
-
: [];
|
|
33
|
-
setInternalValue(formattedValue);
|
|
34
|
-
onValueChange?.(formattedValue);
|
|
28
|
+
onValueChange?.(value);
|
|
35
29
|
}
|
|
36
30
|
else {
|
|
37
|
-
|
|
38
|
-
onValueChange?.(String(newValue));
|
|
31
|
+
onValueChange?.(value);
|
|
39
32
|
}
|
|
40
33
|
}, [onValueChange, multiple]);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, [onOpenChange]);
|
|
51
|
-
return (jsxRuntime.jsx(ComboboxContext.Provider, { value: {
|
|
52
|
-
setValue,
|
|
53
|
-
value,
|
|
54
|
-
inputValue,
|
|
55
|
-
setInputValue,
|
|
56
|
-
open,
|
|
57
|
-
setOpen,
|
|
58
|
-
inputRef,
|
|
59
|
-
multiple,
|
|
60
|
-
listRef
|
|
61
|
-
}, children: jsxRuntime.jsx(radixUi.Popover.Root, { open: open, onOpenChange: setOpen, modal: modal, children: jsxRuntime.jsx(react.ComboboxProvider, { open: open, setOpen: setOpen, value: inputValue, setValue: setInputValue, selectedValue: value, setSelectedValue: setValue, focusLoop: false, includesBaseElement: false, resetValueOnHide: multiple, resetValueOnSelect: multiple, ...props, children: children }) }) }));
|
|
34
|
+
const contextValue = React.useMemo(() => ({
|
|
35
|
+
multiple,
|
|
36
|
+
inputValue,
|
|
37
|
+
hasItems: !!items,
|
|
38
|
+
inputContainerRef,
|
|
39
|
+
value: computedValue,
|
|
40
|
+
onValueChange: handleValueChange
|
|
41
|
+
}), [multiple, inputValue, items, computedValue, handleValueChange]);
|
|
42
|
+
return (jsxRuntime.jsx(ComboboxContext.Provider, { value: contextValue, children: jsxRuntime.jsx(react.Combobox.Root, { multiple: multiple, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, items: items, value: providedValue, defaultValue: defaultValue, modal: true, ...props, children: children }) }));
|
|
62
43
|
};
|
|
63
44
|
|
|
64
45
|
exports.ComboboxRoot = ComboboxRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-root.cjs","sources":["../../../components/combobox/combobox-root.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"combobox-root.cjs","sources":["../../../components/combobox/combobox-root.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport {\n createContext,\n RefObject,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState\n} from 'react';\n\ninterface ComboboxContextValue<Value = string> {\n multiple: boolean;\n inputValue: string;\n hasItems: boolean;\n inputContainerRef: RefObject<HTMLDivElement | null>;\n value: Value | Value[] | null | undefined;\n onValueChange?: (value: Value | Value[] | null) => void;\n}\n\nconst ComboboxContext = createContext<\n ComboboxContextValue<unknown> | undefined\n>(undefined);\n\nexport const useComboboxContext = <\n Value = string\n>(): ComboboxContextValue<Value> => {\n const context = useContext(ComboboxContext);\n if (!context) {\n throw new Error(\n 'useComboboxContext must be used within a ComboboxProvider'\n );\n }\n return context as ComboboxContextValue<Value>;\n};\n\nexport interface BaseComboboxRootProps<Value>\n extends Omit<\n ComboboxPrimitive.Root.Props<Value, boolean>,\n 'onValueChange' | 'onInputValueChange' | 'multiple'\n > {\n onInputValueChange?: (inputValue: string) => void;\n}\n\nexport interface SingleComboboxProps<Value = string>\n extends BaseComboboxRootProps<Value> {\n multiple?: false;\n value?: Value | null;\n defaultValue?: Value | null;\n onValueChange?: (value: Value | null) => void;\n}\n\nexport interface MultipleComboboxProps<Value = string>\n extends BaseComboboxRootProps<Value> {\n multiple: true;\n value?: Value[];\n defaultValue?: Value[];\n onValueChange?: (value: Value[]) => void;\n}\n\nexport type ComboboxRootProps<Value = string> =\n | SingleComboboxProps<Value>\n | MultipleComboboxProps<Value>;\n\nexport const ComboboxRoot = <Value extends unknown | unknown[]>({\n multiple = false,\n children,\n onValueChange,\n onInputValueChange,\n value: providedValue,\n defaultValue,\n items,\n ...props\n}: ComboboxRootProps<Value>) => {\n const [inputValue, setInputValue] = useState('');\n const [internalValue, setInternalValue] = useState<\n Value | Value[] | null | undefined\n >(defaultValue ?? null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const computedValue = providedValue ?? internalValue;\n\n const handleInputValueChange = useCallback(\n (\n value: string,\n eventDetails: ComboboxPrimitive.Root.ChangeEventDetails\n ) => {\n setInputValue(value);\n onInputValueChange?.(value);\n },\n [onInputValueChange]\n );\n\n const handleValueChange = useCallback(\n (\n value: Value | Value[] | null,\n eventDetails: ComboboxPrimitive.Root.ChangeEventDetails\n ) => {\n setInternalValue(value);\n if (multiple) {\n (onValueChange as MultipleComboboxProps<Value>['onValueChange'])?.(\n value as Value[]\n );\n } else {\n (onValueChange as SingleComboboxProps<Value>['onValueChange'])?.(\n value as Value | null\n );\n }\n },\n [onValueChange, multiple]\n );\n\n const contextValue = useMemo(\n () => ({\n multiple,\n inputValue,\n hasItems: !!items,\n inputContainerRef,\n value: computedValue,\n onValueChange: handleValueChange\n }),\n [multiple, inputValue, items, computedValue, handleValueChange]\n );\n\n return (\n <ComboboxContext.Provider\n value={contextValue as ComboboxContextValue<unknown>}\n >\n <ComboboxPrimitive.Root\n multiple={multiple}\n onValueChange={handleValueChange}\n onInputValueChange={handleInputValueChange}\n items={items}\n value={providedValue}\n defaultValue={defaultValue}\n modal\n {...props}\n >\n {children}\n </ComboboxPrimitive.Root>\n </ComboboxContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsBA;AAIO;AAGL;;AAEE;;AAIF;AACF;AA8BO;;AAWL;AAGA;AAEA;;;AAQI;AACF;;;;AAWK;;;AAIA;;AAIL;AAIF;;;;;AAMI;AACA;AACD;;AAsBL;;;"}
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from '@base-ui/react';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
-
interface ComboboxContextValue {
|
|
4
|
-
setValue: (value: string | string[]) => void;
|
|
5
|
-
value?: string | string[];
|
|
6
|
-
inputValue?: string;
|
|
7
|
-
setInputValue: (inputValue: string) => void;
|
|
8
|
-
open: boolean;
|
|
9
|
-
setOpen: (open: boolean) => void;
|
|
10
|
-
inputRef: RefObject<HTMLInputElement | null>;
|
|
3
|
+
interface ComboboxContextValue<Value = string> {
|
|
11
4
|
multiple: boolean;
|
|
12
|
-
|
|
5
|
+
inputValue: string;
|
|
6
|
+
hasItems: boolean;
|
|
7
|
+
inputContainerRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
value: Value | Value[] | null | undefined;
|
|
9
|
+
onValueChange?: (value: Value | Value[] | null) => void;
|
|
13
10
|
}
|
|
14
|
-
export declare const useComboboxContext: () => ComboboxContextValue
|
|
15
|
-
export interface BaseComboboxRootProps extends Omit<
|
|
16
|
-
onOpenChange?: (open: boolean) => void;
|
|
17
|
-
modal?: boolean;
|
|
18
|
-
inputValue?: string;
|
|
11
|
+
export declare const useComboboxContext: <Value = string>() => ComboboxContextValue<Value>;
|
|
12
|
+
export interface BaseComboboxRootProps<Value> extends Omit<ComboboxPrimitive.Root.Props<Value, boolean>, 'onValueChange' | 'onInputValueChange' | 'multiple'> {
|
|
19
13
|
onInputValueChange?: (inputValue: string) => void;
|
|
20
|
-
defaultInputValue?: string;
|
|
21
14
|
}
|
|
22
|
-
export interface SingleComboboxProps extends BaseComboboxRootProps {
|
|
15
|
+
export interface SingleComboboxProps<Value = string> extends BaseComboboxRootProps<Value> {
|
|
23
16
|
multiple?: false;
|
|
24
|
-
value?:
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
value?: Value | null;
|
|
18
|
+
defaultValue?: Value | null;
|
|
19
|
+
onValueChange?: (value: Value | null) => void;
|
|
27
20
|
}
|
|
28
|
-
export interface MultipleComboboxProps extends BaseComboboxRootProps {
|
|
21
|
+
export interface MultipleComboboxProps<Value = string> extends BaseComboboxRootProps<Value> {
|
|
29
22
|
multiple: true;
|
|
30
|
-
value?:
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
value?: Value[];
|
|
24
|
+
defaultValue?: Value[];
|
|
25
|
+
onValueChange?: (value: Value[]) => void;
|
|
33
26
|
}
|
|
34
|
-
export type ComboboxRootProps = SingleComboboxProps | MultipleComboboxProps
|
|
35
|
-
export declare const ComboboxRoot: ({
|
|
27
|
+
export type ComboboxRootProps<Value = string> = SingleComboboxProps<Value> | MultipleComboboxProps<Value>;
|
|
28
|
+
export declare const ComboboxRoot: <Value extends unknown>({ multiple, children, onValueChange, onInputValueChange, value: providedValue, defaultValue, items, ...props }: ComboboxRootProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
36
29
|
export {};
|
|
37
30
|
//# sourceMappingURL=combobox-root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-root.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox-root.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"combobox-root.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox-root.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAEL,SAAS,EAMV,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB,CAAC,KAAK,GAAG,MAAM;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpD,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD;AAMD,eAAO,MAAM,kBAAkB,wBAE1B,qBAAqB,KAAK,CAQ9B,CAAC;AAEF,MAAM,WAAW,qBAAqB,CAAC,KAAK,CAC1C,SAAQ,IAAI,CACV,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,EAC5C,eAAe,GAAG,oBAAoB,GAAG,UAAU,CACpD;IACD,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,mBAAmB,CAAC,KAAK,GAAG,MAAM,CACjD,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,MAAM,CACnD,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACpC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,MAAM,IACxC,mBAAmB,CAAC,KAAK,CAAC,GAC1B,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,eAAO,MAAM,YAAY,0IAStB,kBAAkB,KAAK,CAAC,4CAqE1B,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { createContext, useContext, useState, useRef, useCallback } from 'react';
|
|
3
|
+
import { Combobox } from '@base-ui/react';
|
|
4
|
+
import { createContext, useContext, useState, useRef, useCallback, useMemo } from 'react';
|
|
6
5
|
|
|
7
6
|
const ComboboxContext = createContext(undefined);
|
|
8
7
|
const useComboboxContext = () => {
|
|
@@ -12,51 +11,33 @@ const useComboboxContext = () => {
|
|
|
12
11
|
}
|
|
13
12
|
return context;
|
|
14
13
|
};
|
|
15
|
-
const ComboboxRoot = ({
|
|
16
|
-
const [
|
|
17
|
-
const [
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
14
|
+
const ComboboxRoot = ({ multiple = false, children, onValueChange, onInputValueChange, value: providedValue, defaultValue, items, ...props }) => {
|
|
15
|
+
const [inputValue, setInputValue] = useState('');
|
|
16
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
17
|
+
const inputContainerRef = useRef(null);
|
|
18
|
+
const computedValue = providedValue ?? internalValue;
|
|
19
|
+
const handleInputValueChange = useCallback((value, eventDetails) => {
|
|
20
|
+
setInputValue(value);
|
|
21
|
+
onInputValueChange?.(value);
|
|
22
|
+
}, [onInputValueChange]);
|
|
23
|
+
const handleValueChange = useCallback((value, eventDetails) => {
|
|
24
|
+
setInternalValue(value);
|
|
25
25
|
if (multiple) {
|
|
26
|
-
|
|
27
|
-
? Array.isArray(newValue)
|
|
28
|
-
? newValue
|
|
29
|
-
: [newValue]
|
|
30
|
-
: [];
|
|
31
|
-
setInternalValue(formattedValue);
|
|
32
|
-
onValueChange?.(formattedValue);
|
|
26
|
+
onValueChange?.(value);
|
|
33
27
|
}
|
|
34
28
|
else {
|
|
35
|
-
|
|
36
|
-
onValueChange?.(String(newValue));
|
|
29
|
+
onValueChange?.(value);
|
|
37
30
|
}
|
|
38
31
|
}, [onValueChange, multiple]);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [onOpenChange]);
|
|
49
|
-
return (jsx(ComboboxContext.Provider, { value: {
|
|
50
|
-
setValue,
|
|
51
|
-
value,
|
|
52
|
-
inputValue,
|
|
53
|
-
setInputValue,
|
|
54
|
-
open,
|
|
55
|
-
setOpen,
|
|
56
|
-
inputRef,
|
|
57
|
-
multiple,
|
|
58
|
-
listRef
|
|
59
|
-
}, children: jsx(Popover.Root, { open: open, onOpenChange: setOpen, modal: modal, children: jsx(ComboboxProvider, { open: open, setOpen: setOpen, value: inputValue, setValue: setInputValue, selectedValue: value, setSelectedValue: setValue, focusLoop: false, includesBaseElement: false, resetValueOnHide: multiple, resetValueOnSelect: multiple, ...props, children: children }) }) }));
|
|
32
|
+
const contextValue = useMemo(() => ({
|
|
33
|
+
multiple,
|
|
34
|
+
inputValue,
|
|
35
|
+
hasItems: !!items,
|
|
36
|
+
inputContainerRef,
|
|
37
|
+
value: computedValue,
|
|
38
|
+
onValueChange: handleValueChange
|
|
39
|
+
}), [multiple, inputValue, items, computedValue, handleValueChange]);
|
|
40
|
+
return (jsx(ComboboxContext.Provider, { value: contextValue, children: jsx(Combobox.Root, { multiple: multiple, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, items: items, value: providedValue, defaultValue: defaultValue, modal: true, ...props, children: children }) }));
|
|
60
41
|
};
|
|
61
42
|
|
|
62
43
|
export { ComboboxRoot, useComboboxContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-root.js","sources":["../../../components/combobox/combobox-root.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"combobox-root.js","sources":["../../../components/combobox/combobox-root.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport {\n createContext,\n RefObject,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState\n} from 'react';\n\ninterface ComboboxContextValue<Value = string> {\n multiple: boolean;\n inputValue: string;\n hasItems: boolean;\n inputContainerRef: RefObject<HTMLDivElement | null>;\n value: Value | Value[] | null | undefined;\n onValueChange?: (value: Value | Value[] | null) => void;\n}\n\nconst ComboboxContext = createContext<\n ComboboxContextValue<unknown> | undefined\n>(undefined);\n\nexport const useComboboxContext = <\n Value = string\n>(): ComboboxContextValue<Value> => {\n const context = useContext(ComboboxContext);\n if (!context) {\n throw new Error(\n 'useComboboxContext must be used within a ComboboxProvider'\n );\n }\n return context as ComboboxContextValue<Value>;\n};\n\nexport interface BaseComboboxRootProps<Value>\n extends Omit<\n ComboboxPrimitive.Root.Props<Value, boolean>,\n 'onValueChange' | 'onInputValueChange' | 'multiple'\n > {\n onInputValueChange?: (inputValue: string) => void;\n}\n\nexport interface SingleComboboxProps<Value = string>\n extends BaseComboboxRootProps<Value> {\n multiple?: false;\n value?: Value | null;\n defaultValue?: Value | null;\n onValueChange?: (value: Value | null) => void;\n}\n\nexport interface MultipleComboboxProps<Value = string>\n extends BaseComboboxRootProps<Value> {\n multiple: true;\n value?: Value[];\n defaultValue?: Value[];\n onValueChange?: (value: Value[]) => void;\n}\n\nexport type ComboboxRootProps<Value = string> =\n | SingleComboboxProps<Value>\n | MultipleComboboxProps<Value>;\n\nexport const ComboboxRoot = <Value extends unknown | unknown[]>({\n multiple = false,\n children,\n onValueChange,\n onInputValueChange,\n value: providedValue,\n defaultValue,\n items,\n ...props\n}: ComboboxRootProps<Value>) => {\n const [inputValue, setInputValue] = useState('');\n const [internalValue, setInternalValue] = useState<\n Value | Value[] | null | undefined\n >(defaultValue ?? null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n const computedValue = providedValue ?? internalValue;\n\n const handleInputValueChange = useCallback(\n (\n value: string,\n eventDetails: ComboboxPrimitive.Root.ChangeEventDetails\n ) => {\n setInputValue(value);\n onInputValueChange?.(value);\n },\n [onInputValueChange]\n );\n\n const handleValueChange = useCallback(\n (\n value: Value | Value[] | null,\n eventDetails: ComboboxPrimitive.Root.ChangeEventDetails\n ) => {\n setInternalValue(value);\n if (multiple) {\n (onValueChange as MultipleComboboxProps<Value>['onValueChange'])?.(\n value as Value[]\n );\n } else {\n (onValueChange as SingleComboboxProps<Value>['onValueChange'])?.(\n value as Value | null\n );\n }\n },\n [onValueChange, multiple]\n );\n\n const contextValue = useMemo(\n () => ({\n multiple,\n inputValue,\n hasItems: !!items,\n inputContainerRef,\n value: computedValue,\n onValueChange: handleValueChange\n }),\n [multiple, inputValue, items, computedValue, handleValueChange]\n );\n\n return (\n <ComboboxContext.Provider\n value={contextValue as ComboboxContextValue<unknown>}\n >\n <ComboboxPrimitive.Root\n multiple={multiple}\n onValueChange={handleValueChange}\n onInputValueChange={handleInputValueChange}\n items={items}\n value={providedValue}\n defaultValue={defaultValue}\n modal\n {...props}\n >\n {children}\n </ComboboxPrimitive.Root>\n </ComboboxContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;AAsBA;AAIO;AAGL;;AAEE;;AAIF;AACF;AA8BO;;AAWL;AAGA;AAEA;;;AAQI;AACF;;;;AAWK;;;AAIA;;AAIL;AAIF;;;;;AAMI;AACA;AACD;;AAsBL;;"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
export declare const Combobox: (({
|
|
1
|
+
export declare const Combobox: (<Value extends unknown>({ multiple, children, onValueChange, onInputValueChange, value: providedValue, defaultValue, items, ...props }: import("./combobox-root").ComboboxRootProps<Value>) => import("react/jsx-runtime").JSX.Element) & {
|
|
2
2
|
Input: import("react").ForwardRefExoticComponent<import("./combobox-input").ComboboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
3
|
-
Content: import("react").ForwardRefExoticComponent<import("./combobox-content").ComboboxContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
-
Item: import("react").ForwardRefExoticComponent<import("./combobox-item").ComboboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
-
Group: import("react").ForwardRefExoticComponent<Omit<import("@
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Label: import("react").ForwardRefExoticComponent<Omit<import("@ariakit/react").ComboboxGroupLabelOptions<"div"> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@ariakit/react").ComboboxGroupLabelOptions<T_1>> & {
|
|
9
|
-
[index: `data-${string}`]: unknown;
|
|
10
|
-
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
-
Separator: import("react").ForwardRefExoticComponent<Omit<import("@ariakit/react").ComboboxSeparatorOptions<"hr"> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, keyof import("@ariakit/react").ComboboxSeparatorOptions<T_2>> & {
|
|
12
|
-
[index: `data-${string}`]: unknown;
|
|
13
|
-
}, "ref"> & import("react").RefAttributes<HTMLHRElement>>;
|
|
3
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("./combobox-content").ComboboxContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("./combobox-item").ComboboxItemProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Separator: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
8
|
};
|
|
15
9
|
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../components/combobox/combobox.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ;;;;;;;CAOnB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"content":"combobox-module_content__5b8Oc","list":"combobox-module_list__0Kbu0","itemIcon":"combobox-module_itemIcon__bbgmL","menuitem":"combobox-module_menuitem__6PPmr","label":"combobox-module_label__oU1VF","separator":"combobox-module_separator__nn47j"};
|
|
5
|
+
var styles = {"positioner":"combobox-module_positioner__4Dnxn","content":"combobox-module_content__5b8Oc","list":"combobox-module_list__0Kbu0","itemIcon":"combobox-module_itemIcon__bbgmL","menuitem":"combobox-module_menuitem__6PPmr","label":"combobox-module_label__oU1VF","separator":"combobox-module_separator__nn47j"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
8
8
|
//# sourceMappingURL=combobox.module.css.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"content":"combobox-module_content__5b8Oc","list":"combobox-module_list__0Kbu0","itemIcon":"combobox-module_itemIcon__bbgmL","menuitem":"combobox-module_menuitem__6PPmr","label":"combobox-module_label__oU1VF","separator":"combobox-module_separator__nn47j"};
|
|
1
|
+
var styles = {"positioner":"combobox-module_positioner__4Dnxn","content":"combobox-module_content__5b8Oc","list":"combobox-module_list__0Kbu0","itemIcon":"combobox-module_itemIcon__bbgmL","menuitem":"combobox-module_menuitem__6PPmr","label":"combobox-module_label__oU1VF","separator":"combobox-module_separator__nn47j"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=combobox.module.css.js.map
|