@gears-frontx/ui-kit 0.4.2 → 0.4.3

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.
Files changed (150) hide show
  1. package/README.md +6 -5
  2. package/dist/alert.js +35 -24
  3. package/dist/alert.js.map +1 -1
  4. package/dist/attachment.js +117 -76
  5. package/dist/attachment.js.map +1 -1
  6. package/dist/avatar.js +43 -43
  7. package/dist/badge.js +14 -14
  8. package/dist/card.js +81 -44
  9. package/dist/card.js.map +1 -1
  10. package/dist/chart.js +50 -50
  11. package/dist/chunks/alert.Csv2-ccF.css +1 -0
  12. package/dist/chunks/attachment.BRyIQq3F.css +1 -0
  13. package/dist/chunks/avatar.7EUG65-M.css +1 -0
  14. package/dist/chunks/badge.BwUxa9PB.css +1 -0
  15. package/dist/chunks/card.DSiUMxGK.css +1 -0
  16. package/dist/chunks/chart.B9cGEno8.css +1 -0
  17. package/dist/chunks/code-block.r7Cm0ncj.css +1 -0
  18. package/dist/chunks/description-list.Cx-vFGJL.css +1 -0
  19. package/dist/chunks/empty.DWqLrSfF.css +1 -0
  20. package/dist/chunks/heading.DQxQs5po.css +1 -0
  21. package/dist/chunks/item.BQ70Khqj.css +1 -0
  22. package/dist/chunks/link.BOE4f-aB.css +1 -0
  23. package/dist/chunks/message-scroller.CBjPcz8Y.css +1 -0
  24. package/dist/chunks/sheet.BkZyzAbA.css +1 -0
  25. package/dist/chunks/sidebar.CIuN--7U.css +1 -0
  26. package/dist/chunks/slider.DY1XDCPw.css +1 -0
  27. package/dist/chunks/status-dot.39NKkKQF.css +1 -0
  28. package/dist/chunks/text.7frjnkUr.css +1 -0
  29. package/dist/chunks/visually-hidden.Bd2oAR5D.css +1 -0
  30. package/dist/code-block.d.ts +1 -0
  31. package/dist/code-block.js +152 -0
  32. package/dist/code-block.js.map +1 -0
  33. package/dist/command.js +63 -48
  34. package/dist/command.js.map +1 -1
  35. package/dist/components/alert/alert.d.ts +3 -2
  36. package/dist/components/alert/alert.d.ts.map +1 -1
  37. package/dist/components/attachment/attachment.d.ts +10 -3
  38. package/dist/components/attachment/attachment.d.ts.map +1 -1
  39. package/dist/components/card/card.d.ts +6 -4
  40. package/dist/components/card/card.d.ts.map +1 -1
  41. package/dist/components/code-block/code-block.d.ts +57 -0
  42. package/dist/components/code-block/code-block.d.ts.map +1 -0
  43. package/dist/components/code-block/public.d.ts +2 -0
  44. package/dist/components/code-block/public.d.ts.map +1 -0
  45. package/dist/components/command/command.d.ts +1 -1
  46. package/dist/components/command/command.d.ts.map +1 -1
  47. package/dist/components/description-list/description-list.d.ts +21 -0
  48. package/dist/components/description-list/description-list.d.ts.map +1 -0
  49. package/dist/components/description-list/public.d.ts +2 -0
  50. package/dist/components/description-list/public.d.ts.map +1 -0
  51. package/dist/components/empty/empty.d.ts +3 -2
  52. package/dist/components/empty/empty.d.ts.map +1 -1
  53. package/dist/components/heading/heading.d.ts +10 -0
  54. package/dist/components/heading/heading.d.ts.map +1 -0
  55. package/dist/components/heading/public.d.ts +2 -0
  56. package/dist/components/heading/public.d.ts.map +1 -0
  57. package/dist/components/input-otp/input-otp.d.ts +1 -1
  58. package/dist/components/input-otp/input-otp.d.ts.map +1 -1
  59. package/dist/components/item/item.d.ts +15 -6
  60. package/dist/components/item/item.d.ts.map +1 -1
  61. package/dist/components/link/link.d.ts +18 -0
  62. package/dist/components/link/link.d.ts.map +1 -0
  63. package/dist/components/link/public.d.ts +2 -0
  64. package/dist/components/link/public.d.ts.map +1 -0
  65. package/dist/components/sidebar/sidebar.d.ts +13 -3
  66. package/dist/components/sidebar/sidebar.d.ts.map +1 -1
  67. package/dist/components/slider/slider.d.ts +1 -1
  68. package/dist/components/slider/slider.d.ts.map +1 -1
  69. package/dist/components/table/table.d.ts.map +1 -1
  70. package/dist/components/text/public.d.ts +2 -0
  71. package/dist/components/text/public.d.ts.map +1 -0
  72. package/dist/components/text/text.d.ts +11 -0
  73. package/dist/components/text/text.d.ts.map +1 -0
  74. package/dist/components/visually-hidden/public.d.ts +2 -0
  75. package/dist/components/visually-hidden/public.d.ts.map +1 -0
  76. package/dist/components/visually-hidden/visually-hidden.d.ts +4 -0
  77. package/dist/components/visually-hidden/visually-hidden.d.ts.map +1 -0
  78. package/dist/description-list.d.ts +1 -0
  79. package/dist/description-list.js +78 -0
  80. package/dist/description-list.js.map +1 -0
  81. package/dist/docs/alert.md +8 -2
  82. package/dist/docs/attachment.md +20 -8
  83. package/dist/docs/avatar.md +8 -2
  84. package/dist/docs/badge.md +12 -11
  85. package/dist/docs/button.md +16 -4
  86. package/dist/docs/calendar.md +6 -0
  87. package/dist/docs/card.md +38 -6
  88. package/dist/docs/carousel.md +4 -2
  89. package/dist/docs/chart.md +23 -0
  90. package/dist/docs/code-block.md +114 -0
  91. package/dist/docs/description-list.md +53 -0
  92. package/dist/docs/empty.md +9 -3
  93. package/dist/docs/heading.md +60 -0
  94. package/dist/docs/item.md +70 -3
  95. package/dist/docs/link.md +48 -0
  96. package/dist/docs/message-scroller.md +5 -0
  97. package/dist/docs/sheet.md +20 -3
  98. package/dist/docs/sidebar.md +27 -0
  99. package/dist/docs/status-dot.md +2 -2
  100. package/dist/docs/switch.md +10 -4
  101. package/dist/docs/text.md +51 -0
  102. package/dist/docs/visually-hidden.md +44 -0
  103. package/dist/empty.js +47 -36
  104. package/dist/empty.js.map +1 -1
  105. package/dist/heading.d.ts +1 -0
  106. package/dist/heading.js +36 -0
  107. package/dist/heading.js.map +1 -0
  108. package/dist/index.d.ts +6 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +427 -401
  111. package/dist/index.js.map +1 -1
  112. package/dist/input-otp.js +34 -20
  113. package/dist/input-otp.js.map +1 -1
  114. package/dist/item.js +119 -71
  115. package/dist/item.js.map +1 -1
  116. package/dist/link.d.ts +1 -0
  117. package/dist/link.js +55 -0
  118. package/dist/link.js.map +1 -0
  119. package/dist/message-scroller.js +24 -24
  120. package/dist/sheet.js +41 -41
  121. package/dist/sidebar.js +220 -206
  122. package/dist/sidebar.js.map +1 -1
  123. package/dist/slider.js +34 -21
  124. package/dist/slider.js.map +1 -1
  125. package/dist/status-dot.js +25 -25
  126. package/dist/table.js +172 -157
  127. package/dist/table.js.map +1 -1
  128. package/dist/text.d.ts +1 -0
  129. package/dist/text.js +53 -0
  130. package/dist/text.js.map +1 -0
  131. package/dist/theme.css +29 -6
  132. package/dist/utilities.css +25 -2
  133. package/dist/visually-hidden.d.ts +1 -0
  134. package/dist/visually-hidden.js +18 -0
  135. package/dist/visually-hidden.js.map +1 -0
  136. package/llms.txt +72 -15
  137. package/package.json +1 -1
  138. package/dist/chunks/alert.DsgRIXLn.css +0 -1
  139. package/dist/chunks/attachment.CZuZdlXC.css +0 -1
  140. package/dist/chunks/avatar.BMm-Z9l5.css +0 -1
  141. package/dist/chunks/badge.BCreEn3O.css +0 -1
  142. package/dist/chunks/card.DdBl-usf.css +0 -1
  143. package/dist/chunks/chart.CeyctrXQ.css +0 -1
  144. package/dist/chunks/empty.DnAKlw2g.css +0 -1
  145. package/dist/chunks/item.BkcgydVc.css +0 -1
  146. package/dist/chunks/message-scroller.CbLooS7Q.css +0 -1
  147. package/dist/chunks/sheet.BWvXXyXk.css +0 -1
  148. package/dist/chunks/sidebar.DdEvMURX.css +0 -1
  149. package/dist/chunks/slider.inyNxx4y.css +0 -1
  150. package/dist/chunks/status-dot.DWa2qGKe.css +0 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ kits into their own templates.
