@gears-frontx/ui-kit 0.3.0-alpha.3 → 0.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +182 -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,311 @@
|
|
|
1
|
+
# Questionnaire
|
|
2
|
+
|
|
3
|
+
A single-item-at-a-time multi-step form: one question visible at a time,
|
|
4
|
+
with progress, required/skip/invalid state, and keyboard shortcuts handled
|
|
5
|
+
for you. Behavior comes from **`@shadcn/react/questionnaire`**, a headless,
|
|
6
|
+
zero-runtime-dep engine — a dependency deviation from the kit's usual Base
|
|
7
|
+
UI foundation, taken because Base UI ships no multi-step-form primitive. This file supplies CSS
|
|
8
|
+
Modules styling, composes the kit `Button` for navigation and the kit
|
|
9
|
+
`Input` for freeform answers (matching upstream's own composition), and
|
|
10
|
+
hand-rolls the choice indicator (see `QuestionnaireChoice`'s doc comment
|
|
11
|
+
in `questionnaire.tsx` for why that one piece can't literally reuse the
|
|
12
|
+
kit's `Checkbox`/`RadioGroupItem` components).
|
|
13
|
+
|
|
14
|
+
Composition:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Questionnaire root <form>, owns items + current item
|
|
18
|
+
├── QuestionnaireProgress
|
|
19
|
+
├── QuestionnaireItem one per question, a <fieldset>
|
|
20
|
+
│ ├── QuestionnaireTitle <legend>, the item's accessible name
|
|
21
|
+
│ ├── QuestionnaireDescription
|
|
22
|
+
│ ├── QuestionnaireChoices
|
|
23
|
+
│ │ ├── QuestionnaireChoice ...one per fixed answer
|
|
24
|
+
│ │ └── QuestionnaireInput optional freeform answer, last cell
|
|
25
|
+
│ └── QuestionnaireError
|
|
26
|
+
└── QuestionnaireActions
|
|
27
|
+
├── QuestionnairePrevious
|
|
28
|
+
├── QuestionnaireSkip
|
|
29
|
+
├── QuestionnaireNext
|
|
30
|
+
└── QuestionnaireSubmit
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## When to use
|
|
34
|
+
|
|
35
|
+
- A short, focused form best answered one question at a time — onboarding,
|
|
36
|
+
a survey, a setup wizard — where seeing every field at once would
|
|
37
|
+
overwhelm rather than help.
|
|
38
|
+
|
|
39
|
+
## When not to use
|
|
40
|
+
|
|
41
|
+
- A form where the user benefits from seeing multiple related fields
|
|
42
|
+
together (an address, a billing profile) — compose `Field`/`Input`/
|
|
43
|
+
`Select` directly instead.
|
|
44
|
+
- A long form the user is expected to skim, save, and return to — this
|
|
45
|
+
component has no persistence or free navigation between arbitrary steps
|
|
46
|
+
beyond Previous/Next.
|
|
47
|
+
|
|
48
|
+
## How advancing actually works
|
|
49
|
+
|
|
50
|
+
This is the part that most often surprises people, so it is stated plainly:
|
|
51
|
+
|
|
52
|
+
- **Navigation buttons never disable themselves.** Activating `Next` or
|
|
53
|
+
`Submit` is what *runs* validation and reveals the failure. A disabled
|
|
54
|
+
Next would leave the reader stuck with no explanation.
|
|
55
|
+
- **A required item is valid once it has an answer.**
|
|
56
|
+
- **An optional item is valid once it has an answer _or_ has been
|
|
57
|
+
explicitly skipped.** An untouched optional item fails validation exactly
|
|
58
|
+
like a required one — `Skip` is its way past, not `Next`.
|
|
59
|
+
- **`Submit` re-validates every enabled item**, not just the last one. The
|
|
60
|
+
first failing item becomes active again and gets focus.
|
|
61
|
+
- **Skipping clears the item's answer** and removes it from the submitted
|
|
62
|
+
`FormData` entirely. That is what distinguishes "deliberately declined"
|
|
63
|
+
from "not answered yet"; observe it with `QuestionnaireItem`'s
|
|
64
|
+
`onStatusChange` (`'unanswered' | 'answered' | 'skipped'`).
|
|
65
|
+
- **Selecting an answer never auto-advances**, including via shortcut.
|
|
66
|
+
|
|
67
|
+
Because a blocked `Next` is otherwise completely silent, **render a
|
|
68
|
+
`QuestionnaireError` inside every item**, not just the required ones. Its
|
|
69
|
+
default copy already adapts: "Choose an answer to continue." for a required
|
|
70
|
+
item, "Choose an answer or skip this question." for an optional one.
|
|
71
|
+
|
|
72
|
+
## Keyboard
|
|
73
|
+
|
|
74
|
+
| Key | Behavior |
|
|
75
|
+
|-----|----------|
|
|
76
|
+
| `Tab` / `Shift+Tab` | Move between answer controls and visible actions |
|
|
77
|
+
| `ArrowUp` / `ArrowDown` | Move between answers within the item; native radios also select |
|
|
78
|
+
| `ArrowLeft` | Previous item (when focus is outside a radio or text field) |
|
|
79
|
+
| `ArrowRight` | Next item, only once the item is answered or skipped |
|
|
80
|
+
| `Space` | Select a radio, toggle a checkbox, activate a focused action |
|
|
81
|
+
| `Enter` | Continue from a selected choice or a filled freeform input |
|
|
82
|
+
| `Cmd/Ctrl+Enter` | Validate and continue from anywhere; submits on the last item |
|
|
83
|
+
| assigned letter/number | Select that choice (with `shortcuts` on); does not advance |
|
|
84
|
+
|
|
85
|
+
Shortcuts and arrow navigation pause while typing in a text field.
|
|
86
|
+
|
|
87
|
+
## Props (kit level)
|
|
88
|
+
|
|
89
|
+
`Questionnaire` (root, a native `<form>`):
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Notes |
|
|
92
|
+
|------|------|-------|
|
|
93
|
+
| `items` | `{ name, choices?, required?, disabled? }[]` | The full question list — drives validation, ordering, and shortcut assignment independent of what's actually rendered |
|
|
94
|
+
| `item` / `defaultItem` | `string` | Controlled/uncontrolled current item name |
|
|
95
|
+
| `onItemChange` | `(item: string) => void` | |
|
|
96
|
+
| `shortcuts` | `'letters' \| 'numbers'` | Assigns `A`–`Z` / `1`–`9` to each enabled choice, in `items` order; disabled choices are skipped |
|
|
97
|
+
| `noValidate` | `boolean` | Defaults to `true` — suppresses native constraint bubbles while keeping questionnaire validation |
|
|
98
|
+
|
|
99
|
+
`QuestionnaireProgress`: renders `Question {current} of {total}` as text in
|
|
100
|
+
a `role="progressbar"` — it is **not** a bar by default. Pass `children` to
|
|
101
|
+
replace the copy, or `render={(props, state) => ...}` to draw a real bar
|
|
102
|
+
from `state.current`/`state.total` (see the demo's segmented example).
|
|
103
|
+
|
|
104
|
+
`QuestionnaireItem`: `name` (matches an `items` entry), `required`,
|
|
105
|
+
`multiple` (renders every child `QuestionnaireChoice` as a checkbox
|
|
106
|
+
instead of a radio), `invalid` (mark invalid from an external validator),
|
|
107
|
+
`disabled` (omit from progress and navigation), `onStatusChange`.
|
|
108
|
+
|
|
109
|
+
`QuestionnaireChoice`: `value`, `disabled`, `checked`/`defaultChecked`,
|
|
110
|
+
`onChange`. Renders the hidden native input, a checkbox-square or
|
|
111
|
+
radio-circle indicator (picked automatically from the parent item's
|
|
112
|
+
`multiple`), the label text (`children`), and its own shortcut cap.
|
|
113
|
+
|
|
114
|
+
`QuestionnaireChoiceDescription`: a second line under a choice's label.
|
|
115
|
+
Belongs among `QuestionnaireChoice`'s children.
|
|
116
|
+
|
|
117
|
+
`QuestionnaireInput`: any text `<input>` prop (`type`, `placeholder`,
|
|
118
|
+
`maxLength`, ...) plus `render` — defaults to composing the kit `Input`.
|
|
119
|
+
Belongs inside `QuestionnaireChoices` when an item offers both fixed
|
|
120
|
+
choices and a freeform answer, so the field sits on the choice grid.
|
|
121
|
+
|
|
122
|
+
Navigation (`QuestionnairePrevious`/`QuestionnaireSkip`/`QuestionnaireNext`/
|
|
123
|
+
`QuestionnaireSubmit`), each:
|
|
124
|
+
|
|
125
|
+
| Prop | Type | Default |
|
|
126
|
+
|------|------|---------|
|
|
127
|
+
| `variant` | kit `Button` variant | `'outline'` (Previous/Skip), `'default'` (Next/Submit) |
|
|
128
|
+
| `size` | kit `Button` size | `'default'` |
|
|
129
|
+
| `render` | element to render as | a kit `Button` |
|
|
130
|
+
|
|
131
|
+
Each is hidden (native `hidden`+`inert`, not just visually) when it
|
|
132
|
+
doesn't apply — `Previous` on the first item, `Skip` on a `required` item,
|
|
133
|
+
`Next` on the last item, `Submit` before it. `Next` and `Submit` share one
|
|
134
|
+
grid cell; exactly one is ever visible.
|
|
135
|
+
|
|
136
|
+
## Styling hooks
|
|
137
|
+
|
|
138
|
+
Every part carries data attributes you can key CSS off:
|
|
139
|
+
|
|
140
|
+
| Part | Attributes |
|
|
141
|
+
|------|-----------|
|
|
142
|
+
| `Progress` | `data-current`, `data-total`, `data-first`, `data-last` |
|
|
143
|
+
| `Item` | `data-active`, `data-status`, `data-required`, `data-multiple`, `data-disabled`, `data-invalid` |
|
|
144
|
+
| `Choices` | `data-shortcuts` |
|
|
145
|
+
| `Choice` | `data-type` (`radio`/`checkbox`), `data-checked`, `data-unchecked`, `data-disabled`, `data-invalid`, `data-shortcut` |
|
|
146
|
+
| `Input` | `data-filled`, `data-empty`, `data-disabled`, `data-invalid` |
|
|
147
|
+
| navigation | `data-visible`, `data-hidden`, `data-status`, `data-shortcut` |
|
|
148
|
+
|
|
149
|
+
> **If you add a `display` declaration to any part that the engine hides**
|
|
150
|
+
> (`Item`, `Error`, `ChoiceShortcut`, and the four navigation buttons),
|
|
151
|
+
> re-block it with a matching `[hidden] { display: none }` rule. The
|
|
152
|
+
> `hidden` attribute is enforced only by the UA stylesheet's
|
|
153
|
+
> non-`!important` rule, so any author `display` silently defeats it — and
|
|
154
|
+
> the entire questionnaire then paints every question at once.
|
|
155
|
+
> `questionnaire.module.css` carries that guard for the parts it styles.
|
|
156
|
+
|
|
157
|
+
## Deviations from upstream
|
|
158
|
+
|
|
159
|
+
- **Choice indicator is hand-rolled, not a `Checkbox`/`RadioGroupItem`
|
|
160
|
+
composition.** Those kit components wrap Base UI's `Checkbox`/`Radio`
|
|
161
|
+
primitives, which render as `<span role="checkbox"|"radio">` — never a
|
|
162
|
+
real `<input>`. The questionnaire engine needs its `ChoiceInput` to BE a
|
|
163
|
+
native input (constraint validation, `name`-based radio grouping), so
|
|
164
|
+
this file instead re-implements the same visual language from
|
|
165
|
+
`checkbox.module.css`/`radio-group.module.css` directly here, keyed off
|
|
166
|
+
this element's own `data-type`/`data-checked`/`data-disabled`/
|
|
167
|
+
`data-invalid` attributes.
|
|
168
|
+
- **`ChoiceInput`/`ChoiceLabel`/`ChoiceShortcut` are exported standalone.**
|
|
169
|
+
Upstream only uses them internally inside its `QuestionnaireChoice`. This
|
|
170
|
+
kit exports all three too, for a consumer building a fully custom choice
|
|
171
|
+
layout without `QuestionnaireChoice`'s built-in indicator markup.
|
|
172
|
+
- **No manual default text.** Upstream's wrapper supplies `children ??
|
|
173
|
+
'Previous'` (and similarly for Skip/Next/Submit/the progress text/the
|
|
174
|
+
error message) because its underlying primitive renders nothing without
|
|
175
|
+
it. The installed `@shadcn/react` version already supplies sensible
|
|
176
|
+
default content for `QuestionnaireProgress`, `QuestionnaireError`, and
|
|
177
|
+
each navigation button — this wrapper only forwards `children`/`render`
|
|
178
|
+
when a consumer wants to override that default, it never hardcodes
|
|
179
|
+
English strings that would need translating.
|
|
180
|
+
- **Token-scale spacing.** The kit's spacing scale has no 10px step, so
|
|
181
|
+
upstream's `gap-2.5`/`py-2.5` inside a choice row land on `--space-2`
|
|
182
|
+
(8px) here; the shortcut cap uses the kit's 11px `--text-mono-size`
|
|
183
|
+
rather than upstream's 10px. Every other measurement (44px row,
|
|
184
|
+
8px radius, 16px indicator, 20px cap, 8px choice gap, 16px item and root
|
|
185
|
+
gaps) matches upstream exactly.
|
|
186
|
+
- **Focus is the kit's field ring.** Upstream draws a 3px translucent halo
|
|
187
|
+
outside the row; the kit's field idiom (`input.module.css`) is a
|
|
188
|
+
recolored border plus an inset ring, so the choice row wears that
|
|
189
|
+
instead — and, per the same kit ruling, an invalid row keeps the
|
|
190
|
+
destructive treatment while focused.
|
|
191
|
+
|
|
192
|
+
## Examples
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import {
|
|
196
|
+
Questionnaire,
|
|
197
|
+
QuestionnaireActions,
|
|
198
|
+
QuestionnaireChoice,
|
|
199
|
+
QuestionnaireChoiceDescription,
|
|
200
|
+
QuestionnaireChoices,
|
|
201
|
+
QuestionnaireDescription,
|
|
202
|
+
QuestionnaireError,
|
|
203
|
+
QuestionnaireInput,
|
|
204
|
+
QuestionnaireItem,
|
|
205
|
+
QuestionnaireNext,
|
|
206
|
+
QuestionnairePrevious,
|
|
207
|
+
QuestionnaireProgress,
|
|
208
|
+
QuestionnaireSkip,
|
|
209
|
+
QuestionnaireSubmit,
|
|
210
|
+
QuestionnaireTitle,
|
|
211
|
+
} from '@gears-frontx/ui-kit';
|
|
212
|
+
|
|
213
|
+
const items = [
|
|
214
|
+
{
|
|
215
|
+
name: 'direction',
|
|
216
|
+
choices: [{ value: 'tool-calls' }, { value: 'approvals' }],
|
|
217
|
+
required: true,
|
|
218
|
+
},
|
|
219
|
+
{ name: 'signals', choices: [{ value: 'progress' }, { value: 'risks' }] },
|
|
220
|
+
];
|
|
221
|
+
|
|
222
|
+
function Onboarding() {
|
|
223
|
+
return (
|
|
224
|
+
<Questionnaire
|
|
225
|
+
items={items}
|
|
226
|
+
defaultItem="direction"
|
|
227
|
+
shortcuts="letters"
|
|
228
|
+
onSubmit={handleSubmit}
|
|
229
|
+
>
|
|
230
|
+
<QuestionnaireProgress />
|
|
231
|
+
|
|
232
|
+
<QuestionnaireItem name="direction" required>
|
|
233
|
+
<QuestionnaireTitle>What should the agent build next?</QuestionnaireTitle>
|
|
234
|
+
<QuestionnaireDescription>Choose a direction or describe another task.</QuestionnaireDescription>
|
|
235
|
+
<QuestionnaireChoices>
|
|
236
|
+
<QuestionnaireChoice value="tool-calls">
|
|
237
|
+
Tool call timeline
|
|
238
|
+
<QuestionnaireChoiceDescription>
|
|
239
|
+
Show what the agent ran and what came back.
|
|
240
|
+
</QuestionnaireChoiceDescription>
|
|
241
|
+
</QuestionnaireChoice>
|
|
242
|
+
<QuestionnaireChoice value="approvals">
|
|
243
|
+
Approval checkpoints
|
|
244
|
+
<QuestionnaireChoiceDescription>
|
|
245
|
+
Ask before sensitive or destructive actions.
|
|
246
|
+
</QuestionnaireChoiceDescription>
|
|
247
|
+
</QuestionnaireChoice>
|
|
248
|
+
<QuestionnaireInput aria-label="Another feature" placeholder="Describe another feature…" />
|
|
249
|
+
</QuestionnaireChoices>
|
|
250
|
+
<QuestionnaireError />
|
|
251
|
+
</QuestionnaireItem>
|
|
252
|
+
|
|
253
|
+
{/* `multiple` turns the radios into checkboxes; read with getAll(). */}
|
|
254
|
+
<QuestionnaireItem name="signals" multiple>
|
|
255
|
+
<QuestionnaireTitle>What should every update include?</QuestionnaireTitle>
|
|
256
|
+
<QuestionnaireDescription>Select all that apply, or skip this question.</QuestionnaireDescription>
|
|
257
|
+
<QuestionnaireChoices>
|
|
258
|
+
<QuestionnaireChoice value="progress">Progress</QuestionnaireChoice>
|
|
259
|
+
<QuestionnaireChoice value="risks">Risks</QuestionnaireChoice>
|
|
260
|
+
</QuestionnaireChoices>
|
|
261
|
+
<QuestionnaireError />
|
|
262
|
+
</QuestionnaireItem>
|
|
263
|
+
|
|
264
|
+
<QuestionnaireActions>
|
|
265
|
+
<QuestionnairePrevious />
|
|
266
|
+
<QuestionnaireSkip />
|
|
267
|
+
<QuestionnaireNext />
|
|
268
|
+
<QuestionnaireSubmit>Save plan</QuestionnaireSubmit>
|
|
269
|
+
</QuestionnaireActions>
|
|
270
|
+
</Questionnaire>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Reading the result — a `multiple` item submits one entry per checked
|
|
276
|
+
choice, and a skipped item submits nothing:
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
const data = new FormData(event.currentTarget);
|
|
282
|
+
const answers = {
|
|
283
|
+
direction: data.get('direction'),
|
|
284
|
+
signals: data.getAll('signals'), // [] when skipped
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Anti-patterns
|
|
290
|
+
|
|
291
|
+
- Do not omit `QuestionnaireError` from an item because it is optional — a
|
|
292
|
+
failed `Next` on an untouched optional item is then completely silent.
|
|
293
|
+
- Do not nest a `QuestionnaireChoiceShortcut` inside a
|
|
294
|
+
`QuestionnaireChoice`'s children. `QuestionnaireChoice` already renders
|
|
295
|
+
one; a second produces two key caps on the same row. The standalone
|
|
296
|
+
export is for choice layouts built without `QuestionnaireChoice`.
|
|
297
|
+
- Do not render a `QuestionnaireChoice` for a value missing from the
|
|
298
|
+
parent `QuestionnaireItem`'s `choices` in `items` — the engine warns
|
|
299
|
+
(console) and the choice won't participate in validation/shortcuts.
|
|
300
|
+
- Do not reach for `Checkbox`/`RadioGroupItem` to restyle
|
|
301
|
+
`QuestionnaireChoice`'s indicator — see "Deviations" above for why that
|
|
302
|
+
swap breaks native input semantics the engine depends on. Restyle via
|
|
303
|
+
`questionnaire.module.css`'s own classes/tokens instead.
|
|
304
|
+
- Do not assume `QuestionnaireNext`/`QuestionnaireSubmit` are mutually
|
|
305
|
+
exclusive by conditional rendering — both should always be mounted
|
|
306
|
+
(matching the examples above); the primitive hides whichever doesn't
|
|
307
|
+
apply, which is also what lets its transition-free `hidden` swap happen
|
|
308
|
+
without a flash of the wrong button.
|
|
309
|
+
- Do not gate `Next` behind your own `disabled` unless you also surface why
|
|
310
|
+
it is blocked; the built-in design deliberately keeps it enabled so the
|
|
311
|
+
error can speak.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
A react-resizable-panels wrapper — a group of panels a user can drag to
|
|
4
|
+
resize, split by one or more draggable handles. No Base UI primitive
|
|
5
|
+
exists for this (confirmed against Base UI v1.7.0), so the kit forwards
|
|
6
|
+
straight to the vendor
|
|
7
|
+
primitive with only class-name/icon translation on top.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- A split-pane layout the user controls directly — a file explorer beside
|
|
12
|
+
an editor, a preview pane beside a form, a chat list beside a
|
|
13
|
+
conversation.
|
|
14
|
+
- Nesting a vertical split inside one side of a horizontal split (or vice
|
|
15
|
+
versa) for an IDE-style multi-pane layout.
|
|
16
|
+
|
|
17
|
+
## When not to use
|
|
18
|
+
|
|
19
|
+
- A fixed-proportion layout with no user-driven resizing — plain flex/grid
|
|
20
|
+
is simpler and needs no dependency.
|
|
21
|
+
- A collapsible sidebar with a binary open/closed state (no drag) — that's
|
|
22
|
+
a different interaction; a resizable `Panel`'s `collapsible`/
|
|
23
|
+
`collapsedSize` props solve a related but distinct problem (snap-to-zero
|
|
24
|
+
on drag, not a toggle button).
|
|
25
|
+
|
|
26
|
+
## Parts
|
|
27
|
+
|
|
28
|
+
| Part | Renders | Notes |
|
|
29
|
+
|------|---------|-------|
|
|
30
|
+
| `ResizablePanelGroup` | `react-resizable-panels`' `Group` | Owns layout orientation; always renders `data-group` |
|
|
31
|
+
| `ResizablePanel` | `react-resizable-panels`' `Panel` | Bare pass-through — no kit styling of its own, matching upstream |
|
|
32
|
+
| `ResizableHandle` | `react-resizable-panels`' `Separator` | The draggable divider; `role="separator"`, keyboard-resizable |
|
|
33
|
+
|
|
34
|
+
## Props (kit level)
|
|
35
|
+
|
|
36
|
+
`ResizablePanelGroup` and `ResizablePanel` forward every prop of their
|
|
37
|
+
underlying `react-resizable-panels` primitive verbatim (`orientation`,
|
|
38
|
+
`defaultLayout`, `disabled`, `onLayoutChanged`, `defaultSize`, `minSize`,
|
|
39
|
+
`maxSize`, `collapsible`, `collapsedSize`, ...) — see the library's own
|
|
40
|
+
`GroupProps`/`PanelProps` for the full list, re-exported here as
|
|
41
|
+
`ResizablePanelGroupProps`/`ResizablePanelProps`.
|
|
42
|
+
|
|
43
|
+
`ResizableHandle` forwards every `Separator` prop plus one addition:
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default |
|
|
46
|
+
|------|------|---------|
|
|
47
|
+
| `withHandle` | `boolean` | `false` — renders a small grip glyph centered on the handle |
|
|
48
|
+
|
|
49
|
+
`Group.orientation` defaults to `'horizontal'` (panels side by side,
|
|
50
|
+
resized left/right); a `ResizableHandle`'s own `aria-orientation` (set by
|
|
51
|
+
the vendor, not the kit) describes the DIVIDER's drawn orientation, which
|
|
52
|
+
is the opposite: a `horizontal` group's divider is drawn as a vertical
|
|
53
|
+
line, and a `vertical` group's divider is drawn as a horizontal one — same
|
|
54
|
+
"opposite" relationship `Separator`/`ButtonGroupSeparator` already
|
|
55
|
+
document for their own orientation.
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@gears-frontx/ui-kit';
|
|
61
|
+
|
|
62
|
+
// Two-panel horizontal split
|
|
63
|
+
<ResizablePanelGroup style={{ height: 300 }}>
|
|
64
|
+
<ResizablePanel defaultSize={30} minSize={20}>Sidebar</ResizablePanel>
|
|
65
|
+
<ResizableHandle withHandle />
|
|
66
|
+
<ResizablePanel>Content</ResizablePanel>
|
|
67
|
+
</ResizablePanelGroup>
|
|
68
|
+
|
|
69
|
+
// Vertical split nested inside one side of a horizontal split
|
|
70
|
+
<ResizablePanelGroup style={{ height: 300 }}>
|
|
71
|
+
<ResizablePanel defaultSize={30}>Sidebar</ResizablePanel>
|
|
72
|
+
<ResizableHandle withHandle />
|
|
73
|
+
<ResizablePanel>
|
|
74
|
+
<ResizablePanelGroup orientation="vertical">
|
|
75
|
+
<ResizablePanel>Editor</ResizablePanel>
|
|
76
|
+
<ResizableHandle withHandle />
|
|
77
|
+
<ResizablePanel defaultSize={25}>Console</ResizablePanel>
|
|
78
|
+
</ResizablePanelGroup>
|
|
79
|
+
</ResizablePanel>
|
|
80
|
+
</ResizablePanelGroup>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Anti-patterns
|
|
84
|
+
|
|
85
|
+
- Do not expect `ResizablePanel` to carry any visual styling of its own
|
|
86
|
+
(border, background, padding) — it is a bare pass-through by design
|
|
87
|
+
(faithful to upstream); style the content you put inside it, or pass
|
|
88
|
+
your own `className`.
|
|
89
|
+
- Do not pass a `data-testid` prop to any of these three parts expecting it
|
|
90
|
+
to stick — `react-resizable-panels` claims that attribute for its own
|
|
91
|
+
id-based test-id convention and overwrites it; pass `id` and query by
|
|
92
|
+
that (or by role) instead.
|
|
93
|
+
- Do not read a handle's own `aria-orientation` as "the group's
|
|
94
|
+
orientation" — it is the opposite (see Props above); read the `Group`'s
|
|
95
|
+
own `orientation` prop for that instead.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# ScrollArea
|
|
2
|
+
|
|
3
|
+
A custom-styled scrollable container. Wraps the Base UI ScrollArea
|
|
4
|
+
primitives; scroll physics, overflow detection, and the thumb's drag
|
|
5
|
+
behavior come from Base UI — this component only supplies the visual
|
|
6
|
+
scrollbar/thumb in place of the browser's native one. No variants.
|
|
7
|
+
|
|
8
|
+
Composition (fixed, not a full part-by-part export — see "Upstream source"
|
|
9
|
+
below): `ScrollArea` (root) renders a Viewport wrapping your `children`,
|
|
10
|
+
one vertical `ScrollBar`, and a Corner. `ScrollBar` is exported separately
|
|
11
|
+
only so you can add a second one for the other axis.
|
|
12
|
+
|
|
13
|
+
## When to use
|
|
14
|
+
|
|
15
|
+
- A fixed-height (or fixed-width) panel — a sidebar list, a chat log, a
|
|
16
|
+
code block — where you want a scrollbar that matches the kit's visual
|
|
17
|
+
language across browsers/platforms instead of each OS's native chrome.
|
|
18
|
+
|
|
19
|
+
## When not to use
|
|
20
|
+
|
|
21
|
+
- The page's own root scroll — let the browser handle that; wrapping the
|
|
22
|
+
whole page in `ScrollArea` fights the browser's native scroll
|
|
23
|
+
restoration, `:target` anchoring, and find-in-page.
|
|
24
|
+
- Content that never needs to scroll — this component adds a
|
|
25
|
+
measurement/positioning layer for no benefit over a plain `<div>`.
|
|
26
|
+
|
|
27
|
+
## Upstream source
|
|
28
|
+
|
|
29
|
+
The base registry item (`apps/v4/registry/bases/base/ui/scroll-area.tsx`)
|
|
30
|
+
exports exactly two names, `ScrollArea` and `ScrollBar` — not one export per
|
|
31
|
+
Base UI part. This kit replicates that same two-export surface rather than
|
|
32
|
+
also exporting `Viewport`/`Content`/`Corner` individually; `Corner` in
|
|
33
|
+
particular is rendered internally by `ScrollArea` and takes no `className`
|
|
34
|
+
in either shadcn variant (base or new-york) — Base UI's own
|
|
35
|
+
`ScrollAreaCorner` sizes and positions itself from measured scrollbar/thumb
|
|
36
|
+
geometry, with nothing left for a consumer stylesheet to add.
|
|
37
|
+
|
|
38
|
+
The base registry source ships Root/Viewport structurally but — true to
|
|
39
|
+
the "base" variant's minimal-by-design intent — leaves the scrollbar
|
|
40
|
+
track's width, its invisible padding border, and the thumb's pill shape
|
|
41
|
+
unset; this kit fills those in from the sibling new-york variant (same
|
|
42
|
+
Base UI props, same visual intent), since every kit component ships fully
|
|
43
|
+
themed rather than as a bare structural shell: `0.625rem` track width, a
|
|
44
|
+
1px transparent inset border, `9999px`-radius thumb.
|
|
45
|
+
|
|
46
|
+
## Props (kit level)
|
|
47
|
+
|
|
48
|
+
`ScrollArea` (root): `overflowEdgeThreshold`, `className` — merged after
|
|
49
|
+
the kit class. All other props are native `<div>` props, forwarded to Base
|
|
50
|
+
UI's `ScrollArea.Root`.
|
|
51
|
+
|
|
52
|
+
`ScrollBar`:
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Default |
|
|
55
|
+
|------|------|---------|
|
|
56
|
+
| `orientation` | `vertical` \| `horizontal` | `vertical` |
|
|
57
|
+
| `keepMounted` | `boolean` — keep the track in the DOM when the content doesn't overflow that axis | `false` |
|
|
58
|
+
| `className` | `string` — merged after the kit class | — |
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { ScrollArea } from '@gears-frontx/ui-kit';
|
|
64
|
+
|
|
65
|
+
<ScrollArea style={{ height: '18rem', width: '16rem' }}>
|
|
66
|
+
<ul>
|
|
67
|
+
{items.map((item) => (
|
|
68
|
+
<li key={item.id}>{item.label}</li>
|
|
69
|
+
))}
|
|
70
|
+
</ul>
|
|
71
|
+
</ScrollArea>;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { ScrollArea, ScrollBar } from '@gears-frontx/ui-kit';
|
|
76
|
+
|
|
77
|
+
// Both axes: ScrollArea already renders the vertical bar; add a second,
|
|
78
|
+
// horizontal ScrollBar as an extra child for the other axis.
|
|
79
|
+
<ScrollArea style={{ height: '12rem', width: '24rem' }}>
|
|
80
|
+
<table>{/* wide content */}</table>
|
|
81
|
+
<ScrollBar orientation="horizontal" />
|
|
82
|
+
</ScrollArea>;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Anti-patterns
|
|
86
|
+
|
|
87
|
+
- Do not expect `ScrollArea` to size itself — like the upstream source it
|
|
88
|
+
ships no intrinsic height/width; give it one via `style` or `className`
|
|
89
|
+
(a fixed height, `max-height`, or a flex/grid cell with a bounded size).
|
|
90
|
+
- Do not import `Viewport`, `Content`, or `Corner` from this component —
|
|
91
|
+
they are not exported; the composition is fixed the same way it is
|
|
92
|
+
upstream. Reach for the raw `@base-ui/react/scroll-area` primitives
|
|
93
|
+
directly if you need a different composition.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
An edge-anchored panel for a focused task, form, or detail view without
|
|
4
|
+
leaving the current page context. Wraps the same Base UI Dialog primitives
|
|
5
|
+
`Dialog` does; the panel is portalled, focus trapping, page-scroll locking,
|
|
6
|
+
and Escape/outside-press dismissal come from Base UI. Base UI does **not**
|
|
7
|
+
supply a touch-screen-reader escape hatch on its own — when `modal` is
|
|
8
|
+
`true` (the default) or `'trap-focus'`, its own docs require the consumer
|
|
9
|
+
to render a `Dialog.Close` inside `Dialog.Popup` for that. The kit satisfies
|
|
10
|
+
this by having `SheetContent` render a close button by default
|
|
11
|
+
(`showCloseButton`, see below).
|
|
12
|
+
|
|
13
|
+
Composition: `Sheet` (root, holds open state) → `SheetTrigger` →
|
|
14
|
+
`SheetContent` (portals `SheetHeader` / `SheetFooter` / `SheetTitle` /
|
|
15
|
+
`SheetDescription` / consumer content, anchored to one of four edges via
|
|
16
|
+
`side`) → optional `SheetClose` for a consumer-composed close action (e.g.
|
|
17
|
+
a footer "Cancel" button).
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- A focused task, form, or detail view that benefits from staying anchored
|
|
22
|
+
to a screen edge instead of centered and floating over the page (a
|
|
23
|
+
filter panel, a record's detail view, a multi-field form).
|
|
24
|
+
- Content the user must read or decide on before continuing, where the
|
|
25
|
+
edge-anchored motion better fits a "slide-in panel" mental model than
|
|
26
|
+
`dialog`'s centered pop-up.
|
|
27
|
+
|
|
28
|
+
## When not to use
|
|
29
|
+
|
|
30
|
+
- A centered, page-blocking confirmation or short prompt — use `dialog`.
|
|
31
|
+
- Passive information that does not need to block the page — a sheet is
|
|
32
|
+
modal by default; if it genuinely must not block, pair `modal={false}`
|
|
33
|
+
on the root with `showBackdrop={false}` on `SheetContent` (one without
|
|
34
|
+
the other still blocks: `modal` alone leaves the backdrop covering and
|
|
35
|
+
click-closing over the page).
|
|
36
|
+
- Menus of actions anchored to a trigger — use `dropdown-menu`.
|
|
37
|
+
- Single-line contextual hints — use `tooltip`.
|
|
38
|
+
|
|
39
|
+
## Props (kit level)
|
|
40
|
+
|
|
41
|
+
`Sheet` (root): `open` / `defaultOpen`, `onOpenChange`, `modal` (`true`
|
|
42
|
+
default; `false`; `'trap-focus'`) — see Base UI Dialog.Root.
|
|
43
|
+
|
|
44
|
+
`SheetContent`:
|
|
45
|
+
|
|
46
|
+
| Prop | Type | Default |
|
|
47
|
+
|------|------|---------|
|
|
48
|
+
| `side` | `'top' \| 'right' \| 'bottom' \| 'left'` — which viewport edge the panel is anchored to | `'right'` |
|
|
49
|
+
| `showCloseButton` | `boolean` — renders a top-right close (X) button | `true` |
|
|
50
|
+
| `showBackdrop` | `boolean` — renders the dimming backdrop; set `false` together with `modal={false}` on the root for a genuinely non-modal sheet | `true` |
|
|
51
|
+
| `closeLabel` | `string` — accessible name for that button, the panel's only kit-authored text; same contract as `Dialog`'s `closeLabel` | `'Close'` |
|
|
52
|
+
| `container` | DOM node to portal the panel into | `<body>` |
|
|
53
|
+
| `initialFocus` / `finalFocus` | `boolean \| RefObject \| function` — see Base UI Dialog.Popup | default focus behavior |
|
|
54
|
+
| `className` | `string` — merged after the kit class | — |
|
|
55
|
+
|
|
56
|
+
Setting `showCloseButton={false}` removes the only built-in escape hatch
|
|
57
|
+
touch screen reader users have out of a modal sheet (see above) — only do
|
|
58
|
+
this if you compose your own `SheetClose` somewhere inside `SheetContent`
|
|
59
|
+
(e.g. in the footer).
|
|
60
|
+
|
|
61
|
+
The panel portals to `<body>` by default, so if your theme lives on a
|
|
62
|
+
subtree (`data-theme` on a section instead of `<html>`), pass that section
|
|
63
|
+
as `container` or the panel renders with the root theme.
|
|
64
|
+
|
|
65
|
+
`SheetTrigger` and `SheetClose` are unstyled pass-throughs (native
|
|
66
|
+
`<button>` semantics) — compose them with `Button` via their `render` prop
|
|
67
|
+
for a styled trigger or close action, same as the built-in close button
|
|
68
|
+
does internally.
|
|
69
|
+
|
|
70
|
+
## Side variants
|
|
71
|
+
|
|
72
|
+
`side` picks one of four edge anchors, each with its own sizing and slide
|
|
73
|
+
direction:
|
|
74
|
+
|
|
75
|
+
- `top` — full width, height sized to content (capped and scrollable past
|
|
76
|
+
the viewport), slides down from above.
|
|
77
|
+
- `right` (default) — full height, 75% width capped at `24rem` from the
|
|
78
|
+
640px breakpoint up, slides in from the right.
|
|
79
|
+
- `bottom` — full width, height sized to content (capped and scrollable
|
|
80
|
+
past the viewport), slides up from below.
|
|
81
|
+
- `left` — full height, 75% width capped at `24rem` from the 640px
|
|
82
|
+
breakpoint up, slides in from the left.
|
|
83
|
+
|
|
84
|
+
Every variant is square — the kit's Sheet does not round any corner,
|
|
85
|
+
matching the upstream source (unlike `Dialog`'s fully-rounded, centered
|
|
86
|
+
popup, an edge-anchored panel has no corner that reads as "inner").
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import {
|
|
92
|
+
Button,
|
|
93
|
+
Sheet,
|
|
94
|
+
SheetClose,
|
|
95
|
+
SheetContent,
|
|
96
|
+
SheetDescription,
|
|
97
|
+
SheetFooter,
|
|
98
|
+
SheetHeader,
|
|
99
|
+
SheetTitle,
|
|
100
|
+
SheetTrigger,
|
|
101
|
+
} from '@gears-frontx/ui-kit';
|
|
102
|
+
|
|
103
|
+
<Sheet>
|
|
104
|
+
<SheetTrigger render={<Button variant="outline" />}>Edit profile</SheetTrigger>
|
|
105
|
+
<SheetContent side="right">
|
|
106
|
+
<SheetHeader>
|
|
107
|
+
<SheetTitle>Edit profile</SheetTitle>
|
|
108
|
+
<SheetDescription>
|
|
109
|
+
Make changes to your profile here. Click save when you're done.
|
|
110
|
+
</SheetDescription>
|
|
111
|
+
</SheetHeader>
|
|
112
|
+
<SheetFooter>
|
|
113
|
+
<SheetClose render={<Button variant="outline" />}>Cancel</SheetClose>
|
|
114
|
+
<Button onClick={handleSave}>Save changes</Button>
|
|
115
|
+
</SheetFooter>
|
|
116
|
+
</SheetContent>
|
|
117
|
+
</Sheet>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Wide content
|
|
121
|
+
|
|
122
|
+
`SheetContent` lays its children out as a single-column grid, and the
|
|
123
|
+
column's minimum width is floored at zero — so content wider than the
|
|
124
|
+
panel overflows *inside* it rather than stretching the panel past its
|
|
125
|
+
side's width. Same contract as `Dialog`'s: a wide child (a `Table`, a
|
|
126
|
+
`<pre>` code block, a long unbroken string, an image) needs its own
|
|
127
|
+
horizontal scroll container or should wrap; see `dialog.md`'s "Wide
|
|
128
|
+
content" for the full reasoning.
|
|
129
|
+
|
|
130
|
+
## Scrolling content
|
|
131
|
+
|
|
132
|
+
`SheetHeader` and `SheetFooter` are `position: sticky` (top / bottom) with
|
|
133
|
+
an opaque background matching the panel, by default. That covers two
|
|
134
|
+
shapes:
|
|
135
|
+
|
|
136
|
+
- A consumer-wrapped middle region (`overflow-y: auto` on a child div
|
|
137
|
+
between header and footer) - the panel itself never needs to scroll, so
|
|
138
|
+
the sticky positioning is inert and simply does nothing.
|
|
139
|
+
- Long content dropped in unwrapped (as in the "Scrollable content"
|
|
140
|
+
example) - `SheetContent`'s own `overflow-y: auto` becomes the scroll
|
|
141
|
+
container (see "Wide content" above for the matching horizontal case),
|
|
142
|
+
and header/footer stay pinned at the top/bottom of it, masking whatever
|
|
143
|
+
scrolls underneath. No inline `background` or `position` prop needed on
|
|
144
|
+
`SheetFooter` for this - it is the built-in behavior, same contract as
|
|
145
|
+
`Dialog`'s (see `dialog.md`'s "Scrolling content").
|
|
146
|
+
|
|
147
|
+
For the mask to be complete, `SheetContent` itself carries no padding: the
|
|
148
|
+
inset lives on its direct children instead (side inset on every child, top
|
|
149
|
+
inset on the first, bottom inset on the last), so header and footer span
|
|
150
|
+
the panel's full width and reach its top and bottom edges. Padding on the
|
|
151
|
+
scroll container would have left strips that no sticky region can cover -
|
|
152
|
+
see `dialog.md`'s "Scrolling content" for the mechanism. Consequence when
|
|
153
|
+
styling children: a `className` that sets `padding` on a region overrides
|
|
154
|
+
the inset (same single-class weight) rather than adding to it, and a
|
|
155
|
+
full-width child reaches the panel edges by zeroing its `padding-inline`.
|
|
156
|
+
|
|
157
|
+
## Anti-patterns
|
|
158
|
+
|
|
159
|
+
- Do not nest interactive page content's focus expectations across the
|
|
160
|
+
backdrop — modal mode (the default) already traps focus and moves it
|
|
161
|
+
in/out on open/close; use `initialFocus` / `finalFocus` on
|
|
162
|
+
`SheetContent` if you need to redirect it, don't fight it with manual
|
|
163
|
+
focus management (imperative `.focus()` calls in effects).
|
|
164
|
+
- Do not omit `SheetTitle` — Base UI's accessibility tree needs it even
|
|
165
|
+
if it is visually hidden via `className`; do not delete it for a
|
|
166
|
+
"cleaner" look.
|
|
167
|
+
- Do not use `Sheet` for a centered confirmation prompt — use `dialog`.
|
|
168
|
+
- Do not use `Sheet` for a simple toast/notification — use `toast`.
|