@gears-frontx/ui-kit 0.3.0-alpha.2 → 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 +37 -0
- 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 +33 -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 -129
- 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 +55 -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 -18
- package/package.json +16 -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,178 @@
|
|
|
1
|
+
# Marker
|
|
2
|
+
|
|
3
|
+
An inline conversation marker — a faithful port of [shadcn/ui's base
|
|
4
|
+
Marker](https://ui.shadcn.com/docs/components/base/marker). Marker has no
|
|
5
|
+
Base UI primitive, but still gets `render`-prop polymorphism (via Base
|
|
6
|
+
UI's `useRender`/`mergeProps` utilities) for the one case that needs it:
|
|
7
|
+
rendering as a link or button — the same pattern [`Badge`](badge.md) uses.
|
|
8
|
+
|
|
9
|
+
Use Marker for status updates, system notes, bordered rows, and labeled
|
|
10
|
+
separators inside a conversation thread. Compose it with
|
|
11
|
+
[`Message`](message.md) — Marker is a standalone row, not a message
|
|
12
|
+
surface.
|
|
13
|
+
|
|
14
|
+
## Shimmer dependency
|
|
15
|
+
|
|
16
|
+
Marker pairs with the `shimmer` utility class shipped in this package's
|
|
17
|
+
global stylesheet: `import '@gears-frontx/ui-kit/utilities.css';` once at
|
|
18
|
+
the app entry, alongside `theme.css`. Marker does **not**
|
|
19
|
+
apply it automatically: add the `shimmer` class to `MarkerContent`
|
|
20
|
+
directly for an animated streaming-text effect —
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Marker role="status">
|
|
24
|
+
<MarkerContent className="shimmer">Thinking…</MarkerContent>
|
|
25
|
+
</Marker>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This mirrors [`Attachment`](attachment.md)'s use of the same utility,
|
|
29
|
+
except Attachment applies it automatically off its own `state` prop —
|
|
30
|
+
Marker has no equivalent lifecycle axis, so the consumer opts in per
|
|
31
|
+
marker.
|
|
32
|
+
|
|
33
|
+
## When to use
|
|
34
|
+
|
|
35
|
+
- An inline status or progress note ("Thinking...", "Checking the
|
|
36
|
+
logs...").
|
|
37
|
+
- A system note or bordered row inside a conversation (`variant="border"`).
|
|
38
|
+
- A labeled separator between conversation sections, such as a date
|
|
39
|
+
(`variant="separator"`).
|
|
40
|
+
|
|
41
|
+
## When not to use
|
|
42
|
+
|
|
43
|
+
- A full message row with an avatar, header, or footer — use
|
|
44
|
+
[`Message`](message.md).
|
|
45
|
+
- A framed chat bubble — use [`Bubble`](bubble.md).
|
|
46
|
+
|
|
47
|
+
## Composition
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Marker
|
|
51
|
+
├── MarkerIcon
|
|
52
|
+
└── MarkerContent
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Variants
|
|
56
|
+
|
|
57
|
+
| Variant | Description |
|
|
58
|
+
| ----------- | ----------------------------------------------------- |
|
|
59
|
+
| `default` | An inline marker for status, notes, and actions. |
|
|
60
|
+
| `border` | A default marker with a bottom border under the row. |
|
|
61
|
+
| `separator` | A centered label with divider lines on each side. |
|
|
62
|
+
|
|
63
|
+
## Props
|
|
64
|
+
|
|
65
|
+
### Marker
|
|
66
|
+
|
|
67
|
+
| Prop | Type | Default | Description |
|
|
68
|
+
| ----------- | ---------------------------------------- | ----------- | ------------------------------------------------- |
|
|
69
|
+
| `variant` | `'default' \| 'border' \| 'separator'` | `'default'` | The marker layout. |
|
|
70
|
+
| `render` | `ReactElement` — replaces the root `div` | — | Render as a different element, such as a link. |
|
|
71
|
+
| `className` | `string` | — | Merged after the variant class. |
|
|
72
|
+
|
|
73
|
+
All other props are native `<div>` props (or the target element's props
|
|
74
|
+
when using `render`) and are forwarded as-is, including `role` — see
|
|
75
|
+
Accessibility below.
|
|
76
|
+
|
|
77
|
+
`markerVariants` (the underlying `cva` recipe) is also exported, for a
|
|
78
|
+
consumer composing the marker styles into a custom component.
|
|
79
|
+
|
|
80
|
+
### MarkerIcon
|
|
81
|
+
|
|
82
|
+
A decorative icon slot, hidden from assistive tech with `aria-hidden`.
|
|
83
|
+
Accepts only `className` plus native `<span>` props.
|
|
84
|
+
|
|
85
|
+
### MarkerContent
|
|
86
|
+
|
|
87
|
+
The marker's text content. Accepts only `className` plus native `<span>`
|
|
88
|
+
props.
|
|
89
|
+
|
|
90
|
+
## Examples
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Marker, MarkerContent, MarkerIcon } from '@gears-frontx/ui-kit';
|
|
94
|
+
|
|
95
|
+
<Marker>
|
|
96
|
+
<MarkerIcon>
|
|
97
|
+
<CheckIcon />
|
|
98
|
+
</MarkerIcon>
|
|
99
|
+
<MarkerContent>Explored 4 files</MarkerContent>
|
|
100
|
+
</Marker>;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Separator
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<Marker variant="separator">
|
|
107
|
+
<MarkerContent>Today</MarkerContent>
|
|
108
|
+
</Marker>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Border
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<Marker variant="border">
|
|
115
|
+
<MarkerIcon>
|
|
116
|
+
<FileTextIcon />
|
|
117
|
+
</MarkerIcon>
|
|
118
|
+
<MarkerContent>Opened implementation notes</MarkerContent>
|
|
119
|
+
</Marker>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Link or button
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<Marker render={<a href="/pull/42" />}>
|
|
126
|
+
<MarkerContent>View the pull request</MarkerContent>
|
|
127
|
+
</Marker>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Accessibility
|
|
131
|
+
|
|
132
|
+
Marker is presentational by default. Choose the role based on intent
|
|
133
|
+
rather than relying on a single default:
|
|
134
|
+
|
|
135
|
+
- **Status and progress.** For streaming or in-progress markers ("Checking
|
|
136
|
+
the logs...", a running tool), set `role="status"` so assistive tech
|
|
137
|
+
announces the update as it appears — `Marker` forwards `role` to the
|
|
138
|
+
underlying element.
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
<Marker role="status">
|
|
142
|
+
<MarkerIcon>
|
|
143
|
+
<Spinner />
|
|
144
|
+
</MarkerIcon>
|
|
145
|
+
<MarkerContent>Compacting conversation</MarkerContent>
|
|
146
|
+
</Marker>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- **Labeled separators need no role.** A `separator`-variant marker's
|
|
150
|
+
divider lines are decorative CSS pseudo-elements; its text is announced
|
|
151
|
+
as ordinary content. Do **not** add `role="separator"` to a labeled
|
|
152
|
+
divider — a native separator takes its accessible name from
|
|
153
|
+
`aria-label`, not from its text content, so the visible label would go
|
|
154
|
+
unannounced. Reserve `role="separator"` for a divider with no meaningful
|
|
155
|
+
text of its own.
|
|
156
|
+
|
|
157
|
+
- **Bordered markers keep the default semantics** — the bottom border is
|
|
158
|
+
purely decorative, so choose `role="status"`, `render`, or no role based
|
|
159
|
+
on the marker's actual purpose, same as the default variant.
|
|
160
|
+
|
|
161
|
+
- **Decorative icons.** `MarkerIcon` is hidden from assistive tech; the
|
|
162
|
+
adjacent `MarkerContent` carries the meaning. For an icon-only marker,
|
|
163
|
+
give `Marker` itself an `aria-label` or visible text — an icon alone
|
|
164
|
+
announces as empty.
|
|
165
|
+
|
|
166
|
+
- **Interactive markers.** When a marker links or triggers an action,
|
|
167
|
+
render it as a real `<button>` or `<a>` via `render` so it is focusable
|
|
168
|
+
and exposes the correct role. The accessible name comes from the marker
|
|
169
|
+
text.
|
|
170
|
+
|
|
171
|
+
## Anti-patterns
|
|
172
|
+
|
|
173
|
+
- Do not add `role="separator"` to a `separator`-variant marker that
|
|
174
|
+
carries visible text — see Accessibility above.
|
|
175
|
+
- Do not rely on `MarkerIcon` alone to convey meaning — pair it with
|
|
176
|
+
`MarkerContent` text or an `aria-label` on `Marker`.
|
|
177
|
+
- Do not nest a `Bubble` inside a `Marker` — Marker is a lightweight row,
|
|
178
|
+
not a message surface; use `Message` + `Bubble` for that.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Menubar
|
|
2
|
+
|
|
3
|
+
A horizontal row of menus, like a desktop app's File/Edit/View bar. Wraps
|
|
4
|
+
Base UI's `Menubar` (the roving-tabindex container) plus the kit's own
|
|
5
|
+
`dropdown-menu` parts — each top-level menu is a plain `MenubarMenu`
|
|
6
|
+
(`DropdownMenu`), and Base UI detects its `Menubar` ancestor automatically to
|
|
7
|
+
coordinate keyboard/hover switching between sibling menus.
|
|
8
|
+
|
|
9
|
+
Composition: `Menubar` (root bar) → one or more `MenubarMenu` →
|
|
10
|
+
`MenubarTrigger` → `MenubarContent` (same content parts as `dropdown-menu`:
|
|
11
|
+
`MenubarGroup` / `MenubarItem` / `MenubarCheckboxItem` /
|
|
12
|
+
`MenubarRadioGroup` + `MenubarRadioItem` / `MenubarSeparator` /
|
|
13
|
+
`MenubarShortcut`). Nest a submenu with `MenubarSub` → `MenubarSubTrigger`
|
|
14
|
+
→ `MenubarSubContent`, identical to `dropdown-menu`.
|
|
15
|
+
|
|
16
|
+
Every part past `Menubar` and `MenubarTrigger` is a direct re-export of the
|
|
17
|
+
matching `dropdown-menu` part (same component, same props, same styling) —
|
|
18
|
+
see `dropdown-menu.md` for `MenubarContent`'s positioning props,
|
|
19
|
+
`MenubarItem`'s `variant` axis, `MenubarCheckboxItem`/`MenubarRadioItem`'s
|
|
20
|
+
behavior, and the submenu contract. This file documents only what's unique
|
|
21
|
+
to Menubar: the bar container and the top-level trigger.
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- A persistent, always-visible row of menus at the top of an app or a
|
|
26
|
+
toolbar (File/Edit/View, a document's command bar).
|
|
27
|
+
- Prefer `dropdown-menu` alone for a single "more actions" menu that isn't
|
|
28
|
+
part of a row of peers.
|
|
29
|
+
|
|
30
|
+
## When not to use
|
|
31
|
+
|
|
32
|
+
- Primary page navigation between routes — use `navigation-menu`.
|
|
33
|
+
- A single anchored action menu — use `dropdown-menu` directly (`Menubar`
|
|
34
|
+
adds nothing for exactly one menu).
|
|
35
|
+
|
|
36
|
+
## Props (kit level)
|
|
37
|
+
|
|
38
|
+
`Menubar` (root): `modal` (`true` default), `disabled`, `orientation`
|
|
39
|
+
(`horizontal` default), `loopFocus` — see Base UI `Menubar`. `className` is
|
|
40
|
+
merged after the kit's bar styling (border, radius, `--surface` fill).
|
|
41
|
+
|
|
42
|
+
`MenubarTrigger`: same as `DropdownMenuTrigger` (an unstyled pass-through in
|
|
43
|
+
`dropdown-menu`), styled here as a toolbar button — background on hover and
|
|
44
|
+
while its own menu is open (`data-popup-open`), a `--ring` focus box-shadow,
|
|
45
|
+
disabled at 0.42 opacity. No `variant`/`size` axis — a single look, matching
|
|
46
|
+
upstream.
|
|
47
|
+
|
|
48
|
+
`MenubarMenu`, `MenubarContent`, `MenubarGroup`, `MenubarLabel`,
|
|
49
|
+
`MenubarItem`, `MenubarCheckboxItem`, `MenubarRadioGroup`,
|
|
50
|
+
`MenubarRadioItem`, `MenubarSeparator`, `MenubarShortcut`, `MenubarSub`,
|
|
51
|
+
`MenubarSubTrigger`, `MenubarSubContent`: identical props to their
|
|
52
|
+
`dropdown-menu` counterparts (`DropdownMenu`, `DropdownMenuContent`, ...) —
|
|
53
|
+
these are the same components, re-exported under the `Menubar*` name.
|
|
54
|
+
`MenubarContent` overrides only the positioning defaults (`align="start"`,
|
|
55
|
+
`alignOffset={-4}`, `sideOffset={8}`) to match upstream's menubar-specific
|
|
56
|
+
placement under a toolbar trigger rather than a standalone one.
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import {
|
|
62
|
+
Menubar,
|
|
63
|
+
MenubarCheckboxItem,
|
|
64
|
+
MenubarContent,
|
|
65
|
+
MenubarItem,
|
|
66
|
+
MenubarMenu,
|
|
67
|
+
MenubarRadioGroup,
|
|
68
|
+
MenubarRadioItem,
|
|
69
|
+
MenubarSeparator,
|
|
70
|
+
MenubarShortcut,
|
|
71
|
+
MenubarTrigger,
|
|
72
|
+
} from '@gears-frontx/ui-kit';
|
|
73
|
+
|
|
74
|
+
<Menubar>
|
|
75
|
+
<MenubarMenu>
|
|
76
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
77
|
+
<MenubarContent>
|
|
78
|
+
<MenubarItem>
|
|
79
|
+
New Tab
|
|
80
|
+
<MenubarShortcut>⌘T</MenubarShortcut>
|
|
81
|
+
</MenubarItem>
|
|
82
|
+
<MenubarItem disabled>New Window</MenubarItem>
|
|
83
|
+
<MenubarSeparator />
|
|
84
|
+
<MenubarItem variant="destructive">Close Window</MenubarItem>
|
|
85
|
+
</MenubarContent>
|
|
86
|
+
</MenubarMenu>
|
|
87
|
+
<MenubarMenu>
|
|
88
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
89
|
+
<MenubarContent>
|
|
90
|
+
<MenubarCheckboxItem checked={showBookmarks} onCheckedChange={setShowBookmarks}>
|
|
91
|
+
Show bookmarks
|
|
92
|
+
</MenubarCheckboxItem>
|
|
93
|
+
<MenubarSeparator />
|
|
94
|
+
<MenubarRadioGroup value={zoom} onValueChange={setZoom}>
|
|
95
|
+
<MenubarRadioItem value="100">100%</MenubarRadioItem>
|
|
96
|
+
<MenubarRadioItem value="150">150%</MenubarRadioItem>
|
|
97
|
+
</MenubarRadioGroup>
|
|
98
|
+
</MenubarContent>
|
|
99
|
+
</MenubarMenu>
|
|
100
|
+
</Menubar>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Anti-patterns
|
|
104
|
+
|
|
105
|
+
- Do not put a single `MenubarMenu` inside `Menubar` for one menu that has
|
|
106
|
+
no siblings — use `dropdown-menu` directly, since `Menubar`'s only value
|
|
107
|
+
is coordinating a row of peers.
|
|
108
|
+
- Do not use `Menubar` for page navigation — see `navigation-menu`.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# MessageScroller
|
|
2
|
+
|
|
3
|
+
A chat-transcript scroller with auto-follow: it sticks to the newest message
|
|
4
|
+
while the user is at the bottom, stops following the moment they scroll up
|
|
5
|
+
to read history, and exposes a floating button to jump back. Behavior
|
|
6
|
+
(scroll tracking, anchor bookkeeping, the imperative `scrollTo*` API) comes
|
|
7
|
+
from **`@shadcn/react/message-scroller`**, a headless, zero-runtime-dep
|
|
8
|
+
engine — a dependency deviation from the kit's usual Base UI foundation,
|
|
9
|
+
taken because Base UI ships no chat-scroller primitive. This file supplies only CSS Modules
|
|
10
|
+
styling and composes the kit `Button` for the jump affordance.
|
|
11
|
+
|
|
12
|
+
Composition: `MessageScrollerProvider` (holds auto-follow state, wrap once
|
|
13
|
+
per scroller) → `MessageScroller` (root frame) → `MessageScrollerViewport`
|
|
14
|
+
(the scrolling element) → `MessageScrollerContent` (message list) →
|
|
15
|
+
`MessageScrollerItem` (one message), with `MessageScrollerButton` as a
|
|
16
|
+
sibling of the viewport, absolutely positioned within the root.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- A chat/conversation transcript that should auto-scroll to new messages
|
|
21
|
+
but yield control the instant the user scrolls up to read older ones.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- A generic scrollable panel with no auto-follow need — a plain styled
|
|
26
|
+
`overflow-y: auto` container, or `scroll-area` once ported, is simpler.
|
|
27
|
+
- A virtualized list with windowing (only rendered items exist in the DOM) —
|
|
28
|
+
this component keeps every `MessageScrollerItem` mounted
|
|
29
|
+
(`content-visibility: auto` trims paint cost, not DOM presence).
|
|
30
|
+
|
|
31
|
+
## Props (kit level)
|
|
32
|
+
|
|
33
|
+
`MessageScrollerProvider`: `autoScroll`, `defaultScrollPosition`
|
|
34
|
+
(`'start' | 'end' | 'last-anchor'`), `scrollEdgeThreshold`,
|
|
35
|
+
`scrollPreviousItemPeek`, `scrollMargin` — see
|
|
36
|
+
`useMessageScroller`/`useMessageScrollerScrollable`/
|
|
37
|
+
`useMessageScrollerVisibility` below for reading state back out.
|
|
38
|
+
|
|
39
|
+
`MessageScrollerItem`: `messageId` (target for `scrollToMessage`),
|
|
40
|
+
`scrollAnchor` (marks the item auto-follow/visibility tracking treats as
|
|
41
|
+
the current read position — typically the newest message).
|
|
42
|
+
|
|
43
|
+
`MessageScrollerButton`:
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default |
|
|
46
|
+
|------|------|---------|
|
|
47
|
+
| `direction` | `'end' \| 'start'` | `'end'` |
|
|
48
|
+
| `variant` | kit `Button` variant | `'secondary'` |
|
|
49
|
+
| `size` | kit `Button` size | `'sm'` |
|
|
50
|
+
| `render` | element to render as — defaults to a kit `Button` with the arrow icon | — |
|
|
51
|
+
| `aria-label` | accessible name | `'Scroll to end'` / `'Scroll to start'` |
|
|
52
|
+
| `className` | merged after the kit class | — |
|
|
53
|
+
|
|
54
|
+
Renders as a kit `Button` via `render` (same composition idiom as
|
|
55
|
+
`AlertDialogCancel`/`AlertDialogAction`) and is icon-only by default — no
|
|
56
|
+
visible label, so `Button`'s own icon-only square sizing applies. Pass
|
|
57
|
+
`children` to render a labeled button instead; passing `render` replaces
|
|
58
|
+
the composed `Button` entirely (any element accepting `className`/`ref`
|
|
59
|
+
works, e.g. a router `<Link>`).
|
|
60
|
+
|
|
61
|
+
Hooks (re-exported, call anywhere under `MessageScrollerProvider`):
|
|
62
|
+
`useMessageScroller()` — `{ scrollToEnd, scrollToMessage, scrollToStart }`;
|
|
63
|
+
`useMessageScrollerScrollable()` — `{ start, end }`, whether more content
|
|
64
|
+
exists past each edge; `useMessageScrollerVisibility()` —
|
|
65
|
+
`{ currentAnchorId, visibleMessageIds }`.
|
|
66
|
+
|
|
67
|
+
## Behavior notes
|
|
68
|
+
|
|
69
|
+
- **Short transcripts bottom-anchor.** `MessageScrollerContent` renders
|
|
70
|
+
`justify-content: flex-end` whenever it directly contains at least one
|
|
71
|
+
`MessageScrollerItem` (detected via the `data-scroll-anchor` attribute
|
|
72
|
+
every item carries), so a transcript shorter than its viewport pushes its
|
|
73
|
+
messages down to sit flush against whatever follows the scroller (a
|
|
74
|
+
composer, typically) instead of leaving a permanent gap there. A plain
|
|
75
|
+
reading surface built from `MessageScrollerContent` without any
|
|
76
|
+
`MessageScrollerItem` (see the mail reading pane's history-toggle +
|
|
77
|
+
message body markup) never matches and keeps ordinary top-anchored flow.
|
|
78
|
+
This is pure CSS, scoped by markup shape - no prop to pass, no per-
|
|
79
|
+
consumer compensation.
|
|
80
|
+
|
|
81
|
+
- **A single appended message aligns to the viewport's START, not its
|
|
82
|
+
end.** When exactly one new `MessageScrollerItem` is appended to a
|
|
83
|
+
transcript already on screen, `@shadcn/react`'s content-diff heuristic
|
|
84
|
+
(`handleContentChange`) anchors that item to the TOP of the viewport and
|
|
85
|
+
pads a real, non-zero `[data-message-scroller-spacer]` underneath it so
|
|
86
|
+
the alignment is reachable. Its follow-to-end fast path only applies to
|
|
87
|
+
multi-item changes, so it never fires for an append of one - `autoScroll`
|
|
88
|
+
or not. This is separate from the transcript-switching hazard in
|
|
89
|
+
Anti-patterns below: that one is about reusing a provider across two
|
|
90
|
+
different transcripts, this one happens within a single transcript that
|
|
91
|
+
never changed identity.
|
|
92
|
+
|
|
93
|
+
To get the follow-the-newest behavior a chat surface wants, call
|
|
94
|
+
`scrollToEnd()` yourself after each append, inside a double
|
|
95
|
+
`requestAnimationFrame` so it lands after the primitive's own adjustment
|
|
96
|
+
has painted:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
/** Renders no DOM - it exists only to call `scrollToEnd` at the right moment. */
|
|
100
|
+
function FollowNewestMessage({ lastMessageId }: { lastMessageId: string | undefined }) {
|
|
101
|
+
const { scrollToEnd } = useMessageScroller();
|
|
102
|
+
const previousLastMessageId = useRef(lastMessageId);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (lastMessageId === undefined || lastMessageId === previousLastMessageId.current) {
|
|
106
|
+
previousLastMessageId.current = lastMessageId;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
previousLastMessageId.current = lastMessageId;
|
|
110
|
+
// The primitive's MutationObserver fires as soon as the new item lands
|
|
111
|
+
// in the DOM and applies its own align-to-start adjustment. Two frames
|
|
112
|
+
// land after that adjustment's paint, so this call is the last word on
|
|
113
|
+
// scroll position rather than one the primitive can still clobber.
|
|
114
|
+
let frame = requestAnimationFrame(() => {
|
|
115
|
+
frame = requestAnimationFrame(() => {
|
|
116
|
+
scrollToEnd({ behavior: 'smooth' });
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
return () => cancelAnimationFrame(frame);
|
|
120
|
+
}, [lastMessageId, scrollToEnd]);
|
|
121
|
+
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`useMessageScroller` reads the provider's context, so the component
|
|
127
|
+
calling it has to sit inside `MessageScrollerProvider` - which is why
|
|
128
|
+
this is a child component rather than an effect in the parent that
|
|
129
|
+
renders the provider.
|
|
130
|
+
|
|
131
|
+
## Deviations from upstream
|
|
132
|
+
|
|
133
|
+
- **Icon-only by default, via `aria-label`.** Upstream always renders a
|
|
134
|
+
visually-hidden `sr-only` label span inside the button; this kit's
|
|
135
|
+
`Button` treats any non-empty `children` as a visible label (driving its
|
|
136
|
+
own icon-only auto-sizing), so an `sr-only` span would have forced the
|
|
137
|
+
wide pill shape instead of the compact circle. This component passes an
|
|
138
|
+
explicit `''` to suppress the primitive's own visible-text fallback (it
|
|
139
|
+
falls back to real text whenever `children` is nullish, not merely
|
|
140
|
+
omitted) and supplies the accessible name via `aria-label` instead —
|
|
141
|
+
the kit's standing convention for bare icon buttons (see `button.md`).
|
|
142
|
+
- **No scroll-fade edge mask.** Upstream's viewport also carries a
|
|
143
|
+
`scroll-fade-b` Tailwind utility (a gradient mask hinting more content
|
|
144
|
+
below) and a `scrollbar-thin` utility. Neither is ported; the viewport
|
|
145
|
+
here uses the platform default scrollbar and no fade mask.
|
|
146
|
+
- **No manual recolor on the button.** Upstream repaints the composed
|
|
147
|
+
`Button` to `border-border bg-background text-foreground` regardless of
|
|
148
|
+
the `variant` it passes. This wrapper leaves color entirely to the kit
|
|
149
|
+
`Button`'s own `variant` (default `secondary`), so it looks like every
|
|
150
|
+
other secondary button in the kit rather than a one-off recolor.
|
|
151
|
+
|
|
152
|
+
## Examples
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import {
|
|
156
|
+
MessageScroller,
|
|
157
|
+
MessageScrollerButton,
|
|
158
|
+
MessageScrollerContent,
|
|
159
|
+
MessageScrollerItem,
|
|
160
|
+
MessageScrollerProvider,
|
|
161
|
+
MessageScrollerViewport,
|
|
162
|
+
useMessageScrollerScrollable,
|
|
163
|
+
} from '@gears-frontx/ui-kit';
|
|
164
|
+
|
|
165
|
+
function Transcript({ messages }: { messages: { id: string; text: string }[] }) {
|
|
166
|
+
const { end } = useMessageScrollerScrollable();
|
|
167
|
+
return (
|
|
168
|
+
<MessageScrollerProvider>
|
|
169
|
+
<MessageScroller style={{ height: 480 }}>
|
|
170
|
+
<MessageScrollerViewport>
|
|
171
|
+
<MessageScrollerContent>
|
|
172
|
+
{messages.map((message, index) => (
|
|
173
|
+
<MessageScrollerItem
|
|
174
|
+
key={message.id}
|
|
175
|
+
messageId={message.id}
|
|
176
|
+
scrollAnchor={index === messages.length - 1}
|
|
177
|
+
>
|
|
178
|
+
{message.text}
|
|
179
|
+
</MessageScrollerItem>
|
|
180
|
+
))}
|
|
181
|
+
</MessageScrollerContent>
|
|
182
|
+
</MessageScrollerViewport>
|
|
183
|
+
{end && <MessageScrollerButton direction="end" />}
|
|
184
|
+
</MessageScroller>
|
|
185
|
+
</MessageScrollerProvider>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Testing
|
|
191
|
+
|
|
192
|
+
jsdom implements neither real scrolling (`scrollHeight`/`clientHeight`
|
|
193
|
+
always read 0) nor `content-visibility`, so auto-follow tracking, the
|
|
194
|
+
`data-active`/`data-scrollable` states derived from real scroll position,
|
|
195
|
+
and the render-cost skip from `content-visibility: auto` cannot be
|
|
196
|
+
exercised under vitest. `message-scroller.test.tsx` covers part rendering,
|
|
197
|
+
class/prop wiring, and the `Button` composition (default icon-only sizing,
|
|
198
|
+
`aria-label` override, a fully custom `render` target) instead — behavior
|
|
199
|
+
that doesn't depend on layout.
|
|
200
|
+
|
|
201
|
+
## Anti-patterns
|
|
202
|
+
|
|
203
|
+
- Do not nest more than one `MessageScrollerProvider`/`MessageScroller` per
|
|
204
|
+
scroller — the auto-follow state is per-provider.
|
|
205
|
+
- Do not reuse one `MessageScrollerProvider` across two DIFFERENT
|
|
206
|
+
transcripts (switching the open conversation/mail to a different one)
|
|
207
|
+
without giving it a `key` that changes with the transcript's identity
|
|
208
|
+
(e.g. `key={conversation.id}`). The provider's scroll-anchor/spacer state
|
|
209
|
+
lives in `@shadcn/react`'s own refs, which never reset on their own; if
|
|
210
|
+
the same provider instance stays mounted while its messages are swapped
|
|
211
|
+
for a different transcript's list, the primitive reads that as an
|
|
212
|
+
in-place edit to the CURRENT transcript (an append/removal) rather than
|
|
213
|
+
"this is a different transcript, start over" - it can then try to anchor
|
|
214
|
+
the read position to the previous transcript's item count, leaving a
|
|
215
|
+
real, non-zero `[data-message-scroller-spacer]` gap between the last
|
|
216
|
+
message and whatever follows the scroller. Keying the provider by the
|
|
217
|
+
transcript's id forces a genuine remount (and a fresh
|
|
218
|
+
`scrollToEnd`-on-load) every time the open transcript changes.
|
|
219
|
+
- Do not rely on `MessageScrollerButton`'s default icon-only rendering AND
|
|
220
|
+
omit `aria-label` while also passing empty/whitespace `children` — the
|
|
221
|
+
button would carry no accessible name at all.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Message
|
|
2
|
+
|
|
3
|
+
A conversation row — a faithful port of [shadcn/ui's base
|
|
4
|
+
Message](https://ui.shadcn.com/docs/components/base/message). Message has
|
|
5
|
+
no Base UI primitive; it is plain `div`s wired together through a
|
|
6
|
+
`data-align` state attribute. Message owns the **row** layout — avatar,
|
|
7
|
+
alignment, header, and footer — around a message. Render the visible
|
|
8
|
+
message surface inside it with [`Bubble`](bubble.md). For the scroll
|
|
9
|
+
container around a whole conversation, reach for `MessageScroller` (not
|
|
10
|
+
ported in this wave).
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- A single message row in a conversation thread — assistant, user, or
|
|
15
|
+
system — with an optional avatar and header/footer metadata.
|
|
16
|
+
- Stack consecutive messages from the same sender with `MessageGroup`.
|
|
17
|
+
|
|
18
|
+
## When not to use
|
|
19
|
+
|
|
20
|
+
- The visible bubble/surface itself — that is [`Bubble`](bubble.md)'s job,
|
|
21
|
+
not Message's. Message is intentionally just the row wrapper.
|
|
22
|
+
- A one-off status line with no avatar/header/footer — use
|
|
23
|
+
[`Marker`](marker.md) instead.
|
|
24
|
+
|
|
25
|
+
## Composition
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Message
|
|
29
|
+
├── MessageAvatar
|
|
30
|
+
└── MessageContent
|
|
31
|
+
├── MessageHeader
|
|
32
|
+
├── Bubble
|
|
33
|
+
└── MessageFooter
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
MessageGroup
|
|
38
|
+
├── Message
|
|
39
|
+
└── Message
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
### Message
|
|
45
|
+
|
|
46
|
+
| Prop | Type | Default | Description |
|
|
47
|
+
| ----------- | ------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| `align` | `'start' \| 'end'` | `'start'` | Which side of the conversation this row belongs to. Reverses the row and shifts descendant parts to match. |
|
|
49
|
+
| `className` | `string` | — | Merged after the base class. |
|
|
50
|
+
|
|
51
|
+
All other props are native `<div>` props and are forwarded as-is.
|
|
52
|
+
|
|
53
|
+
### MessageGroup / MessageAvatar / MessageContent / MessageHeader / MessageFooter
|
|
54
|
+
|
|
55
|
+
Each accepts only `className` (merged after its base class) plus native
|
|
56
|
+
`<div>` props — no variant props of their own. `align` lives on `Message`
|
|
57
|
+
alone; the other parts react to it via CSS, not a prop of their own.
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@gears-frontx/ui-kit';
|
|
63
|
+
import { Bubble, BubbleContent } from '@gears-frontx/ui-kit';
|
|
64
|
+
import { Message, MessageAvatar, MessageContent } from '@gears-frontx/ui-kit';
|
|
65
|
+
|
|
66
|
+
<Message>
|
|
67
|
+
<MessageAvatar>
|
|
68
|
+
<Avatar>
|
|
69
|
+
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
70
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
71
|
+
</Avatar>
|
|
72
|
+
</MessageAvatar>
|
|
73
|
+
<MessageContent>
|
|
74
|
+
<Bubble>
|
|
75
|
+
<BubbleContent>How can I help you today?</BubbleContent>
|
|
76
|
+
</Bubble>
|
|
77
|
+
</MessageContent>
|
|
78
|
+
</Message>;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Alignment
|
|
82
|
+
|
|
83
|
+
`align="end"` reverses the row (avatar moves to the trailing edge) and
|
|
84
|
+
right-aligns `MessageContent`'s children and `MessageFooter`'s own content
|
|
85
|
+
— use it for the current user's own messages in a two-sided conversation.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Message align="end">
|
|
89
|
+
<MessageAvatar>
|
|
90
|
+
<Avatar>
|
|
91
|
+
<AvatarFallback>You</AvatarFallback>
|
|
92
|
+
</Avatar>
|
|
93
|
+
</MessageAvatar>
|
|
94
|
+
<MessageContent>
|
|
95
|
+
<Bubble align="end">
|
|
96
|
+
<BubbleContent>What did the last deploy change?</BubbleContent>
|
|
97
|
+
</Bubble>
|
|
98
|
+
</MessageContent>
|
|
99
|
+
</Message>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Group
|
|
103
|
+
|
|
104
|
+
Use `MessageGroup` to stack consecutive messages from the same sender.
|
|
105
|
+
Render an empty `MessageAvatar` on the earlier messages to keep them
|
|
106
|
+
aligned with the avatar on the last one.
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
<MessageGroup>
|
|
110
|
+
<Message>
|
|
111
|
+
<MessageAvatar />
|
|
112
|
+
<MessageContent>
|
|
113
|
+
<Bubble>
|
|
114
|
+
<BubbleContent>I checked the registry output.</BubbleContent>
|
|
115
|
+
</Bubble>
|
|
116
|
+
</MessageContent>
|
|
117
|
+
</Message>
|
|
118
|
+
<Message>
|
|
119
|
+
<MessageAvatar>
|
|
120
|
+
<Avatar>
|
|
121
|
+
<AvatarFallback>CN</AvatarFallback>
|
|
122
|
+
</Avatar>
|
|
123
|
+
</MessageAvatar>
|
|
124
|
+
<MessageContent>
|
|
125
|
+
<Bubble>
|
|
126
|
+
<BubbleContent>The stale route is gone.</BubbleContent>
|
|
127
|
+
</Bubble>
|
|
128
|
+
</MessageContent>
|
|
129
|
+
</Message>
|
|
130
|
+
</MessageGroup>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Header and footer
|
|
134
|
+
|
|
135
|
+
Use `MessageHeader` for a sender name and `MessageFooter` for metadata such
|
|
136
|
+
as a delivery or read status, or message-level actions.
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
<Message>
|
|
140
|
+
<MessageContent>
|
|
141
|
+
<MessageHeader>Assistant</MessageHeader>
|
|
142
|
+
<Bubble>
|
|
143
|
+
<BubbleContent>Done — 4 files changed.</BubbleContent>
|
|
144
|
+
</Bubble>
|
|
145
|
+
<MessageFooter>Delivered</MessageFooter>
|
|
146
|
+
</MessageContent>
|
|
147
|
+
</Message>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`MessageHeader`/`MessageFooter` collapse their inline padding to zero when
|
|
151
|
+
the message's `Bubble` is `variant="ghost"` — an inset header/footer would
|
|
152
|
+
otherwise float disconnected from a bubble that no longer has a frame to
|
|
153
|
+
sit inside.
|
|
154
|
+
|
|
155
|
+
## Accessibility
|
|
156
|
+
|
|
157
|
+
Message is a presentational layout wrapper. Accessibility comes from the
|
|
158
|
+
content placed inside it.
|
|
159
|
+
|
|
160
|
+
- **Label icon-only actions.** Action buttons in `MessageFooter` are
|
|
161
|
+
usually icon-only — give each one an `aria-label`.
|
|
162
|
+
- **Status updates.** For an in-progress message, use a
|
|
163
|
+
[`Marker`](marker.md) with `role="status"` inside the row so assistive
|
|
164
|
+
tech announces the update as it appears:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<Message>
|
|
168
|
+
<Marker role="status">
|
|
169
|
+
<MarkerIcon>
|
|
170
|
+
<Spinner />
|
|
171
|
+
</MarkerIcon>
|
|
172
|
+
<MarkerContent>Checking the logs...</MarkerContent>
|
|
173
|
+
</Marker>
|
|
174
|
+
</Message>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Anti-patterns
|
|
178
|
+
|
|
179
|
+
- Do not render the message surface directly inside `Message` — always go
|
|
180
|
+
through `MessageContent` > `Bubble`, so header/footer padding and the
|
|
181
|
+
avatar's footer-aware shift work correctly.
|
|
182
|
+
- Do not set `align` on individual sub-parts — it belongs on `Message`
|
|
183
|
+
alone; every other part reacts to it through CSS.
|