@kanzo-tech/ui 0.10.0 → 0.12.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.
Files changed (70) hide show
  1. package/dist/charts/chart-stat.d.ts +12 -10
  2. package/dist/charts/chart-stat.d.ts.map +1 -1
  3. package/dist/charts/chart-stat.js +21 -16
  4. package/dist/charts/chart-stat.js.map +1 -1
  5. package/dist/composites/language-picker.d.ts +44 -0
  6. package/dist/composites/language-picker.d.ts.map +1 -0
  7. package/dist/composites/language-picker.js +163 -0
  8. package/dist/composites/language-picker.js.map +1 -0
  9. package/dist/guard-corpus.d.ts.map +1 -1
  10. package/dist/index.d.ts +12 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +693 -667
  13. package/dist/index.js.map +1 -1
  14. package/dist/layouts/empty.d.ts +54 -0
  15. package/dist/layouts/empty.d.ts.map +1 -0
  16. package/dist/layouts/empty.js +99 -0
  17. package/dist/layouts/empty.js.map +1 -0
  18. package/dist/layouts/gated.d.ts +24 -0
  19. package/dist/layouts/gated.d.ts.map +1 -0
  20. package/dist/layouts/gated.js +46 -0
  21. package/dist/layouts/gated.js.map +1 -0
  22. package/dist/layouts/section.d.ts +30 -5
  23. package/dist/layouts/section.d.ts.map +1 -1
  24. package/dist/layouts/section.js +71 -53
  25. package/dist/layouts/section.js.map +1 -1
  26. package/dist/lib/use-async-collection.d.ts +57 -0
  27. package/dist/lib/use-async-collection.d.ts.map +1 -0
  28. package/dist/lib/use-async-collection.js +43 -0
  29. package/dist/lib/use-async-collection.js.map +1 -0
  30. package/dist/lib/use-debounced-commit.d.ts +28 -0
  31. package/dist/lib/use-debounced-commit.d.ts.map +1 -0
  32. package/dist/lib/use-debounced-commit.js +26 -0
  33. package/dist/lib/use-debounced-commit.js.map +1 -0
  34. package/dist/shark-parity.divergences.d.ts.map +1 -1
  35. package/dist/simples/date-picker.d.ts.map +1 -1
  36. package/dist/simples/date-picker.js +66 -60
  37. package/dist/simples/date-picker.js.map +1 -1
  38. package/dist/simples/field.d.ts +42 -3
  39. package/dist/simples/field.d.ts.map +1 -1
  40. package/dist/simples/field.js +143 -105
  41. package/dist/simples/field.js.map +1 -1
  42. package/dist/simples/floating-panel.js +1 -1
  43. package/dist/simples/floating-panel.js.map +1 -1
  44. package/dist/simples/locale.d.ts +4 -0
  45. package/dist/simples/locale.d.ts.map +1 -0
  46. package/dist/simples/locale.js +8 -0
  47. package/dist/simples/locale.js.map +1 -0
  48. package/dist/simples/segment-group.d.ts.map +1 -1
  49. package/dist/simples/segment-group.js +67 -61
  50. package/dist/simples/segment-group.js.map +1 -1
  51. package/dist/simples/stat.d.ts +45 -0
  52. package/dist/simples/stat.d.ts.map +1 -0
  53. package/dist/simples/stat.js +155 -0
  54. package/dist/simples/stat.js.map +1 -0
  55. package/dist/table/actions-column.d.ts +20 -0
  56. package/dist/table/actions-column.d.ts.map +1 -0
  57. package/dist/table/actions-column.js +38 -0
  58. package/dist/table/actions-column.js.map +1 -0
  59. package/dist/table/data-table-content.d.ts.map +1 -1
  60. package/dist/table/data-table-content.js +31 -20
  61. package/dist/table/data-table-content.js.map +1 -1
  62. package/dist/table.d.ts +2 -0
  63. package/dist/table.d.ts.map +1 -1
  64. package/dist/table.js +13 -11
  65. package/dist/table.js.map +1 -1
  66. package/package.json +5 -5
  67. package/dist/simples/stat-tile.d.ts +0 -31
  68. package/dist/simples/stat-tile.d.ts.map +0 -1
  69. package/dist/simples/stat-tile.js +0 -64
  70. package/dist/simples/stat-tile.js.map +0 -1
