@box-kite/react 0.0.1 → 1.0.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 (188) hide show
  1. package/.claude/rules/box-kite-rules.md +43 -0
  2. package/.claude/skills/box-kite/SKILL.md +431 -0
  3. package/BOX_AI_CONTEXT.md +1833 -0
  4. package/BOX_KITE_AI_CONTEXT.md +1833 -0
  5. package/LICENSE +21 -0
  6. package/README.md +710 -7
  7. package/a11y.cjs +1 -0
  8. package/a11y.d.ts +15 -0
  9. package/a11y.mjs +3 -0
  10. package/behavior.cjs +1 -0
  11. package/behavior.mjs +295 -0
  12. package/box.cjs +1 -0
  13. package/box.d.ts +46 -0
  14. package/box.mjs +23 -0
  15. package/client.cjs +1 -0
  16. package/client.mjs +163 -0
  17. package/components/baseSvg.cjs +1 -0
  18. package/components/baseSvg.d.ts +5 -0
  19. package/components/baseSvg.mjs +21 -0
  20. package/components/button.cjs +1 -0
  21. package/components/button.d.ts +16 -0
  22. package/components/button.mjs +19 -0
  23. package/components/chart.cjs +1 -0
  24. package/components/chart.d.ts +82 -0
  25. package/components/chart.mjs +261 -0
  26. package/components/checkbox.cjs +1 -0
  27. package/components/checkbox.d.ts +28 -0
  28. package/components/checkbox.mjs +38 -0
  29. package/components/dataGrid/components/dataGridBody.d.ts +7 -0
  30. package/components/dataGrid/components/dataGridBottomBar.d.ts +6 -0
  31. package/components/dataGrid/components/dataGridCell.d.ts +15 -0
  32. package/components/dataGrid/components/dataGridCellRowDetail.d.ts +6 -0
  33. package/components/dataGrid/components/dataGridCellRowSelection.d.ts +6 -0
  34. package/components/dataGrid/components/dataGridCellText.d.ts +6 -0
  35. package/components/dataGrid/components/dataGridColumnFilter.d.ts +9 -0
  36. package/components/dataGrid/components/dataGridColumnGroups.d.ts +7 -0
  37. package/components/dataGrid/components/dataGridContent.d.ts +6 -0
  38. package/components/dataGrid/components/dataGridDetailRow.d.ts +8 -0
  39. package/components/dataGrid/components/dataGridEmptyColumns.d.ts +6 -0
  40. package/components/dataGrid/components/dataGridFilterCell.d.ts +11 -0
  41. package/components/dataGrid/components/dataGridFilterRow.d.ts +6 -0
  42. package/components/dataGrid/components/dataGridGlobalFilter.d.ts +6 -0
  43. package/components/dataGrid/components/dataGridGroupRow.d.ts +8 -0
  44. package/components/dataGrid/components/dataGridHeader.d.ts +6 -0
  45. package/components/dataGrid/components/dataGridHeaderCell.d.ts +9 -0
  46. package/components/dataGrid/components/dataGridHeaderCellContextMenu.d.ts +11 -0
  47. package/components/dataGrid/components/dataGridHeaderCellResizer.d.ts +14 -0
  48. package/components/dataGrid/components/dataGridLoader.d.ts +11 -0
  49. package/components/dataGrid/components/dataGridPagination.d.ts +6 -0
  50. package/components/dataGrid/components/dataGridRow.d.ts +8 -0
  51. package/components/dataGrid/components/dataGridTopBar.d.ts +6 -0
  52. package/components/dataGrid/components/dataGridTopBarContextMenu.d.ts +6 -0
  53. package/components/dataGrid/contracts/dataGridContract.d.ts +213 -0
  54. package/components/dataGrid/gridNavigationContext.d.ts +24 -0
  55. package/components/dataGrid/models/cellModel.d.ts +18 -0
  56. package/components/dataGrid/models/columnModel.d.ts +150 -0
  57. package/components/dataGrid/models/columnVisibilityModel.d.ts +24 -0
  58. package/components/dataGrid/models/detailRowModel.d.ts +22 -0
  59. package/components/dataGrid/models/filterModel.d.ts +22 -0
  60. package/components/dataGrid/models/gridModel.d.ts +206 -0
  61. package/components/dataGrid/models/groupRowCellModel.d.ts +26 -0
  62. package/components/dataGrid/models/groupRowModel.d.ts +48 -0
  63. package/components/dataGrid/models/headerCellModel.d.ts +83 -0
  64. package/components/dataGrid/models/paginationModel.d.ts +32 -0
  65. package/components/dataGrid/models/rowModel.d.ts +34 -0
  66. package/components/dataGrid/models/viewportModel.d.ts +44 -0
  67. package/components/dataGrid/useGrid.d.ts +8 -0
  68. package/components/dataGrid/useGridNavigation.d.ts +21 -0
  69. package/components/dataGrid.cjs +1 -0
  70. package/components/dataGrid.d.ts +2 -0
  71. package/components/dataGrid.mjs +3178 -0
  72. package/components/dropdown/dropdownContext.d.ts +44 -0
  73. package/components/dropdown/dropdownItems.d.ts +22 -0
  74. package/components/dropdown/dropdownRowRenderer.d.ts +8 -0
  75. package/components/dropdown/dropdownSearch.d.ts +21 -0
  76. package/components/dropdown/utils.d.ts +1 -0
  77. package/components/dropdown.cjs +1 -0
  78. package/components/dropdown.d.ts +47 -0
  79. package/components/dropdown.mjs +479 -0
  80. package/components/flex.cjs +1 -0
  81. package/components/flex.d.ts +6 -0
  82. package/components/flex.mjs +16 -0
  83. package/components/form.cjs +1 -0
  84. package/components/form.d.ts +10 -0
  85. package/components/form.mjs +58 -0
  86. package/components/grid.cjs +1 -0
  87. package/components/grid.d.ts +6 -0
  88. package/components/grid.mjs +16 -0
  89. package/components/icon.cjs +1 -0
  90. package/components/icon.d.ts +36 -0
  91. package/components/icon.mjs +41 -0
  92. package/components/overlay.cjs +1 -0
  93. package/components/overlay.d.ts +43 -0
  94. package/components/overlay.mjs +82 -0
  95. package/components/presence.cjs +1 -0
  96. package/components/presence.d.ts +30 -0
  97. package/components/presence.mjs +11 -0
  98. package/components/radioButton.cjs +1 -0
  99. package/components/radioButton.d.ts +24 -0
  100. package/components/radioButton.mjs +32 -0
  101. package/components/radioGroup.cjs +1 -0
  102. package/components/radioGroup.d.ts +38 -0
  103. package/components/radioGroup.mjs +79 -0
  104. package/components/select.cjs +1 -0
  105. package/components/select.d.ts +42 -0
  106. package/components/select.mjs +36 -0
  107. package/components/semantics.cjs +1 -0
  108. package/components/semantics.d.ts +34 -0
  109. package/components/semantics.mjs +17 -0
  110. package/components/svg.cjs +1 -0
  111. package/components/svg.d.ts +63 -0
  112. package/components/svg.mjs +141 -0
  113. package/components/switch.cjs +1 -0
  114. package/components/switch.d.ts +20 -0
  115. package/components/switch.mjs +25 -0
  116. package/components/textarea.cjs +1 -0
  117. package/components/textarea.d.ts +27 -0
  118. package/components/textarea.mjs +33 -0
  119. package/components/textbox.cjs +1 -0
  120. package/components/textbox.d.ts +26 -0
  121. package/components/textbox.mjs +33 -0
  122. package/components/tooltip.cjs +1 -0
  123. package/components/tooltip.d.ts +63 -0
  124. package/components/tooltip.mjs +108 -0
  125. package/components/visuallyHidden.cjs +1 -0
  126. package/components/visuallyHidden.d.ts +6 -0
  127. package/components/visuallyHidden.mjs +23 -0
  128. package/effects.cjs +1 -0
  129. package/effects.mjs +6 -0
  130. package/forms.cjs +1 -0
  131. package/forms.mjs +21 -0
  132. package/icons/dotsIcon.d.ts +2 -0
  133. package/icons/expandIcon.d.ts +2 -0
  134. package/icons/groupingIcon.d.ts +2 -0
  135. package/icons/pinIcon.d.ts +2 -0
  136. package/icons/searchIcon.d.ts +2 -0
  137. package/icons/sortIcon.d.ts +2 -0
  138. package/motion.cjs +1 -0
  139. package/motion.mjs +66 -0
  140. package/package.json +203 -7
  141. package/platform.cjs +1 -0
  142. package/platform.mjs +32 -0
  143. package/react/a11y/callbacks.d.ts +12 -0
  144. package/react/a11y/useControllableState.d.ts +25 -0
  145. package/react/a11y/useDismiss.d.ts +25 -0
  146. package/react/a11y/useFocusReturn.d.ts +18 -0
  147. package/react/a11y/useIdentifier.d.ts +17 -0
  148. package/react/a11y/useRovingFocus.d.ts +84 -0
  149. package/react/animation/usePresence.d.ts +32 -0
  150. package/react/boxClassNames.d.ts +25 -0
  151. package/react/boxProps.d.ts +49 -0
  152. package/react/boxTagProps.d.ts +7 -0
  153. package/react/clientRuntime.d.ts +11 -0
  154. package/react/effects.d.ts +10 -0
  155. package/react/forms/labelledControl.d.ts +17 -0
  156. package/react/forms/placeholderProp.d.ts +13 -0
  157. package/react/hooks/usePortalContainer.d.ts +1 -0
  158. package/react/hooks/useVirtualization.d.ts +43 -0
  159. package/react/hooks/useVisibility.d.ts +9 -0
  160. package/react/reactTypes.d.ts +10 -0
  161. package/react/resolveStyles.d.ts +18 -0
  162. package/react/styleElements.d.ts +3 -0
  163. package/react/svg/attributesInProps.d.ts +4 -0
  164. package/react/svg/svgNaming.d.ts +15 -0
  165. package/react/theme/theme.d.ts +26 -0
  166. package/react/theme/themeContext.d.ts +7 -0
  167. package/react/useStyles.d.ts +22 -0
  168. package/react-shared.cjs +1 -0
  169. package/react-shared.mjs +105 -0
  170. package/rolldown-runtime.cjs +1 -0
  171. package/rsc.cjs +1 -0
  172. package/rsc.d.ts +27 -0
  173. package/rsc.mjs +18 -0
  174. package/ssg.cjs +1 -0
  175. package/ssg.d.ts +24 -0
  176. package/ssg.mjs +25 -0
  177. package/utils/animation/animationUtils.d.ts +29 -0
  178. package/utils/array/arrayUtils.d.ts +15 -0
  179. package/utils/box/boxUtils.d.ts +5 -0
  180. package/utils/chart/chartUtils.d.ts +98 -0
  181. package/utils/dom/domUtils.d.ts +26 -0
  182. package/utils/environment/environmentUtils.d.ts +18 -0
  183. package/utils/fn/fnUtils.d.ts +4 -0
  184. package/utils/form/formUtils.d.ts +8 -0
  185. package/utils/memo.d.ts +10 -0
  186. package/utils/object/objectUtils.d.ts +13 -0
  187. package/utils/string/fuzzySearch.d.ts +27 -0
  188. package/utils/string/stringUtils.d.ts +4 -0