17
17
  import '@gears-frontx/ui-kit/theme.css'; // design tokens (CSS variables)
18
18
 
19
19
  // two optional global stylesheets, each imported only if you need it:
20
- import '@gears-frontx/ui-kit/utilities.css'; // shimmer, scroll-fade-x, no-scrollbar
20
+ import '@gears-frontx/ui-kit/utilities.css'; // shimmer, scroll-fade-x, no-scrollbar, sr-only
21
21
  import '@gears-frontx/ui-kit/typeset.css'; // prose styling for rendered markdown/HTML
22
22
  ```
23
23
 
@@ -65,10 +65,11 @@ like Select or Dialog still ships Base UI's own client bundle; only the kit
65
65
  wrapper around it needs no directive of its own). The rest call a hook directly
66
66
  in their own render body and ship a banner on their own chunk instead.
67
67
 
68
- The kit components that carry a `'use client'` banner of their own: Attachment,
69
- Badge, Breadcrumb, Bubble, ButtonGroup, Carousel, Chart, Combobox, ContextMenu,
70
- DataGrid, DataTable, Drawer, DropdownMenu, Marker, PageHeader, Sidebar,
71
- StatusDot, Table, Toast.
68
+ The kit components that carry a `'use client'` banner of their own: Alert,
69
+ Attachment, Badge, Breadcrumb, Bubble, ButtonGroup, Card, Carousel, Chart,
70
+ CodeBlock, Combobox, Command, ContextMenu, DataGrid, DataTable, Drawer,
71
+ DropdownMenu, Empty, Heading, InputOtp, Item, Link, Marker, PageHeader,
72
+ Sidebar, StatusDot, Table, Text, Toast, VisuallyHidden.
72
73
 
73
74
  Everything else — including interactive primitives like Button, Checkbox,
74
75
  Dialog, Select, Switch, RadioGroup, and Tabs — stays server-renderable; each
package/dist/alert.js CHANGED
@@ -1,39 +1,50 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { cx as i, cva as l } from "class-variance-authority";
3
- import './chunks/alert.DsgRIXLn.css';const c = "_alert_rvg6q_13", s = "_variantDefault_rvg6q_30", o = "_variantDestructive_rvg6q_35", v = "_alertTitle_rvg6q_77", u = "_alertDescription_rvg6q_85", _ = "_alertAction_rvg6q_100", a = {
4
- alert: c,
5
- variantDefault: s,
6
- variantDestructive: o,
7
- alertTitle: v,
8
- alertDescription: u,
9
- alertAction: _
10
- }, f = l(a.alert, {
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { mergeProps as l } from "@base-ui/react/merge-props";
4
+ import { useRender as c } from "@base-ui/react/use-render";
5
+ import { cx as n, cva as o } from "class-variance-authority";
6
+ import './chunks/alert.Csv2-ccF.css';const s = "_alert_1eco7_13", u = "_variantDefault_1eco7_30", v = "_variantDestructive_1eco7_35", _ = "_alertTitle_1eco7_77", d = "_alertDescription_1eco7_85", f = "_alertAction_1eco7_100", m = "_renderedTitle_1eco7_124", r = {
7
+ alert: s,
8
+ variantDefault: u,
9
+ variantDestructive: v,
10
+ alertTitle: _,
11
+ alertDescription: d,
12
+ alertAction: f,
13
+ renderedTitle: m
14
+ }, p = o(r.alert, {
11
15
  variants: {
12
16
  variant: {
13
- default: a.variantDefault,
14
- destructive: a.variantDestructive
17
+ default: r.variantDefault,
18
+ destructive: r.variantDestructive
15
19
  }
16
20
  },
17
21
  defaultVariants: {
18
22
  variant: "default"
19
23
  }
20
24
  });
21
- function d({ className: t, variant: r, ...n }) {
22
- return /* @__PURE__ */ e("div", { role: "alert", className: f({ variant: r, className: t }), ...n });
25
+ function x({ className: e, variant: t, ...a }) {
26
+ return /* @__PURE__ */ i("div", { role: "alert", className: p({ variant: t, className: e }), ...a });
23
27
  }
24
- function m({ className: t, ...r }) {
25
- return /* @__PURE__ */ e("div", { className: i(a.alertTitle, t), ...r });
28
+ function g({ className: e, render: t, ...a }) {
29
+ return c({
30
+ defaultTagName: "div",
31
+ render: t,
32
+ props: l(
33
+ { className: n(r.alertTitle, t && r.renderedTitle, e) },
34
+ a
35
+ )
36
+ });
26
37
  }
27
- function p({ className: t, ...r }) {
28
- return /* @__PURE__ */ e("div", { className: i(a.alertDescription, t), ...r });
38
+ function V({ className: e, ...t }) {
39
+ return /* @__PURE__ */ i("div", { className: n(r.alertDescription, e), ...t });
29
40
  }
30
- function g({ className: t, ...r }) {
31
- return /* @__PURE__ */ e("div", { className: i(a.alertAction, t), ...r });
41
+ function j({ className: e, ...t }) {
42
+ return /* @__PURE__ */ i("div", { className: n(r.alertAction, e), ...t });
32
43
  }
33
44
  export {
34
- d as Alert,
35
- g as AlertAction,
36
- p as AlertDescription,
37
- m as AlertTitle
45
+ x as Alert,
46
+ j as AlertAction,
47
+ V as AlertDescription,
48
+ g as AlertTitle
38
49
  };
39
50
  //# sourceMappingURL=alert.js.map
package/dist/alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sources":["../src/components/alert/alert.tsx"],"sourcesContent":["import { cva, cx, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport styles from './alert.module.css';\n\n/*\n * Alert has no Base UI primitive (registry/bases/base/ui/alert.tsx ships\n * plain `div`s with data-slot markers and a `role=\"alert\"` root) — a pure\n * styling translation over native elements, same shape as Card (see\n * card.tsx). No `data-slot` attributes, per the kit-wide convention: the\n * icon/action layout below is detected structurally (`:has()`), the same\n * sanctioned pattern Card's header/action classes already use (see\n * tokens.test.ts).\n */\n\nconst alertVariants = cva(styles.alert, {\n variants: {\n variant: {\n default: styles.variantDefault,\n destructive: styles.variantDestructive,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport type AlertProps = ComponentProps<'div'> & VariantProps<typeof alertVariants>;\n\nexport function Alert({ className, variant, ...props }: AlertProps) {\n return <div role=\"alert\" className={alertVariants({ variant, className })} {...props} />;\n}\n\nexport type AlertTitleProps = ComponentProps<'div'>;\n\nexport function AlertTitle({ className, ...props }: AlertTitleProps) {\n return <div className={cx(styles.alertTitle, className)} {...props} />;\n}\n\nexport type AlertDescriptionProps = ComponentProps<'div'>;\n\nexport function AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return <div className={cx(styles.alertDescription, className)} {...props} />;\n}\n\n/**\n * Positions in the alert's top-right corner (see alert.module.css) — an\n * `AlertAction` present as a direct child also reserves room in the\n * alert's own padding so body text never runs under it, detected the same\n * structural way (no prop to set).\n */\nexport type AlertActionProps = ComponentProps<'div'>;\n\nexport function AlertAction({ className, ...props }: AlertActionProps) {\n return <div className={cx(styles.alertAction, className)} {...props} />;\n}\n"],"names":["alertVariants","cva","styles","Alert","className","variant","props","jsx","AlertTitle","cx","AlertDescription","AlertAction"],"mappings":";;;;;;;;;GAeMA,IAAgBC,EAAIC,EAAO,OAAO;AAAA,EACtC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAASA,EAAO;AAAA,MAChB,aAAaA,EAAO;AAAA,IAAA;AAAA,EACtB;AAAA,EAEF,iBAAiB;AAAA,IACf,SAAS;AAAA,EAAA;AAEb,CAAC;AAIM,SAASC,EAAM,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,KAAqB;AAClE,SAAO,gBAAAC,EAAC,OAAA,EAAI,MAAK,SAAQ,WAAWP,EAAc,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,GAAI,GAAGE,EAAA,CAAO;AACxF;AAIO,SAASE,EAAW,EAAE,WAAAJ,GAAW,GAAGE,KAA0B;AACnE,SAAO,gBAAAC,EAAC,SAAI,WAAWE,EAAGP,EAAO,YAAYE,CAAS,GAAI,GAAGE,GAAO;AACtE;AAIO,SAASI,EAAiB,EAAE,WAAAN,GAAW,GAAGE,KAAgC;AAC/E,SAAO,gBAAAC,EAAC,SAAI,WAAWE,EAAGP,EAAO,kBAAkBE,CAAS,GAAI,GAAGE,GAAO;AAC5E;AAUO,SAASK,EAAY,EAAE,WAAAP,GAAW,GAAGE,KAA2B;AACrE,SAAO,gBAAAC,EAAC,SAAI,WAAWE,EAAGP,EAAO,aAAaE,CAAS,GAAI,GAAGE,GAAO;AACvE;"}
1
+ {"version":3,"file":"alert.js","sources":["../src/components/alert/alert.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport styles from './alert.module.css';\n\n/*\n * Alert has no Base UI primitive (registry/bases/base/ui/alert.tsx ships\n * plain `div`s with data-slot markers and a `role=\"alert\"` root) — a pure\n * styling translation over native elements, same shape as Card (see\n * card.tsx). No `data-slot` attributes, per the kit-wide convention: the\n * icon/action layout below is detected structurally (`:has()`), the same\n * sanctioned pattern Card's header/action classes already use (see\n * tokens.test.ts).\n */\n\nconst alertVariants = cva(styles.alert, {\n variants: {\n variant: {\n default: styles.variantDefault,\n destructive: styles.variantDestructive,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport type AlertProps = ComponentProps<'div'> & VariantProps<typeof alertVariants>;\n\nexport function Alert({ className, variant, ...props }: AlertProps) {\n return <div role=\"alert\" className={alertVariants({ variant, className })} {...props} />;\n}\n\nexport type AlertTitleProps = useRender.ComponentProps<'div'>;\n\n/*\n * `render` swaps the element (a heading, typically) through Base UI's\n * `useRender`/`mergeProps`, which is why this module ships `'use client'`.\n * With `render` the element also takes `.renderedTitle`, which resets the\n * UA heading margins and font at zero specificity. Without it the markup is\n * the same `div` with the same class.\n */\nexport function AlertTitle({ className, render, ...props }: AlertTitleProps) {\n return useRender({\n defaultTagName: 'div',\n render,\n props: mergeProps<'div'>(\n { className: cx(styles.alertTitle, render && styles.renderedTitle, className) },\n props,\n ),\n });\n}\n\nexport type AlertDescriptionProps = ComponentProps<'div'>;\n\nexport function AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return <div className={cx(styles.alertDescription, className)} {...props} />;\n}\n\n/**\n * Positions in the alert's top-right corner (see alert.module.css) — an\n * `AlertAction` present as a direct child also reserves room in the\n * alert's own padding so body text never runs under it, detected the same\n * structural way (no prop to set).\n */\nexport type AlertActionProps = ComponentProps<'div'>;\n\nexport function AlertAction({ className, ...props }: AlertActionProps) {\n return <div className={cx(styles.alertAction, className)} {...props} />;\n}\n"],"names":["alertVariants","cva","styles","Alert","className","variant","props","jsx","AlertTitle","render","useRender","mergeProps","cx","AlertDescription","AlertAction"],"mappings":";;;;;;;;;;;;;GAmBMA,IAAgBC,EAAIC,EAAO,OAAO;AAAA,EACtC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAASA,EAAO;AAAA,MAChB,aAAaA,EAAO;AAAA,IAAA;AAAA,EACtB;AAAA,EAEF,iBAAiB;AAAA,IACf,SAAS;AAAA,EAAA;AAEb,CAAC;AAIM,SAASC,EAAM,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,KAAqB;AAClE,SAAO,gBAAAC,EAAC,OAAA,EAAI,MAAK,SAAQ,WAAWP,EAAc,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,GAAI,GAAGE,EAAA,CAAO;AACxF;AAWO,SAASE,EAAW,EAAE,WAAAJ,GAAW,QAAAK,GAAQ,GAAGH,KAA0B;AAC3E,SAAOI,EAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,QAAAD;AAAA,IACA,OAAOE;AAAA,MACL,EAAE,WAAWC,EAAGV,EAAO,YAAYO,KAAUP,EAAO,eAAeE,CAAS,EAAA;AAAA,MAC5EE;AAAA,IAAA;AAAA,EACF,CACD;AACH;AAIO,SAASO,EAAiB,EAAE,WAAAT,GAAW,GAAGE,KAAgC;AAC/E,SAAO,gBAAAC,EAAC,SAAI,WAAWK,EAAGV,EAAO,kBAAkBE,CAAS,GAAI,GAAGE,GAAO;AAC5E;AAUO,SAASQ,EAAY,EAAE,WAAAV,GAAW,GAAGE,KAA2B;AACrE,SAAO,gBAAAC,EAAC,SAAI,WAAWK,EAAGV,EAAO,aAAaE,CAAS,GAAI,GAAGE,GAAO;AACvE;"}
@@ -1,37 +1,37 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { mergeProps as h } from "@base-ui/react/merge-props";
4
- import { useRender as _ } from "@base-ui/react/use-render";
5
- import { cx as c, cva as r } from "class-variance-authority";
6
- import { useContext as l, createContext as u } from "react";
7
- import { Button as p } from "./button.js";
8
- import './chunks/attachment.CZuZdlXC.css';const d = "_attachment_1jpm5_20", f = "_sizeDefault_1jpm5_61", v = "_attachmentContent_1jpm5_67", z = "_sizeSm_1jpm5_75", g = "_sizeXs_1jpm5_89", A = "_orientationHorizontal_1jpm5_107", j = "_orientationVertical_1jpm5_114", T = "_attachmentMedia_1jpm5_124", N = "_variantIcon_1jpm5_188", D = "_variantImage_1jpm5_191", V = "_attachmentTitle_1jpm5_212", x = "_attachmentDescription_1jpm5_223", C = "_attachmentActions_1jpm5_248", I = "_attachmentAction_1jpm5_248", M = "_attachmentTrigger_1jpm5_270", G = "_attachmentGroup_1jpm5_277", n = {
9
- attachment: d,
10
- sizeDefault: f,
11
- attachmentContent: v,
12
- sizeSm: z,
13
- sizeXs: g,
14
- orientationHorizontal: A,
15
- orientationVertical: j,
16
- attachmentMedia: T,
17
- variantIcon: N,
18
- variantImage: D,
19
- attachmentTitle: V,
20
- attachmentDescription: x,
21
- attachmentActions: C,
22
- attachmentAction: I,
23
- attachmentTrigger: M,
24
- attachmentGroup: G
25
- }, m = u("done"), S = r(n.attachment, {
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { mergeProps as d } from "@base-ui/react/merge-props";
4
+ import { useRender as f } from "@base-ui/react/use-render";
5
+ import { cx as m, cva as _ } from "class-variance-authority";
6
+ import { useRef as g, useState as p, useContext as z, createContext as w, useEffect as A } from "react";
7
+ import { Button as k } from "./button.js";
8
+ import './chunks/attachment.BRyIQq3F.css';const T = "_attachment_kup4w_20", N = "_sizeDefault_kup4w_61", x = "_attachmentContent_kup4w_67", C = "_sizeSm_kup4w_75", D = "_sizeXs_kup4w_89", I = "_orientationHorizontal_kup4w_107", V = "_orientationVertical_kup4w_114", b = "_attachmentMedia_kup4w_124", M = "_variantIcon_kup4w_188", S = "_variantImage_kup4w_191", G = "_attachmentTitle_kup4w_212", H = "_attachmentDescription_kup4w_223", R = "_attachmentActions_kup4w_248", X = "_attachmentAction_kup4w_248", y = "_attachmentTrigger_kup4w_270", B = "_attachmentGroup_kup4w_277", o = {
9
+ attachment: T,
10
+ sizeDefault: N,
11
+ attachmentContent: x,
12
+ sizeSm: C,
13
+ sizeXs: D,
14
+ orientationHorizontal: I,
15
+ orientationVertical: V,
16
+ attachmentMedia: b,
17
+ variantIcon: M,
18
+ variantImage: S,
19
+ attachmentTitle: G,
20
+ attachmentDescription: H,
21
+ attachmentActions: R,
22
+ attachmentAction: X,
23
+ attachmentTrigger: y,
24
+ attachmentGroup: B
25
+ }, v = w("done"), F = _(o.attachment, {
26
26
  variants: {
27
27
  size: {
28
- default: n.sizeDefault,
29
- sm: n.sizeSm,
30
- xs: n.sizeXs
28
+ default: o.sizeDefault,
29
+ sm: o.sizeSm,
30
+ xs: o.sizeXs
31
31
  },
32
32
  orientation: {
33
- horizontal: n.orientationHorizontal,
34
- vertical: n.orientationVertical
33
+ horizontal: o.orientationHorizontal,
34
+ vertical: o.orientationVertical
35
35
  }
36
36
  },
37
37
  defaultVariants: {
@@ -39,103 +39,144 @@ import './chunks/attachment.CZuZdlXC.css';const d = "_attachment_1jpm5_20", f =
39
39
  orientation: "horizontal"
40
40
  }
41
41
  });
42
- function k({
43
- className: a,
42
+ function K({
43
+ className: n,
44
44
  state: t = "done",
45
45
  size: e = "default",
46
- orientation: i = "horizontal",
46
+ orientation: a = "horizontal",
47
47
  ...s
48
48
  }) {
49
- return /* @__PURE__ */ o(m.Provider, { value: t, children: /* @__PURE__ */ o(
49
+ return /* @__PURE__ */ r(v.Provider, { value: t, children: /* @__PURE__ */ r(
50
50
  "div",
51
51
  {
52
52
  "data-state": t,
53
53
  "data-size": e,
54
- "data-orientation": i,
55
- className: S({ size: e, orientation: i, className: a }),
54
+ "data-orientation": a,
55
+ className: F({ size: e, orientation: a, className: n }),
56
56
  ...s
57
57
  }
58
58
  ) });
59
59
  }
60
- const H = r(n.attachmentMedia, {
60
+ const O = _(o.attachmentMedia, {
61
61
  variants: {
62
62
  variant: {
63
- icon: n.variantIcon,
64
- image: n.variantImage
63
+ icon: o.variantIcon,
64
+ image: o.variantImage
65
65
  }
66
66
  },
67
67
  defaultVariants: {
68
68
  variant: "icon"
69
69
  }
70
70
  });
71
- function q({ className: a, variant: t, ...e }) {
72
- const i = t ?? "icon";
73
- return /* @__PURE__ */ o(
71
+ function Q({ className: n, variant: t, ...e }) {
72
+ const a = t ?? "icon";
73
+ return /* @__PURE__ */ r(
74
74
  "div",
75
75
  {
76
- "data-variant": i,
77
- className: H({ variant: i, className: a }),
76
+ "data-variant": a,
77
+ className: O({ variant: a, className: n }),
78
78
  ...e
79
79
  }
80
80
  );
81
81
  }
82
- function w({ className: a, ...t }) {
83
- return /* @__PURE__ */ o("div", { className: c(n.attachmentContent, a), ...t });
82
+ function U({ className: n, ...t }) {
83
+ return /* @__PURE__ */ r("div", { className: m(o.attachmentContent, n), ...t });
84
84
  }
85
- function E({ className: a, ...t }) {
86
- const e = l(m);
87
- return /* @__PURE__ */ o(
85
+ function Y({ className: n, ...t }) {
86
+ const e = z(v);
87
+ return /* @__PURE__ */ r(
88
88
  "span",
89
89
  {
90
- className: c(n.attachmentTitle, (e === "uploading" || e === "processing") && "shimmer", a),
90
+ className: m(o.attachmentTitle, (e === "uploading" || e === "processing") && "shimmer", n),
91
91
  ...t
92
92
  }
93
93
  );
94
94
  }
95
- function F({ className: a, ...t }) {
96
- return /* @__PURE__ */ o("span", { className: c(n.attachmentDescription, a), ...t });
95
+ function Z({ className: n, ...t }) {
96
+ return /* @__PURE__ */ r("span", { className: m(o.attachmentDescription, n), ...t });
97
97
  }
98
- function J({ className: a, ...t }) {
99
- return /* @__PURE__ */ o("div", { className: c(n.attachmentActions, a), ...t });
98
+ function $({ className: n, ...t }) {
99
+ return /* @__PURE__ */ r("div", { className: m(o.attachmentActions, n), ...t });
100
100
  }
101
- function K({ className: a, variant: t, size: e = "sm", ...i }) {
102
- return /* @__PURE__ */ o(
103
- p,
101
+ function tt({ className: n, variant: t, size: e = "sm", ...a }) {
102
+ return /* @__PURE__ */ r(
103
+ k,
104
104
  {
105
105
  variant: t ?? "ghost",
106
106
  size: e,
107
- className: c(n.attachmentAction, a),
108
- ...i
107
+ className: m(o.attachmentAction, n),
108
+ ...a
109
109
  }
110
110
  );
111
111
  }
112
- function L({ className: a, render: t, type: e, ...i }) {
113
- return _({
112
+ function nt({ className: n, render: t, type: e, ...a }) {
113
+ return f({
114
114
  defaultTagName: "button",
115
115
  render: t,
116
- props: h(
116
+ props: d(
117
117
  {
118
118
  type: t ? e : e ?? "button",
119
- className: c(n.attachmentTrigger, a)
119
+ className: m(o.attachmentTrigger, n)
120
120
  },
121
- i
121
+ a
122
122
  )
123
123
  });
124
124
  }
125
- function O({ className: a, ...t }) {
126
- return /* @__PURE__ */ o("div", { className: c(n.attachmentGroup, "scroll-fade-x", "no-scrollbar", a), ...t });
125
+ function P(n) {
126
+ const [t, e] = p(!1);
127
+ return A(() => {
128
+ const a = n.current;
129
+ if (!a) return;
130
+ const s = () => e(a.scrollWidth > a.clientWidth);
131
+ s();
132
+ const i = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(s), l = () => {
133
+ if (i) {
134
+ i.disconnect(), i.observe(a);
135
+ for (const h of a.children) i.observe(h);
136
+ }
137
+ };
138
+ l();
139
+ const c = typeof MutationObserver > "u" ? void 0 : new MutationObserver(() => {
140
+ l(), s();
141
+ });
142
+ return c == null || c.observe(a, { childList: !0 }), () => {
143
+ i == null || i.disconnect(), c == null || c.disconnect();
144
+ };
145
+ }, [n]), t;
146
+ }
147
+ function at({ className: n, label: t, tabIndex: e, ref: a, ...s }) {
148
+ const i = g(null), l = P(i), [c, h] = p(!1);
149
+ return f({
150
+ defaultTagName: "div",
151
+ ref: a === void 0 ? i : [i, a],
152
+ props: d(
153
+ {
154
+ role: t === void 0 ? void 0 : "group",
155
+ "aria-label": t,
156
+ tabIndex: e ?? (l || c ? 0 : void 0),
157
+ onFocus: (u) => {
158
+ u.target === u.currentTarget && h(!0);
159
+ },
160
+ onBlur: (u) => {
161
+ u.target === u.currentTarget && h(!1);
162
+ },
163
+ className: m(o.attachmentGroup, "scroll-fade-x", "no-scrollbar", n)
164
+ },
165
+ s
166
+ )
167
+ });
127
168
  }
128
169
  export {
129
- k as Attachment,
130
- K as AttachmentAction,
131
- J as AttachmentActions,
132
- w as AttachmentContent,
133
- F as AttachmentDescription,
134
- O as AttachmentGroup,
135
- q as AttachmentMedia,
136
- E as AttachmentTitle,
137
- L as AttachmentTrigger,
138
- H as attachmentMediaVariants,
139
- S as attachmentVariants
170
+ K as Attachment,
171
+ tt as AttachmentAction,
172
+ $ as AttachmentActions,
173
+ U as AttachmentContent,
174
+ Z as AttachmentDescription,
175
+ at as AttachmentGroup,
176
+ Q as AttachmentMedia,
177
+ Y as AttachmentTitle,
178
+ nt as AttachmentTrigger,
179
+ O as attachmentMediaVariants,
180
+ F as attachmentVariants
140
181
  };
141
182
  //# sourceMappingURL=attachment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.js","sources":["../src/components/attachment/attachment.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { createContext, useContext, type ComponentProps } from 'react';\n\nimport { Button, type ButtonProps } from '../button/button.js';\nimport styles from './attachment.module.css';\n\n/*\n * A faithful port of shadcn/ui's base Attachment\n * (registry/bases/base/ui/attachment.tsx): a file/image attachment card\n * with media, metadata, upload state, and actions. No primitive to lean\n * on — the upload state machine (`state`) is plain data-attribute-driven\n * CSS, same shape as Message/Bubble, for every part EXCEPT the shimmer\n * below.\n *\n * Uses two utilities from this package's global stylesheet\n * (src/styles/utilities.css, imported alongside theme.css — see that\n * file's own header): `shimmer` on `AttachmentTitle` while uploading or\n * processing, and `scroll-fade-x` + `no-scrollbar` on `AttachmentGroup`'s\n * scroll track.\n *\n * Upstream drives the shimmer purely through a CSS ancestor selector\n * (`group-data-[state=processing]/attachment:shimmer`) with no extra prop\n * on `AttachmentTitle` at all. `shimmer` is a GLOBAL utility class, not a\n * CSS Modules class — there is no CSS-only way to conditionally attach an\n * unrelated global class name to a descendant based on an ancestor's data\n * attribute (a plain descendant selector can style `.attachmentTitle`\n * directly, but it cannot make that element also match every rule the\n * literal `.shimmer` class carries). Every other ancestor-state read\n * below (`AttachmentMedia`'s size/orientation/error styling,\n * `AttachmentDescription`'s error tint) stays pure CSS for exactly this\n * reason — only the shimmer needs it. React context carries the state\n * down to `AttachmentTitle` instead, so the API stays prop-free like\n * upstream — the consumer never re-passes `state` to a child part.\n */\nconst AttachmentStateContext = createContext<AttachmentProps['state']>('done');\n\nconst attachmentVariants = cva(styles.attachment, {\n variants: {\n size: {\n default: styles.sizeDefault,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n },\n orientation: {\n horizontal: styles.orientationHorizontal,\n vertical: styles.orientationVertical,\n },\n },\n defaultVariants: {\n size: 'default',\n orientation: 'horizontal',\n },\n});\n\nexport interface AttachmentProps extends ComponentProps<'div'>, VariantProps<typeof attachmentVariants> {\n /**\n * The upload state. Drives styling (idle's dashed border, error's\n * destructive tint on the media/description) and `AttachmentTitle`'s\n * shimmer.\n * @default 'done'\n */\n state?: 'idle' | 'uploading' | 'processing' | 'error' | 'done';\n}\n\n/** The root attachment container. */\nexport function Attachment({\n className,\n state = 'done',\n size = 'default',\n orientation = 'horizontal',\n ...props\n}: AttachmentProps) {\n return (\n <AttachmentStateContext.Provider value={state}>\n <div\n data-state={state}\n data-size={size}\n data-orientation={orientation}\n className={attachmentVariants({ size, orientation, className })}\n {...props}\n />\n </AttachmentStateContext.Provider>\n );\n}\n\nconst attachmentMediaVariants = cva(styles.attachmentMedia, {\n variants: {\n variant: {\n icon: styles.variantIcon,\n image: styles.variantImage,\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport interface AttachmentMediaProps\n extends ComponentProps<'div'>, VariantProps<typeof attachmentMediaVariants> {}\n\n/** The media slot for an icon or image preview. Sizes and tints itself off\n * the ancestor `Attachment`'s `size`/`orientation`/`state` via CSS — no\n * extra props needed. */\nexport function AttachmentMedia({ className, variant, ...props }: AttachmentMediaProps) {\n // cva's own VariantProps types this `| null` (a consumer can pass\n // `variant={null}` to explicitly reset to the default), which a default\n // parameter value alone doesn't absorb — only `undefined` does. cva reads\n // that null as \"emit no variant class at all\" while `data-variant` would\n // still be dropped by React, so the media slot would come out with neither\n // the default class nor the attribute. Resolved once here, same as\n // marker.tsx, so class and attribute always agree.\n const resolvedVariant = variant ?? 'icon';\n return (\n <div\n data-variant={resolvedVariant}\n className={attachmentMediaVariants({ variant: resolvedVariant, className })}\n {...props}\n />\n );\n}\n\nexport type AttachmentContentProps = ComponentProps<'div'>;\n\n/** Wraps the title and description. */\nexport function AttachmentContent({ className, ...props }: AttachmentContentProps) {\n return <div className={cx(styles.attachmentContent, className)} {...props} />;\n}\n\nexport type AttachmentTitleProps = ComponentProps<'span'>;\n\n/** The attachment name. Shimmers (via the global `shimmer` utility class —\n * see this file's own header) while the ancestor `Attachment`'s `state` is\n * `'uploading'` or `'processing'` — read from context, not a prop. */\nexport function AttachmentTitle({ className, ...props }: AttachmentTitleProps) {\n const state = useContext(AttachmentStateContext);\n return (\n <span\n className={cx(styles.attachmentTitle, (state === 'uploading' || state === 'processing') && 'shimmer', className)}\n {...props}\n />\n );\n}\n\nexport type AttachmentDescriptionProps = ComponentProps<'span'>;\n\n/** Secondary metadata such as the file type, size, or upload status. Picks\n * up the ancestor `Attachment`'s `error` tint via a CSS descendant\n * selector — no extra prop needed. */\nexport function AttachmentDescription({ className, ...props }: AttachmentDescriptionProps) {\n return <span className={cx(styles.attachmentDescription, className)} {...props} />;\n}\n\nexport type AttachmentActionsProps = ComponentProps<'div'>;\n\n/** A container for one or more actions, aligned to the end of the\n * attachment. */\nexport function AttachmentActions({ className, ...props }: AttachmentActionsProps) {\n return <div className={cx(styles.attachmentActions, className)} {...props} />;\n}\n\nexport type AttachmentActionProps = ButtonProps;\n\n/**\n * An action button. Renders the kit `Button` and accepts all of its props.\n *\n * DRIFT from upstream: shadcn's `AttachmentAction` defaults to\n * `size=\"icon-xs\"` — a dedicated micro icon-only step this kit's `Button`\n * does not have.\n * `size=\"sm\"` is the smallest step available; icon-only squaring already\n * works at any size via Button's own `[data-icon-only]` rule\n * (button.module.css), so the visual result is a slightly larger action\n * button (32px) than upstream's (24px), not a broken one.\n */\nexport function AttachmentAction({ className, variant, size = 'sm', ...props }: AttachmentActionProps) {\n return (\n <Button\n variant={variant ?? 'ghost'}\n size={size}\n className={cx(styles.attachmentAction, className)}\n {...props}\n />\n );\n}\n\nexport type AttachmentTriggerProps = useRender.ComponentProps<'button'>;\n\n/** A full-card overlay that activates the attachment — opens a link or\n * dialog while `AttachmentActions` stay independently clickable (it sits\n * behind them in the stacking order). Renders a `<button>` by default. */\nexport function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerProps) {\n return useRender({\n defaultTagName: 'button',\n render,\n props: mergeProps<'button'>(\n {\n type: render ? type : (type ?? 'button'),\n className: cx(styles.attachmentTrigger, className),\n },\n props,\n ),\n });\n}\n\nexport type AttachmentGroupProps = ComponentProps<'div'>;\n\n/** Lays out attachments in a horizontally scrollable, snapping row with an\n * edge fade. Applies `scroll-fade-x` and `no-scrollbar` (this package's\n * global utilities — see this file's own header) directly, by class name,\n * alongside the module's own layout class. */\nexport function AttachmentGroup({ className, ...props }: AttachmentGroupProps) {\n return <div className={cx(styles.attachmentGroup, 'scroll-fade-x', 'no-scrollbar', className)} {...props} />;\n}\n\nexport { attachmentMediaVariants, attachmentVariants };\n"],"names":["AttachmentStateContext","createContext","attachmentVariants","cva","styles","Attachment","className","state","size","orientation","props","jsx","attachmentMediaVariants","AttachmentMedia","variant","resolvedVariant","AttachmentContent","cx","AttachmentTitle","useContext","AttachmentDescription","AttachmentActions","AttachmentAction","Button","AttachmentTrigger","render","type","useRender","mergeProps","AttachmentGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;GAsCMA,IAAyBC,EAAwC,MAAM,GAEvEC,IAAqBC,EAAIC,EAAO,YAAY;AAAA,EAChD,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAASA,EAAO;AAAA,MAChB,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEb,aAAa;AAAA,MACX,YAAYA,EAAO;AAAA,MACnB,UAAUA,EAAO;AAAA,IAAA;AAAA,EACnB;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAEjB,CAAC;AAaM,SAASC,EAAW;AAAA,EAC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,WAAWD,CAAS;AAAA,MAC9G,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AAOO,SAASU,EAAsB,EAAE,WAAAd,GAAW,GAAGI,KAAqC;AACzF,SAAO,gBAAAC,EAAC,UAAK,WAAWM,EAAGb,EAAO,uBAAuBE,CAAS,GAAI,GAAGI,GAAO;AAClF;AAMO,SAASW,EAAkB,EAAE,WAAAf,GAAW,GAAGI,KAAiC;AACjF,SAAO,gBAAAC,EAAC,SAAI,WAAWM,EAAGb,EAAO,mBAAmBE,CAAS,GAAI,GAAGI,GAAO;AAC7E;AAeO,SAASY,EAAiB,EAAE,WAAAhB,GAAW,SAAAQ,GAAS,MAAAN,IAAO,MAAM,GAAGE,KAAgC;AACrG,SACE,gBAAAC;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,SAAST,KAAW;AAAA,MACpB,MAAAN;AAAA,MACA,WAAWS,EAAGb,EAAO,kBAAkBE,CAAS;AAAA,MAC/C,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AAOO,SAASc,EAAkB,EAAE,WAAAlB,GAAW,QAAAmB,GAAQ,MAAAC,GAAM,GAAGhB,KAAiC;AAC/F,SAAOiB,EAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,QAAAF;AAAA,IACA,OAAOG;AAAA,MACL;AAAA,QACE,MAAMH,IAASC,IAAQA,KAAQ;AAAA,QAC/B,WAAWT,EAAGb,EAAO,mBAAmBE,CAAS;AAAA,MAAA;AAAA,MAEnDI;AAAA,IAAA;AAAA,EACF,CACD;AACH;AAQO,SAASmB,EAAgB,EAAE,WAAAvB,GAAW,GAAGI,KAA+B;AAC7E,SAAO,gBAAAC,EAAC,OAAA,EAAI,WAAWM,EAAGb,EAAO,iBAAiB,iBAAiB,gBAAgBE,CAAS,GAAI,GAAGI,EAAA,CAAO;AAC5G;"}
1
+ {"version":3,"file":"attachment.js","sources":["../src/components/attachment/attachment.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { createContext, useContext, useEffect, useRef, useState, type ComponentProps, type RefObject } from 'react';\n\nimport { Button, type ButtonProps } from '../button/button.js';\nimport styles from './attachment.module.css';\n\n/*\n * A faithful port of shadcn/ui's base Attachment\n * (registry/bases/base/ui/attachment.tsx): a file/image attachment card\n * with media, metadata, upload state, and actions. No primitive to lean\n * on — the upload state machine (`state`) is plain data-attribute-driven\n * CSS, same shape as Message/Bubble, for every part EXCEPT the shimmer\n * below.\n *\n * Uses two utilities from this package's global stylesheet\n * (src/styles/utilities.css, imported alongside theme.css — see that\n * file's own header): `shimmer` on `AttachmentTitle` while uploading or\n * processing, and `scroll-fade-x` + `no-scrollbar` on `AttachmentGroup`'s\n * scroll track.\n *\n * Upstream drives the shimmer purely through a CSS ancestor selector\n * (`group-data-[state=processing]/attachment:shimmer`) with no extra prop\n * on `AttachmentTitle` at all. `shimmer` is a GLOBAL utility class, not a\n * CSS Modules class — there is no CSS-only way to conditionally attach an\n * unrelated global class name to a descendant based on an ancestor's data\n * attribute (a plain descendant selector can style `.attachmentTitle`\n * directly, but it cannot make that element also match every rule the\n * literal `.shimmer` class carries). Every other ancestor-state read\n * below (`AttachmentMedia`'s size/orientation/error styling,\n * `AttachmentDescription`'s error tint) stays pure CSS for exactly this\n * reason — only the shimmer needs it. React context carries the state\n * down to `AttachmentTitle` instead, so the API stays prop-free like\n * upstream — the consumer never re-passes `state` to a child part.\n */\nconst AttachmentStateContext = createContext<AttachmentProps['state']>('done');\n\nconst attachmentVariants = cva(styles.attachment, {\n variants: {\n size: {\n default: styles.sizeDefault,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n },\n orientation: {\n horizontal: styles.orientationHorizontal,\n vertical: styles.orientationVertical,\n },\n },\n defaultVariants: {\n size: 'default',\n orientation: 'horizontal',\n },\n});\n\nexport interface AttachmentProps extends ComponentProps<'div'>, VariantProps<typeof attachmentVariants> {\n /**\n * The upload state. Drives styling (idle's dashed border, error's\n * destructive tint on the media/description) and `AttachmentTitle`'s\n * shimmer.\n * @default 'done'\n */\n state?: 'idle' | 'uploading' | 'processing' | 'error' | 'done';\n}\n\n/** The root attachment container. */\nexport function Attachment({\n className,\n state = 'done',\n size = 'default',\n orientation = 'horizontal',\n ...props\n}: AttachmentProps) {\n return (\n <AttachmentStateContext.Provider value={state}>\n <div\n data-state={state}\n data-size={size}\n data-orientation={orientation}\n className={attachmentVariants({ size, orientation, className })}\n {...props}\n />\n </AttachmentStateContext.Provider>\n );\n}\n\nconst attachmentMediaVariants = cva(styles.attachmentMedia, {\n variants: {\n variant: {\n icon: styles.variantIcon,\n image: styles.variantImage,\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport interface AttachmentMediaProps\n extends ComponentProps<'div'>, VariantProps<typeof attachmentMediaVariants> {}\n\n/** The media slot for an icon or image preview. Sizes and tints itself off\n * the ancestor `Attachment`'s `size`/`orientation`/`state` via CSS — no\n * extra props needed. */\nexport function AttachmentMedia({ className, variant, ...props }: AttachmentMediaProps) {\n // cva's own VariantProps types this `| null` (a consumer can pass\n // `variant={null}` to explicitly reset to the default), which a default\n // parameter value alone doesn't absorb — only `undefined` does. cva reads\n // that null as \"emit no variant class at all\" while `data-variant` would\n // still be dropped by React, so the media slot would come out with neither\n // the default class nor the attribute. Resolved once here, same as\n // marker.tsx, so class and attribute always agree.\n const resolvedVariant = variant ?? 'icon';\n return (\n <div\n data-variant={resolvedVariant}\n className={attachmentMediaVariants({ variant: resolvedVariant, className })}\n {...props}\n />\n );\n}\n\nexport type AttachmentContentProps = ComponentProps<'div'>;\n\n/** Wraps the title and description. */\nexport function AttachmentContent({ className, ...props }: AttachmentContentProps) {\n return <div className={cx(styles.attachmentContent, className)} {...props} />;\n}\n\nexport type AttachmentTitleProps = ComponentProps<'span'>;\n\n/** The attachment name. Shimmers (via the global `shimmer` utility class —\n * see this file's own header) while the ancestor `Attachment`'s `state` is\n * `'uploading'` or `'processing'` — read from context, not a prop. */\nexport function AttachmentTitle({ className, ...props }: AttachmentTitleProps) {\n const state = useContext(AttachmentStateContext);\n return (\n <span\n className={cx(styles.attachmentTitle, (state === 'uploading' || state === 'processing') && 'shimmer', className)}\n {...props}\n />\n );\n}\n\nexport type AttachmentDescriptionProps = ComponentProps<'span'>;\n\n/** Secondary metadata such as the file type, size, or upload status. Picks\n * up the ancestor `Attachment`'s `error` tint via a CSS descendant\n * selector — no extra prop needed. */\nexport function AttachmentDescription({ className, ...props }: AttachmentDescriptionProps) {\n return <span className={cx(styles.attachmentDescription, className)} {...props} />;\n}\n\nexport type AttachmentActionsProps = ComponentProps<'div'>;\n\n/** A container for one or more actions, aligned to the end of the\n * attachment. */\nexport function AttachmentActions({ className, ...props }: AttachmentActionsProps) {\n return <div className={cx(styles.attachmentActions, className)} {...props} />;\n}\n\nexport type AttachmentActionProps = ButtonProps;\n\n/**\n * An action button. Renders the kit `Button` and accepts all of its props.\n *\n * DRIFT from upstream: shadcn's `AttachmentAction` defaults to\n * `size=\"icon-xs\"` — a dedicated micro icon-only step this kit's `Button`\n * does not have.\n * `size=\"sm\"` is the smallest step available; icon-only squaring already\n * works at any size via Button's own `[data-icon-only]` rule\n * (button.module.css), so the visual result is a slightly larger action\n * button (32px) than upstream's (24px), not a broken one.\n */\nexport function AttachmentAction({ className, variant, size = 'sm', ...props }: AttachmentActionProps) {\n return (\n <Button\n variant={variant ?? 'ghost'}\n size={size}\n className={cx(styles.attachmentAction, className)}\n {...props}\n />\n );\n}\n\nexport type AttachmentTriggerProps = useRender.ComponentProps<'button'>;\n\n/** A full-card overlay that activates the attachment — opens a link or\n * dialog while `AttachmentActions` stay independently clickable (it sits\n * behind them in the stacking order). Renders a `<button>` by default. */\nexport function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerProps) {\n return useRender({\n defaultTagName: 'button',\n render,\n props: mergeProps<'button'>(\n {\n type: render ? type : (type ?? 'button'),\n className: cx(styles.attachmentTrigger, className),\n },\n props,\n ),\n });\n}\n\nexport interface AttachmentGroupProps extends ComponentProps<'div'> {\n /**\n * Accessible name for the row (`role=\"group\"` + `aria-label`). Announced\n * when keyboard focus lands on an overflowing row; without it the group\n * has no role and no name.\n */\n label?: string;\n}\n\n/*\n * The row hides its scrollbar, so while its attachments overflow it a\n * keyboard user needs the row itself as a tab stop to scroll it with the\n * arrow keys (WCAG 2.1.1), the same reason Table's scroll wrapper is one.\n * Unlike Table, the stop is held only while the content overflows, the way\n * Base UI's ScrollArea viewport does it: the usual composer row holds one or\n * two attachments that fit, and an unconditional stop would add an empty one\n * to every such row. Overflow is re-measured when the row or one of its\n * children resizes and when children come or go. A focused row keeps its\n * stop until it blurs. A `tabIndex` the caller passes always wins.\n *\n * `label` gives `role=\"group\"`, not Table's `role=\"region\"`: a message list\n * can hold many attachment rows, and a landmark per row would flood\n * landmark navigation.\n */\nfunction useHorizontalOverflow(ref: RefObject<HTMLDivElement | null>): boolean {\n const [overflowing, setOverflowing] = useState(false);\n useEffect(() => {\n const element = ref.current;\n if (!element) return undefined;\n const measure = () => setOverflowing(element.scrollWidth > element.clientWidth);\n measure();\n // Each observer is optional on its own: without ResizeObserver the row\n // still re-measures when children come or go.\n const resizeObserver = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(measure);\n const observeChildren = () => {\n if (!resizeObserver) return;\n resizeObserver.disconnect();\n resizeObserver.observe(element);\n for (const child of element.children) resizeObserver.observe(child);\n };\n observeChildren();\n const mutationObserver =\n typeof MutationObserver === 'undefined'\n ? undefined\n : new MutationObserver(() => {\n observeChildren();\n measure();\n });\n mutationObserver?.observe(element, { childList: true });\n return () => {\n resizeObserver?.disconnect();\n mutationObserver?.disconnect();\n };\n }, [ref]);\n return overflowing;\n}\n\n/** Lays out attachments in a horizontally scrollable, snapping row with an\n * edge fade. Applies `scroll-fade-x` and `no-scrollbar` (this package's\n * global utilities, see this file's own header) directly, by class name,\n * alongside the module's own layout class. */\nexport function AttachmentGroup({ className, label, tabIndex, ref, ...props }: AttachmentGroupProps) {\n const groupRef = useRef<HTMLDivElement>(null);\n const overflowing = useHorizontalOverflow(groupRef);\n // Once focused, the row keeps its stop until it loses focus: dropping\n // tabindex from the focused element (an attachment removed, the viewport\n // widened) would send focus to the body and lose the user's place.\n const [focused, setFocused] = useState(false);\n return useRender({\n defaultTagName: 'div',\n ref: ref === undefined ? groupRef : [groupRef, ref],\n props: mergeProps<'div'>(\n {\n role: label === undefined ? undefined : 'group',\n 'aria-label': label,\n tabIndex: tabIndex ?? (overflowing || focused ? 0 : undefined),\n onFocus: (event) => {\n if (event.target === event.currentTarget) setFocused(true);\n },\n onBlur: (event) => {\n if (event.target === event.currentTarget) setFocused(false);\n },\n className: cx(styles.attachmentGroup, 'scroll-fade-x', 'no-scrollbar', className),\n },\n props,\n ),\n });\n}\n\nexport { attachmentMediaVariants, attachmentVariants };\n"],"names":["AttachmentStateContext","createContext","attachmentVariants","cva","styles","Attachment","className","state","size","orientation","props","jsx","attachmentMediaVariants","AttachmentMedia","variant","resolvedVariant","AttachmentContent","cx","AttachmentTitle","useContext","AttachmentDescription","AttachmentActions","AttachmentAction","Button","AttachmentTrigger","render","type","useRender","mergeProps","useHorizontalOverflow","ref","overflowing","setOverflowing","useState","useEffect","element","measure","resizeObserver","observeChildren","child","mutationObserver","AttachmentGroup","label","tabIndex","groupRef","useRef","focused","setFocused","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;GAsCMA,IAAyBC,EAAwC,MAAM,GAEvEC,IAAqBC,EAAIC,EAAO,YAAY;AAAA,EAChD,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAASA,EAAO;AAAA,MAChB,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEb,aAAa;AAAA,MACX,YAAYA,EAAO;AAAA,MACnB,UAAUA,EAAO;AAAA,IAAA;AAAA,EACnB;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,aAAa;AA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CAAS;AAAA,MAAA;AAAA,MAElFI;AAAA,IAAA;AAAA,EACF,CACD;AACH;"}
package/dist/avatar.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Avatar as s } from "@base-ui/react/avatar";
3
- import { cx as g, cva as c } from "class-variance-authority";
4
- import './chunks/avatar.BMm-Z9l5.css';const i = "_avatar_gglhk_33", _ = "_sizeSm_gglhk_80", u = "_sizeDefault_gglhk_85", f = "_sizeLg_gglhk_90", v = "_image_gglhk_24", k = "_fallback_gglhk_24", m = "_variantSolid_gglhk_161", d = "_toneNeutral_gglhk_161", h = "_toneAccent_gglhk_166", p = "_toneInfo_gglhk_171", S = "_toneSuccess_gglhk_176", z = "_toneWarning_gglhk_181", A = "_toneDanger_gglhk_186", b = "_variantSoft_gglhk_191", N = "_badge_gglhk_26", D = "_group_gglhk_264", C = "_groupCount_gglhk_276", a = {
5
- avatar: i,
6
- sizeSm: _,
7
- sizeDefault: u,
8
- sizeLg: f,
9
- image: v,
10
- fallback: k,
11
- variantSolid: m,
12
- toneNeutral: d,
13
- toneAccent: h,
14
- toneInfo: p,
15
- toneSuccess: S,
16
- toneWarning: z,
17
- toneDanger: A,
18
- variantSoft: b,
19
- badge: N,
20
- group: D,
21
- groupCount: C
22
- }, I = c(a.avatar, {
3
+ import { cx as c, cva as i } from "class-variance-authority";
4
+ import './chunks/avatar.7EUG65-M.css';const _ = "_avatar_1bvgp_33", u = "_sizeSm_1bvgp_80", v = "_sizeDefault_1bvgp_85", l = "_sizeLg_1bvgp_90", f = "_image_1bvgp_24", p = "_fallback_1bvgp_24", b = "_variantSolid_1bvgp_166", m = "_toneNeutral_1bvgp_166", d = "_toneAccent_1bvgp_171", S = "_toneInfo_1bvgp_176", z = "_toneSuccess_1bvgp_181", A = "_toneWarning_1bvgp_186", N = "_toneDanger_1bvgp_191", D = "_variantSoft_1bvgp_196", k = "_badge_1bvgp_26", C = "_group_1bvgp_269", I = "_groupCount_1bvgp_281", a = {
5
+ avatar: _,
6
+ sizeSm: u,
7
+ sizeDefault: v,
8
+ sizeLg: l,
9
+ image: f,
10
+ fallback: p,
11
+ variantSolid: b,
12
+ toneNeutral: m,
13
+ toneAccent: d,
14
+ toneInfo: S,
15
+ toneSuccess: z,
16
+ toneWarning: A,
17
+ toneDanger: N,
18
+ variantSoft: D,
19
+ badge: k,
20
+ group: C,
21
+ groupCount: I
22
+ }, V = i(a.avatar, {
23
23
  variants: {
24
24
  size: {
25
25
  default: a.sizeDefault,
@@ -31,13 +31,13 @@ import './chunks/avatar.BMm-Z9l5.css';const i = "_avatar_gglhk_33", _ = "_sizeSm
31
31
  size: "default"
32
32
  }
33
33
  });
34
- function G({ className: t, size: n, ...o }) {
35
- return /* @__PURE__ */ e(s.Root, { className: I({ size: n, className: t }), ...o });
34
+ function j({ className: t, size: n, ...o }) {
35
+ return /* @__PURE__ */ e(s.Root, { className: V({ size: n, className: t }), ...o });
36
36
  }
37
- function j({ className: t, ...n }) {
38
- return /* @__PURE__ */ e(s.Image, { className: g(a.image, t), ...n });
37
+ function w({ className: t, ...n }) {
38
+ return /* @__PURE__ */ e(s.Image, { className: c(a.image, t), ...n });
39
39
  }
40
- const l = {
40
+ const g = {
41
41
  tone: {
42
42
  neutral: a.toneNeutral,
43
43
  accent: a.toneAccent,
@@ -50,38 +50,38 @@ const l = {
50
50
  solid: a.variantSolid,
51
51
  soft: a.variantSoft
52
52
  }
53
- }, V = c(a.fallback, {
54
- variants: l,
53
+ }, x = i(a.fallback, {
54
+ variants: g,
55
55
  defaultVariants: { tone: "neutral", variant: "soft" }
56
56
  });
57
- function w({ className: t, tone: n, variant: o, ...r }) {
57
+ function y({ className: t, tone: n, variant: o, ...r }) {
58
58
  return /* @__PURE__ */ e(
59
59
  s.Fallback,
60
60
  {
61
- className: V({ tone: n, variant: o, className: t }),
61
+ className: x({ tone: n, variant: o, className: t }),
62
62
  ...r
63
63
  }
64
64
  );
65
65
  }
66
- function y({ className: t, ...n }) {
67
- return /* @__PURE__ */ e("span", { className: g(a.badge, t), ...n });
68
- }
69
66
  function B({ className: t, ...n }) {
70
- return /* @__PURE__ */ e("div", { className: g(a.group, t), ...n });
67
+ return /* @__PURE__ */ e("span", { className: c(a.badge, t), ...n });
68
+ }
69
+ function R({ className: t, ...n }) {
70
+ return /* @__PURE__ */ e("div", { className: c(a.group, t), ...n });
71
71
  }
72
- const x = c(a.groupCount, {
73
- variants: l,
72
+ const L = i(a.groupCount, {
73
+ variants: g,
74
74
  defaultVariants: { tone: "neutral", variant: "soft" }
75
75
  });
76
- function R({ className: t, tone: n, variant: o, ...r }) {
77
- return /* @__PURE__ */ e("div", { className: x({ tone: n, variant: o, className: t }), ...r });
76
+ function $({ className: t, tone: n, variant: o, ...r }) {
77
+ return /* @__PURE__ */ e("div", { className: L({ tone: n, variant: o, className: t }), ...r });
78
78
  }
79
79
  export {
80
- G as Avatar,
81
- y as AvatarBadge,
82
- w as AvatarFallback,
83
- B as AvatarGroup,
84
- R as AvatarGroupCount,
85
- j as AvatarImage
80
+ j as Avatar,
81
+ B as AvatarBadge,
82
+ y as AvatarFallback,
83
+ R as AvatarGroup,
84
+ $ as AvatarGroupCount,
85
+ w as AvatarImage
86
86
  };
87
87
  //# sourceMappingURL=avatar.js.map
package/dist/badge.js CHANGED
@@ -2,25 +2,25 @@
2
2
  import { jsxs as c, Fragment as o, jsx as _ } from "react/jsx-runtime";
3
3
  import { mergeProps as u } from "@base-ui/react/merge-props";
4
4
  import { useRender as d } from "@base-ui/react/use-render";
5
- import { cva as z } from "class-variance-authority";
6
- import './chunks/badge.BCreEn3O.css';const g = "_badge_nk3z3_37", l = "_dot_nk3z3_82", f = "_sizeXs_nk3z3_106", k = "_sizeDefault_nk3z3_121", D = "_variantDefault_nk3z3_166", m = "_variantSecondary_nk3z3_12", y = "_variantDestructive_nk3z3_198", p = "_variantCategory_nk3z3_235", S = "_variantOutline_nk3z3_254", h = "_variantGhost_nk3z3_264", b = "_variantLink_nk3z3_281", x = "_variantSuccess_nk3z3_314", A = "_variantWarning_nk3z3_323", C = "_variantDanger_nk3z3_332", G = "_variantInfo_nk3z3_341", I = "_variantAccent_nk3z3_350", a = {
7
- badge: g,
8
- dot: l,
9
- sizeXs: f,
10
- sizeDefault: k,
11
- variantDefault: D,
12
- variantSecondary: m,
13
- variantDestructive: y,
14
- variantCategory: p,
15
- variantOutline: S,
16
- variantGhost: h,
17
- variantLink: b,
5
+ import { cva as g } from "class-variance-authority";
6
+ import './chunks/badge.BwUxa9PB.css';const l = "_badge_1v1n6_37", f = "_dot_1v1n6_84", D = "_sizeXs_1v1n6_108", m = "_sizeDefault_1v1n6_123", y = "_variantDefault_1v1n6_168", p = "_variantSecondary_1v1n6_12", z = "_variantDestructive_1v1n6_202", S = "_variantCategory_1v1n6_246", h = "_variantOutline_1v1n6_265", b = "_variantGhost_1v1n6_275", k = "_variantLink_1v1n6_292", x = "_variantSuccess_1v1n6_325", A = "_variantWarning_1v1n6_338", C = "_variantDanger_1v1n6_351", G = "_variantInfo_1v1n6_364", I = "_variantAccent_1v1n6_373", a = {
7
+ badge: l,
8
+ dot: f,
9
+ sizeXs: D,
10
+ sizeDefault: m,
11
+ variantDefault: y,
12
+ variantSecondary: p,
13
+ variantDestructive: z,
14
+ variantCategory: S,
15
+ variantOutline: h,
16
+ variantGhost: b,
17
+ variantLink: k,
18
18
  variantSuccess: x,
19
19
  variantWarning: A,
20
20
  variantDanger: C,
21
21
  variantInfo: G,
22
22
  variantAccent: I
23
- }, L = z(a.badge, {
23
+ }, L = g(a.badge, {
24
24
  variants: {
25
25
  variant: {
26
26
  default: a.variantDefault,