@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,254 @@
|
|
|
1
|
+
# Attachment
|
|
2
|
+
|
|
3
|
+
A file or image attachment card — a faithful port of [shadcn/ui's base
|
|
4
|
+
Attachment](https://ui.shadcn.com/docs/components/base/attachment). No
|
|
5
|
+
primitive to lean on — the upload state machine is hand-written, plain
|
|
6
|
+
data-attribute-driven CSS. Use it for files and images in chat composers,
|
|
7
|
+
message threads, and upload lists.
|
|
8
|
+
|
|
9
|
+
## Utility dependencies
|
|
10
|
+
|
|
11
|
+
Attachment uses two utility classes shipped in this package's global
|
|
12
|
+
stylesheet: `import '@gears-frontx/ui-kit/utilities.css';` once at the app
|
|
13
|
+
entry, alongside `theme.css`.
|
|
14
|
+
|
|
15
|
+
- **`shimmer`** — `AttachmentTitle` adds it automatically while the
|
|
16
|
+
ancestor `Attachment`'s `state` is `'uploading'` or `'processing'`. This
|
|
17
|
+
is read from React context, not a prop: unlike upstream's pure-CSS
|
|
18
|
+
ancestor selector, attaching an unrelated *global* class conditionally
|
|
19
|
+
needs JavaScript, so `Attachment` provides its `state` via context and
|
|
20
|
+
`AttachmentTitle` consumes it internally — the consumer never re-passes
|
|
21
|
+
`state` to `AttachmentTitle` itself, matching upstream's prop-free API
|
|
22
|
+
exactly.
|
|
23
|
+
- **`scroll-fade-x`** and **`no-scrollbar`** — applied directly by
|
|
24
|
+
`AttachmentGroup` to its own scroll track, for the edge fade and hidden
|
|
25
|
+
scrollbar on its horizontally scrolling row.
|
|
26
|
+
|
|
27
|
+
Both utilities are inert if `utilities.css` isn't imported — import it
|
|
28
|
+
once alongside `theme.css` for these effects to render.
|
|
29
|
+
|
|
30
|
+
## When to use
|
|
31
|
+
|
|
32
|
+
- A file or image attachment in a chat composer, message thread, or upload
|
|
33
|
+
list, with optional actions and upload state.
|
|
34
|
+
|
|
35
|
+
## When not to use
|
|
36
|
+
|
|
37
|
+
- The visible bubble/surface of a text message — use [`Bubble`](bubble.md).
|
|
38
|
+
- A generic card — use `Card` (no upload-state axis, no media/actions
|
|
39
|
+
parts).
|
|
40
|
+
|
|
41
|
+
## Composition
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
Attachment
|
|
45
|
+
├── AttachmentMedia
|
|
46
|
+
├── AttachmentContent
|
|
47
|
+
│ ├── AttachmentTitle
|
|
48
|
+
│ └── AttachmentDescription
|
|
49
|
+
├── AttachmentActions
|
|
50
|
+
│ └── AttachmentAction
|
|
51
|
+
└── AttachmentTrigger
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
AttachmentGroup
|
|
56
|
+
├── Attachment
|
|
57
|
+
└── Attachment
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Variants
|
|
61
|
+
|
|
62
|
+
### Attachment
|
|
63
|
+
|
|
64
|
+
| `state` | Description |
|
|
65
|
+
| ------------- | --------------------------------------------------------------------- |
|
|
66
|
+
| `idle` | Not yet started — dashed border, awaiting a drop or selection. |
|
|
67
|
+
| `uploading` | In progress — `AttachmentTitle` shimmers. |
|
|
68
|
+
| `processing` | Post-upload processing — `AttachmentTitle` shimmers. |
|
|
69
|
+
| `error` | Failed — destructive-tinted border, media, and description. |
|
|
70
|
+
| `done` | Complete (default) — the plain resting state. |
|
|
71
|
+
|
|
72
|
+
| `size` | Description |
|
|
73
|
+
| ----------- | ------------------------------------------------ |
|
|
74
|
+
| `default` | The standard attachment size. |
|
|
75
|
+
| `sm` | A smaller, denser attachment. |
|
|
76
|
+
| `xs` | The smallest attachment, tighter radius/icons. |
|
|
77
|
+
|
|
78
|
+
| `orientation` | Description |
|
|
79
|
+
| -------------- | ----------------------------------------- |
|
|
80
|
+
| `horizontal` | Media beside the content (default). |
|
|
81
|
+
| `vertical` | Media above the content, image-card style. |
|
|
82
|
+
|
|
83
|
+
### AttachmentMedia
|
|
84
|
+
|
|
85
|
+
| `variant` | Description |
|
|
86
|
+
| --------- | ------------------------------------------- |
|
|
87
|
+
| `icon` | Holds a decorative file-type icon (default). |
|
|
88
|
+
| `image` | Holds an `<img>` preview. |
|
|
89
|
+
|
|
90
|
+
## Props
|
|
91
|
+
|
|
92
|
+
### Attachment
|
|
93
|
+
|
|
94
|
+
| Prop | Type | Default | Description |
|
|
95
|
+
| ------------- | -------------------------------------------------------------- | -------------- | ---------------------------------------------------- |
|
|
96
|
+
| `state` | `'idle' \| 'uploading' \| 'processing' \| 'error' \| 'done'` | `'done'` | The upload state. Drives styling and the shimmer. |
|
|
97
|
+
| `size` | `'default' \| 'sm' \| 'xs'` | `'default'` | The attachment size. |
|
|
98
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Lay the media beside or above the content. |
|
|
99
|
+
| `className` | `string` | — | Merged after the variant classes. |
|
|
100
|
+
|
|
101
|
+
All other props are native `<div>` props and are forwarded as-is.
|
|
102
|
+
|
|
103
|
+
### AttachmentMedia
|
|
104
|
+
|
|
105
|
+
| Prop | Type | Default | Description |
|
|
106
|
+
| ----------- | ------------------- | -------- | --------------------------------------- |
|
|
107
|
+
| `variant` | `'icon' \| 'image'` | `'icon'` | Whether the media holds an icon or an `<img>`. |
|
|
108
|
+
| `className` | `string` | — | Merged after the variant class. |
|
|
109
|
+
|
|
110
|
+
### AttachmentTitle / AttachmentDescription / AttachmentContent / AttachmentActions
|
|
111
|
+
|
|
112
|
+
Each accepts only `className` (merged after its base class) plus native
|
|
113
|
+
props for its element (`<span>` for Title/Description, `<div>` for
|
|
114
|
+
Content/Actions) — no `state` prop of their own; see "Utility
|
|
115
|
+
dependencies" above for how `AttachmentTitle` still reacts to the
|
|
116
|
+
ancestor's upload state.
|
|
117
|
+
|
|
118
|
+
### AttachmentAction
|
|
119
|
+
|
|
120
|
+
| Prop | Type | Default | Description |
|
|
121
|
+
| ---------- | --------------------------------------- | -------- | ------------------------------------------ |
|
|
122
|
+
| `size` | Kit `Button`'s `size` (`'default' \| 'sm' \| 'lg'`) | `'sm'` | The button size — see the drift note below. |
|
|
123
|
+
| `...props` | `ComponentProps<typeof Button>` | — | Props spread to the underlying kit `Button`. |
|
|
124
|
+
|
|
125
|
+
**Drift from upstream:** shadcn's `AttachmentAction` defaults to
|
|
126
|
+
`size="icon-xs"` — a dedicated micro icon-only step this kit's `Button`
|
|
127
|
+
does not have.
|
|
128
|
+
`size="sm"` is the smallest step available; icon-only squaring already
|
|
129
|
+
works at any size via `Button`'s own `[data-icon-only]` rule, so the
|
|
130
|
+
visual result is a slightly larger action button (32px) than upstream's
|
|
131
|
+
(24px), not a broken one.
|
|
132
|
+
|
|
133
|
+
### AttachmentTrigger
|
|
134
|
+
|
|
135
|
+
| Prop | Type | Default | Description |
|
|
136
|
+
| ---------- | ---------------------------------- | ------- | ------------------------------------------------- |
|
|
137
|
+
| `render` | `ReactElement` — replaces the root `button` | — | Render as a different element, such as a link. |
|
|
138
|
+
| `...props` | native `<button>` props | — | Forwarded as-is. |
|
|
139
|
+
|
|
140
|
+
### AttachmentGroup
|
|
141
|
+
|
|
142
|
+
Accepts only `className` (merged after the layout class, alongside the
|
|
143
|
+
`scroll-fade-x`/`no-scrollbar` utility classes) plus native `<div>` props.
|
|
144
|
+
|
|
145
|
+
`attachmentVariants`/`attachmentMediaVariants` (the underlying `cva`
|
|
146
|
+
recipes) are also exported.
|
|
147
|
+
|
|
148
|
+
## Examples
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import {
|
|
152
|
+
Attachment,
|
|
153
|
+
AttachmentAction,
|
|
154
|
+
AttachmentActions,
|
|
155
|
+
AttachmentContent,
|
|
156
|
+
AttachmentDescription,
|
|
157
|
+
AttachmentMedia,
|
|
158
|
+
AttachmentTitle,
|
|
159
|
+
} from '@gears-frontx/ui-kit';
|
|
160
|
+
|
|
161
|
+
<Attachment>
|
|
162
|
+
<AttachmentMedia>
|
|
163
|
+
<FileTextIcon />
|
|
164
|
+
</AttachmentMedia>
|
|
165
|
+
<AttachmentContent>
|
|
166
|
+
<AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>
|
|
167
|
+
<AttachmentDescription>PDF · 2.4 MB</AttachmentDescription>
|
|
168
|
+
</AttachmentContent>
|
|
169
|
+
<AttachmentActions>
|
|
170
|
+
<AttachmentAction aria-label="Remove sales-dashboard.pdf">
|
|
171
|
+
<XIcon />
|
|
172
|
+
</AttachmentAction>
|
|
173
|
+
</AttachmentActions>
|
|
174
|
+
</Attachment>;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Image
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<Attachment orientation="vertical">
|
|
181
|
+
<AttachmentMedia variant="image">
|
|
182
|
+
<img src="/preview.png" alt="" />
|
|
183
|
+
</AttachmentMedia>
|
|
184
|
+
<AttachmentContent>
|
|
185
|
+
<AttachmentTitle>workspace.png</AttachmentTitle>
|
|
186
|
+
<AttachmentDescription>PNG · 1.1 MB</AttachmentDescription>
|
|
187
|
+
</AttachmentContent>
|
|
188
|
+
</Attachment>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Upload states
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<Attachment state="uploading">
|
|
195
|
+
<AttachmentMedia>
|
|
196
|
+
<FileIcon />
|
|
197
|
+
</AttachmentMedia>
|
|
198
|
+
<AttachmentContent>
|
|
199
|
+
<AttachmentTitle>large-export.csv</AttachmentTitle>
|
|
200
|
+
<AttachmentDescription>Uploading…</AttachmentDescription>
|
|
201
|
+
</AttachmentContent>
|
|
202
|
+
</Attachment>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Group
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
<AttachmentGroup>
|
|
209
|
+
<Attachment size="sm">{/* … */}</Attachment>
|
|
210
|
+
<Attachment size="sm">{/* … */}</Attachment>
|
|
211
|
+
</AttachmentGroup>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Trigger
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
<Dialog>
|
|
218
|
+
<Attachment>
|
|
219
|
+
{/* media, content, actions */}
|
|
220
|
+
<DialogTrigger render={<AttachmentTrigger aria-label="Preview research-summary.pdf" />} />
|
|
221
|
+
</Attachment>
|
|
222
|
+
<DialogContent>{/* … */}</DialogContent>
|
|
223
|
+
</Dialog>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Accessibility
|
|
227
|
+
|
|
228
|
+
`AttachmentAction` renders a `Button`, and `AttachmentTrigger` renders a
|
|
229
|
+
real `<button>` (or your element via `render`).
|
|
230
|
+
|
|
231
|
+
- **Label icon-only actions.** `AttachmentAction` is usually icon-only —
|
|
232
|
+
give each one an `aria-label` describing the action and its target.
|
|
233
|
+
- **Label the trigger.** `AttachmentTrigger` covers the card with no text
|
|
234
|
+
of its own — give it an `aria-label` for what activating it does. It
|
|
235
|
+
sits behind the actions in the stacking order, so an `AttachmentAction`
|
|
236
|
+
and the `AttachmentTrigger` never trap each other — both remain
|
|
237
|
+
separately focusable and clickable.
|
|
238
|
+
- **Keyboard scrolling.** `AttachmentGroup` scrolls horizontally. When its
|
|
239
|
+
attachments are interactive (a trigger or actions), keyboard users reach
|
|
240
|
+
off-screen items by tabbing to them. For a row of presentational
|
|
241
|
+
attachments, make the group itself focusable and scrollable by adding
|
|
242
|
+
`tabIndex={0}`, `role="group"`, and an `aria-label`.
|
|
243
|
+
- **Meaning beyond color.** The `error` state uses a destructive color —
|
|
244
|
+
keep the failure reason in `AttachmentDescription` so the state is not
|
|
245
|
+
conveyed by color alone.
|
|
246
|
+
|
|
247
|
+
## Anti-patterns
|
|
248
|
+
|
|
249
|
+
- Do not rely on `error` styling alone to communicate failure — pair it
|
|
250
|
+
with text in `AttachmentDescription`.
|
|
251
|
+
- Do not nest another full `Attachment` inside `AttachmentActions` — that
|
|
252
|
+
slot is for action buttons, not attachments.
|
|
253
|
+
- Do not forget `utilities.css` — without it, `AttachmentTitle`'s shimmer
|
|
254
|
+
and `AttachmentGroup`'s edge fade/hidden scrollbar silently do nothing.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
A user's profile picture, with a fallback for when it hasn't loaded (or
|
|
4
|
+
doesn't exist). Wraps the Base UI Avatar primitive for the image/fallback
|
|
5
|
+
timing; the badge and group parts have no Base UI primitive underneath —
|
|
6
|
+
they're plain markup positioned via CSS.
|
|
7
|
+
|
|
8
|
+
Composition: `Avatar` (root, sizes itself and clips its content to a
|
|
9
|
+
circle) → `AvatarImage` (shown once loaded) + `AvatarFallback` (shown
|
|
10
|
+
until then, or on error) + optional `AvatarBadge` (a status dot in the
|
|
11
|
+
corner). `AvatarGroup` wraps several `Avatar`s (and optionally one
|
|
12
|
+
`AvatarGroupCount`) to overlap them into a stack.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- A user or account's profile picture next to their name, in a comment,
|
|
17
|
+
a list row, or a header.
|
|
18
|
+
- A stack of participants (a thread, a call, a shared document) via
|
|
19
|
+
`AvatarGroup` + `AvatarGroupCount` for "+N more".
|
|
20
|
+
|
|
21
|
+
## When not to use
|
|
22
|
+
|
|
23
|
+
- A generic icon with no identity behind it — a plain icon/button doesn't
|
|
24
|
+
need the image-loading/fallback machinery this component provides.
|
|
25
|
+
|
|
26
|
+
## Props
|
|
27
|
+
|
|
28
|
+
`Avatar` (root):
|
|
29
|
+
|
|
30
|
+
| Prop | Type | Default |
|
|
31
|
+
|------|------|---------|
|
|
32
|
+
| `size` | `sm` \| `default` \| `lg` | `default` |
|
|
33
|
+
| `className` | `string` — merged after the kit class | — |
|
|
34
|
+
|
|
35
|
+
All other props are native `<span>` props, forwarded to Base UI's
|
|
36
|
+
`Avatar.Root`.
|
|
37
|
+
|
|
38
|
+
`AvatarImage`: all native `<img>` props plus `onLoadingStatusChange`
|
|
39
|
+
(fires with `'idle' | 'loading' | 'loaded' | 'error'`). Renders nothing
|
|
40
|
+
until the image has loaded — `AvatarFallback` is what's visible until
|
|
41
|
+
then.
|
|
42
|
+
|
|
43
|
+
`AvatarFallback`:
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default |
|
|
46
|
+
|------|------|---------|
|
|
47
|
+
| `tone` | `neutral` \| `accent` \| `info` \| `success` \| `warning` \| `danger` | `neutral` |
|
|
48
|
+
| `variant` | `solid` \| `soft` | `soft` |
|
|
49
|
+
| `delay` | `number` — ms to wait before showing the fallback | — |
|
|
50
|
+
| `className` | `string` — merged after the kit class | — |
|
|
51
|
+
|
|
52
|
+
`tone` × `variant` is the fill matrix: `solid` paints the tone at full
|
|
53
|
+
strength with an on-primary label, `soft` puts the tone's own label color
|
|
54
|
+
on its soft surface. The `neutral`/`soft` default is the plain
|
|
55
|
+
muted-on-muted fill, so a fallback given neither prop looks exactly as it
|
|
56
|
+
did before these axes existed.
|
|
57
|
+
|
|
58
|
+
**`tone` is identity styling, not status.** Derive it from *who* the
|
|
59
|
+
avatar stands for — a stable hash of a user id, a team's assigned color —
|
|
60
|
+
so the same person keeps the same circle everywhere. It must not encode a
|
|
61
|
+
live state (online, invited, suspended); that is `AvatarBadge`'s job.
|
|
62
|
+
|
|
63
|
+
`delay` is useful to skip a flash of fallback for fast-loading images —
|
|
64
|
+
omitted means "show immediately". The fallback renders whenever the image
|
|
65
|
+
hasn't finished loading (`idle`/`loading`/`error`), regardless of whether
|
|
66
|
+
an `AvatarImage` is even present.
|
|
67
|
+
|
|
68
|
+
`AvatarBadge`: all native `<span>` props. Positioned absolutely against
|
|
69
|
+
the `Avatar` root's bottom-right corner — mount it as a **direct child of
|
|
70
|
+
`Avatar`**, alongside `AvatarImage`/`AvatarFallback`; its own dot size
|
|
71
|
+
scales with the ancestor `Avatar`'s `size` (hidden entirely at `size="sm"`,
|
|
72
|
+
matching upstream — a status dot has no room to read at the smallest
|
|
73
|
+
size).
|
|
74
|
+
|
|
75
|
+
`AvatarGroup`: all native `<div>` props. Overlaps its children by half a
|
|
76
|
+
step and gives each one a 2px ring in the page background color, so the
|
|
77
|
+
circles read as separate discs where they overlap. The ring is drawn
|
|
78
|
+
outside each member's circle, so it cuts cleanly through the member behind
|
|
79
|
+
it whatever that member is filled with — a photo, a plain fallback, or any
|
|
80
|
+
`tone`/`variant` fill. Members paint in DOM order, so the last one in the
|
|
81
|
+
markup sits on top of the stack.
|
|
82
|
+
|
|
83
|
+
`AvatarGroupCount`:
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Default |
|
|
86
|
+
|------|------|---------|
|
|
87
|
+
| `tone` | `neutral` \| `accent` \| `info` \| `success` \| `warning` \| `danger` | `neutral` |
|
|
88
|
+
| `variant` | `solid` \| `soft` | `soft` |
|
|
89
|
+
| `className` | `string` — merged after the kit class | — |
|
|
90
|
+
|
|
91
|
+
Plus all native `<div>` props. It takes the same fill matrix as
|
|
92
|
+
`AvatarFallback` so a "+3" chip can match the toned members it caps off.
|
|
93
|
+
It takes no `size` prop — it sizes itself off its sibling `Avatar`s' `size`
|
|
94
|
+
inside the same `AvatarGroup` (via a CSS `:has()` selector), because size
|
|
95
|
+
is a property of the group while tone is a choice about this one chip.
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@gears-frontx/ui-kit';
|
|
101
|
+
|
|
102
|
+
<Avatar>
|
|
103
|
+
<AvatarImage src="/jane.jpg" alt="Jane Doe" />
|
|
104
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
105
|
+
</Avatar>;
|
|
106
|
+
|
|
107
|
+
// Small, with a status badge
|
|
108
|
+
<Avatar size="sm">
|
|
109
|
+
<AvatarImage src="/jane.jpg" alt="Jane Doe" />
|
|
110
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
111
|
+
</Avatar>;
|
|
112
|
+
|
|
113
|
+
<Avatar size="lg">
|
|
114
|
+
<AvatarImage src="/jane.jpg" alt="Jane Doe" />
|
|
115
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
116
|
+
<AvatarBadge />
|
|
117
|
+
</Avatar>;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// Identity fills: a colored circle per person, tone picked from the user id
|
|
122
|
+
<Avatar>
|
|
123
|
+
<AvatarFallback tone="accent" variant="solid">
|
|
124
|
+
ML
|
|
125
|
+
</AvatarFallback>
|
|
126
|
+
</Avatar>;
|
|
127
|
+
|
|
128
|
+
<Avatar>
|
|
129
|
+
<AvatarFallback tone="success" variant="soft">
|
|
130
|
+
JB
|
|
131
|
+
</AvatarFallback>
|
|
132
|
+
</Avatar>;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from '@gears-frontx/ui-kit';
|
|
137
|
+
|
|
138
|
+
<AvatarGroup>
|
|
139
|
+
<Avatar>
|
|
140
|
+
<AvatarImage src="/jane.jpg" alt="Jane Doe" />
|
|
141
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
142
|
+
</Avatar>
|
|
143
|
+
<Avatar>
|
|
144
|
+
<AvatarImage src="/sam.jpg" alt="Sam Lee" />
|
|
145
|
+
<AvatarFallback>SL</AvatarFallback>
|
|
146
|
+
</Avatar>
|
|
147
|
+
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
148
|
+
</AvatarGroup>;
|
|
149
|
+
|
|
150
|
+
// Toned members; the count chip can carry a fill of its own
|
|
151
|
+
<AvatarGroup>
|
|
152
|
+
<Avatar>
|
|
153
|
+
<AvatarFallback tone="accent" variant="solid">
|
|
154
|
+
ML
|
|
155
|
+
</AvatarFallback>
|
|
156
|
+
</Avatar>
|
|
157
|
+
<Avatar>
|
|
158
|
+
<AvatarFallback tone="success" variant="solid">
|
|
159
|
+
JB
|
|
160
|
+
</AvatarFallback>
|
|
161
|
+
</Avatar>
|
|
162
|
+
<AvatarGroupCount tone="accent" variant="soft">
|
|
163
|
+
+3
|
|
164
|
+
</AvatarGroupCount>
|
|
165
|
+
</AvatarGroup>;
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Anti-patterns
|
|
169
|
+
|
|
170
|
+
- Do not mount `AvatarBadge` outside of an `Avatar` — its absolute
|
|
171
|
+
positioning is anchored to the root's own `position: relative`, and
|
|
172
|
+
its size reads the ancestor `Avatar`'s size class.
|
|
173
|
+
- Do not expect `AvatarFallback` to hide once `AvatarImage` starts
|
|
174
|
+
loading — it stays visible until the image finishes loading
|
|
175
|
+
successfully (or indefinitely on error/no `src`), by design (see
|
|
176
|
+
upstream's own doc comment: "the image to be displayed" is a distinct
|
|
177
|
+
concern from "what shows while it isn't").
|
|
178
|
+
- Do not give `AvatarGroupCount` a `size` prop expecting it to control its
|
|
179
|
+
own dimensions — it has none; it sizes itself from its sibling
|
|
180
|
+
`Avatar`s' `size` within the same `AvatarGroup`.
|
|
181
|
+
- Do not drive `AvatarFallback`'s `tone` from a status (`danger` for a
|
|
182
|
+
suspended account, `success` for an online one) — a person's circle would
|
|
183
|
+
change color as their state changes, breaking the recognition the fill
|
|
184
|
+
exists to provide. Use `AvatarBadge` for state and keep `tone` tied to
|
|
185
|
+
identity.
|
package/dist/docs/badge.md
CHANGED
|
@@ -1,96 +1,108 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
5
|
-
styled `span`, plus a `render` prop (via Base
|
|
6
|
-
utilities) for the one case that needs it:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
A compact inline label — a faithful port of [shadcn/ui's base
|
|
4
|
+
Badge](https://ui.shadcn.com/docs/components/base/badge). Badge has no
|
|
5
|
+
Base UI primitive — it's a styled `span`, plus a `render` prop (via Base
|
|
6
|
+
UI's `useRender`/`mergeProps` utilities) for the one case that needs it:
|
|
7
|
+
rendering as a link.
|
|
8
|
+
|
|
9
|
+
Badge's variant axis is **paint only**, in two groups on one axis:
|
|
10
|
+
|
|
11
|
+
- **Upstream paint** — `default`, `secondary`, `destructive`, `outline`,
|
|
12
|
+
`ghost`, `link`: the same six names and the same meaning as
|
|
13
|
+
[Button](button.md)'s.
|
|
14
|
+
- **Tone** — `success`, `warning`, `danger`, `info`, `accent`: a soft
|
|
15
|
+
tinted fill with the tone's own color as the label, matching the Studio
|
|
16
|
+
design's Badge row. Its sixth specimen, Neutral, is `secondary` — that
|
|
17
|
+
variant already paints the drawn pair exactly, so there is no separate
|
|
18
|
+
`neutral` name.
|
|
19
|
+
|
|
20
|
+
Note that `destructive` and `danger` are both present on purpose: solid
|
|
21
|
+
red with a white label, and a soft red fill with a red label — two
|
|
22
|
+
emphasis levels of the same red.
|
|
23
|
+
|
|
24
|
+
A tone is still paint, not state: it colors a label, it does not track
|
|
25
|
+
one. Badge's five tones (`success`, `warning`, `danger`, `info`, `accent`)
|
|
26
|
+
are the semantic-ish colors available — pick the one that best matches the
|
|
27
|
+
status, but keep the label text itself explicit; color alone is not a
|
|
28
|
+
substitute for a state machine.
|
|
29
|
+
|
|
30
|
+
> **Accessibility caveat on tones.** At Badge's 12px/500 label, WCAG 1.4.3
|
|
31
|
+
> asks 4.5:1. Four of the drawn tone pairs currently fall short — light
|
|
32
|
+
> `success` 3.43:1, `warning` 2.90:1, `danger` 4.28:1, `info` 3.73:1, and
|
|
33
|
+
> dark `danger` 3.80:1 — because the shortfall is in the theme's status
|
|
34
|
+
> token pairs, not in this component. Until those pairs are re-pinned, do
|
|
35
|
+
> not let a tone's color be the only thing carrying the meaning: keep the
|
|
36
|
+
> label text itself explicit. `accent` and `secondary` clear AA in both
|
|
37
|
+
> themes, as do `success`, `warning` and `info` in dark.
|
|
14
38
|
|
|
15
39
|
## When to use
|
|
16
40
|
|
|
17
|
-
- A
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
clickable when it isn't. The kit's focus ring appears automatically once
|
|
29
|
-
the anchor receives keyboard focus. Give it discernible text — a badge
|
|
30
|
-
with no accessible name is unusable via keyboard or screen reader.
|
|
41
|
+
- A short, static inline label: a count, a category tag, a plan name, a
|
|
42
|
+
version number.
|
|
43
|
+
- A status label that benefits from color (running/failed/pending/beta) —
|
|
44
|
+
pick the tone variant (`success`/`warning`/`danger`/`info`/`accent`)
|
|
45
|
+
that matches the meaning, and still spell the status out in the label
|
|
46
|
+
text; a tone is paint, not a live indicator.
|
|
47
|
+
- A clickable tag — pass `render={<a href="..." />}`. The kit's focus
|
|
48
|
+
ring appears once the anchor receives keyboard focus, and hover
|
|
49
|
+
feedback (background/underline) only applies once actually rendered as
|
|
50
|
+
a link. Give it discernible text — a badge with no accessible name is
|
|
51
|
+
unusable via keyboard or screen reader.
|
|
31
52
|
|
|
32
53
|
## When not to use
|
|
33
54
|
|
|
34
55
|
- A clickable action with its own visual weight — use `button`.
|
|
35
56
|
- Long or wrapping text — Badge is single-line (`white-space: nowrap`) and
|
|
36
57
|
clips overflow.
|
|
37
|
-
- Prose-colored emphasis or arbitrary brand colors — intents are the whole
|
|
38
|
-
vocabulary; recoloring a badge via CSS breaks the semantic contract.
|
|
39
58
|
|
|
40
59
|
## Props (kit level)
|
|
41
60
|
|
|
42
61
|
| Prop | Type | Default |
|
|
43
62
|
|------|------|---------|
|
|
44
|
-
| `variant` | `success` \| `warning` \| `
|
|
45
|
-
| `shape` | `pill` \| `plain` | `pill` |
|
|
46
|
-
| `dot` | `boolean` — show the status dot in the variant's accent color; ignored when `icon` is set | `false` |
|
|
47
|
-
| `icon` | `ReactNode` — leading icon, decorative (`aria-hidden`), 12px, accent-colored; replaces the dot | — |
|
|
63
|
+
| `variant` | `default` \| `secondary` \| `destructive` \| `outline` \| `ghost` \| `link` \| `success` \| `warning` \| `danger` \| `info` \| `accent` | `default` |
|
|
48
64
|
| `render` | `ReactElement` — replaces the root `span`, e.g. with an `<a>` | — |
|
|
49
|
-
| `className` | `string` — merged after the variant
|
|
65
|
+
| `className` | `string` — merged after the variant class | — |
|
|
50
66
|
|
|
51
67
|
All other props are native `<span>` props (or the target element's props
|
|
52
68
|
when using `render`) and are forwarded as-is, including `aria-invalid`
|
|
53
69
|
(shows a destructive-tinted border and ring, independent of `variant`).
|
|
54
70
|
|
|
71
|
+
`badgeVariants` (the underlying `cva` recipe) is also exported, for a
|
|
72
|
+
consumer that needs the class string without the component — e.g. styling
|
|
73
|
+
a link that must stay a real `<a>` outside of `render`.
|
|
74
|
+
|
|
55
75
|
## Examples
|
|
56
76
|
|
|
57
77
|
```tsx
|
|
58
78
|
import { Badge } from '@gears-frontx/ui-kit';
|
|
59
79
|
|
|
60
|
-
//
|
|
61
|
-
<Badge
|
|
62
|
-
<Badge variant="
|
|
63
|
-
<Badge variant="
|
|
64
|
-
<Badge variant="
|
|
65
|
-
<Badge>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<Badge variant="
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<Badge variant="info" icon={<BetaIcon />}>Beta</Badge>
|
|
80
|
+
// Upstream paint
|
|
81
|
+
<Badge>default</Badge>
|
|
82
|
+
<Badge variant="secondary">secondary</Badge>
|
|
83
|
+
<Badge variant="destructive">destructive</Badge>
|
|
84
|
+
<Badge variant="outline">outline</Badge>
|
|
85
|
+
<Badge variant="ghost">ghost</Badge>
|
|
86
|
+
<Badge variant="link">link</Badge>
|
|
87
|
+
|
|
88
|
+
// Tone — soft fill, tone-colored label ("secondary" is this row's Neutral)
|
|
89
|
+
<Badge variant="success">success</Badge>
|
|
90
|
+
<Badge variant="warning">warning</Badge>
|
|
91
|
+
<Badge variant="danger">danger</Badge>
|
|
92
|
+
<Badge variant="info">info</Badge>
|
|
93
|
+
<Badge variant="accent">accent</Badge>
|
|
75
94
|
|
|
76
95
|
// A badge that is actually a link — hover feedback only applies here
|
|
77
|
-
<Badge variant="
|
|
78
|
-
|
|
96
|
+
<Badge variant="outline" render={<a href="/plans/pro" />}>
|
|
97
|
+
Pro plan
|
|
79
98
|
</Badge>
|
|
80
99
|
```
|
|
81
100
|
|
|
82
101
|
## Anti-patterns
|
|
83
102
|
|
|
84
|
-
- Do not
|
|
85
|
-
|
|
86
|
-
- Do not recolor a badge via `className`/`style` — the intent palette and
|
|
87
|
-
its contrast math live in the kit; brand changes belong in theme tokens.
|
|
88
|
-
- Do not expect hover feedback from a plain (non-`render`) badge — it only
|
|
89
|
-
appears when the badge actually renders as a link via `render`.
|
|
103
|
+
- Do not let a tone carry meaning on its own — a tone paints, it does not
|
|
104
|
+
announce. Always spell out the meaning in the label text itself.
|
|
90
105
|
- Do not nest interactive controls inside a Badge — it is a label, not a
|
|
91
106
|
container.
|
|
92
|
-
- Do not
|
|
93
|
-
|
|
94
|
-
- Do not drop an icon into Badge's children (`<Badge><Icon />label</Badge>`)
|
|
95
|
-
— the kit no longer sizes a bare svg child; use the `icon` prop, which is
|
|
96
|
-
sized and accent-colored automatically.
|
|
107
|
+
- Do not expect hover feedback from a plain (non-`render`) badge — it only
|
|
108
|
+
appears when the badge actually renders as a link via `render`.
|