@gears-frontx/ui-kit 0.3.0-alpha.3 → 0.4.0-alpha.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 +28 -6
- package/dist/accordion.d.ts +1 -0
- package/dist/accordion.js +35 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert-dialog.d.ts +1 -0
- package/dist/alert-dialog.js +97 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/alert.d.ts +1 -0
- package/dist/alert.js +39 -0
- package/dist/alert.js.map +1 -0
- package/dist/aspect-ratio.d.ts +1 -0
- package/dist/aspect-ratio.js +19 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/attachment.d.ts +1 -0
- package/dist/attachment.js +133 -0
- package/dist/attachment.js.map +1 -0
- package/dist/avatar.d.ts +1 -0
- package/dist/avatar.js +87 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.js +32 -46
- package/dist/badge.js.map +1 -1
- package/dist/breadcrumb.d.ts +1 -0
- package/dist/breadcrumb.js +81 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/bubble.d.ts +1 -0
- package/dist/bubble.js +94 -0
- package/dist/bubble.js.map +1 -0
- package/dist/button-group.d.ts +1 -0
- package/dist/button-group.js +61 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.js +30 -29
- package/dist/button.js.map +1 -1
- package/dist/calendar.d.ts +1 -0
- package/dist/calendar.js +134 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.js +24 -24
- package/dist/carousel.d.ts +1 -0
- package/dist/carousel.js +163 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +202 -0
- package/dist/chart.js.map +1 -0
- package/dist/checkbox.js +14 -39
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/accordion.X_AK08Iv.css +1 -0
- package/dist/chunks/alert-dialog.B50f-Gsz.css +1 -0
- package/dist/chunks/alert.BJLRcB65.css +1 -0
- package/dist/chunks/aspect-ratio.DJbPE7BX.css +1 -0
- package/dist/chunks/attachment.rknKEWlr.css +1 -0
- package/dist/chunks/avatar.CsQmQnay.css +1 -0
- package/dist/chunks/badge.DR0epAiZ.css +1 -0
- package/dist/chunks/breadcrumb.QKz32ceR.css +1 -0
- package/dist/chunks/bubble.BKcAopT7.css +1 -0
- package/dist/chunks/button-group.D0Ir-jbL.css +1 -0
- package/dist/chunks/button.D69BdJF1.css +1 -0
- package/dist/chunks/calendar.Cnbv4EzY.css +1 -0
- package/dist/chunks/card.D3Ct_dza.css +1 -0
- package/dist/chunks/carousel.CjaKGN_D.css +1 -0
- package/dist/chunks/chart.CeyctrXQ.css +1 -0
- package/dist/chunks/checkbox.CZfE_PkU.css +1 -0
- package/dist/chunks/collapsible.BQ-sU5sQ.css +1 -0
- package/dist/chunks/combobox.CtYpZAKB.css +1 -0
- package/dist/chunks/command.Km60IuqD.css +1 -0
- package/dist/chunks/context-menu.Bjib7_AL.css +1 -0
- package/dist/chunks/data-table.DECm3qI-.css +1 -0
- package/dist/chunks/date-picker.BcRqyOg8.css +1 -0
- package/dist/chunks/dialog.BxcZ12Gb.css +1 -0
- package/dist/chunks/drawer.BkS_qEHj.css +1 -0
- package/dist/chunks/dropdown-menu.CDaeWYDT.css +1 -0
- package/dist/chunks/empty.B334jSES.css +1 -0
- package/dist/chunks/field.yTrg1G90.css +1 -0
- package/dist/chunks/hover-card.DmwvigMp.css +1 -0
- package/dist/chunks/input-group.CFIUP-Oh.css +1 -0
- package/dist/chunks/input-otp.XSpqyVij.css +1 -0
- package/dist/chunks/input.DvA_mTq8.css +1 -0
- package/dist/chunks/item.CLg1KaYF.css +1 -0
- package/dist/chunks/kbd.DZuUVB_m.css +1 -0
- package/dist/chunks/marker.DDxI_rZn.css +1 -0
- package/dist/chunks/menubar.CxRNI9o4.css +1 -0
- package/dist/chunks/message-scroller.CbLooS7Q.css +1 -0
- package/dist/chunks/message.BhD5JDJK.css +1 -0
- package/dist/chunks/native-select.BdYLTCZv.css +1 -0
- package/dist/chunks/navigation-menu.C2JGHAKD.css +1 -0
- package/dist/chunks/pagination.DUiQuWla.css +1 -0
- package/dist/chunks/popover.fOvPrnsr.css +1 -0
- package/dist/chunks/progress.Bp13t8iw.css +1 -0
- package/dist/chunks/questionnaire.DYnuWKAQ.css +1 -0
- package/dist/chunks/radio-group.CV3MBCsI.css +1 -0
- package/dist/chunks/resizable.B71V-1lR.css +1 -0
- package/dist/chunks/scroll-area.C4kWMAsU.css +1 -0
- package/dist/chunks/select.iEwV-sfJ.css +1 -0
- package/dist/chunks/sheet.DALPg9vf.css +1 -0
- package/dist/chunks/sidebar.CGTQhfWG.css +1 -0
- package/dist/chunks/slider.B5nouD7J.css +1 -0
- package/dist/chunks/spinner.UKK4f1tu.css +1 -0
- package/dist/chunks/switch.CIW9Jr1x.css +1 -0
- package/dist/chunks/table.CFAJfhd-.css +1 -0
- package/dist/chunks/tabs.C4jGj2Vg.css +1 -0
- package/dist/chunks/textarea.ORRSI69B.css +1 -0
- package/dist/chunks/toggle-group.Bd0cCCnV.css +1 -0
- package/dist/chunks/toggle.B9tvfl1n.css +1 -0
- package/dist/collapsible.d.ts +1 -0
- package/dist/collapsible.js +22 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/combobox.d.ts +1 -0
- package/dist/combobox.js +159 -0
- package/dist/combobox.js.map +1 -0
- package/dist/command.d.ts +1 -0
- package/dist/command.js +75 -0
- package/dist/command.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts +24 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/public.d.ts +2 -0
- package/dist/components/accordion/public.d.ts.map +1 -0
- package/dist/components/alert/alert.d.ts +21 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/public.d.ts +2 -0
- package/dist/components/alert/public.d.ts.map +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +95 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog/public.d.ts +2 -0
- package/dist/components/alert-dialog/public.d.ts.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio/public.d.ts +2 -0
- package/dist/components/aspect-ratio/public.d.ts.map +1 -0
- package/dist/components/attachment/attachment.d.ts +71 -0
- package/dist/components/attachment/attachment.d.ts.map +1 -0
- package/dist/components/attachment/public.d.ts +2 -0
- package/dist/components/attachment/public.d.ts.map +1 -0
- package/dist/components/avatar/avatar.d.ts +40 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/public.d.ts +2 -0
- package/dist/components/avatar/public.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +3 -16
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/public.d.ts +1 -1
- package/dist/components/badge/public.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +19 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/public.d.ts +2 -0
- package/dist/components/breadcrumb/public.d.ts.map +1 -0
- package/dist/components/bubble/bubble.d.ts +35 -0
- package/dist/components/bubble/bubble.d.ts.map +1 -0
- package/dist/components/bubble/public.d.ts +2 -0
- package/dist/components/bubble/public.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +1 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/public.d.ts +1 -1
- package/dist/components/button/public.d.ts.map +1 -1
- package/dist/components/button-group/button-group.d.ts +17 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -0
- package/dist/components/button-group/public.d.ts +2 -0
- package/dist/components/button-group/public.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +29 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/public.d.ts +2 -0
- package/dist/components/calendar/public.d.ts.map +1 -0
- package/dist/components/carousel/carousel.d.ts +43 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/public.d.ts +2 -0
- package/dist/components/carousel/public.d.ts.map +1 -0
- package/dist/components/chart/chart.d.ts +48 -0
- package/dist/components/chart/chart.d.ts.map +1 -0
- package/dist/components/chart/public.d.ts +2 -0
- package/dist/components/chart/public.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.d.ts +14 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible/public.d.ts +2 -0
- package/dist/components/collapsible/public.d.ts.map +1 -0
- package/dist/components/combobox/combobox.d.ts +128 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/public.d.ts +2 -0
- package/dist/components/combobox/public.d.ts.map +1 -0
- package/dist/components/command/command.d.ts +44 -0
- package/dist/components/command/command.d.ts.map +1 -0
- package/dist/components/command/public.d.ts +2 -0
- package/dist/components/command/public.d.ts.map +1 -0
- package/dist/components/context-menu/context-menu.d.ts +82 -0
- package/dist/components/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu/public.d.ts +2 -0
- package/dist/components/context-menu/public.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +81 -0
- package/dist/components/data-table/data-table.d.ts.map +1 -0
- package/dist/components/data-table/public.d.ts +2 -0
- package/dist/components/data-table/public.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +76 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/public.d.ts +2 -0
- package/dist/components/date-picker/public.d.ts.map +1 -0
- package/dist/components/dialog/dialog.d.ts +12 -3
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/direction/direction.d.ts +2 -0
- package/dist/components/direction/direction.d.ts.map +1 -0
- package/dist/components/direction/public.d.ts +2 -0
- package/dist/components/direction/public.d.ts.map +1 -0
- package/dist/components/drawer/drawer.d.ts +83 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/public.d.ts +2 -0
- package/dist/components/drawer/public.d.ts.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +1 -4
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/empty/empty.d.ts +23 -0
- package/dist/components/empty/empty.d.ts.map +1 -0
- package/dist/components/empty/public.d.ts +2 -0
- package/dist/components/empty/public.d.ts.map +1 -0
- package/dist/components/field/field.d.ts +33 -12
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/public.d.ts +1 -1
- package/dist/components/field/public.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts +33 -0
- package/dist/components/hover-card/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card/public.d.ts +2 -0
- package/dist/components/hover-card/public.d.ts.map +1 -0
- package/dist/components/input-group/input-group.d.ts +38 -0
- package/dist/components/input-group/input-group.d.ts.map +1 -0
- package/dist/components/input-group/public.d.ts +2 -0
- package/dist/components/input-group/public.d.ts.map +1 -0
- package/dist/components/input-otp/input-otp.d.ts +17 -0
- package/dist/components/input-otp/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp/public.d.ts +2 -0
- package/dist/components/input-otp/public.d.ts.map +1 -0
- package/dist/components/item/item.d.ts +47 -0
- package/dist/components/item/item.d.ts.map +1 -0
- package/dist/components/item/public.d.ts +2 -0
- package/dist/components/item/public.d.ts.map +1 -0
- package/dist/components/kbd/kbd.d.ts +8 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -0
- package/dist/components/kbd/public.d.ts +2 -0
- package/dist/components/kbd/public.d.ts.map +1 -0
- package/dist/components/marker/marker.d.ts +19 -0
- package/dist/components/marker/marker.d.ts.map +1 -0
- package/dist/components/marker/public.d.ts +2 -0
- package/dist/components/marker/public.d.ts.map +1 -0
- package/dist/components/menubar/menubar.d.ts +57 -0
- package/dist/components/menubar/menubar.d.ts.map +1 -0
- package/dist/components/menubar/public.d.ts +2 -0
- package/dist/components/menubar/public.d.ts.map +1 -0
- package/dist/components/message/message.d.ts +35 -0
- package/dist/components/message/message.d.ts.map +1 -0
- package/dist/components/message/public.d.ts +2 -0
- package/dist/components/message/public.d.ts.map +1 -0
- package/dist/components/message-scroller/message-scroller.d.ts +75 -0
- package/dist/components/message-scroller/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller/public.d.ts +2 -0
- package/dist/components/message-scroller/public.d.ts.map +1 -0
- package/dist/components/native-select/native-select.d.ts +14 -0
- package/dist/components/native-select/native-select.d.ts.map +1 -0
- package/dist/components/native-select/public.d.ts +2 -0
- package/dist/components/native-select/public.d.ts.map +1 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +83 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu/public.d.ts +2 -0
- package/dist/components/navigation-menu/public.d.ts.map +1 -0
- package/dist/components/pagination/pagination.d.ts +37 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/public.d.ts +2 -0
- package/dist/components/pagination/public.d.ts.map +1 -0
- package/dist/components/popover/popover.d.ts +32 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/public.d.ts +2 -0
- package/dist/components/popover/public.d.ts.map +1 -0
- package/dist/components/progress/progress.d.ts +22 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/public.d.ts +2 -0
- package/dist/components/progress/public.d.ts.map +1 -0
- package/dist/components/questionnaire/public.d.ts +2 -0
- package/dist/components/questionnaire/public.d.ts.map +1 -0
- package/dist/components/questionnaire/questionnaire.d.ts +192 -0
- package/dist/components/questionnaire/questionnaire.d.ts.map +1 -0
- package/dist/components/resizable/public.d.ts +2 -0
- package/dist/components/resizable/public.d.ts.map +1 -0
- package/dist/components/resizable/resizable.d.ts +12 -0
- package/dist/components/resizable/resizable.d.ts.map +1 -0
- package/dist/components/scroll-area/public.d.ts +2 -0
- package/dist/components/scroll-area/public.d.ts.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +10 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/select/select.d.ts +3 -5
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/sheet/public.d.ts +2 -0
- package/dist/components/sheet/public.d.ts.map +1 -0
- package/dist/components/sheet/sheet.d.ts +56 -0
- package/dist/components/sheet/sheet.d.ts.map +1 -0
- package/dist/components/sidebar/public.d.ts +2 -0
- package/dist/components/sidebar/public.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +167 -0
- package/dist/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/use-mobile.d.ts +18 -0
- package/dist/components/sidebar/use-mobile.d.ts.map +1 -0
- package/dist/components/slider/public.d.ts +2 -0
- package/dist/components/slider/public.d.ts.map +1 -0
- package/dist/components/slider/slider.d.ts +6 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/spinner/public.d.ts +2 -0
- package/dist/components/spinner/public.d.ts.map +1 -0
- package/dist/components/spinner/spinner.d.ts +4 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toggle/public.d.ts +2 -0
- package/dist/components/toggle/public.d.ts.map +1 -0
- package/dist/components/toggle/toggle.d.ts +11 -0
- package/dist/components/toggle/toggle.d.ts.map +1 -0
- package/dist/components/toggle-group/public.d.ts +2 -0
- package/dist/components/toggle-group/public.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +1 -4
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/context-menu.d.ts +1 -0
- package/dist/context-menu.js +201 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/data-table.d.ts +1 -0
- package/dist/data-table.js +162 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +1 -0
- package/dist/date-picker.js +175 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.js +40 -55
- package/dist/dialog.js.map +1 -1
- package/dist/direction.d.ts +1 -0
- package/dist/direction.js +6 -0
- package/dist/direction.js.map +1 -0
- package/dist/docs/accordion.md +86 -0
- package/dist/docs/alert-dialog.md +151 -0
- package/dist/docs/alert.md +74 -0
- package/dist/docs/aspect-ratio.md +65 -0
- package/dist/docs/attachment.md +254 -0
- package/dist/docs/avatar.md +185 -0
- package/dist/docs/badge.md +72 -60
- package/dist/docs/breadcrumb.md +86 -0
- package/dist/docs/bubble.md +233 -0
- package/dist/docs/button-group.md +107 -0
- package/dist/docs/calendar.md +114 -0
- package/dist/docs/card.md +15 -7
- package/dist/docs/carousel.md +152 -0
- package/dist/docs/chart.md +174 -0
- package/dist/docs/collapsible.md +80 -0
- package/dist/docs/combobox.md +192 -0
- package/dist/docs/command.md +171 -0
- package/dist/docs/context-menu.md +173 -0
- package/dist/docs/data-table.md +183 -0
- package/dist/docs/date-picker.md +137 -0
- package/dist/docs/dialog.md +33 -0
- package/dist/docs/direction.md +51 -0
- package/dist/docs/drawer.md +242 -0
- package/dist/docs/empty.md +80 -0
- package/dist/docs/field.md +105 -38
- package/dist/docs/hover-card.md +81 -0
- package/dist/docs/input-group.md +158 -0
- package/dist/docs/input-otp.md +116 -0
- package/dist/docs/input.md +31 -20
- package/dist/docs/item.md +106 -0
- package/dist/docs/kbd.md +53 -0
- package/dist/docs/marker.md +178 -0
- package/dist/docs/menubar.md +108 -0
- package/dist/docs/message-scroller.md +221 -0
- package/dist/docs/message.md +183 -0
- package/dist/docs/native-select.md +93 -0
- package/dist/docs/navigation-menu.md +176 -0
- package/dist/docs/pagination.md +96 -0
- package/dist/docs/popover.md +87 -0
- package/dist/docs/progress.md +58 -0
- package/dist/docs/questionnaire.md +311 -0
- package/dist/docs/resizable.md +95 -0
- package/dist/docs/scroll-area.md +93 -0
- package/dist/docs/sheet.md +168 -0
- package/dist/docs/sidebar.md +309 -0
- package/dist/docs/slider.md +66 -0
- package/dist/docs/spinner.md +55 -0
- package/dist/docs/table.md +85 -20
- package/dist/docs/textarea.md +19 -2
- package/dist/docs/toggle-group.md +77 -0
- package/dist/docs/toggle.md +58 -0
- package/dist/docs/typeset.md +75 -0
- package/dist/drawer.d.ts +1 -0
- package/dist/drawer.js +120 -0
- package/dist/drawer.js.map +1 -0
- package/dist/dropdown-menu.js +98 -130
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/empty.d.ts +1 -0
- package/dist/empty.js +50 -0
- package/dist/empty.js.map +1 -0
- package/dist/field.js +105 -20
- package/dist/field.js.map +1 -1
- package/dist/hover-card.d.ts +1 -0
- package/dist/hover-card.js +44 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +431 -93
- package/dist/index.js.map +1 -1
- package/dist/input-group.d.ts +1 -0
- package/dist/input-group.js +91 -0
- package/dist/input-group.js.map +1 -0
- package/dist/input-otp.d.ts +1 -0
- package/dist/input-otp.js +28 -0
- package/dist/input-otp.js.map +1 -0
- package/dist/input.js +17 -17
- package/dist/item.d.ts +1 -0
- package/dist/item.js +107 -0
- package/dist/item.js.map +1 -0
- package/dist/kbd.d.ts +1 -0
- package/dist/kbd.js +17 -0
- package/dist/kbd.js.map +1 -0
- package/dist/marker.d.ts +1 -0
- package/dist/marker.js +52 -0
- package/dist/marker.js.map +1 -0
- package/dist/menubar.d.ts +1 -0
- package/dist/menubar.js +50 -0
- package/dist/menubar.js.map +1 -0
- package/dist/message-scroller.d.ts +1 -0
- package/dist/message-scroller.js +69 -0
- package/dist/message-scroller.js.map +1 -0
- package/dist/message.d.ts +1 -0
- package/dist/message.js +37 -0
- package/dist/message.js.map +1 -0
- package/dist/native-select.d.ts +1 -0
- package/dist/native-select.js +42 -0
- package/dist/native-select.js.map +1 -0
- package/dist/navigation-menu.d.ts +1 -0
- package/dist/navigation-menu.js +97 -0
- package/dist/navigation-menu.js.map +1 -0
- package/dist/pagination.d.ts +1 -0
- package/dist/pagination.js +104 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +59 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.d.ts +1 -0
- package/dist/progress.js +36 -0
- package/dist/progress.js.map +1 -0
- package/dist/questionnaire.d.ts +1 -0
- package/dist/questionnaire.js +209 -0
- package/dist/questionnaire.js.map +1 -0
- package/dist/radio-group.js +7 -7
- package/dist/resizable.d.ts +1 -0
- package/dist/resizable.js +24 -0
- package/dist/resizable.js.map +1 -0
- package/dist/scroll-area.d.ts +1 -0
- package/dist/scroll-area.js +32 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/select.js +83 -107
- package/dist/select.js.map +1 -1
- package/dist/sheet.d.ts +1 -0
- package/dist/sheet.js +94 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sidebar.d.ts +1 -0
- package/dist/sidebar.js +386 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/slider.d.ts +1 -0
- package/dist/slider.js +40 -0
- package/dist/slider.js.map +1 -0
- package/dist/spinner.d.ts +1 -0
- package/dist/spinner.js +21 -0
- package/dist/spinner.js.map +1 -0
- package/dist/switch.js +11 -11
- package/dist/table.js +34 -35
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +17 -17
- package/dist/textarea.js +14 -7
- package/dist/textarea.js.map +1 -1
- package/dist/theme.css +35 -20
- package/dist/toast.js +54 -164
- package/dist/toast.js.map +1 -1
- package/dist/toggle-group.d.ts +1 -0
- package/dist/toggle-group.js +46 -0
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle.d.ts +1 -0
- package/dist/toggle.js +39 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tooltip.js.map +1 -1
- package/dist/typeset.css +532 -0
- package/dist/utilities.css +583 -0
- package/llms.txt +268 -24
- package/package.json +15 -3
- package/dist/chunks/badge.BcdxDzJ7.css +0 -1
- package/dist/chunks/button.DNo8DTR3.css +0 -1
- package/dist/chunks/card.B0AcyAT1.css +0 -1
- package/dist/chunks/checkbox.D3kdAalh.css +0 -1
- package/dist/chunks/dialog.D6LS2vnG.css +0 -1
- package/dist/chunks/dropdown-menu.DmDZc5gB.css +0 -1
- package/dist/chunks/field.BNZx8HfN.css +0 -1
- package/dist/chunks/input.C8RDCC-a.css +0 -1
- package/dist/chunks/radio-group.zAFY9yCF.css +0 -1
- package/dist/chunks/select.Dt0diN4P.css +0 -1
- package/dist/chunks/switch.CsaIRnCA.css +0 -1
- package/dist/chunks/table.BuWHXL6e.css +0 -1
- package/dist/chunks/tabs.KEksCAxN.css +0 -1
- package/dist/chunks/textarea.N3iiWUuz.css +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Carousel
|
|
2
|
+
|
|
3
|
+
An embla-carousel-react wrapper — a scroll-snapping track of slides with
|
|
4
|
+
optional Previous/Next controls and keyboard navigation. No Base UI
|
|
5
|
+
primitive exists for this (confirmed against Base UI v1.7.0), so
|
|
6
|
+
`Carousel` owns the embla instance directly and
|
|
7
|
+
shares it with its parts through context.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- A horizontally (or vertically) scrolling set of cards, images, or panels
|
|
12
|
+
where only one (or a few) is visible at a time and the user steps through
|
|
13
|
+
them — a product gallery, a testimonial strip, an onboarding sequence.
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
|
|
17
|
+
- A tabbed panel switcher with no scroll-snap feel — use `Tabs`.
|
|
18
|
+
- A plain overflowing row a user can free-scroll (no snapping, no
|
|
19
|
+
Previous/Next affordance needed) — a native `overflow-x: auto` container
|
|
20
|
+
is simpler and needs no dependency.
|
|
21
|
+
|
|
22
|
+
## Parts
|
|
23
|
+
|
|
24
|
+
| Part | Renders | Notes |
|
|
25
|
+
|------|---------|-------|
|
|
26
|
+
| `Carousel` | `<div role="region">` | Owns the embla instance; provides context to every part below |
|
|
27
|
+
| `CarouselContent` | Two nested `<div>`s | Outer is embla's scroll viewport (`overflow: hidden`); inner is the flex track embla translates |
|
|
28
|
+
| `CarouselItem` | `<div role="group">` | One slide; `aria-roledescription="slide"` |
|
|
29
|
+
| `CarouselPrevious` | `Button` | Icon-only, `variant="outline"` `size="sm"` by default |
|
|
30
|
+
| `CarouselNext` | `Button` | Same as `CarouselPrevious`, mirrored |
|
|
31
|
+
|
|
32
|
+
## Props (kit level)
|
|
33
|
+
|
|
34
|
+
`Carousel`:
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default |
|
|
37
|
+
|------|------|---------|
|
|
38
|
+
| `orientation` | `horizontal` \| `vertical` | `horizontal` |
|
|
39
|
+
| `opts` | embla `EmblaOptionsType` | — |
|
|
40
|
+
| `plugins` | embla `EmblaPluginType[]` | — |
|
|
41
|
+
| `setApi` | `(api: CarouselApi) => void` | — |
|
|
42
|
+
| `className` | `string` | — |
|
|
43
|
+
|
|
44
|
+
Every other part forwards its underlying element's native props, plus
|
|
45
|
+
`CarouselPrevious`/`CarouselNext` forward every `Button` prop except `icon`
|
|
46
|
+
(fixed to the chevron glyph — see below) — `variant`, `size`, `aria-label`,
|
|
47
|
+
`onClick`, `disabled`, etc. all pass through and override the computed
|
|
48
|
+
defaults.
|
|
49
|
+
|
|
50
|
+
`orientation` reaches every part through context, not a prop each part
|
|
51
|
+
takes individually — set it once on `Carousel` and `CarouselContent`,
|
|
52
|
+
`CarouselItem`, `CarouselPrevious`, and `CarouselNext` all read it off
|
|
53
|
+
`data-orientation`.
|
|
54
|
+
|
|
55
|
+
### Spacing contract
|
|
56
|
+
|
|
57
|
+
`CarouselContent`'s viewport clips overflow (`overflow: hidden`), and
|
|
58
|
+
`CarouselItem` only pads its *leading* edge — the inter-item gap upstream's
|
|
59
|
+
`pl-4`/`-ml-4` (horizontal) or `pt-4`/`-mt-4` (vertical) pair produces. It
|
|
60
|
+
does not pad a slide's trailing or cross-axis edges. A bordered element
|
|
61
|
+
(a `Card`, an image, anything with a visible edge) placed directly inside
|
|
62
|
+
`CarouselItem` therefore fills the item flush to those un-padded sides,
|
|
63
|
+
which can coincide with the viewport's clipped bounds and cut the border
|
|
64
|
+
off there. Wrap such content in a padding div — `--space-1` matches
|
|
65
|
+
upstream's own `p-1` — the same way every example below does:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<CarouselItem>
|
|
69
|
+
<div style={{ padding: 'var(--space-1)' }}>
|
|
70
|
+
<Card>...</Card>
|
|
71
|
+
</div>
|
|
72
|
+
</CarouselItem>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Content with no visible edge (plain text, an unbordered image) doesn't
|
|
76
|
+
need the wrapper.
|
|
77
|
+
|
|
78
|
+
`useCarousel()` is also exported: the same context hook every part above
|
|
79
|
+
uses internally, for building custom controls (a slide counter, dot
|
|
80
|
+
indicators) that need `canScrollPrev`/`canScrollNext`/`scrollPrev`/
|
|
81
|
+
`scrollNext`/the raw embla `api`. It throws outside a `<Carousel>`.
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import {
|
|
87
|
+
Carousel,
|
|
88
|
+
CarouselContent,
|
|
89
|
+
CarouselItem,
|
|
90
|
+
CarouselNext,
|
|
91
|
+
CarouselPrevious,
|
|
92
|
+
} from '@gears-frontx/ui-kit';
|
|
93
|
+
|
|
94
|
+
// Horizontal (default), with nav buttons
|
|
95
|
+
<Carousel>
|
|
96
|
+
<CarouselContent>
|
|
97
|
+
<CarouselItem>Slide 1</CarouselItem>
|
|
98
|
+
<CarouselItem>Slide 2</CarouselItem>
|
|
99
|
+
<CarouselItem>Slide 3</CarouselItem>
|
|
100
|
+
</CarouselContent>
|
|
101
|
+
<CarouselPrevious />
|
|
102
|
+
<CarouselNext />
|
|
103
|
+
</Carousel>
|
|
104
|
+
|
|
105
|
+
// Vertical
|
|
106
|
+
<Carousel orientation="vertical" opts={{ align: 'start' }}>
|
|
107
|
+
<CarouselContent>
|
|
108
|
+
<CarouselItem>Slide 1</CarouselItem>
|
|
109
|
+
<CarouselItem>Slide 2</CarouselItem>
|
|
110
|
+
</CarouselContent>
|
|
111
|
+
<CarouselPrevious />
|
|
112
|
+
<CarouselNext />
|
|
113
|
+
</Carousel>
|
|
114
|
+
|
|
115
|
+
// Reading embla's own API for a custom slide counter
|
|
116
|
+
function CountedCarousel() {
|
|
117
|
+
const [api, setApi] = useState<CarouselApi>();
|
|
118
|
+
const [current, setCurrent] = useState(0);
|
|
119
|
+
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!api) return;
|
|
122
|
+
api.on('select', () => setCurrent(api.selectedScrollSnap()));
|
|
123
|
+
}, [api]);
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<Carousel setApi={setApi}>
|
|
127
|
+
<CarouselContent>{/* items */}</CarouselContent>
|
|
128
|
+
<p>Slide {current + 1}</p>
|
|
129
|
+
</Carousel>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Anti-patterns
|
|
135
|
+
|
|
136
|
+
- Do not render `CarouselItem`, `CarouselContent`, `CarouselPrevious`, or
|
|
137
|
+
`CarouselNext` outside a `Carousel` — they call `useCarousel()`
|
|
138
|
+
internally and throw immediately (`useCarousel must be used within a
|
|
139
|
+
<Carousel />`) rather than silently rendering broken.
|
|
140
|
+
- Do not pass `icon` to `CarouselPrevious`/`CarouselNext` expecting to swap
|
|
141
|
+
the glyph — that prop is intentionally omitted from their type (the kit
|
|
142
|
+
inlines the chevron SVGs directly, same precedent as `Spinner`/
|
|
143
|
+
`Pagination`); style via `className` instead, or compose your own button
|
|
144
|
+
from `useCarousel()`'s `scrollPrev`/`scrollNext`/`canScrollPrev`/
|
|
145
|
+
`canScrollNext` if a different control entirely is needed.
|
|
146
|
+
- Keyboard navigation only wires `ArrowLeft`/`ArrowRight`, even in the
|
|
147
|
+
`vertical` orientation — this replicates upstream's own behavior exactly
|
|
148
|
+
(see carousel.tsx), it is not a kit-side bug to work around.
|
|
149
|
+
- Do not place a bordered element directly inside `CarouselItem` without
|
|
150
|
+
the padding wrapper from "Spacing contract" above — its trailing and
|
|
151
|
+
cross-axis edges have no padding of their own, so the border sits flush
|
|
152
|
+
against the viewport's clipped bounds and gets cut off there.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Chart
|
|
2
|
+
|
|
3
|
+
A themeable wrapper around [Recharts](https://recharts.org), faithfully
|
|
4
|
+
porting [shadcn/ui's base Chart](https://ui.shadcn.com/docs/components/base/chart):
|
|
5
|
+
`ChartContainer` (Recharts `ResponsiveContainer` + per-instance color
|
|
6
|
+
injection), `ChartTooltip`/`ChartTooltipContent`, `ChartLegend`/
|
|
7
|
+
`ChartLegendContent`, and the `ChartConfig` type. Chart draws no chart type
|
|
8
|
+
itself — bars, lines, areas, pies, etc. are Recharts components a consumer
|
|
9
|
+
composes as `ChartContainer`'s children, same as upstream.
|
|
10
|
+
|
|
11
|
+
There is no variant or size axis — upstream ships none either. Every part
|
|
12
|
+
is a single visual treatment; all styling is either fixed (grid/flex
|
|
13
|
+
layout, spacing, text roles) or supplied per-instance by the consumer's own
|
|
14
|
+
`ChartConfig`.
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<ChartContainer config={chartConfig}>
|
|
20
|
+
<BarChart data={data}>
|
|
21
|
+
<CartesianGrid vertical={false} />
|
|
22
|
+
<XAxis dataKey="month" />
|
|
23
|
+
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
|
|
24
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
25
|
+
<ChartLegend content={<ChartLegendContent />} />
|
|
26
|
+
</BarChart>
|
|
27
|
+
</ChartContainer>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`ChartContainer` provides the `ChartConfig` to `ChartTooltipContent`/
|
|
31
|
+
`ChartLegendContent` via context — both throw if rendered outside one.
|
|
32
|
+
`ChartTooltip`/`ChartLegend` are plain re-exports of Recharts'
|
|
33
|
+
`Tooltip`/`Legend`; pass the kit's `*Content` components as their
|
|
34
|
+
`content` prop for themed rendering, or omit `content` for Recharts'
|
|
35
|
+
own default.
|
|
36
|
+
|
|
37
|
+
## Series colors: `ChartConfig`, not `--chart-*` tokens
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
type ChartConfig = Record<
|
|
41
|
+
string,
|
|
42
|
+
{ label?: ReactNode; icon?: ComponentType } & (
|
|
43
|
+
| { color?: string }
|
|
44
|
+
| { theme: { light: string; dark: string } }
|
|
45
|
+
)
|
|
46
|
+
>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Every series gets its color from `ChartConfig` — either a flat `color`
|
|
50
|
+
(one value for both themes) or a `theme` map with independent
|
|
51
|
+
`light`/`dark` values. `ChartContainer` reads this config and injects a
|
|
52
|
+
`--color-<key>` custom property per entry, scoped to that chart instance;
|
|
53
|
+
a series then paints itself with `fill="var(--color-<key>)"` /
|
|
54
|
+
`stroke="var(--color-<key>)"` on its own Recharts element:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const chartConfig = {
|
|
58
|
+
desktop: { label: 'Desktop', color: 'var(--primary)' },
|
|
59
|
+
mobile: { label: 'Mobile', theme: { light: '#e11d48', dark: '#fb7185' } },
|
|
60
|
+
} satisfies ChartConfig;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**This kit does not ship `--chart-1` through `--chart-5`.** Upstream's own
|
|
64
|
+
docs use those as example *values* for `ChartConfig`'s `color` field
|
|
65
|
+
(`color: "var(--chart-1)"`) — a convenience palette, not part of the
|
|
66
|
+
mechanism itself, which only ever reads whatever string `ChartConfig`
|
|
67
|
+
supplies. `theme.css` is frozen for this port and defines no such tokens,
|
|
68
|
+
so they are not available as a shorthand today. A consumer can reference
|
|
69
|
+
any existing kit token (`var(--primary)`, `var(--info)`, ...), a literal
|
|
70
|
+
color, or its own palette. **Open integrator decision:** if a fixed,
|
|
71
|
+
theme-aware chart palette (`--chart-1`..`--chart-5`) is wanted as a kit
|
|
72
|
+
default, it needs a `theme.css` addition — out of scope for this port.
|
|
73
|
+
|
|
74
|
+
### Dark mode
|
|
75
|
+
|
|
76
|
+
`ChartConfig['theme']` keys are exactly `light`/`dark`, matching upstream.
|
|
77
|
+
What differs is the selector `ChartStyle` compiles them to: upstream emits
|
|
78
|
+
a single `.dark [data-chart=id] { ... }` block (a Tailwind dark-mode
|
|
79
|
+
class this kit doesn't have); this port emits the kit's own dual dark
|
|
80
|
+
mechanism instead — `[data-theme='dark'] [data-chart=id]` plus a
|
|
81
|
+
`prefers-color-scheme` fallback guarded by `:not([data-theme='light'])`,
|
|
82
|
+
mirroring `theme.css`'s own light/dark selectors. Nothing about the public
|
|
83
|
+
API changes — only the CSS text `ChartStyle` generates internally.
|
|
84
|
+
|
|
85
|
+
## Props (kit level)
|
|
86
|
+
|
|
87
|
+
`ChartContainer`:
|
|
88
|
+
|
|
89
|
+
| Prop | Type | Default |
|
|
90
|
+
|------|------|---------|
|
|
91
|
+
| `config` | `ChartConfig` — **required** | — |
|
|
92
|
+
| `children` | Recharts chart element(s) — **required** | — |
|
|
93
|
+
| `id` | `string` — seeds the `data-chart` scoping id | generated |
|
|
94
|
+
| `initialDimension` | `{ width: number; height: number }` — size Recharts assumes before its first real measurement | `{ width: 320, height: 200 }` |
|
|
95
|
+
| `className` | `string` — merged after the kit class | — |
|
|
96
|
+
|
|
97
|
+
`ChartTooltipContent` (all optional): `indicator` (`'dot'` \| `'line'` \|
|
|
98
|
+
`'dashed'`, default `'dot'`), `hideLabel`, `hideIndicator`, `label`,
|
|
99
|
+
`labelFormatter`, `labelClassName`, `formatter`, `color` (overrides every
|
|
100
|
+
row's indicator color), `nameKey`, `labelKey`, plus Recharts' own
|
|
101
|
+
`Tooltip`/`DefaultTooltipContent` props (forwarded, not re-documented
|
|
102
|
+
here — see Recharts' docs).
|
|
103
|
+
|
|
104
|
+
`ChartLegendContent` (all optional): `hideIcon`, `nameKey`,
|
|
105
|
+
`verticalAlign` (`'top'` places the legend's padding above the chart
|
|
106
|
+
instead of below), plus Recharts' own `Legend` content props.
|
|
107
|
+
|
|
108
|
+
## Porting notes
|
|
109
|
+
|
|
110
|
+
All twelve of the `[&_.recharts-*]` descendant rules upstream applies to
|
|
111
|
+
`ChartContainer`'s root are ported, including the five that retint
|
|
112
|
+
Recharts' own stock-coloured elements: `[stroke='#ccc']` (default
|
|
113
|
+
cartesian/polar grid lines and reference lines) picks up `--border`, and
|
|
114
|
+
`[stroke='#fff']` (default dot and sector outlines, drawn for a white
|
|
115
|
+
page) goes transparent. So a chart that leaves `CartesianGrid`/
|
|
116
|
+
`ReferenceLine` unstyled reads correctly in dark mode instead of showing
|
|
117
|
+
Recharts' light-page grey.
|
|
118
|
+
|
|
119
|
+
`id` is normalized to `[A-Za-z0-9_-]` before it reaches either the
|
|
120
|
+
`data-chart` attribute or the per-instance `<style>` block, and a
|
|
121
|
+
`ChartConfig` colour containing anything that could end a declaration or
|
|
122
|
+
the style element (`;`, `{}`, `<>`, `\`, a comment marker) is dropped
|
|
123
|
+
rather than injected. Both are consumer strings landing verbatim in a
|
|
124
|
+
stylesheet; keep ids and config keys to plain identifiers and colours to
|
|
125
|
+
plain colour syntax and neither rule is noticeable. If you render
|
|
126
|
+
`ChartStyle` yourself instead of using `ChartContainer`, put the same
|
|
127
|
+
normalized id on your own `data-chart` attribute or the selector will not
|
|
128
|
+
match it.
|
|
129
|
+
|
|
130
|
+
## Examples
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import {
|
|
134
|
+
ChartContainer,
|
|
135
|
+
ChartLegend,
|
|
136
|
+
ChartLegendContent,
|
|
137
|
+
ChartTooltip,
|
|
138
|
+
ChartTooltipContent,
|
|
139
|
+
type ChartConfig,
|
|
140
|
+
} from '@gears-frontx/ui-kit';
|
|
141
|
+
import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts';
|
|
142
|
+
|
|
143
|
+
const chartConfig = {
|
|
144
|
+
desktop: { label: 'Desktop', color: 'var(--primary)' },
|
|
145
|
+
mobile: { label: 'Mobile', color: 'var(--info)' },
|
|
146
|
+
} satisfies ChartConfig;
|
|
147
|
+
|
|
148
|
+
const data = [
|
|
149
|
+
{ month: 'Jan', desktop: 186, mobile: 80 },
|
|
150
|
+
{ month: 'Feb', desktop: 305, mobile: 200 },
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
<ChartContainer config={chartConfig}>
|
|
154
|
+
<BarChart data={data}>
|
|
155
|
+
<CartesianGrid vertical={false} />
|
|
156
|
+
<XAxis dataKey="month" tickLine={false} axisLine={false} />
|
|
157
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
158
|
+
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
|
|
159
|
+
<Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
|
|
160
|
+
<ChartLegend content={<ChartLegendContent />} />
|
|
161
|
+
</BarChart>
|
|
162
|
+
</ChartContainer>;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Anti-patterns
|
|
166
|
+
|
|
167
|
+
- Do not render `ChartTooltipContent`/`ChartLegendContent` outside a
|
|
168
|
+
`ChartContainer` — both call a hook that throws without its context.
|
|
169
|
+
- Do not hardcode a series color inline on the Recharts element and skip
|
|
170
|
+
`ChartConfig` — the config is also what the tooltip/legend read back to
|
|
171
|
+
resolve each series' label and (for the legend's fallback swatch) color.
|
|
172
|
+
- Do not reach for `--chart-1`..`--chart-5` — they don't exist in this
|
|
173
|
+
kit; use `ChartConfig`'s `color`/`theme` with an existing token or a
|
|
174
|
+
literal value instead (see "Series colors" above).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Collapsible
|
|
2
|
+
|
|
3
|
+
A single expandable/collapsible section. Wraps the Base UI Collapsible
|
|
4
|
+
primitives; open/close state, keyboard interaction, and the panel's
|
|
5
|
+
height-animation values come from Base UI. No variants — this is a
|
|
6
|
+
structural, single-purpose component.
|
|
7
|
+
|
|
8
|
+
Composition: `Collapsible` (root, holds open state) → `CollapsibleTrigger`
|
|
9
|
+
(a native `<button>`) → `CollapsibleContent` (the panel, unmounted while
|
|
10
|
+
closed unless `keepMounted` is set).
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- A single section a user can show/hide on demand — "Show more", an
|
|
15
|
+
expandable filter panel, a details/summary-style block where you need
|
|
16
|
+
more control over styling or animation than the native `<details>`
|
|
17
|
+
element offers.
|
|
18
|
+
|
|
19
|
+
## When not to use
|
|
20
|
+
|
|
21
|
+
- A list of many mutually-exclusive or independently-expandable sections
|
|
22
|
+
— use `Accordion`; this component is a single panel, not a group.
|
|
23
|
+
- A popup anchored to a trigger (menu, tooltip, popover) — `Collapsible`
|
|
24
|
+
reflows the document in place; it does not portal or position content
|
|
25
|
+
relative to the trigger.
|
|
26
|
+
|
|
27
|
+
## Props (kit level)
|
|
28
|
+
|
|
29
|
+
`Collapsible` (root): `open` / `defaultOpen`, `onOpenChange`, `disabled` —
|
|
30
|
+
see Base UI `Collapsible.Root`.
|
|
31
|
+
|
|
32
|
+
`CollapsibleTrigger`: all native `<button>` props; disabled forwards to
|
|
33
|
+
the native `disabled` attribute (unlike `Button`'s own `loading`
|
|
34
|
+
handling, there is no `focusableWhenDisabled` override here).
|
|
35
|
+
|
|
36
|
+
`CollapsibleContent`: `keepMounted` (keep the panel in the DOM while
|
|
37
|
+
closed, default `false`), `hiddenUntilFound` (hide via `hidden="until-found"`
|
|
38
|
+
so the browser's built-in page search can still expand it — overrides
|
|
39
|
+
`keepMounted`), `className` — merged after the kit class.
|
|
40
|
+
|
|
41
|
+
## Behavior
|
|
42
|
+
|
|
43
|
+
- The panel animates open/close by height, using Base UI's own measured
|
|
44
|
+
content height (`--collapsible-panel-height`) rather than a fixed
|
|
45
|
+
`max-height` — the transition always matches the content's real size,
|
|
46
|
+
however tall it is.
|
|
47
|
+
- By default the panel is removed from the DOM entirely while closed (not
|
|
48
|
+
just visually hidden) — pass `keepMounted` on `CollapsibleContent` to
|
|
49
|
+
keep it mounted (e.g. so its inputs retain focus/state across toggles).
|
|
50
|
+
- `disabled` on the root suppresses the trigger's interaction; the trigger
|
|
51
|
+
itself still renders (it isn't hidden), just inert.
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@gears-frontx/ui-kit';
|
|
57
|
+
|
|
58
|
+
<Collapsible>
|
|
59
|
+
<CollapsibleTrigger>What is included?</CollapsibleTrigger>
|
|
60
|
+
<CollapsibleContent>Everything in the Pro plan, plus priority support.</CollapsibleContent>
|
|
61
|
+
</Collapsible>;
|
|
62
|
+
|
|
63
|
+
// Starts open, and stays mounted (state-preserving) while collapsed
|
|
64
|
+
<Collapsible defaultOpen>
|
|
65
|
+
<CollapsibleTrigger>Advanced options</CollapsibleTrigger>
|
|
66
|
+
<CollapsibleContent keepMounted>
|
|
67
|
+
<input placeholder="Custom endpoint" />
|
|
68
|
+
</CollapsibleContent>
|
|
69
|
+
</Collapsible>;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Anti-patterns
|
|
73
|
+
|
|
74
|
+
- Do not nest interactive controls the user needs while the panel is
|
|
75
|
+
closed inside `CollapsibleContent` without `keepMounted` — closed
|
|
76
|
+
content is removed from the DOM by default and cannot hold focus or
|
|
77
|
+
retain uncontrolled input state across a collapse.
|
|
78
|
+
- Do not reach for this component to build a menu or tooltip — it has no
|
|
79
|
+
portal, no positioning, and no dismiss-on-outside-press; see
|
|
80
|
+
`DropdownMenu`/`Tooltip`/`Dialog` for those patterns.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Combobox
|
|
2
|
+
|
|
3
|
+
A filterable text field for picking from a list, wrapping Base UI's
|
|
4
|
+
dedicated `Combobox` primitive (not a Popover+search composition). The
|
|
5
|
+
input itself displays and edits the current value; the popup filters as
|
|
6
|
+
you type. Portalled, keyboard navigation, typeahead-by-typing, and form
|
|
7
|
+
submission (hidden native input on the root) come from Base UI.
|
|
8
|
+
|
|
9
|
+
Composition, single-select: `Combobox` (root, holds the value) →
|
|
10
|
+
`ComboboxInput` (the field itself; renders its own trailing trigger/clear
|
|
11
|
+
buttons) → `ComboboxContent` → `ComboboxEmpty` / `ComboboxList` /
|
|
12
|
+
`ComboboxItem` — `ComboboxGroup` / `ComboboxLabel` / `ComboboxSeparator`
|
|
13
|
+
for grouped lists. `ComboboxContent` does not wrap its children in a list
|
|
14
|
+
the way `SelectContent` does — place `ComboboxEmpty` and `ComboboxList` as
|
|
15
|
+
its direct children yourself, so an empty-results message can sit
|
|
16
|
+
alongside (not inside) the scrolling list.
|
|
17
|
+
|
|
18
|
+
Composition, multi-select: swap `ComboboxInput` for `ComboboxChips` (a
|
|
19
|
+
container of `ComboboxChip` pills plus a trailing `ComboboxChipsInput`),
|
|
20
|
+
and anchor the popup to the chips instead of a single-line field with
|
|
21
|
+
`useComboboxAnchor()`.
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- A single value from a long or unbounded list, filterable by typing —
|
|
26
|
+
the list a `select` covers by scrolling doesn't fit a combobox until it
|
|
27
|
+
is long enough that typing beats scrolling.
|
|
28
|
+
- Multiple values from a list, shown as removable chips (`multiple`).
|
|
29
|
+
|
|
30
|
+
## When not to use
|
|
31
|
+
|
|
32
|
+
- 2–6 always-visible options — use `radio-group`.
|
|
33
|
+
- A short, non-searchable list — use `select`; a combobox invites typing a
|
|
34
|
+
query that doesn't need to exist.
|
|
35
|
+
|
|
36
|
+
## Props (kit level)
|
|
37
|
+
|
|
38
|
+
`Combobox` (root): `value` / `defaultValue`, `onValueChange`, `multiple`,
|
|
39
|
+
`name`, `disabled`, `required`, `autoHighlight` — see Base UI
|
|
40
|
+
`Combobox.Root`. Always pass `items` as well: without it, filtering and
|
|
41
|
+
the built-in label/value stringification (for `{ value, label }`-shaped
|
|
42
|
+
items) don't run.
|
|
43
|
+
|
|
44
|
+
`ComboboxInput`:
|
|
45
|
+
|
|
46
|
+
| Prop | Type | Default |
|
|
47
|
+
|------|------|---------|
|
|
48
|
+
| `showTrigger` | `boolean` — renders the trailing chevron button that opens the popup | `true` |
|
|
49
|
+
| `showClear` | `boolean` — renders a trailing clear button once a value is chosen. Base UI only mounts it while there's something to clear, and it visually replaces the trigger in the same corner rather than the two ever stacking | `false` |
|
|
50
|
+
| `toggleLabel` | `string` — accessible name for the chevron button | `'Toggle options'` |
|
|
51
|
+
| `clearLabel` | `string` — accessible name for the clear button | `'Clear value'` |
|
|
52
|
+
| `className` | `string` — merged after the kit class | — |
|
|
53
|
+
|
|
54
|
+
Both trailing buttons are icon-only, so those two labels ARE their
|
|
55
|
+
accessible names — override them for any language but English, the same
|
|
56
|
+
way `Dialog`'s `closeLabel` and `SidebarTrigger`'s `label` work.
|
|
57
|
+
|
|
58
|
+
`ComboboxContent` accepts positioning props (`side`, `sideOffset`,
|
|
59
|
+
`align`, `alignOffset`, `anchor`, plus the escape hatch for fields inside a
|
|
60
|
+
`transform`/`filter` container: `positionMethod="fixed"`,
|
|
61
|
+
`collisionBoundary`, `collisionPadding`) and `container` — the popup
|
|
62
|
+
portals to `<body>` by default, so if your theme lives on a subtree
|
|
63
|
+
(`data-theme` on a section instead of `<html>`), pass that section as
|
|
64
|
+
`container` or the popup renders with the root theme. `ComboboxItem` takes
|
|
65
|
+
`value` (required) and `disabled`. `aria-invalid` on `ComboboxInput` (or
|
|
66
|
+
`ComboboxChips`, for multi-select) switches its border and ring to the
|
|
67
|
+
destructive color.
|
|
68
|
+
|
|
69
|
+
`ComboboxChip` takes `showRemove` (`boolean`, default `true`) to omit the
|
|
70
|
+
remove button on a fixed/read-only chip, and `removeLabel` (`string`,
|
|
71
|
+
default `'Remove'`) for that button's accessible name — worth naming the
|
|
72
|
+
chip itself (`removeLabel={`Remove ${label}`}`) once a form carries
|
|
73
|
+
several.
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
Single-select, filterable, with groups:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import {
|
|
81
|
+
Combobox,
|
|
82
|
+
ComboboxContent,
|
|
83
|
+
ComboboxEmpty,
|
|
84
|
+
ComboboxGroup,
|
|
85
|
+
ComboboxInput,
|
|
86
|
+
ComboboxItem,
|
|
87
|
+
ComboboxLabel,
|
|
88
|
+
ComboboxList,
|
|
89
|
+
ComboboxSeparator,
|
|
90
|
+
} from '@gears-frontx/ui-kit';
|
|
91
|
+
|
|
92
|
+
const TIMEZONES = [
|
|
93
|
+
{ value: 'europe', label: 'Europe', items: ['Frankfurt', 'Dublin'] },
|
|
94
|
+
{ value: 'americas', label: 'Americas', items: ['Virginia', 'Oregon'] },
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
<Combobox items={TIMEZONES}>
|
|
98
|
+
<ComboboxInput aria-label="Timezone" placeholder="Select a timezone" showClear />
|
|
99
|
+
<ComboboxContent>
|
|
100
|
+
<ComboboxEmpty>No timezones found.</ComboboxEmpty>
|
|
101
|
+
<ComboboxList>
|
|
102
|
+
{(group) => (
|
|
103
|
+
<ComboboxGroup key={group.value} items={group.items}>
|
|
104
|
+
<ComboboxLabel>{group.label}</ComboboxLabel>
|
|
105
|
+
{group.items.map((item) => (
|
|
106
|
+
<ComboboxItem key={item} value={item}>
|
|
107
|
+
{item}
|
|
108
|
+
</ComboboxItem>
|
|
109
|
+
))}
|
|
110
|
+
</ComboboxGroup>
|
|
111
|
+
)}
|
|
112
|
+
</ComboboxList>
|
|
113
|
+
</ComboboxContent>
|
|
114
|
+
</Combobox>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Multi-select, chips:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import {
|
|
121
|
+
Combobox,
|
|
122
|
+
ComboboxChip,
|
|
123
|
+
ComboboxChips,
|
|
124
|
+
ComboboxChipsInput,
|
|
125
|
+
ComboboxContent,
|
|
126
|
+
ComboboxEmpty,
|
|
127
|
+
ComboboxItem,
|
|
128
|
+
ComboboxList,
|
|
129
|
+
ComboboxValue,
|
|
130
|
+
useComboboxAnchor,
|
|
131
|
+
} from '@gears-frontx/ui-kit';
|
|
132
|
+
|
|
133
|
+
function FrameworkPicker() {
|
|
134
|
+
const anchor = useComboboxAnchor();
|
|
135
|
+
return (
|
|
136
|
+
<Combobox multiple items={FRAMEWORKS}>
|
|
137
|
+
<ComboboxChips ref={anchor}>
|
|
138
|
+
<ComboboxValue>
|
|
139
|
+
{(values: string[]) =>
|
|
140
|
+
values.map((value) => (
|
|
141
|
+
<ComboboxChip key={value}>{value}</ComboboxChip>
|
|
142
|
+
))
|
|
143
|
+
}
|
|
144
|
+
</ComboboxValue>
|
|
145
|
+
<ComboboxChipsInput aria-label="Frameworks" placeholder="Add a framework" />
|
|
146
|
+
</ComboboxChips>
|
|
147
|
+
<ComboboxContent anchor={anchor}>
|
|
148
|
+
<ComboboxEmpty>No frameworks found.</ComboboxEmpty>
|
|
149
|
+
<ComboboxList>
|
|
150
|
+
{(item: string) => <ComboboxItem key={item} value={item}>{item}</ComboboxItem>}
|
|
151
|
+
</ComboboxList>
|
|
152
|
+
</ComboboxContent>
|
|
153
|
+
</Combobox>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Not ported from upstream
|
|
159
|
+
|
|
160
|
+
Upstream's own `combobox.tsx` (the shadcn/ui base-variant registry file
|
|
161
|
+
this was ported from) surfaces only a subset of Base UI's Combobox
|
|
162
|
+
primitive. Skipped for the same reason upstream skips them — no kit API
|
|
163
|
+
exists beyond what upstream demonstrates:
|
|
164
|
+
|
|
165
|
+
- `Combobox.Row` / `virtualized` — virtualized/grid list rendering.
|
|
166
|
+
- `Combobox.Status` — a live-region announcer separate from `Empty`.
|
|
167
|
+
- `Combobox.Backdrop` / `Combobox.Arrow` / `Combobox.Icon` — upstream
|
|
168
|
+
renders no modal backdrop, no positioner arrow, and inlines its chevron
|
|
169
|
+
as a plain child rather than through the `Icon` part.
|
|
170
|
+
- `Combobox.InputGroup` (the Base UI part, distinct from the unrelated
|
|
171
|
+
shadcn `input-group` registry component upstream actually composes
|
|
172
|
+
with) — never referenced by upstream's own source.
|
|
173
|
+
- `useFilter` / `useFilteredItems` — upstream relies on `Combobox.Root`'s
|
|
174
|
+
built-in filtering (pass `items`); these hooks are for externally
|
|
175
|
+
controlled filtering, which upstream's example never does.
|
|
176
|
+
- A standalone `Clear` export — upstream defines `ComboboxClear` but does
|
|
177
|
+
not export it from its file; it only appears composed into its
|
|
178
|
+
`ComboboxInput` via `showClear`, which this kit mirrors exactly.
|
|
179
|
+
|
|
180
|
+
`ComboboxInput`'s field text also skips the literal-1rem/1.5rem small-screen
|
|
181
|
+
step `input.module.css`/`textarea.module.css` drop to below the desktop
|
|
182
|
+
breakpoint (an iOS Safari focus-zoom guard) — that pattern depends on a
|
|
183
|
+
`tokens.test.ts` `EXCEPTIONS` entry naming the file, and this port is out of
|
|
184
|
+
scope to add `combobox.module.css`'s own entry to that list. `.input` uses
|
|
185
|
+
the Studio/Label token metrics unconditionally instead, same as this kit's
|
|
186
|
+
button-based triggers (which never had the zoom problem to begin with).
|
|
187
|
+
|
|
188
|
+
## Anti-patterns
|
|
189
|
+
|
|
190
|
+
- Do not use a combobox for navigation — that is a menu/link pattern.
|
|
191
|
+
- Do not omit `items` — without it, object-shaped values render as
|
|
192
|
+
`[object Object]` in the field instead of their label.
|