@@ -0,0 +1,82 @@
1
+ import { RefAttributes } from 'react';
2
+ import { BoxProps } from '../box';
3
+ import { ExtractElementFromTag } from '../react/reactTypes';
4
+ import { BoxStyleProps, ComponentsAndVariants } from '@box-kite/core/types';
5
+ import { SvgProps } from './svg';
6
+ /**
7
+ * The chart micro-primitives: the small drawings a dashboard is made of, as Boxes. Deliberately not a chart
8
+ * *library* — no axes, no legends, no data transformations; what you get instead is that every prop,
9
+ * breakpoint and theme works. Two rules run through all four: **shape is an attribute, paint is a class**
10
+ * (so ten thousand rows share one rule), and a ring's fill is a **rounded fraction**, because a dash length
11
+ * lands in a class name and still has to transition. Naming is `Svg`'s: no `label` means `aria-hidden`.
12
+ */
13
+ /**
14
+ * The props every primitive shares: an `Svg`'s, minus the `viewBox` and `variant` they own and with
15
+ * `children` narrowed to SVG content — a chart's children are a label in a ring, never a render prop.
16
+ */
17
+ type ChartProps = Omit<SvgProps, 'viewBox' | 'variant' | 'children'> & {
18
+ children?: React.ReactNode;
19
+ };
20
+ /** A paint value: a colour token, or the `url(#…)`/`var(--…)` a gradient or a theme provides. */
21
+ type Paint = NonNullable<BoxStyleProps['fill']>;
22
+ export interface SparklineProps extends ChartProps {
23
+ /** The numbers to draw, oldest first. */
24
+ data: readonly number[];
25
+ /** `line` (default), `area` — the line with the space beneath it filled — or `bar`. */
26
+ variant?: 'line' | 'area' | 'bar';
27
+ /**
28
+ * Fix the ends of the value axis. Without them the line uses its own lowest and highest value, so
29
+ * every row of a table is scaled to itself; with them a column of sparklines is comparable.
30
+ */
31
+ min?: number;
32
+ max?: number;
33
+ }
34
+ /** A line, area or bar chart small enough to sit inside a line of text or a table cell. */
35
+ export declare const Sparkline: import('react').ForwardRefExoticComponent<Omit<SparklineProps, "ref"> & RefAttributes<SVGSVGElement>>;
36
+ /** What a ring and a dial have in common: one value, and how thick the arc drawing it is. */
37
+ export interface ProgressRingProps extends ChartProps {
38
+ /** How full the arc is, from 0 to 1. Rounded to half a percent — see `ChartUtils.FRACTION_STEP`. */
39
+ value: number;
40
+ /** The width of the ring in view units, out of the 100 the box is wide. */
41
+ thickness?: number;
42
+ /** The unfilled part of the ring, as the same colour faded — so the track follows the theme too. */
43
+ trackOpacity?: NonNullable<BoxStyleProps['strokeOpacity']>;
44
+ }
45
+ /** A full circle filled to `value`, starting at twelve o'clock — the percentage-complete ring. */
46
+ export declare const ProgressRing: import('react').ForwardRefExoticComponent<Omit<ProgressRingProps, "ref"> & RefAttributes<SVGSVGElement>>;
47
+ export interface GaugeProps extends ProgressRingProps {
48
+ /** How far round the dial goes, in degrees. Three quarters of a turn by default. */
49
+ sweep?: number;
50
+ /** Where it starts, in degrees clockwise from twelve o'clock. Bottom left by default. */
51
+ start?: number;
52
+ }
53
+ /** A dial: an arc of `sweep` degrees filled to `value`. A gauge with `sweep={360}` is a ring. */
54
+ export declare const Gauge: import('react').ForwardRefExoticComponent<Omit<GaugeProps, "ref"> & RefAttributes<SVGSVGElement>>;
55
+ export interface MiniDonutProps extends ChartProps {
56
+ /** One value per segment. Each is drawn as its share of the whole, so they need no total. */
57
+ data: readonly number[];
58
+ /** One colour per segment, cycled if there are fewer than there are values. */
59
+ colors?: readonly Paint[];
60
+ /** The width of the ring in view units, out of the 100 the box is wide. */
61
+ thickness?: number;
62
+ }
63
+ /** A ring divided into one segment per value — a pie chart with its middle left for a number. */
64
+ export declare const MiniDonut: import('react').ForwardRefExoticComponent<Omit<MiniDonutProps, "ref"> & RefAttributes<SVGSVGElement>>;
65
+ /**
66
+ * The series a `<ChartContainer>` draws: `series={['revenue', 'cost']}` takes the palette in order,
67
+ * `series={{ revenue: 'emerald-600' }}` names its own paint. A name becomes part of a custom-property
68
+ * name, so it has to be a CSS identifier — a dot-path `dataKey` is skipped rather than taking the rest.
69
+ */
70
+ export type ChartSeries = readonly string[] | Readonly<Record<string, Paint>>;
71
+ export interface ChartContainerProps<TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never> extends BoxProps<TTag, TKey> {
72
+ /** The series drawn inside, and what colour each of them is. */
73
+ series?: ChartSeries;
74
+ }
75
+ /**
76
+ * The theming bridge: a Box that declares the variables a chart reads, so the chart itself names no
77
+ * colour. `vars` is an ordinary prop, so the palette is themed and responsive like everything else and
78
+ * lands in a *class* — two containers with the same series share one rule, and it renders on a server.
79
+ * The names are the ecosystem's, so a chart copied from shadcn works unchanged. It adds no ARIA.
80
+ */
81
+ export declare const ChartContainer: <TTag extends keyof React.JSX.IntrinsicElements = "div", TKey extends keyof ComponentsAndVariants = never>(props: ChartContainerProps<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
82
+ export {};
@@ -0,0 +1,261 @@
1
+ import { Circle as e, Path as t, Svg as n } from "./svg.mjs";
2
+ import { forwardRef as r } from "react";
3
+ import { mergeDeep as i } from "@box-kite/core";
4
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import c from "@box-kite/react";
6
+ //#region src/utils/chart/chartUtils.ts
7
+ var l;
8
+ (function(e) {
9
+ let t = e.VIEW = 100, n = e.CENTRE = t / 2, r = e.FRACTION_STEP = .005;
10
+ function i(e) {
11
+ return Math.round(e * 100) / 100;
12
+ }
13
+ function a(e) {
14
+ return Math.round(Math.min(Math.max(e, 0), 1) / r) * r;
15
+ }
16
+ e.fraction = a;
17
+ function o(e, r = {}) {
18
+ if (e.length === 0) return [];
19
+ let a = r.min ?? Math.min(...e), o = (r.max ?? Math.max(...e)) - a, s = (e) => i(o === 0 ? n : t - (e - a) / o * t);
20
+ if (e.length === 1) return [{
21
+ x: 0,
22
+ y: s(e[0])
23
+ }, {
24
+ x: t,
25
+ y: s(e[0])
26
+ }];
27
+ let c = t / (e.length - 1);
28
+ return e.map((e, t) => ({
29
+ x: i(t * c),
30
+ y: s(e)
31
+ }));
32
+ }
33
+ e.points = o;
34
+ function s(e) {
35
+ return e.length === 0 ? "" : e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x} ${e.y}`).join("");
36
+ }
37
+ e.linePath = s;
38
+ function c(e) {
39
+ if (e.length === 0) return "";
40
+ let n = e[e.length - 1];
41
+ return `${s(e)}L${n.x} ${t}L${e[0].x} ${t}Z`;
42
+ }
43
+ e.areaPath = c;
44
+ function l(e, n = {}, r = .25) {
45
+ if (e.length === 0) return "";
46
+ let a = t / e.length, s = i(a * (1 - r)), c = i((a - s) / 2);
47
+ return o(e, n).map((e, n) => {
48
+ let r = Math.min(e.y, t - 1);
49
+ return `M${i(n * a + c)} ${r}h${s}v${i(t - r)}h${-s}Z`;
50
+ }).join("");
51
+ }
52
+ e.barsPath = l;
53
+ function u(e) {
54
+ return i(n - e / 2);
55
+ }
56
+ e.radius = u;
57
+ function d(e) {
58
+ return i(2 * Math.PI * e);
59
+ }
60
+ e.circumference = d;
61
+ function f(e, t) {
62
+ return {
63
+ strokeDasharray: i(e),
64
+ strokeDashoffset: i(e * (1 - a(t)))
65
+ };
66
+ }
67
+ e.dash = f;
68
+ function p(e, t) {
69
+ let r = (t - 90) * Math.PI / 180;
70
+ return {
71
+ x: i(n + e * Math.cos(r)),
72
+ y: i(n + e * Math.sin(r))
73
+ };
74
+ }
75
+ function m(e, t) {
76
+ return i(d(e) * (Math.min(Math.abs(t), 360) / 360));
77
+ }
78
+ e.arcLength = m;
79
+ function h(e, t, n) {
80
+ if (Math.abs(n) >= 360) {
81
+ let n = p(e, t), r = p(e, t + 180);
82
+ return `M${n.x} ${n.y}A${e} ${e} 0 0 1 ${r.x} ${r.y}A${e} ${e} 0 0 1 ${n.x} ${n.y}`;
83
+ }
84
+ let r = p(e, t), i = p(e, t + n), a = +(Math.abs(n) > 180), o = n < 0 ? 0 : 1;
85
+ return `M${r.x} ${r.y}A${e} ${e} 0 ${a} ${o} ${i.x} ${i.y}`;
86
+ }
87
+ e.arcPath = h;
88
+ function g(e, t) {
89
+ let n = e.reduce((e, t) => e + Math.max(t, 0), 0);
90
+ if (n <= 0) return [];
91
+ let r = 0;
92
+ return e.map((e, o) => {
93
+ let s = a(Math.max(e, 0) / n), c = i(t * s), l = i(r * 360);
94
+ return r += s, {
95
+ strokeDasharray: `${c} ${i(t - c)}`,
96
+ rotate: l,
97
+ value: e,
98
+ index: o
99
+ };
100
+ });
101
+ }
102
+ e.donutSegments = g;
103
+ let _ = e.PALETTE = [
104
+ "sky-500",
105
+ "emerald-500",
106
+ "amber-500",
107
+ "violet-500",
108
+ "rose-500",
109
+ "cyan-500"
110
+ ];
111
+ e.DARK_PALETTE = [
112
+ "sky-400",
113
+ "emerald-400",
114
+ "amber-400",
115
+ "violet-400",
116
+ "rose-400",
117
+ "cyan-400"
118
+ ];
119
+ function v(e) {
120
+ return e.reduce((e, t, n) => (e[`chart-${n + 1}`] = t, e), {});
121
+ }
122
+ e.paletteVariables = v;
123
+ function y(e, t = _.length) {
124
+ return (Array.isArray(e) ? e.map((e, n) => [e, `var(--chart-${n % t + 1})`]) : Object.entries(e)).reduce((e, [t, n]) => (e[`color-${t}`] = n, e), {});
125
+ }
126
+ e.seriesVariables = y;
127
+ })(l ||= {});
128
+ var u = l, d = `0 0 ${u.VIEW} ${u.VIEW}`, f = u.PALETTE;
129
+ function p(e, r) {
130
+ let { data: i, variant: c = "line", min: l, max: f, children: p, ...m } = e, h = {
131
+ min: l,
132
+ max: f
133
+ }, g = u.points(i, h);
134
+ return /* @__PURE__ */ s(n, {
135
+ viewBox: d,
136
+ preserveAspectRatio: "none",
137
+ vectorEffect: "non-scaling-stroke",
138
+ width: "100%",
139
+ height: "1.5rem",
140
+ overflow: "visible",
141
+ stroke: "currentColor",
142
+ fill: "currentColor",
143
+ strokeWidth: 1.5,
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round",
146
+ ref: r,
147
+ ...m,
148
+ children: [c === "bar" ? /* @__PURE__ */ o(t, {
149
+ d: u.barsPath(i, h),
150
+ stroke: "none"
151
+ }) : /* @__PURE__ */ s(a, { children: [c === "area" && /* @__PURE__ */ o(t, {
152
+ d: u.areaPath(g),
153
+ stroke: "none",
154
+ fillOpacity: .2
155
+ }), /* @__PURE__ */ o(t, {
156
+ d: u.linePath(g),
157
+ fill: "none"
158
+ })] }), p]
159
+ });
160
+ }
161
+ var m = /* @__PURE__ */ r(p);
162
+ m.displayName = "Sparkline";
163
+ function h(t, r) {
164
+ let { value: i, thickness: a = 10, trackOpacity: c = .2, children: l, ...f } = t, p = u.radius(a), m = u.circumference(p);
165
+ return /* @__PURE__ */ s(n, {
166
+ viewBox: d,
167
+ width: "3rem",
168
+ height: "3rem",
169
+ stroke: "currentColor",
170
+ fill: "none",
171
+ strokeWidth: a,
172
+ strokeLinecap: "round",
173
+ ref: r,
174
+ ...f,
175
+ children: [
176
+ /* @__PURE__ */ o(e, {
177
+ cx: u.CENTRE,
178
+ cy: u.CENTRE,
179
+ r: p,
180
+ strokeOpacity: c
181
+ }),
182
+ /* @__PURE__ */ o(e, {
183
+ cx: u.CENTRE,
184
+ cy: u.CENTRE,
185
+ r: p,
186
+ transform: `rotate(-90 ${u.CENTRE} ${u.CENTRE})`,
187
+ ...u.dash(m, i)
188
+ }),
189
+ l
190
+ ]
191
+ });
192
+ }
193
+ var g = /* @__PURE__ */ r(h);
194
+ g.displayName = "ProgressRing";
195
+ function _(e, r) {
196
+ let { value: i, thickness: a = 10, trackOpacity: c = .2, sweep: l = 270, start: f = 225, children: p, ...m } = e, h = u.radius(a), g = u.arcLength(h, l), _ = u.arcPath(h, f, l);
197
+ return /* @__PURE__ */ s(n, {
198
+ viewBox: d,
199
+ width: "4rem",
200
+ height: "4rem",
201
+ stroke: "currentColor",
202
+ fill: "none",
203
+ strokeWidth: a,
204
+ strokeLinecap: "round",
205
+ ref: r,
206
+ ...m,
207
+ children: [
208
+ /* @__PURE__ */ o(t, {
209
+ d: _,
210
+ strokeOpacity: c
211
+ }),
212
+ /* @__PURE__ */ o(t, {
213
+ d: _,
214
+ ...u.dash(g, i)
215
+ }),
216
+ p
217
+ ]
218
+ });
219
+ }
220
+ var v = /* @__PURE__ */ r(_);
221
+ v.displayName = "Gauge";
222
+ function y(t, r) {
223
+ let { data: i, colors: a = f, thickness: c = 20, children: l, ...p } = t, m = u.radius(c), h = u.circumference(m);
224
+ return /* @__PURE__ */ s(n, {
225
+ viewBox: d,
226
+ width: "3rem",
227
+ height: "3rem",
228
+ fill: "none",
229
+ strokeWidth: c,
230
+ ref: r,
231
+ ...p,
232
+ children: [u.donutSegments(i, h).map((t) => /* @__PURE__ */ o(e, {
233
+ cx: u.CENTRE,
234
+ cy: u.CENTRE,
235
+ r: m,
236
+ stroke: a[t.index % a.length],
237
+ strokeDasharray: t.strokeDasharray,
238
+ transform: `rotate(${t.rotate - 90} ${u.CENTRE} ${u.CENTRE})`
239
+ }, t.index)), l]
240
+ });
241
+ }
242
+ var b = /* @__PURE__ */ r(y);
243
+ b.displayName = "MiniDonut";
244
+ function x(e, t) {
245
+ let { series: n, vars: r, theme: a, ...s } = e, l = {
246
+ ...u.paletteVariables(u.PALETTE),
247
+ ...n ? u.seriesVariables(n) : {},
248
+ ...r
249
+ }, d = i({ dark: { vars: u.paletteVariables(u.DARK_PALETTE) } }, a ?? {});
250
+ return /* @__PURE__ */ o(c, {
251
+ ref: t,
252
+ vars: l,
253
+ theme: d,
254
+ ...s
255
+ });
256
+ }
257
+ var S = r(x);
258
+ S.displayName = "ChartContainer";
259
+ var C = S;
260
+ //#endregion
261
+ export { C as ChartContainer, v as Gauge, b as MiniDonut, g as ProgressRing, m as Sparkline };
@@ -0,0 +1 @@
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../box.cjs"),n=require("../forms.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=[`name`,`onInput`,`onChange`,`autoFocus`,`readOnly`,`value`,`defaultChecked`];function o(o,s){let{label:c,labelProps:l,...u}=o,d=Array.isArray(o.indeterminate)?o.indeterminate[0]:o.indeterminate,f=typeof d==`boolean`&&d,p=e.t.buildProps(u,a,{type:`checkbox`,...f?{"aria-checked":`mixed`}:{}}),m=(0,r.useRef)(null);return(0,r.useImperativeHandle)(s,()=>m.current),(0,r.useEffect)(()=>{m.current&&(m.current.indeterminate=f)},[m,f]),(0,i.jsx)(n.n,{label:c,labelProps:l,children:(0,i.jsx)(t.default,{tag:`input`,ref:m,component:`checkbox`,...p})})}var s=(0,r.forwardRef)(o);s.displayName=`Checkbox`,exports.default=s;
@@ -0,0 +1,28 @@
1
+ import { RefAttributes } from 'react';
2
+ import { BoxTagProps, BoxProps } from '../box';
3
+ import { OmitTagProps } from '../react/boxProps';
4
+ import { ComponentsAndVariants } from '@box-kite/core/types';
5
+ declare const tagProps: readonly ["name", "onInput", "onChange", "autoFocus", "readOnly", "value", "defaultChecked"];
6
+ type TagPropsType = (typeof tagProps)[number];
7
+ type CheckboxProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'input', TKey>, 'tag' | 'props'>;
8
+ type CheckboxTagProps = OmitTagProps<BoxTagProps<'input'>, TagPropsType | 'type'>;
9
+ interface Props<TKey extends keyof ComponentsAndVariants> extends CheckboxProps<TKey> {
10
+ name?: string;
11
+ props?: CheckboxTagProps;
12
+ onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
13
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
+ value?: string | number;
15
+ autoFocus?: boolean;
16
+ readOnly?: boolean;
17
+ defaultChecked?: boolean;
18
+ /**
19
+ * The text beside the checkbox — rendered inside a `<label>` that wraps the input, so the
20
+ * association is the component's job. Without it a consumer has to wire `htmlFor`/`id` by hand,
21
+ * and a checkbox with no label is the single most common accessibility failure there is.
22
+ */
23
+ label?: React.ReactNode;
24
+ /** Styles for the wrapping `<label>`: the row's layout, not the box's own appearance. */
25
+ labelProps?: BoxProps<'label'>;
26
+ }
27
+ declare const _default: <TKey extends keyof ComponentsAndVariants = "checkbox">(props: Props<TKey> & RefAttributes<HTMLInputElement>) => React.ReactNode;
28
+ export default _default;
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { t as e } from "../react-shared.mjs";
3
+ import t from "../box.mjs";
4
+ import { n } from "../forms.mjs";
5
+ import { forwardRef as r, useEffect as i, useImperativeHandle as a, useRef as o } from "react";
6
+ import { jsx as s } from "react/jsx-runtime";
7
+ //#region src/components/checkbox.tsx
8
+ var c = [
9
+ "name",
10
+ "onInput",
11
+ "onChange",
12
+ "autoFocus",
13
+ "readOnly",
14
+ "value",
15
+ "defaultChecked"
16
+ ];
17
+ function l(r, l) {
18
+ let { label: u, labelProps: d, ...f } = r, p = Array.isArray(r.indeterminate) ? r.indeterminate[0] : r.indeterminate, m = typeof p == "boolean" && p, h = e.buildProps(f, c, {
19
+ type: "checkbox",
20
+ ...m ? { "aria-checked": "mixed" } : {}
21
+ }), g = o(null);
22
+ return a(l, () => g.current), i(() => {
23
+ g.current && (g.current.indeterminate = m);
24
+ }, [g, m]), /* @__PURE__ */ s(n, {
25
+ label: u,
26
+ labelProps: d,
27
+ children: /* @__PURE__ */ s(t, {
28
+ tag: "input",
29
+ ref: g,
30
+ component: "checkbox",
31
+ ...h
32
+ })
33
+ });
34
+ }
35
+ var u = r(l);
36
+ u.displayName = "Checkbox";
37
+ //#endregion
38
+ export { u as default };
@@ -0,0 +1,7 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ scrollTop: number;
5
+ }
6
+ export default function DataGridBody<TRow>(props: Props<TRow>): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridBottomBar<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { BoxProps } from '../../../box';
2
+ import { default as CellModel } from '../models/cellModel';
3
+ import { default as GroupRowCellModel } from '../models/groupRowCellModel';
4
+ interface Props<TRow> extends BoxProps {
5
+ children: React.ReactNode;
6
+ cell: CellModel<TRow> | GroupRowCellModel<TRow>;
7
+ /** Navigation coordinates. `columnIndex` counts rendered cells, which a group row has fewer of. */
8
+ row: number;
9
+ columnIndex: number;
10
+ /** 1-based `aria-colindex`, when the cell does not sit at `columnIndex`. */
11
+ ariaColIndex?: number;
12
+ ariaColSpan?: number;
13
+ }
14
+ export default function DataGridCell<TRow>(props: Props<TRow>): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as CellModel } from '../models/cellModel';
2
+ interface Props<TRow> {
3
+ cell: CellModel<TRow>;
4
+ }
5
+ export default function DataGridCellRowDetail<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as CellModel } from '../models/cellModel';
2
+ interface Props<TRow> {
3
+ cell: CellModel<TRow>;
4
+ }
5
+ export default function DataGridCellRowSelection<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as CellModel } from '../models/cellModel';
2
+ interface Props<TRow> {
3
+ cell: CellModel<TRow>;
4
+ }
5
+ export default function DataGridCellText<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as ColumnModel } from '../models/columnModel';
2
+ interface Props<TRow> {
3
+ column: ColumnModel<TRow>;
4
+ }
5
+ /**
6
+ * Renders the appropriate filter input for the column's resolved filter type.
7
+ */
8
+ export default function DataGridColumnFilter<TRow>(props: Props<TRow>): import("react").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { default as GridModel } from '../models/gridModel';
3
+ interface Props<TRow> {
4
+ grid: GridModel<TRow>;
5
+ }
6
+ export default function DataGridColumnGroups<TRow>(props: Props<TRow>): React.JSX.Element | null;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridContent<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as DetailRowModel } from '../models/detailRowModel';
2
+ interface Props<TRow> {
3
+ row: DetailRowModel<TRow>;
4
+ /** Position in the whole row list, not in the rendered window. */
5
+ index: number;
6
+ }
7
+ export default function DataGridDetailRow<TRow>(props: Props<TRow>): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridEmptyColumns<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as ColumnModel } from '../models/columnModel';
2
+ import { default as GridModel } from '../models/gridModel';
3
+ interface Props<TRow> {
4
+ column: ColumnModel<TRow>;
5
+ grid: GridModel<TRow>;
6
+ /** Navigation coordinates: the filter row, and this cell's column along it. */
7
+ row: number;
8
+ columnIndex: number;
9
+ }
10
+ export default function DataGridFilterCell<TRow>(props: Props<TRow>): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridFilterRow<TRow>(props: Props<TRow>): import("react").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridGlobalFilter<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as GroupRowModel } from '../models/groupRowModel';
2
+ interface Props<TRow> {
3
+ row: GroupRowModel<TRow>;
4
+ /** Position in the whole row list, not in the rendered window. */
5
+ index: number;
6
+ }
7
+ export default function DataGridGroupRow<TRow>(props: Props<TRow>): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridHeader<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as ColumnModel } from '../models/columnModel';
2
+ interface Props<TRow> {
3
+ column: ColumnModel<TRow>;
4
+ /** Navigation coordinates: which header row this is, and where the cell sits along it. */
5
+ row: number;
6
+ columnIndex: number;
7
+ }
8
+ export default function DataGridHeaderCell<TRow>(props: Props<TRow>): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as ColumnModel } from '../models/columnModel';
2
+ interface Props<TRow> {
3
+ column: ColumnModel<TRow>;
4
+ }
5
+ /**
6
+ * The column's menu — APG's menu button, on top of `Overlay`. The items are data rather than JSX because
7
+ * the pattern needs them as a list: `useRovingFocus` numbers them for the arrows and the typeahead, and
8
+ * which exist changes with the column's state. Sections are a rendering detail on top of that list.
9
+ */
10
+ export default function DataGridHeaderCellContextMenu<TRow>(props: Props<TRow>): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as ColumnModel } from '../models/columnModel';
2
+ interface Props<TRow> {
3
+ column: ColumnModel<TRow>;
4
+ /** The header cell this separator sits in — `aria-controls`, the pane it resizes. */
5
+ controls: string;
6
+ }
7
+ /**
8
+ * The column resizer, which is APG's window splitter: a `separator` with a value in pixels, its own tab
9
+ * stop, and the arrows that move it. The drag and the keyboard run the same model at the same cost — each
10
+ * step paints the widths straight onto the grid element and React is told once, when the gesture ends
11
+ * (a press is a gesture too; it ends on `keyup`).
12
+ */
13
+ export default function DataGridHeaderCellResizer<TRow>(props: Props<TRow>): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ /**
6
+ * The indeterminate loading bar: a 40%-wide bar sliding off one edge to the other, over and over. The
7
+ * sweep is `rb-datagrid-loader`, registered with the engine's own keyframes, and the animation props
8
+ * live in the bar's component styles — this component draws three Boxes and nothing else.
9
+ */
10
+ export default function DataGridLoader<TRow>(props: Props<TRow>): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridPagination<TRow>(props: Props<TRow>): import("react").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as RowModel } from '../models/rowModel';
2
+ interface Props<TRow> {
3
+ row: RowModel<TRow>;
4
+ /** Position in the whole row list, not in the rendered window. */
5
+ index: number;
6
+ }
7
+ export default function DataGridRow<TRow>(props: Props<TRow>): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridTopBar<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as GridModel } from '../models/gridModel';
2
+ interface Props<TRow> {
3
+ grid: GridModel<TRow>;
4
+ }
5
+ export default function DataGridTopBarContextMenu<TRow>(props: Props<TRow>): import("react").JSX.Element;
6
+ export {};