@@ -1,21 +1,23 @@
1
- import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
- import { useSegmentGroupContext as c, SegmentGroup as o } from "@ark-ui/react/segment-group";
3
- import { cn as i } from "../lib/cn.js";
4
- const N = c, w = (e) => {
1
+ "use client";
2
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
3
+ import { useFieldContext as v } from "@ark-ui/react/field";
4
+ import { useSegmentGroupContext as h, SegmentGroup as i } from "@ark-ui/react/segment-group";
5
+ import { cn as d } from "../lib/cn.js";
6
+ const G = h, S = (a) => {
5
7
  const {
6
- orientation: a = "horizontal",
7
- variant: r = "default",
8
- options: t,
9
- itemClassName: s,
10
- className: u,
11
- children: p,
12
- slot: g,
13
- ...m
14
- } = e;
15
- return /* @__PURE__ */ l(
16
- o.Root,
8
+ orientation: r = "horizontal",
9
+ variant: n = "default",
10
+ options: e,
11
+ itemClassName: l,
12
+ className: p,
13
+ children: g,
14
+ slot: m,
15
+ ...c
16
+ } = a, t = v();
17
+ return /* @__PURE__ */ u(
18
+ i.Root,
17
19
  {
18
- className: i(
20
+ className: d(
19
21
  "group/segment-group relative",
20
22
  "flex gap-2",
21
23
  "isolate",
@@ -30,34 +32,38 @@ const N = c, w = (e) => {
30
32
  // (ΔE 0.00–1.65), and step 5 is `--accent`. `--border` moved from 5 to 6 precisely so a
31
33
  // border and a hover surface would stop being the same colour.
32
34
  "data-[variant=solid]:rounded-field data-[variant=solid]:border data-[variant=solid]:border-border data-[variant=solid]:bg-muted data-[variant=solid]:p-1",
33
- u
35
+ p
34
36
  ),
35
- "data-variant": r,
36
- orientation: a,
37
- ...m,
38
- "data-slot": g ?? "segment-group",
37
+ "data-variant": n,
38
+ disabled: t == null ? void 0 : t.disabled,
39
+ invalid: t == null ? void 0 : t.invalid,
40
+ orientation: r,
41
+ readOnly: t == null ? void 0 : t.readOnly,
42
+ required: t == null ? void 0 : t.required,
43
+ ...c,
44
+ "data-slot": m ?? "segment-group",
39
45
  children: [
40
- /* @__PURE__ */ n(b, {}),
41
- t == null ? void 0 : t.map((d) => /* @__PURE__ */ n(
42
- v,
46
+ /* @__PURE__ */ o(f, {}),
47
+ e == null ? void 0 : e.map((s) => /* @__PURE__ */ o(
48
+ b,
43
49
  {
44
- value: d.value,
45
- disabled: d.disabled,
46
- className: i("px-3 py-1.5", s),
47
- children: /* @__PURE__ */ n(h, { className: "flex items-center justify-center gap-2 text-sm font-medium", children: d.label })
50
+ value: s.value,
51
+ disabled: s.disabled,
52
+ className: d("px-3 py-1.5", l),
53
+ children: /* @__PURE__ */ o(x, { className: "flex items-center justify-center gap-2 text-sm font-medium", children: s.label })
48
54
  },
49
- d.value
55
+ s.value
50
56
  )),
51
- p
57
+ g
52
58
  ]
53
59
  }
54
60
  );
55
- }, v = (e) => {
56
- const { className: a, children: r, slot: t, ...s } = e;
57
- return /* @__PURE__ */ l(
58
- o.Item,
61
+ }, b = (a) => {
62
+ const { className: r, children: n, slot: e, ...l } = a;
63
+ return /* @__PURE__ */ u(
64
+ i.Item,
59
65
  {
60
- className: i(
66
+ className: d(
61
67
  "relative z-1",
62
68
  "inline-flex items-center justify-center",
63
69
  "cursor-pointer select-none",
@@ -68,33 +74,33 @@ const N = c, w = (e) => {
68
74
  "rounded-[inherit] border border-transparent",
69
75
  "outline-none data-focus-visible:border-primary data-focus-visible:ring-[3px] data-focus-visible:ring-ring",
70
76
  "data-disabled:pointer-events-none data-disabled:opacity-64",
71
- a
77
+ r
72
78
  ),
73
- ...s,
74
- "data-slot": t ?? "segment-group-item",
79
+ ...l,
80
+ "data-slot": e ?? "segment-group-item",
75
81
  children: [
76
- r,
77
- /* @__PURE__ */ n(o.ItemControl, {}),
78
- /* @__PURE__ */ n(o.ItemHiddenInput, {})
82
+ n,
83
+ /* @__PURE__ */ o(i.ItemControl, {}),
84
+ /* @__PURE__ */ o(i.ItemHiddenInput, {})
79
85
  ]
80
86
  }
81
87
  );
82
- }, h = (e) => {
83
- const { className: a, slot: r, ...t } = e;
84
- return /* @__PURE__ */ n(
85
- o.ItemText,
88
+ }, x = (a) => {
89
+ const { className: r, slot: n, ...e } = a;
90
+ return /* @__PURE__ */ o(
91
+ i.ItemText,
86
92
  {
87
- className: i("relative z-1", a),
88
- ...t,
89
- "data-slot": r ?? "segment-group-item-text"
93
+ className: d("relative z-1", r),
94
+ ...e,
95
+ "data-slot": n ?? "segment-group-item-text"
90
96
  }
91
97
  );
92
- }, b = (e) => {
93
- const { className: a, slot: r, ...t } = e;
94
- return /* @__PURE__ */ n(
95
- o.Indicator,
98
+ }, f = (a) => {
99
+ const { className: r, slot: n, ...e } = a;
100
+ return /* @__PURE__ */ o(
101
+ i.Indicator,
96
102
  {
97
- className: i(
103
+ className: d(
98
104
  "absolute top-(--top) left-(--left) z-0",
99
105
  "h-(--height) w-(--width)",
100
106
  "rounded-[inherit]",
@@ -112,18 +118,18 @@ const N = c, w = (e) => {
112
118
  "data-[orientation=horizontal]:group-data-[variant=underline]/segment-group:h-0.5",
113
119
  "data-[orientation=vertical]:group-data-[variant=underline]/segment-group:w-0.5",
114
120
  "motion-reduce:transition-none!",
115
- a
121
+ r
116
122
  ),
117
- ...t,
118
- "data-slot": r ?? "segment-group-indicator"
123
+ ...e,
124
+ "data-slot": n ?? "segment-group-indicator"
119
125
  }
120
126
  );
121
127
  };
122
128
  export {
123
- w as SegmentGroup,
124
- b as SegmentGroupIndicator,
125
- v as SegmentGroupItem,
126
- h as SegmentGroupItemText,
127
- N as useSegmentGroup
129
+ S as SegmentGroup,
130
+ f as SegmentGroupIndicator,
131
+ b as SegmentGroupItem,
132
+ x as SegmentGroupItemText,
133
+ G as useSegmentGroup
128
134
  };
129
135
  //# sourceMappingURL=segment-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-group.js","sources":["../../src/simples/segment-group.tsx"],"sourcesContent":["import {\n SegmentGroup as ArkSegmentGroup,\n useSegmentGroupContext,\n} from \"@ark-ui/react/segment-group\";\nimport type React from \"react\";\nimport { cn } from \"../lib/cn\";\n\nexport const useSegmentGroup = useSegmentGroupContext;\n\ntype SegmentGroupVariant = \"default\" | \"underline\" | \"solid\";\n\nexport interface SegmentGroupOption {\n value: string;\n label: React.ReactNode;\n disabled?: boolean;\n}\n\ninterface SegmentGroupProps\n extends React.ComponentProps<typeof ArkSegmentGroup.Root> {\n /**\n * The visual variant of the segment group.\n *\n * @default \"default\"\n */\n variant?: SegmentGroupVariant;\n /** Data-driven items rendered before `children` (additive with the compound API). */\n options?: readonly SegmentGroupOption[];\n /** Extra classes applied to each `options`-rendered item. */\n itemClassName?: string;\n}\n\nexport const SegmentGroup = (props: SegmentGroupProps) => {\n const {\n orientation = \"horizontal\",\n variant = \"default\",\n options,\n itemClassName,\n className,\n children,\n slot,\n ...rest\n } = props;\n\n return (\n <ArkSegmentGroup.Root\n className={cn(\n \"group/segment-group relative\",\n \"flex gap-2\",\n \"isolate\",\n \"data-[orientation=vertical]:flex-col\",\n \"data-disabled:opacity-64\",\n \"data-[variant=underline]:gap-1 data-[variant=underline]:border-input\",\n \"data-[orientation=horizontal]:data-[variant=underline]:border-b\",\n \"data-[orientation=vertical]:data-[variant=underline]:border-l\",\n // `solid`: a filled `bg-muted` track with equal-width segments — the contained\n // \"segmented control\" look, so consumers stop hand-rolling the track each time.\n // The track border is solid: diluted, it composited to ramp step 5 on every backdrop\n // (ΔE 0.00–1.65), and step 5 is `--accent`. `--border` moved from 5 to 6 precisely so a\n // border and a hover surface would stop being the same colour.\n \"data-[variant=solid]:rounded-field data-[variant=solid]:border data-[variant=solid]:border-border data-[variant=solid]:bg-muted data-[variant=solid]:p-1\",\n className\n )}\n data-variant={variant}\n orientation={orientation}\n {...rest}\n data-slot={slot ?? \"segment-group\"}\n >\n <SegmentGroupIndicator />\n\n {options?.map((o) => (\n <SegmentGroupItem\n key={o.value}\n value={o.value}\n disabled={o.disabled}\n className={cn(\"px-3 py-1.5\", itemClassName)}\n >\n <SegmentGroupItemText className=\"flex items-center justify-center gap-2 text-sm font-medium\">\n {o.label}\n </SegmentGroupItemText>\n </SegmentGroupItem>\n ))}\n\n {children}\n </ArkSegmentGroup.Root>\n );\n};\n\nexport const SegmentGroupItem = (\n props: React.ComponentProps<typeof ArkSegmentGroup.Item>\n) => {\n const { className, children, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.Item\n className={cn(\n \"relative z-1\",\n \"inline-flex items-center justify-center\",\n \"cursor-pointer select-none\",\n \"text-sm font-medium text-muted-foreground transition-colors\",\n \"hover:text-foreground data-[state=checked]:text-foreground\",\n \"data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start\",\n \"group-data-[variant=solid]/segment-group:flex-1 group-data-[variant=solid]/segment-group:justify-center\",\n \"rounded-[inherit] border border-transparent\",\n \"outline-none data-focus-visible:border-primary data-focus-visible:ring-[3px] data-focus-visible:ring-ring\",\n \"data-disabled:pointer-events-none data-disabled:opacity-64\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"segment-group-item\"}\n >\n {children}\n\n <ArkSegmentGroup.ItemControl />\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n};\n\nexport const SegmentGroupItemText = (\n props: React.ComponentProps<typeof ArkSegmentGroup.ItemText>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.ItemText\n className={cn(\"relative z-1\", className)}\n {...rest}\n data-slot={slot ?? \"segment-group-item-text\"}\n />\n );\n};\n\nexport const SegmentGroupIndicator = (\n props: React.ComponentProps<typeof ArkSegmentGroup.Indicator>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.Indicator\n className={cn(\n \"absolute top-(--top) left-(--left) z-0\",\n \"h-(--height) w-(--width)\",\n \"rounded-[inherit]\",\n // The moving \"pill\": an elevated surface with a hairline border and a soft shadow, so\n // the selected segment reads as a raised chip on the muted track (crisp, not flat).\n // Solid for the same reason as the track — diluted it landed on step 5, `--accent`.\n \"border border-border bg-background shadow-sm\",\n \"transition-[width,height,left,top] duration-150 ease-out\",\n \"[transition-property:var(--transition-property,width,height,left,top)]\",\n // `underline` is a bar, not a pill: drop the chrome and paint the accent.\n \"group-data-[variant=underline]/segment-group:border-transparent group-data-[variant=underline]/segment-group:bg-primary group-data-[variant=underline]/segment-group:shadow-none\",\n \"data-[orientation=horizontal]:group-data-[variant=underline]/segment-group:top-[calc(var(--top)+var(--height)-1px)]\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:right-[calc(var(--left)+var(--width)-1px)]\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:-translate-x-px\",\n \"data-[orientation=horizontal]:group-data-[variant=underline]/segment-group:h-0.5\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:w-0.5\",\n \"motion-reduce:transition-none!\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"segment-group-indicator\"}\n />\n );\n};\n"],"names":["useSegmentGroup","useSegmentGroupContext","SegmentGroup","props","orientation","variant","options","itemClassName","className","children","slot","rest","jsxs","ArkSegmentGroup","cn","jsx","SegmentGroupIndicator","o","SegmentGroupItem","SegmentGroupItemText"],"mappings":";;;AAOO,MAAMA,IAAkBC,GAwBlBC,IAAe,CAACC,MAA6B;AACxD,QAAM;AAAA,IACJ,aAAAC,IAAc;AAAA,IACd,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDR;AAEJ,SACE,gBAAAS;AAAA,IAACC,EAAgB;AAAA,IAAhB;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMA;AAAA,QACAN;AAAA,MAAA;AAAA,MAEF,gBAAcH;AAAA,MACd,aAAAD;AAAA,MACC,GAAGO;AAAA,MACJ,aAAWD,KAAQ;AAAA,MAEnB,UAAA;AAAA,QAAA,gBAAAK,EAACC,GAAA,EAAsB;AAAA,QAEtBV,KAAA,gBAAAA,EAAS,IAAI,CAACW,MACb,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,OAAOD,EAAE;AAAA,YACT,UAAUA,EAAE;AAAA,YACZ,WAAWH,EAAG,eAAeP,CAAa;AAAA,YAE1C,UAAA,gBAAAQ,EAACI,GAAA,EAAqB,WAAU,8D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AA,MAAA;AAAA,MAED,GAAGG;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGzB;"}
1
+ {"version":3,"file":"segment-group.js","sources":["../../src/simples/segment-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { type UseFieldContext, useFieldContext } from \"@ark-ui/react/field\";\nimport {\n SegmentGroup as ArkSegmentGroup,\n useSegmentGroupContext,\n} from \"@ark-ui/react/segment-group\";\nimport type React from \"react\";\nimport { cn } from \"../lib/cn\";\n\nexport const useSegmentGroup = useSegmentGroupContext;\n\ntype SegmentGroupVariant = \"default\" | \"underline\" | \"solid\";\n\nexport interface SegmentGroupOption {\n value: string;\n label: React.ReactNode;\n disabled?: boolean;\n}\n\ninterface SegmentGroupProps\n extends React.ComponentProps<typeof ArkSegmentGroup.Root> {\n /**\n * The visual variant of the segment group.\n *\n * @default \"default\"\n */\n variant?: SegmentGroupVariant;\n /** Data-driven items rendered before `children` (additive with the compound API). */\n options?: readonly SegmentGroupOption[];\n /** Extra classes applied to each `options`-rendered item. */\n itemClassName?: string;\n}\n\n// Ark's `useSegmentGroup` reads no `useFieldContext`, so a `Field disabled` left the segments\n// clickable. Bridged here the way `RadioGroup` does it — state flags only, explicit props win, and\n// with no `Field` ancestor every flag is `undefined`, which Ark strips before the machine sees it.\nexport const SegmentGroup = (props: SegmentGroupProps) => {\n const {\n orientation = \"horizontal\",\n variant = \"default\",\n options,\n itemClassName,\n className,\n children,\n slot,\n ...rest\n } = props;\n\n const field: UseFieldContext | undefined = useFieldContext();\n\n return (\n <ArkSegmentGroup.Root\n className={cn(\n \"group/segment-group relative\",\n \"flex gap-2\",\n \"isolate\",\n \"data-[orientation=vertical]:flex-col\",\n \"data-disabled:opacity-64\",\n \"data-[variant=underline]:gap-1 data-[variant=underline]:border-input\",\n \"data-[orientation=horizontal]:data-[variant=underline]:border-b\",\n \"data-[orientation=vertical]:data-[variant=underline]:border-l\",\n // `solid`: a filled `bg-muted` track with equal-width segments — the contained\n // \"segmented control\" look, so consumers stop hand-rolling the track each time.\n // The track border is solid: diluted, it composited to ramp step 5 on every backdrop\n // (ΔE 0.00–1.65), and step 5 is `--accent`. `--border` moved from 5 to 6 precisely so a\n // border and a hover surface would stop being the same colour.\n \"data-[variant=solid]:rounded-field data-[variant=solid]:border data-[variant=solid]:border-border data-[variant=solid]:bg-muted data-[variant=solid]:p-1\",\n className\n )}\n data-variant={variant}\n disabled={field?.disabled}\n invalid={field?.invalid}\n orientation={orientation}\n readOnly={field?.readOnly}\n required={field?.required}\n {...rest}\n data-slot={slot ?? \"segment-group\"}\n >\n <SegmentGroupIndicator />\n\n {options?.map((o) => (\n <SegmentGroupItem\n key={o.value}\n value={o.value}\n disabled={o.disabled}\n className={cn(\"px-3 py-1.5\", itemClassName)}\n >\n <SegmentGroupItemText className=\"flex items-center justify-center gap-2 text-sm font-medium\">\n {o.label}\n </SegmentGroupItemText>\n </SegmentGroupItem>\n ))}\n\n {children}\n </ArkSegmentGroup.Root>\n );\n};\n\nexport const SegmentGroupItem = (\n props: React.ComponentProps<typeof ArkSegmentGroup.Item>\n) => {\n const { className, children, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.Item\n className={cn(\n \"relative z-1\",\n \"inline-flex items-center justify-center\",\n \"cursor-pointer select-none\",\n \"text-sm font-medium text-muted-foreground transition-colors\",\n \"hover:text-foreground data-[state=checked]:text-foreground\",\n \"data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start\",\n \"group-data-[variant=solid]/segment-group:flex-1 group-data-[variant=solid]/segment-group:justify-center\",\n \"rounded-[inherit] border border-transparent\",\n \"outline-none data-focus-visible:border-primary data-focus-visible:ring-[3px] data-focus-visible:ring-ring\",\n \"data-disabled:pointer-events-none data-disabled:opacity-64\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"segment-group-item\"}\n >\n {children}\n\n <ArkSegmentGroup.ItemControl />\n <ArkSegmentGroup.ItemHiddenInput />\n </ArkSegmentGroup.Item>\n );\n};\n\nexport const SegmentGroupItemText = (\n props: React.ComponentProps<typeof ArkSegmentGroup.ItemText>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.ItemText\n className={cn(\"relative z-1\", className)}\n {...rest}\n data-slot={slot ?? \"segment-group-item-text\"}\n />\n );\n};\n\nexport const SegmentGroupIndicator = (\n props: React.ComponentProps<typeof ArkSegmentGroup.Indicator>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkSegmentGroup.Indicator\n className={cn(\n \"absolute top-(--top) left-(--left) z-0\",\n \"h-(--height) w-(--width)\",\n \"rounded-[inherit]\",\n // The moving \"pill\": an elevated surface with a hairline border and a soft shadow, so\n // the selected segment reads as a raised chip on the muted track (crisp, not flat).\n // Solid for the same reason as the track — diluted it landed on step 5, `--accent`.\n \"border border-border bg-background shadow-sm\",\n \"transition-[width,height,left,top] duration-150 ease-out\",\n \"[transition-property:var(--transition-property,width,height,left,top)]\",\n // `underline` is a bar, not a pill: drop the chrome and paint the accent.\n \"group-data-[variant=underline]/segment-group:border-transparent group-data-[variant=underline]/segment-group:bg-primary group-data-[variant=underline]/segment-group:shadow-none\",\n \"data-[orientation=horizontal]:group-data-[variant=underline]/segment-group:top-[calc(var(--top)+var(--height)-1px)]\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:right-[calc(var(--left)+var(--width)-1px)]\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:-translate-x-px\",\n \"data-[orientation=horizontal]:group-data-[variant=underline]/segment-group:h-0.5\",\n \"data-[orientation=vertical]:group-data-[variant=underline]/segment-group:w-0.5\",\n \"motion-reduce:transition-none!\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"segment-group-indicator\"}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AAUO;AA4BL;AAAM;AACU;AACJ;AACV;AACA;AACA;AACA;AACA;AACG;AAKL;AACE;AAAiB;AAAhB;AACY;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AAAA;AAEY;AACG;AACD;AAChB;AACiB;AACA;AACb;AACe;AAEnB;AAAuB;AAGrB;AAAC;AAAA;AAEU;AACG;AAC8B;AAI1C;AAAA;AAPO;AAAA;AAWV;AAAA;AAAA;AAGP;AAKE;AAEA;AACE;AAAiB;AAAhB;AACY;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAElB;AAAA;AAE4B;AACI;AAAA;AAAA;AAGvC;AAKE;AAEA;AACE;AAAiB;AAAhB;AACwC;AACnC;AACe;AAAA;AAGzB;AAKE;AAEA;AACE;AAAiB;AAAhB;AACY;AACT;AACA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEE;AACe;AAAA;AAGzB;;;;;;;;"}
@@ -0,0 +1,45 @@
1
+ import { ark } from '@ark-ui/react/factory';
2
+ import { Card } from './card';
3
+ export interface StatRootProps extends React.ComponentProps<typeof Card> {
4
+ /** The status family, written to `data-variant` and read by `StatIndicator`. */
5
+ variant?: "default" | "success" | "info" | "warning" | "destructive";
6
+ }
7
+ /**
8
+ * One dashboard number. A `Card`, so `asChild` makes the anchor *be* the tile — one tab stop, and
9
+ * the router seam. The link styles key on the element (`[a&]`, as `Badge` does) rather than on a
10
+ * prop, so they cannot disagree with what was rendered.
11
+ */
12
+ export declare const StatRoot: (props: StatRootProps) => import("react").JSX.Element;
13
+ export declare const StatIndicator: (props: React.ComponentProps<typeof ark.div>) => import("react").JSX.Element;
14
+ /** Sentence case, no trailing colon. */
15
+ export declare const StatLabel: (props: React.ComponentProps<typeof ark.span>) => import("react").JSX.Element;
16
+ export interface StatValueProps extends React.ComponentProps<typeof ark.div> {
17
+ /** Swaps the figure for a skeleton of its size, so the tile does not jump when it lands. */
18
+ loading?: boolean;
19
+ }
20
+ /**
21
+ * The figure, as the host formats it — `FormatNumber` with `notation="compact"` is the dashboard
22
+ * reading. Proportional figures on purpose: a lone headline number is not a column to align.
23
+ */
24
+ export declare const StatValue: (props: StatValueProps) => import("react").JSX.Element;
25
+ export interface StatDeltaProps extends React.ComponentProps<typeof ark.div> {
26
+ /** Signed change. Its sign draws the direction icon; with `goodWhenUp`, it picks the colour. */
27
+ value: number;
28
+ /**
29
+ * Against the magnitude, before the comparison — `"%"`, `"pp"`, `"ms"`. "+8.2 vs last week" is a
30
+ * different claim from "+8.2% vs last week".
31
+ */
32
+ unit?: string;
33
+ /** Whether a rise is good. Two more failed runs and two more members are both `+2`. @default true */
34
+ goodWhenUp?: boolean;
35
+ }
36
+ /** The comparison period is the children: `<StatDelta value={4.2} unit="%">vs last month</StatDelta>`. */
37
+ export declare const StatDelta: (props: StatDeltaProps) => import("react").JSX.Element;
38
+ export interface StatTrendProps extends Omit<React.ComponentProps<typeof ark.svg>, "values"> {
39
+ /** About a dozen points, oldest first. Fewer than two draws nothing. */
40
+ values: readonly number[];
41
+ }
42
+ /** A sparkline with its last value marked — unlabelled, because a reader who needs the values needs a chart. */
43
+ export declare const StatTrend: (props: StatTrendProps) => import("react").JSX.Element | null;
44
+ export declare const StatDescription: (props: React.ComponentProps<typeof ark.p>) => import("react").JSX.Element;
45
+ //# sourceMappingURL=stat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.d.ts","sourceRoot":"","sources":["../../src/simples/stat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAK5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACtE,gFAAgF;IAChF,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;CACtE;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aA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"@ark-ui/react/format";
4
+ import { MinusIcon as k, TrendingDownIcon as S, TrendingUpIcon as y } from "lucide-react";
5
+ import { tv as D } from "tailwind-variants";
6
+ import { cn as i } from "../lib/cn.js";
7
+ import { Card as I } from "./card.js";
8
+ import { Skeleton as _ } from "./skeleton.js";
9
+ const V = (a) => {
10
+ const { variant: t = "default", className: s, slot: e, ...n } = a;
11
+ return /* @__PURE__ */ o(
12
+ I,
13
+ {
14
+ className: i(
15
+ "group/stat [--space:--spacing(4)] px-(--space)",
16
+ // Indicator and label share the first row; the value and the trend share the second.
17
+ "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-0 gap-y-1",
18
+ "outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring",
19
+ "[a&]:hover:border-primary/40",
20
+ s
21
+ ),
22
+ "data-variant": t,
23
+ ...n,
24
+ slot: e ?? "stat-root"
25
+ }
26
+ );
27
+ }, W = (a) => {
28
+ const { className: t, slot: s, ...e } = a;
29
+ return /* @__PURE__ */ o(
30
+ d.div,
31
+ {
32
+ "aria-hidden": !0,
33
+ className: i(
34
+ "col-start-1 me-2 shrink-0 rounded-full p-1.5 [&_svg]:size-3.5",
35
+ // The soft status pair `Badge` measured: step-11 ink on a 7% wash.
36
+ "bg-muted text-muted-foreground",
37
+ "group-data-[variant=success]/stat:bg-success/7 group-data-[variant=success]/stat:text-success-foreground",
38
+ "group-data-[variant=info]/stat:bg-info/7 group-data-[variant=info]/stat:text-info-foreground",
39
+ "group-data-[variant=warning]/stat:bg-warning/7 group-data-[variant=warning]/stat:text-warning-foreground",
40
+ "group-data-[variant=destructive]/stat:bg-destructive/7 group-data-[variant=destructive]/stat:text-destructive-foreground",
41
+ t
42
+ ),
43
+ ...e,
44
+ "data-slot": s ?? "stat-indicator"
45
+ }
46
+ );
47
+ }, B = (a) => {
48
+ const { className: t, slot: s, ...e } = a;
49
+ return /* @__PURE__ */ o(
50
+ d.span,
51
+ {
52
+ className: i(
53
+ "col-start-2 col-end-[-1] truncate font-medium text-muted-foreground text-sm",
54
+ t
55
+ ),
56
+ ...e,
57
+ "data-slot": s ?? "stat-label"
58
+ }
59
+ );
60
+ }, R = (a) => {
61
+ const { loading: t = !1, className: s, children: e, slot: n, ...r } = a;
62
+ return /* @__PURE__ */ o(
63
+ d.div,
64
+ {
65
+ "aria-busy": t || void 0,
66
+ className: i(
67
+ "col-start-1 col-end-3 pt-2 font-semibold text-2xl text-foreground leading-none tracking-tight",
68
+ s
69
+ ),
70
+ ...r,
71
+ "data-slot": n ?? "stat-value",
72
+ children: t ? /* @__PURE__ */ o(_, { className: "h-6 w-20" }) : e
73
+ }
74
+ );
75
+ }, $ = D({
76
+ base: "col-span-full flex items-center gap-1 font-medium text-xs [&_svg]:size-3.5 [&_svg]:shrink-0",
77
+ variants: {
78
+ // Step-11 ink: a delta is 12px text and owes 4.5:1, which the step-9 fill does not reach.
79
+ tone: {
80
+ good: "text-success-foreground",
81
+ bad: "text-destructive-foreground",
82
+ flat: "text-muted-foreground"
83
+ }
84
+ }
85
+ }), X = (a) => {
86
+ const { value: t, unit: s, goodWhenUp: e = !0, className: n, children: r, slot: c, ...m } = a, l = t > 0 ? "up" : t < 0 ? "down" : "flat", g = l === "flat" ? "flat" : l === "up" === e ? "good" : "bad", u = { up: y, down: S, flat: k }[l];
87
+ return /* @__PURE__ */ v(
88
+ d.div,
89
+ {
90
+ className: i($({ tone: g }), n),
91
+ "data-direction": l,
92
+ ...m,
93
+ "data-slot": c ?? "stat-delta",
94
+ children: [
95
+ /* @__PURE__ */ o(u, { "aria-hidden": !0 }),
96
+ /* @__PURE__ */ v("span", { children: [
97
+ /* @__PURE__ */ o(w, { maximumFractionDigits: 1, signDisplay: "exceptZero", value: t }),
98
+ s
99
+ ] }),
100
+ r != null && /* @__PURE__ */ o("span", { className: "font-normal text-muted-foreground", children: r })
101
+ ]
102
+ }
103
+ );
104
+ }, Y = (a) => {
105
+ const { values: t, className: s, slot: e, ...n } = a;
106
+ if (t.length < 2) return null;
107
+ const r = 72, c = 22, m = Math.min(...t), l = Math.max(...t) - m || 1, g = r / (t.length - 1), u = t.map((p, f) => [f * g, c - (p - m) / l * c]), x = u.map(([p, f], b) => `${b ? "L" : "M"}${p.toFixed(1)},${f.toFixed(1)}`).join(" "), [h, N] = u[u.length - 1] ?? [0, 0];
108
+ return /* @__PURE__ */ v(
109
+ d.svg,
110
+ {
111
+ "aria-hidden": !0,
112
+ className: i("col-start-3 ms-3 self-end overflow-visible", s),
113
+ height: c,
114
+ viewBox: `0 0 ${r} ${c}`,
115
+ width: r,
116
+ ...n,
117
+ "data-slot": e ?? "stat-trend",
118
+ children: [
119
+ /* @__PURE__ */ o(
120
+ "path",
121
+ {
122
+ className: "text-muted-foreground",
123
+ d: x,
124
+ fill: "none",
125
+ stroke: "currentColor",
126
+ strokeLinecap: "round",
127
+ strokeLinejoin: "round",
128
+ strokeWidth: 1.5
129
+ }
130
+ ),
131
+ /* @__PURE__ */ o("circle", { className: "fill-primary", cx: h, cy: N, r: 2.5 })
132
+ ]
133
+ }
134
+ );
135
+ }, Z = (a) => {
136
+ const { className: t, slot: s, ...e } = a;
137
+ return /* @__PURE__ */ o(
138
+ d.p,
139
+ {
140
+ className: i("col-span-full text-muted-foreground text-sm", t),
141
+ ...e,
142
+ "data-slot": s ?? "stat-description"
143
+ }
144
+ );
145
+ };
146
+ export {
147
+ X as StatDelta,
148
+ Z as StatDescription,
149
+ W as StatIndicator,
150
+ B as StatLabel,
151
+ V as StatRoot,
152
+ Y as StatTrend,
153
+ R as StatValue
154
+ };
155
+ //# sourceMappingURL=stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.js","sources":["../../src/simples/stat.tsx"],"sourcesContent":["import { ark } from \"@ark-ui/react/factory\";\nimport { FormatNumber } from \"@ark-ui/react/format\";\nimport { MinusIcon, TrendingDownIcon, TrendingUpIcon } from \"lucide-react\";\nimport { tv } from \"tailwind-variants\";\nimport { cn } from \"../lib/cn\";\nimport { Card } from \"./card\";\nimport { Skeleton } from \"./skeleton\";\n\nexport interface StatRootProps extends React.ComponentProps<typeof Card> {\n /** The status family, written to `data-variant` and read by `StatIndicator`. */\n variant?: \"default\" | \"success\" | \"info\" | \"warning\" | \"destructive\";\n}\n\n/**\n * One dashboard number. A `Card`, so `asChild` makes the anchor *be* the tile — one tab stop, and\n * the router seam. The link styles key on the element (`[a&]`, as `Badge` does) rather than on a\n * prop, so they cannot disagree with what was rendered.\n */\nexport const StatRoot = (props: StatRootProps) => {\n const { variant = \"default\", className, slot, ...rest } = props;\n\n return (\n <Card\n className={cn(\n \"group/stat [--space:--spacing(4)] px-(--space)\",\n // Indicator and label share the first row; the value and the trend share the second.\n \"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-0 gap-y-1\",\n \"outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring\",\n \"[a&]:hover:border-primary/40\",\n className\n )}\n data-variant={variant}\n {...rest}\n slot={slot ?? \"stat-root\"}\n />\n );\n};\n\nexport const StatIndicator = (props: React.ComponentProps<typeof ark.div>) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ark.div\n aria-hidden\n className={cn(\n \"col-start-1 me-2 shrink-0 rounded-full p-1.5 [&_svg]:size-3.5\",\n // The soft status pair `Badge` measured: step-11 ink on a 7% wash.\n \"bg-muted text-muted-foreground\",\n \"group-data-[variant=success]/stat:bg-success/7 group-data-[variant=success]/stat:text-success-foreground\",\n \"group-data-[variant=info]/stat:bg-info/7 group-data-[variant=info]/stat:text-info-foreground\",\n \"group-data-[variant=warning]/stat:bg-warning/7 group-data-[variant=warning]/stat:text-warning-foreground\",\n \"group-data-[variant=destructive]/stat:bg-destructive/7 group-data-[variant=destructive]/stat:text-destructive-foreground\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"stat-indicator\"}\n />\n );\n};\n\n/** Sentence case, no trailing colon. */\nexport const StatLabel = (props: React.ComponentProps<typeof ark.span>) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ark.span\n className={cn(\n \"col-start-2 col-end-[-1] truncate font-medium text-muted-foreground text-sm\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"stat-label\"}\n />\n );\n};\n\nexport interface StatValueProps extends React.ComponentProps<typeof ark.div> {\n /** Swaps the figure for a skeleton of its size, so the tile does not jump when it lands. */\n loading?: boolean;\n}\n\n/**\n * The figure, as the host formats it — `FormatNumber` with `notation=\"compact\"` is the dashboard\n * reading. Proportional figures on purpose: a lone headline number is not a column to align.\n */\nexport const StatValue = (props: StatValueProps) => {\n const { loading = false, className, children, slot, ...rest } = props;\n\n return (\n <ark.div\n aria-busy={loading || undefined}\n className={cn(\n \"col-start-1 col-end-3 pt-2 font-semibold text-2xl text-foreground leading-none tracking-tight\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"stat-value\"}\n >\n {loading ? <Skeleton className=\"h-6 w-20\" /> : children}\n </ark.div>\n );\n};\n\nconst statDeltaVariants = tv({\n base: \"col-span-full flex items-center gap-1 font-medium text-xs [&_svg]:size-3.5 [&_svg]:shrink-0\",\n variants: {\n // Step-11 ink: a delta is 12px text and owes 4.5:1, which the step-9 fill does not reach.\n tone: {\n good: \"text-success-foreground\",\n bad: \"text-destructive-foreground\",\n flat: \"text-muted-foreground\",\n },\n },\n});\n\nexport interface StatDeltaProps extends React.ComponentProps<typeof ark.div> {\n /** Signed change. Its sign draws the direction icon; with `goodWhenUp`, it picks the colour. */\n value: number;\n /**\n * Against the magnitude, before the comparison — `\"%\"`, `\"pp\"`, `\"ms\"`. \"+8.2 vs last week\" is a\n * different claim from \"+8.2% vs last week\".\n */\n unit?: string;\n /** Whether a rise is good. Two more failed runs and two more members are both `+2`. @default true */\n goodWhenUp?: boolean;\n}\n\n/** The comparison period is the children: `<StatDelta value={4.2} unit=\"%\">vs last month</StatDelta>`. */\nexport const StatDelta = (props: StatDeltaProps) => {\n const { value, unit, goodWhenUp = true, className, children, slot, ...rest } = props;\n const direction = value > 0 ? \"up\" : value < 0 ? \"down\" : \"flat\";\n const tone = direction === \"flat\" ? \"flat\" : (direction === \"up\") === goodWhenUp ? \"good\" : \"bad\";\n // Never colour alone: the icon carries the direction and the sign carries it in text.\n const Icon = { up: TrendingUpIcon, down: TrendingDownIcon, flat: MinusIcon }[direction];\n\n return (\n <ark.div\n className={cn(statDeltaVariants({ tone }), className)}\n data-direction={direction}\n {...rest}\n data-slot={slot ?? \"stat-delta\"}\n >\n <Icon aria-hidden />\n <span>\n <FormatNumber maximumFractionDigits={1} signDisplay=\"exceptZero\" value={value} />\n {unit}\n </span>\n {children != null && <span className=\"font-normal text-muted-foreground\">{children}</span>}\n </ark.div>\n );\n};\n\n// `values` is also an SVG animation attribute, meaningless on an `<svg>`; the series takes the name.\nexport interface StatTrendProps extends Omit<React.ComponentProps<typeof ark.svg>, \"values\"> {\n /** About a dozen points, oldest first. Fewer than two draws nothing. */\n values: readonly number[];\n}\n\n/** A sparkline with its last value marked — unlabelled, because a reader who needs the values needs a chart. */\nexport const StatTrend = (props: StatTrendProps) => {\n const { values, className, slot, ...rest } = props;\n if (values.length < 2) return null;\n\n const w = 72;\n const h = 22;\n const min = Math.min(...values);\n const range = Math.max(...values) - min || 1;\n const step = w / (values.length - 1);\n const points = values.map((v, i) => [i * step, h - ((v - min) / range) * h] as const);\n const d = points.map(([x, y], i) => `${i ? \"L\" : \"M\"}${x.toFixed(1)},${y.toFixed(1)}`).join(\" \");\n const [lastX, lastY] = points[points.length - 1] ?? [0, 0];\n\n return (\n <ark.svg\n aria-hidden\n className={cn(\"col-start-3 ms-3 self-end overflow-visible\", className)}\n height={h}\n viewBox={`0 0 ${w} ${h}`}\n width={w}\n {...rest}\n data-slot={slot ?? \"stat-trend\"}\n >\n {/* A 1.5px trend line is a graphical object carrying information, so it owes 3:1. Diluted it\n measured 2.91:1 on the light page (3.33–3.35 in dark); step 11 solid is 9.19 and 8.52. */}\n <path\n className=\"text-muted-foreground\"\n d={d}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1.5}\n />\n <circle className=\"fill-primary\" cx={lastX} cy={lastY} r={2.5} />\n </ark.svg>\n );\n};\n\nexport const StatDescription = (props: React.ComponentProps<typeof ark.p>) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ark.p\n className={cn(\"col-span-full text-muted-foreground text-sm\", className)}\n {...rest}\n data-slot={slot ?? \"stat-description\"}\n />\n );\n};\n"],"names":["StatRoot","props","variant","className","slot","rest","jsx","Card","cn","StatIndicator","ark","StatLabel","StatValue","loading","children","Skeleton","statDeltaVariants","tv","StatDelta","value","unit","goodWhenUp","direction","tone","Icon","TrendingUpIcon","TrendingDownIcon","MinusIcon","jsxs","FormatNumber","StatTrend","values","w","h","min","range","step","points","v","i","d","x","y","lastX","lastY","StatDescription"],"mappings":";;;;;;;;AAkBO,MAAMA,IAAW,CAACC,MAAyB;AAChD,QAAM,EAAE,SAAAC,IAAU,WAAW,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAASJ;AAE1D,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACAL;AAAA,MAAA;AAAA,MAEF,gBAAcD;AAAA,MACb,GAAGG;AAAA,MACJ,MAAMD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGpB,GAEaK,IAAgB,CAACR,MAAgD;AAC5E,QAAM,EAAE,WAAAE,GAAW,MAAAC,GAAM,GAAGC,MAASJ;AAErC,SACE,gBAAAK;AAAA,IAACI,EAAI;AAAA,IAAJ;AAAA,MACC,eAAW;AAAA,MACX,WAAWF;AAAA,QACT;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGzB,GAGaO,IAAY,CAACV,MAAiD;AACzE,QAAM,EAA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E,QAAQ8B;AAAA,MACR,SAAS,OAAOD,CAAC,IAAIC,CAAC;AAAA,MACtB,OAAOD;AAAA,MACN,GAAG3B;AAAA,MACJ,aAAWD,KAAQ;AAAA,MAInB,UAAA;AAAA,QAAA,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,GAAAkC;AAAA,YACA,MAAK;AAAA,YACL,QAAO;AAAA,YACP,eAAc;AAAA,YACd,gBAAe;AAAA,YACf,aAAa;AAAA,UAAA;AAAA,QAAA;AAAA,QAEf,gBAAAlC,EAAC,YAAO,WAAU,gBAAe,IAAIqC,GAAO,IAAIC,GAAO,GAAG,IAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGrE,GAEaC,IAAkB,CAAC5C,MAA8C;AAC5E,QAAM,EAAE,WAAAE,GAAW,MAAAC,GAAM,GAAGC,MAASJ;AAErC,SACE,gBAAAK;AAAA,IAACI,EAAI;AAAA,IAAJ;AAAA,MACC,WAAWF,EAAG,+CAA+CL,CAAS;AAAA,MACrE,GAAGE;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGzB;"}
@@ -0,0 +1,20 @@
1
+ import { ColumnDef, Row } from '@tanstack/react-table';
2
+ import { ReactNode } from 'react';
3
+ export interface ActionsColumnOptions<TData> {
4
+ /** Visually hidden header text, so the column is not an empty `<th>`. Default "Actions". */
5
+ headerLabel?: string;
6
+ /** Column id. Default "actions". */
7
+ id?: string;
8
+ /** aria-label for a row's trigger. It names the row — the icon has no text to borrow. */
9
+ label: (row: Row<TData>) => string;
10
+ /** The row's menu items — `MenuItem`, `MenuSeparator`, `MenuGroup`. `null` renders no trigger. */
11
+ menu: (row: Row<TData>) => ReactNode;
12
+ }
13
+ /**
14
+ * A trailing row-menu column. A row with nothing permitted gets no trigger rather than an empty
15
+ * menu. The trigger and the menu both stop click propagation so neither fires
16
+ * `DataTableContent`'s `onRowClick` — the menu too, because a portal's events bubble through the
17
+ * React tree to the row regardless of where the DOM put them.
18
+ */
19
+ export declare function actionsColumn<TData>(options: ActionsColumnOptions<TData>): ColumnDef<TData, unknown>;
20
+ //# sourceMappingURL=actions-column.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions-column.d.ts","sourceRoot":"","sources":["../../src/table/actions-column.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,oBAAoB,CAAC,KAAK;IACzC,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yFAAyF;IACzF,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC;IACnC,kGAAkG;IAClG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;CACtC;AAMD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EACjC,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,GACnC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAkC3B"}
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as n, jsxs as m } from "react/jsx-runtime";
3
+ import { EllipsisIcon as u } from "lucide-react";
4
+ import { Button as d } from "../simples/button.js";
5
+ import { Menu as p, MenuTrigger as f, MenuContent as h } from "../simples/menu.js";
6
+ const i = 44;
7
+ function z(r) {
8
+ const { headerLabel: t = "Actions", id: s = "actions", label: a, menu: c } = r;
9
+ return {
10
+ cell: ({ row: l }) => {
11
+ const o = c(l);
12
+ return o == null ? null : /* @__PURE__ */ n("div", { className: "flex justify-end", children: /* @__PURE__ */ m(p, { children: [
13
+ /* @__PURE__ */ n(f, { asChild: !0, children: /* @__PURE__ */ n(
14
+ d,
15
+ {
16
+ "aria-label": a(l),
17
+ onClick: (e) => e.stopPropagation(),
18
+ size: "icon-sm",
19
+ variant: "ghost",
20
+ children: /* @__PURE__ */ n(u, {})
21
+ }
22
+ ) }),
23
+ /* @__PURE__ */ n(h, { onClick: (e) => e.stopPropagation(), children: o })
24
+ ] }) });
25
+ },
26
+ enableHiding: !1,
27
+ enableSorting: !1,
28
+ header: () => /* @__PURE__ */ n("span", { className: "sr-only", children: t }),
29
+ id: s,
30
+ maxSize: i,
31
+ minSize: i,
32
+ size: i
33
+ };
34
+ }
35
+ export {
36
+ z as actionsColumn
37
+ };
38
+ //# sourceMappingURL=actions-column.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions-column.js","sources":["../../src/table/actions-column.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ColumnDef, Row } from \"@tanstack/react-table\";\nimport { EllipsisIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { Button } from \"../simples/button.js\";\nimport { Menu, MenuContent, MenuTrigger } from \"../simples/menu.js\";\n\nexport interface ActionsColumnOptions<TData> {\n /** Visually hidden header text, so the column is not an empty `<th>`. Default \"Actions\". */\n headerLabel?: string;\n /** Column id. Default \"actions\". */\n id?: string;\n /** aria-label for a row's trigger. It names the row — the icon has no text to borrow. */\n label: (row: Row<TData>) => string;\n /** The row's menu items — `MenuItem`, `MenuSeparator`, `MenuGroup`. `null` renders no trigger. */\n menu: (row: Row<TData>) => ReactNode;\n}\n\n// The trigger at `--size-field: 0.25rem` (28px) plus the cell's `p-2`. A floor, not a clamp: in\n// an auto-layout table a wider density's trigger still wins, and the column takes no slack.\nconst WIDTH = 44;\n\n/**\n * A trailing row-menu column. A row with nothing permitted gets no trigger rather than an empty\n * menu. The trigger and the menu both stop click propagation so neither fires\n * `DataTableContent`'s `onRowClick` — the menu too, because a portal's events bubble through the\n * React tree to the row regardless of where the DOM put them.\n */\nexport function actionsColumn<TData>(\n options: ActionsColumnOptions<TData>,\n): ColumnDef<TData, unknown> {\n const { headerLabel = \"Actions\", id = \"actions\", label, menu } = options;\n\n return {\n cell: ({ row }) => {\n const items = menu(row);\n if (items == null) return null;\n\n return (\n <div className=\"flex justify-end\">\n <Menu>\n <MenuTrigger asChild>\n <Button\n aria-label={label(row)}\n onClick={(event) => event.stopPropagation()}\n size=\"icon-sm\"\n variant=\"ghost\"\n >\n <EllipsisIcon />\n </Button>\n </MenuTrigger>\n <MenuContent onClick={(event) => event.stopPropagation()}>{items}</MenuContent>\n </Menu>\n </div>\n );\n },\n enableHiding: false,\n enableSorting: false,\n header: () => <span className=\"sr-only\">{headerLabel}</span>,\n id,\n maxSize: WIDTH,\n minSize: WIDTH,\n size: WIDTH,\n };\n}\n"],"names":[],"mappings":";;;;;AAqBA;AAQO;AAGL;AAEA;AAAO;AAEH;AACA;AAKM;AACE;AAAC;AAAA;AACsB;AACK;AACrB;AACG;AAEM;AAAA;AAElB;AACiE;AAErE;AAEJ;AACc;AACC;AACsC;AACrD;AACS;AACA;AACH;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-content.d.ts","sourceRoot":"","sources":["../../src/table/data-table-content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,EAON,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,OAAO,CACpD,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5D,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,qBAAqB,CAAC,KAAK,CAAC,qBAkGpF"}
1
+ {"version":3,"file":"data-table-content.d.ts","sourceRoot":"","sources":["../../src/table/data-table-content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,EAON,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,OAAO,CACpD,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5D,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,qBAAqB,CAAC,KAAK,CAAC,qBA4GpF"}
@@ -1,28 +1,39 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as x } from "react/jsx-runtime";
3
- import { flexRender as i } from "@tanstack/react-table";
4
- import { cn as C } from "../lib/cn.js";
5
- import { Table as T, TableHeader as D, TableRow as n, TableHead as v, TableBody as w, TableCell as d, TableFooter as y } from "../simples/table.js";
6
- import { useDataTableContext as k } from "./data-table-root.js";
7
- const H = (a) => a ? "overflow-clip" : "overflow-hidden";
8
- function j(a) {
2
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
3
+ import { flexRender as a } from "@tanstack/react-table";
4
+ import { cn as D } from "../lib/cn.js";
5
+ import { Table as T, TableHeader as v, TableRow as r, TableHead as w, TableBody as y, TableCell as c, TableFooter as k } from "../simples/table.js";
6
+ import { useDataTableContext as H } from "./data-table-root.js";
7
+ const N = (i) => i ? "overflow-clip" : "overflow-hidden";
8
+ function j(i) {
9
9
  const {
10
10
  empty: u = "No results.",
11
11
  onRowClick: l,
12
12
  className: f,
13
- stickyHeader: c = !1,
14
- maxHeight: s,
15
- ...h
16
- } = a, r = k(), p = c && s === void 0, m = r.getRowModel().rows, b = r.getVisibleLeafColumns().length || 1, g = r.getFooterGroups().some((o) => o.headers.some((e) => e.column.columnDef.footer));
13
+ stickyHeader: s = !1,
14
+ maxHeight: d,
15
+ ...g
16
+ } = i, n = H(), h = s && d === void 0, m = n.getRowModel().rows, p = n._getDefaultColumnDef().size, b = n.getVisibleLeafColumns().length || 1, x = n.getFooterGroups().some((o) => o.headers.some((e) => e.column.columnDef.footer));
17
17
  return /* @__PURE__ */ t(
18
18
  "div",
19
19
  {
20
- className: C(H(p), "rounded-lg border border-border", f),
20
+ className: D(N(h), "rounded-lg border border-border", f),
21
21
  "data-slot": "data-table-content",
22
- children: /* @__PURE__ */ x(T, { maxHeight: s, stickyHeader: c, ...h, children: [
23
- /* @__PURE__ */ t(D, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ t(n, { children: o.headers.map((e) => /* @__PURE__ */ t(v, { children: e.isPlaceholder ? null : i(e.column.columnDef.header, e.getContext()) }, e.id)) }, o.id)) }),
24
- /* @__PURE__ */ t(w, { children: m.length ? m.map((o) => /* @__PURE__ */ t(
25
- n,
22
+ children: /* @__PURE__ */ C(T, { maxHeight: d, stickyHeader: s, ...g, children: [
23
+ /* @__PURE__ */ t(v, { children: n.getHeaderGroups().map((o) => /* @__PURE__ */ t(r, { children: o.headers.map((e) => (
24
+ // Only a column that declares its own `size` gets a width. TanStack merges a
25
+ // default of 150 into every column, and applying that would fix the whole table.
26
+ /* @__PURE__ */ t(
27
+ w,
28
+ {
29
+ style: e.column.columnDef.size === p ? void 0 : { width: e.getSize() },
30
+ children: e.isPlaceholder ? null : a(e.column.columnDef.header, e.getContext())
31
+ },
32
+ e.id
33
+ )
34
+ )) }, o.id)) }),
35
+ /* @__PURE__ */ t(y, { children: m.length ? m.map((o) => /* @__PURE__ */ t(
36
+ r,
26
37
  {
27
38
  className: l ? "cursor-pointer" : void 0,
28
39
  "data-state": o.getIsSelected() ? "selected" : void 0,
@@ -31,18 +42,18 @@ function j(a) {
31
42
  e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), l(o.original)));
32
43
  } : void 0,
33
44
  tabIndex: l ? 0 : void 0,
34
- children: o.getVisibleCells().map((e) => /* @__PURE__ */ t(d, { children: i(e.column.columnDef.cell, e.getContext()) }, e.id))
45
+ children: o.getVisibleCells().map((e) => /* @__PURE__ */ t(c, { children: a(e.column.columnDef.cell, e.getContext()) }, e.id))
35
46
  },
36
47
  o.id
37
- )) : /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
38
- d,
48
+ )) : /* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(
49
+ c,
39
50
  {
40
51
  className: "h-24 whitespace-normal text-center text-muted-foreground",
41
52
  colSpan: b,
42
53
  children: u
43
54
  }
44
55
  ) }) }),
45
- g && /* @__PURE__ */ t(y, { children: r.getFooterGroups().map((o) => /* @__PURE__ */ t(n, { children: o.headers.map((e) => /* @__PURE__ */ t(d, { children: e.isPlaceholder ? null : i(e.column.columnDef.footer, e.getContext()) }, e.id)) }, o.id)) })
56
+ x && /* @__PURE__ */ t(k, { children: n.getFooterGroups().map((o) => /* @__PURE__ */ t(r, { children: o.headers.map((e) => /* @__PURE__ */ t(c, { children: e.isPlaceholder ? null : a(e.column.columnDef.footer, e.getContext()) }, e.id)) }, o.id)) })
46
57
  ] })
47
58
  }
48
59
  );