@adea-ai/ui 0.100.2 → 0.101.1

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 (132) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  2. package/dist/components/composites/about-dialog/about-dialog.js +2 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  4. package/dist/components/composites/account-menu/account-menu.d.ts +7 -0
  5. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  6. package/dist/components/composites/account-menu/account-menu.js +116 -89
  7. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  8. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  9. package/dist/components/composites/help-center/help-center.js +26 -21
  10. package/dist/components/composites/help-center/help-center.js.map +1 -1
  11. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  12. package/dist/components/composites/settings/settings.js +43 -36
  13. package/dist/components/composites/settings/settings.js.map +1 -1
  14. package/dist/components/composites/stat/stat.d.ts.map +1 -1
  15. package/dist/components/composites/stat/stat.js +46 -35
  16. package/dist/components/composites/stat/stat.js.map +1 -1
  17. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  18. package/dist/components/composites/update-dialog/update-dialog.js +73 -58
  19. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  20. package/dist/components/layout/page/page.d.ts.map +1 -1
  21. package/dist/components/layout/page/page.js +19 -13
  22. package/dist/components/layout/page/page.js.map +1 -1
  23. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  24. package/dist/components/theme/appearance-panel.js +37 -18
  25. package/dist/components/theme/appearance-panel.js.map +1 -1
  26. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  27. package/dist/components/ui/alert-dialog/alert-dialog.js +5 -1
  28. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  29. package/dist/components/ui/card/card.d.ts.map +1 -1
  30. package/dist/components/ui/card/card.js +5 -1
  31. package/dist/components/ui/card/card.js.map +1 -1
  32. package/dist/components/ui/chart/chart-options.d.ts +3 -2
  33. package/dist/components/ui/chart/chart-options.d.ts.map +1 -1
  34. package/dist/components/ui/chart/chart-options.js +30 -9
  35. package/dist/components/ui/chart/chart-options.js.map +1 -1
  36. package/dist/components/ui/chart/chart.d.ts +4 -9
  37. package/dist/components/ui/chart/chart.d.ts.map +1 -1
  38. package/dist/components/ui/chart/chart.js +65 -10
  39. package/dist/components/ui/chart/chart.js.map +1 -1
  40. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  41. package/dist/components/ui/dialog/dialog.js +5 -1
  42. package/dist/components/ui/dialog/dialog.js.map +1 -1
  43. package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
  44. package/dist/components/ui/drawer/drawer.js +5 -1
  45. package/dist/components/ui/drawer/drawer.js.map +1 -1
  46. package/dist/components/ui/field/field.d.ts.map +1 -1
  47. package/dist/components/ui/field/field.js +2 -1
  48. package/dist/components/ui/field/field.js.map +1 -1
  49. package/dist/components/ui/item/item.d.ts +1 -1
  50. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  51. package/dist/components/ui/navigation-menu/navigation-menu.js +8 -7
  52. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  53. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  54. package/dist/components/ui/sheet/sheet.js +5 -1
  55. package/dist/components/ui/sheet/sheet.js.map +1 -1
  56. package/dist/components/ui/tabs/tabs.d.ts +13 -0
  57. package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
  58. package/dist/components/ui/tabs/tabs.js +15 -1
  59. package/dist/components/ui/tabs/tabs.js.map +1 -1
  60. package/dist/components/ui/toast/toast.d.ts.map +1 -1
  61. package/dist/components/ui/toast/toast.js +6 -2
  62. package/dist/components/ui/toast/toast.js.map +1 -1
  63. package/dist/components/ui/typography/index.d.ts +3 -0
  64. package/dist/components/ui/typography/index.d.ts.map +1 -0
  65. package/dist/components/ui/typography/index.js +2 -0
  66. package/dist/components/ui/typography/typography.d.ts +84 -0
  67. package/dist/components/ui/typography/typography.d.ts.map +1 -0
  68. package/dist/components/ui/typography/typography.js +179 -0
  69. package/dist/components/ui/typography/typography.js.map +1 -0
  70. package/dist/index.d.ts +1 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +2 -1
  73. package/dist/r/account-menu.json +1 -0
  74. package/dist/r/alert-dialog.json +1 -0
  75. package/dist/r/card.json +1 -0
  76. package/dist/r/dialog.json +1 -0
  77. package/dist/r/drawer.json +1 -0
  78. package/dist/r/field.json +1 -0
  79. package/dist/r/help-center.json +1 -0
  80. package/dist/r/page.json +1 -0
  81. package/dist/r/registry.json +37 -0
  82. package/dist/r/settings.json +1 -0
  83. package/dist/r/sheet.json +1 -0
  84. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +3 -2
  85. package/dist/r/src/components/composites/account-menu/account-menu.tsx +105 -66
  86. package/dist/r/src/components/composites/help-center/help-center.tsx +2 -1
  87. package/dist/r/src/components/composites/settings/settings.tsx +4 -1
  88. package/dist/r/src/components/composites/stat/stat.tsx +7 -2
  89. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +36 -24
  90. package/dist/r/src/components/layout/page/page.tsx +3 -2
  91. package/dist/r/src/components/theme/appearance-panel.tsx +13 -4
  92. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -1
  93. package/dist/r/src/components/ui/card/card.tsx +2 -1
  94. package/dist/r/src/components/ui/chart/chart-options.ts +35 -7
  95. package/dist/r/src/components/ui/chart/chart.tsx +65 -12
  96. package/dist/r/src/components/ui/dialog/dialog.tsx +2 -1
  97. package/dist/r/src/components/ui/drawer/drawer.tsx +2 -1
  98. package/dist/r/src/components/ui/field/field.tsx +2 -3
  99. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +27 -20
  100. package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
  101. package/dist/r/src/components/ui/tabs/tabs.tsx +18 -1
  102. package/dist/r/src/components/ui/toast/toast.tsx +7 -6
  103. package/dist/r/src/components/ui/typography/index.ts +9 -0
  104. package/dist/r/src/components/ui/typography/typography.tsx +205 -0
  105. package/dist/r/stat.json +1 -0
  106. package/dist/r/theming.json +1 -0
  107. package/dist/r/typography.json +24 -0
  108. package/dist/r/update-dialog.json +1 -0
  109. package/package.json +1 -1
  110. package/registry.json +37 -0
  111. package/src/components/composites/about-dialog/about-dialog.tsx +3 -2
  112. package/src/components/composites/account-menu/account-menu.tsx +105 -66
  113. package/src/components/composites/help-center/help-center.tsx +2 -1
  114. package/src/components/composites/settings/settings.tsx +4 -1
  115. package/src/components/composites/stat/stat.tsx +7 -2
  116. package/src/components/composites/update-dialog/update-dialog.tsx +36 -24
  117. package/src/components/layout/page/page.tsx +3 -2
  118. package/src/components/theme/appearance-panel.tsx +13 -4
  119. package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -1
  120. package/src/components/ui/card/card.tsx +2 -1
  121. package/src/components/ui/chart/chart-options.ts +35 -7
  122. package/src/components/ui/chart/chart.tsx +65 -12
  123. package/src/components/ui/dialog/dialog.tsx +2 -1
  124. package/src/components/ui/drawer/drawer.tsx +2 -1
  125. package/src/components/ui/field/field.tsx +2 -3
  126. package/src/components/ui/navigation-menu/navigation-menu.tsx +27 -20
  127. package/src/components/ui/sheet/sheet.tsx +5 -1
  128. package/src/components/ui/tabs/tabs.tsx +18 -1
  129. package/src/components/ui/toast/toast.tsx +7 -6
  130. package/src/components/ui/typography/index.ts +9 -0
  131. package/src/components/ui/typography/typography.tsx +205 -0
  132. package/src/index.ts +1 -0
@@ -47,7 +47,9 @@ var _tmpl$5 = /*#__PURE__*/ template(`<li class="flex items-center gap-1.5 text-
47
47
  * A canvas cannot read a custom property, so the options and datasets carry
48
48
  * `var(--token)` strings and each chart resolves them against its own element
49
49
  * when it renders, and again whenever the root's attributes change — the
50
- * `.dark` class, `data-accent`, an inline override. See `createThemeResolver`.
50
+ * `.dark` class, `data-accent`, `data-font`, an inline override. The type is
51
+ * resolved the same way: `--font-sans` for the family and a type-scale rung for
52
+ * the size, so a chart follows the font axis too. See `createThemeResolver`.
51
53
  */
52
54
  /**
53
55
  * Register a piece with Chart.js. The escape hatch for a caller's own chart type.
@@ -85,6 +87,21 @@ function toCanvasColor(value) {
85
87
  const [r, g, b, a] = swatch.getImageData(0, 0, 1, 1).data;
86
88
  return `rgba(${r}, ${g}, ${b}, ${Math.round((a ?? 255) / 255 * 1e3) / 1e3})`;
87
89
  }
90
+ var length = /^(-?\d*\.?\d+)(px|rem)$/;
91
+ /**
92
+ * A token's computed value as a canvas option: a colour as an sRGB colour, a
93
+ * `px`/`rem` length (a type-scale rung) as the number of pixels Chart.js wants,
94
+ * and anything else — a font stack — as written.
95
+ */
96
+ function toCanvasValue(raw) {
97
+ const match = length.exec(raw);
98
+ if (match) {
99
+ const value = Number(match[1]);
100
+ if (match[2] === "px") return value;
101
+ return value * (Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16);
102
+ }
103
+ return toCanvasColor(raw);
104
+ }
88
105
  /**
89
106
  * Resolves `var(--token)` strings against a chart's element, and re-resolves
90
107
  * them when the theme changes.
@@ -93,15 +110,24 @@ function toCanvasColor(value) {
93
110
  * inline tokens takes those. The observer watches every attribute on `<html>`,
94
111
  * because that is where both applications switch appearance, accent and theme
95
112
  * (`.dark`, `data-accent`, `data-theme`, inline variables); a theme axis added
96
- * later is covered without touching this. It is released with the chart.
113
+ * later is covered without touching this. It also re-resolves when a web font
114
+ * finishes loading: a canvas draws text once, so a chart rendered before the
115
+ * face selected by `data-font` arrived would otherwise keep the fallback face
116
+ * until something else redrew it. Both are released with the chart.
97
117
  */
98
118
  function createThemeResolver() {
99
119
  let element;
100
120
  const [revision, invalidate] = createSignal(void 0, { equals: false });
121
+ const onFontsLoaded = () => invalidate();
101
122
  onMount(() => {
102
123
  const observer = new MutationObserver(() => invalidate());
103
124
  observer.observe(document.documentElement, { attributes: true });
104
- onCleanup(() => observer.disconnect());
125
+ const fonts = typeof document.fonts === "undefined" ? void 0 : document.fonts;
126
+ fonts?.addEventListener("loadingdone", onFontsLoaded);
127
+ onCleanup(() => {
128
+ observer.disconnect();
129
+ fonts?.removeEventListener("loadingdone", onFontsLoaded);
130
+ });
105
131
  });
106
132
  return {
107
133
  ref: (el) => {
@@ -115,7 +141,7 @@ function createThemeResolver() {
115
141
  return resolveCssVariables(value, (name) => {
116
142
  if (!resolved.has(name)) {
117
143
  const raw = style.getPropertyValue(name).trim();
118
- resolved.set(name, raw ? toCanvasColor(raw) : void 0);
144
+ resolved.set(name, raw ? toCanvasValue(raw) : void 0);
119
145
  }
120
146
  return resolved.get(name);
121
147
  });
@@ -296,20 +322,49 @@ function RadarChart(props) {
296
322
  })();
297
323
  }
298
324
  /**
299
- * A polar area chart: radial bars, for a composition.
325
+ * Puts the themed radial scale back on a chart `solid-chartjs` has just created.
326
+ *
327
+ * `solid-chartjs` deletes `options.scales.r` for every chart type but radar when
328
+ * it first creates a chart. Today that delete lands on a throwaway copy — Solid
329
+ * compiles `options={…}` to a getter, so its next read rebuilds the object with
330
+ * `r` intact — but that is an accident of how the prop is passed: a memoised or
331
+ * static options object would lose the scale, and the polar area would fall back
332
+ * to Chart.js's defaults (grey ticks on a translucent white box, which is a white
333
+ * box on a dark card). Restoring it from this component's own options makes the
334
+ * themed scale independent of both. Later option updates (every theme change)
335
+ * pass `r` through untouched; only creation drops it.
300
336
  *
301
- * Its scale is left to Chart.js's polar-area defaults (`'none'` rather than
302
- * `'radial'`): `solid-chartjs` deletes `options.scales.r` for every chart type
303
- * but radar when it first creates the chart, so radial styling here would apply
304
- * only after the first theme change — a chart that restyles itself on a toggle.
337
+ * `afterInit` runs inside Chart.js's constructor, after the options are read and
338
+ * before the first update builds the scales and draws, so the themed scale is in
339
+ * place for the first frame — no default-styled frame, and no extra update. The
340
+ * plugin is per instance, passed through the chart's `plugins` prop, so nothing
341
+ * is registered globally.
305
342
  */
343
+ function restoreRadialScale(options) {
344
+ return {
345
+ id: "adea-radial-scale",
346
+ afterInit(chart) {
347
+ const scale = options().scales?.["r"];
348
+ if (!scale) return;
349
+ chart.options.scales = {
350
+ ...chart.options.scales,
351
+ r: scale
352
+ };
353
+ }
354
+ };
355
+ }
356
+ /** A polar area chart: radial bars, for a composition. */
306
357
  function PolarAreaChart(props) {
307
358
  const theme = createThemeResolver();
359
+ const options = () => theme.resolve(chartOptions(props.options, "radial"));
308
360
  return (() => {
309
361
  var _el$1 = _tmpl$3();
310
362
  var _ref$6 = theme.ref;
311
363
  typeof _ref$6 === "function" ? use(_ref$6, _el$1) : theme.ref = _el$1;
312
364
  insert(_el$1, createComponent(PolarArea, {
365
+ get plugins() {
366
+ return [restoreRadialScale(options)];
367
+ },
313
368
  get data() {
314
369
  return theme.resolve({
315
370
  labels: [...props.labels],
@@ -322,7 +377,7 @@ function PolarAreaChart(props) {
322
377
  });
323
378
  },
324
379
  get options() {
325
- return theme.resolve(chartOptions(props.options, "none"));
380
+ return options();
326
381
  }
327
382
  }));
328
383
  effect(() => className(_el$1, cn("h-64", props.class)));
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":["For","Show","createSignal","onCleanup","onMount","splitProps","JSX","Dynamic","Bar","Bubble","Doughnut","Line","Pie","PolarArea","Radar","Scatter","Chart","ChartJs","ArcElement","BarElement","CategoryScale","Filler","Legend","LineElement","LinearScale","LogarithmicScale","PointElement","RadialLinearScale","Tooltip","ChartTooltip","ChartOptions","ChartType","cn","chartOptions","chartSeriesColors","mergeChartOptions","resolveCssVariables","ChartScaleShape","registerChartPiece","piece","Parameters","register","swatch","CanvasRenderingContext2D","toCanvasColor","value","CSS","supports","undefined","canvas","document","createElement","width","height","getContext","willReadFrequently","globalCompositeOperation","fillStyle","fillRect","r","g","b","a","getImageData","data","Math","round","createThemeResolver","element","HTMLElement","revision","invalidate","equals","observer","MutationObserver","observe","documentElement","attributes","disconnect","ref","el","resolve","T","getComputedStyle","style","resolved","Map","name","has","raw","getPropertyValue","trim","set","get","ChartFrameProps","title","description","actions","Element","children","class","ChartFrame","props","local","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","_$insert","_$createComponent","when","_el$5","_tmpl$","_$effect","_$className","SeriesChartProps","labels","series","label","color","options","stacked","datasetsFor","filled","map","entry","index","borderColor","length","backgroundColor","pointBackgroundColor","borderWidth","pointRadius","pointHoverRadius","tension","fill","seriesOptions","extra","shape","scales","x","y","LineChart","area","theme","_el$6","_tmpl$3","_ref$","_$use","datasets","BarChart","horizontal","_el$7","_ref$2","dataset","borderRadius","indexAxis","ScatterChart","_el$8","_ref$3","point","BubbleChart","_el$9","_ref$4","RadarChart","_el$0","_ref$5","PolarAreaChart","_el$1","_ref$6","DonutChart","cutout","component","_el$10","_ref$7","_","ChartLegend","_el$11","_tmpl$4","each","_el$12","_tmpl$5","_el$13","_$p","_$setStyleProperty","ChartJs","ChartTooltip","_$createComponent","_$className","_$use","_$setStyleProperty"],"sources":["../../../../src/components/ui/chart/chart.tsx"],"sourcesContent":["import { For, Show, createSignal, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, Scatter } from 'solid-chartjs'\nimport {\n Chart as ChartJs,\n ArcElement,\n BarElement,\n CategoryScale,\n Filler,\n Legend,\n LineElement,\n LinearScale,\n LogarithmicScale,\n PointElement,\n RadialLinearScale,\n Tooltip as ChartTooltip,\n} from 'chart.js'\nimport type { ChartOptions, ChartType } from 'chart.js'\nimport { cn } from '#lib/utils'\nimport {\n chartOptions,\n chartSeriesColors,\n mergeChartOptions,\n resolveCssVariables,\n type ChartScaleShape,\n} from './chart-options'\n\n/**\n * Chart.\n *\n * A thin wrapper over Chart.js, themed through the same CSS custom properties as\n * everything else. The wrapper is thin on purpose: a design system's job here is\n * to make a chart *look like the rest of the application* — the palette, the\n * type scale, the tooltip surface, the grid lines — and not to re-implement\n * scales and axes, which is where a hand-rolled chart goes wrong.\n *\n * ## Registration, and why it is here rather than left to the caller\n *\n * Chart.js is tree-shakeable through explicit registration: nothing is bundled\n * until a controller, a scale or a plugin is registered. That is the whole reason\n * it was chosen over a batteries-included charting library, and it only pays off\n * if the registrations are scoped to what a component actually uses.\n *\n * This module registers the **shared** pieces once — scales, elements, tooltip,\n * legend, filler — and nothing else. The controllers are imported per component\n * so a `LineChart` does not carry the radar controller, and a consumer that\n * imports only `LineChart` gets only that. Measured: see the story for the\n * per-component figures the tree-shaking gate publishes.\n *\n * A caller with a chart type this file does not export registers its own\n * controller with `registerChartPiece`, which is the escape hatch rather than a\n * reason to widen the registration above.\n *\n * ## Theming\n *\n * Colours come from `--chart-1` through `--chart-5`, which every theme\n * defines, and the grid, ticks and labels from `--border` and\n * `--muted-foreground`. That means a chart follows the accent axis and the\n * appearance with no per-chart configuration — and a caller that wants a\n * specific series colour passes it explicitly, as a colour or as `var(--token)`.\n *\n * A canvas cannot read a custom property, so the options and datasets carry\n * `var(--token)` strings and each chart resolves them against its own element\n * when it renders, and again whenever the root's attributes change — the\n * `.dark` class, `data-accent`, an inline override. See `createThemeResolver`.\n */\n\n/**\n * Register a piece with Chart.js. The escape hatch for a caller's own chart type.\n *\n * `solid-chartjs` re-exports the typed components but not the registry, so\n * registration comes from `chart.js` itself — which is also the honest place for\n * it, since the registry is Chart.js's global.\n */\nexport function registerChartPiece(piece: Parameters<typeof ChartJs.register>[number]): void {\n ChartJs.register(piece)\n}\n\nChartJs.register(\n CategoryScale,\n LinearScale,\n LogarithmicScale,\n RadialLinearScale,\n PointElement,\n LineElement,\n BarElement,\n ArcElement,\n Filler,\n ChartTooltip,\n Legend\n)\n\nexport { chartOptions, chartSeriesColors }\n\n/**\n * One pixel to paint a colour on, shared by every chart.\n *\n * The canvas *paints* `oklch()`, but Chart.js also *parses* colours — to derive a\n * hover shade and to animate between two colours — and its parser reads only\n * rgb, hsl, hex and names. Painting the computed value and reading the pixel\n * back gives the sRGB colour the canvas would have drawn anyway, in a form both\n * understand, whatever syntax a theme uses (`oklch()`, `color-mix()`, …).\n */\nlet swatch: CanvasRenderingContext2D | null | undefined\n\nfunction toCanvasColor(value: string): string {\n if (typeof CSS === 'undefined' || !CSS.supports('color', value)) return value\n if (swatch === undefined) {\n const canvas = document.createElement('canvas')\n canvas.width = 1\n canvas.height = 1\n swatch = canvas.getContext('2d', { willReadFrequently: true })\n }\n if (!swatch) return value\n swatch.globalCompositeOperation = 'copy'\n swatch.fillStyle = value\n swatch.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = swatch.getImageData(0, 0, 1, 1).data\n return `rgba(${r}, ${g}, ${b}, ${Math.round(((a ?? 255) / 255) * 1000) / 1000})`\n}\n\n/**\n * Resolves `var(--token)` strings against a chart's element, and re-resolves\n * them when the theme changes.\n *\n * The element rather than the root, so a chart inside a subtree with its own\n * inline tokens takes those. The observer watches every attribute on `<html>`,\n * because that is where both applications switch appearance, accent and theme\n * (`.dark`, `data-accent`, `data-theme`, inline variables); a theme axis added\n * later is covered without touching this. It is released with the chart.\n */\nfunction createThemeResolver() {\n let element: HTMLElement | undefined\n const [revision, invalidate] = createSignal(undefined, { equals: false })\n\n onMount(() => {\n const observer = new MutationObserver(() => invalidate())\n observer.observe(document.documentElement, { attributes: true })\n onCleanup(() => observer.disconnect())\n })\n\n return {\n ref: (el: HTMLElement) => {\n element = el\n },\n resolve<T>(value: T): T {\n revision()\n if (!element || typeof getComputedStyle === 'undefined') return value\n const style = getComputedStyle(element)\n const resolved = new Map<string, string | undefined>()\n return resolveCssVariables(value, (name) => {\n if (!resolved.has(name)) {\n const raw = style.getPropertyValue(name).trim()\n resolved.set(name, raw ? toCanvasColor(raw) : undefined)\n }\n return resolved.get(name)\n })\n },\n }\n}\n\n/** A chart's frame: a bordered surface with a title and an optional description. */\nexport type ChartFrameProps = {\n /** The chart's title. Required — a chart with no name is not readable. */\n title: string\n /** What the chart shows. Announced to assistive technology, and drawn. */\n description?: string\n /** Trailing controls. */\n actions?: JSX.Element\n children: JSX.Element\n class?: string\n}\n\nexport function ChartFrame(props: ChartFrameProps) {\n const [local] = splitProps(props, ['title', 'description', 'actions', 'children', 'class'])\n\n return (\n <figure class={cn('grid gap-3 rounded-lg border border-border bg-card p-4', local.class)}>\n <figcaption class=\"flex items-start justify-between gap-3\">\n <div>\n <h3 class=\"text-sm font-semibold text-foreground\">{local.title}</h3>\n <Show when={local.description}>\n <p class=\"text-xs text-muted-foreground\">{local.description}</p>\n </Show>\n </div>\n {local.actions}\n </figcaption>\n {local.children}\n </figure>\n )\n}\n\ntype SeriesChartProps = {\n /** The category labels along the axis. */\n labels: readonly string[]\n /** One entry per series. `data` is aligned to `labels`. */\n series: readonly { label: string; data: readonly number[]; color?: string }[]\n /** Chart.js options, merged deeply over the theme's defaults. */\n options?: ChartOptions\n /** Stack the series. */\n stacked?: boolean\n class?: string\n}\n\n/**\n * The data as Chart.js datasets, with the theme's colours applied in order and\n * the series' own colour winning when it has one.\n *\n * `fill: false` and a 2px border are deliberate: a filled line chart is a\n * different chart, and a 1px line at a 12px label size reads as a grid line.\n */\nfunction datasetsFor(series: SeriesChartProps['series'], filled: boolean) {\n return series.map((entry, index) => ({\n label: entry.label,\n data: [...entry.data],\n borderColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointBackgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n borderWidth: 2,\n pointRadius: 0,\n pointHoverRadius: 4,\n tension: 0.3,\n fill: filled,\n }))\n}\n\nfunction seriesOptions(\n props: SeriesChartProps,\n extra?: ChartOptions,\n shape: ChartScaleShape = 'cartesian'\n): ChartOptions {\n // Stacking is a cartesian idea; a radar has no x or y to stack, and naming\n // them would make Chart.js draw them.\n const stacked =\n props.stacked && shape === 'cartesian'\n ? { scales: { x: { stacked: true }, y: { stacked: true } } }\n : undefined\n return chartOptions(mergeChartOptions(extra, stacked, props.options), shape)\n}\n\n/** A line chart. The default for a series over time. */\nexport function LineChart(props: SeriesChartProps & { area?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Line\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, props.area ?? false),\n })}\n options={theme.resolve(seriesOptions(props))}\n />\n </div>\n )\n}\n\n/** A bar chart. `stacked` for parts of a whole over categories. */\nexport function BarChart(props: SeriesChartProps & { horizontal?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true).map((dataset) => ({\n ...dataset,\n borderWidth: 0,\n borderRadius: 3,\n })),\n })}\n options={theme.resolve(seriesOptions(props, { indexAxis: props.horizontal ? 'y' : 'x' }))}\n />\n </div>\n )\n}\n\n/** A scatter plot, for a correlation rather than a series. */\nexport function ScatterChart(props: {\n series: readonly { label: string; data: readonly { x: number; y: number }[]; color?: string }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Scatter\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointRadius: 3,\n pointHoverRadius: 5,\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A bubble chart: scatter with a third dimension carried by the radius. */\nexport function BubbleChart(props: {\n series: readonly {\n label: string\n data: readonly { x: number; y: number; r: number }[]\n color?: string\n }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bubble\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A radar chart, for a profile across fixed axes. */\nexport function RadarChart(props: SeriesChartProps) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Radar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true),\n })}\n options={theme.resolve(seriesOptions(props, undefined, 'radial'))}\n />\n </div>\n )\n}\n\n/**\n * A polar area chart: radial bars, for a composition.\n *\n * Its scale is left to Chart.js's polar-area defaults (`'none'` rather than\n * `'radial'`): `solid-chartjs` deletes `options.scales.r` for every chart type\n * but radar when it first creates the chart, so radial styling here would apply\n * only after the first theme change — a chart that restyles itself on a toggle.\n */\nexport function PolarAreaChart(props: {\n labels: readonly string[]\n data: readonly number[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <PolarArea\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: [...chartSeriesColors],\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={theme.resolve(chartOptions(props.options, 'none'))}\n />\n </div>\n )\n}\n\n/**\n * A doughnut or a pie, for a composition with few enough slices to name.\n *\n * Both are one component because the only difference is the hole, and a caller\n * choosing between them is choosing a ratio rather than a chart. `cutout` is the\n * hole's share of the radius: 0 is a pie, 60% is the doughnut most dashboards\n * mean. A composition with more than about six slices should be a bar chart —\n * past that, the smallest slices become unreadable and their labels collide.\n */\nexport function DonutChart(props: {\n labels: readonly string[]\n data: readonly number[]\n /** The hole, as a percentage of the radius. 0 for a pie. */\n cutout?: number\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n // `Dynamic` rather than a local component accessor: Solid's JSX types require\n // a component reference, and an accessor returning one is a call in disguise.\n const component = () => (props.cutout === 0 ? Pie : Doughnut)\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Dynamic\n component={component()}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: props.labels.map(\n (_, index) => chartSeriesColors[index % chartSeriesColors.length]\n ),\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={theme.resolve(\n chartOptions(\n mergeChartOptions(\n props.cutout === 0\n ? undefined\n : ({\n cutout: `${props.cutout ?? 60}%`,\n } satisfies ChartOptions<'doughnut'> as ChartOptions),\n props.options\n ),\n 'none'\n )\n )}\n />\n </div>\n )\n}\n\n/** A legend built from the same five colours, for a chart whose legend is elsewhere. */\nexport function ChartLegend(props: {\n series: readonly { label: string; color?: string }[]\n class?: string\n}) {\n return (\n <ul class={cn('flex flex-wrap items-center gap-x-3 gap-y-1', props.class)}>\n <For each={props.series}>\n {(entry, index) => (\n <li class=\"flex items-center gap-1.5 text-2xs text-muted-foreground\">\n <span\n class=\"size-2 shrink-0 rounded-full\"\n style={{\n background: entry.color ?? chartSeriesColors[index() % chartSeriesColors.length],\n }}\n aria-hidden=\"true\"\n />\n {entry.label}\n </li>\n )}\n </For>\n </ul>\n )\n}\n\nexport type { ChartType, ChartOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgBsC,mBAAmBC,OAA0D;CAC3FtB,MAAQwB,SAASF,KAAK;AACxB;AAEAtB,MAAQwB,SACNrB,eACAI,aACAC,kBACAE,mBACAD,cACAH,aACAJ,YACAD,YACAG,QACAQ,SACAP,MACF;;;;;;;;;;AAaA,IAAIoB;AAEJ,SAASE,cAAcC,OAAuB;CAC5C,IAAI,OAAOC,QAAQ,eAAe,CAACA,IAAIC,SAAS,SAASF,KAAK,GAAG,OAAOA;CACxE,IAAIH,WAAWM,KAAAA,GAAW;EACxB,MAAMC,SAASC,SAASC,cAAc,QAAQ;EAC9CF,OAAOG,QAAQ;EACfH,OAAOI,SA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,KAC3BmD,GAAGjD,UAAU9F,kBAAkB8F,QAAQ9F,kBAAkBgG,OAC5D;MACAD,aAAa;MACbI,aAAa;KACf,CAAC;IAEL,CAAC;GAAC;GAAA,IACFX,UAAO;IAAA,OAAEwB,MAAMjE,QACbhD,aACEE,kBACEmE,MAAMuE,WAAW,IACb7H,KAAAA,IACC,EACC6H,QAAQ,GAAGvE,MAAMuE,UAAU,GAAE,GAC/B,GACJvE,MAAMoB,OACR,GACA,MACF,CACF;GAAC;EAAA,CAAA,CAAA;EAAAP,aAAAC,UAAA2D,QA5BuB/I,GAAG,QAAQsE,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAA2E;CAAA,EAAA,CAAA;AAgCvD;;AAGA,SAAgBG,YAAY5E,OAGzB;CACD,cAAA;EAAA,IAAA6E,SAAAC,QAAA;EAAAtE,OAAAqE,QAAApE,gBAEK/G,KAAG;GAAA,IAACqL,OAAI;IAAA,OAAE/E,MAAMiB;GAAM;GAAApB,WACnB4B,OAAOC,iBAAK;IAAA,IAAAsD,SAAAC,QAAA,GAAAC,SAAAF,OAAA3E;IAAAG,OAAAwE,cASTvD,MAAMP,OAAK,IAAA;IAAAL,QAAAsE,QAAAC,iBAAAF,QAAA,cAJIzD,MAAMN,SAASvF,kBAAkB8F,MAAM,IAAI9F,kBAAkBgG,OAAO,CAAA;IAAA,OAAAoD;GAAA,EAAA,CAAA;EAMvF,CAAA,CAAA;EAAAnE,aAAAC,UAAA+D,QAbMnJ,GAAG,+CAA+CsE,MAAMF,KAAK,CAAC,CAAA;EAAA,OAAA+E;CAAA,EAAA,CAAA;AAiB7E"}
1
+ {"version":3,"file":"chart.js","names":["For","Show","createSignal","onCleanup","onMount","splitProps","JSX","Dynamic","Bar","Bubble","Doughnut","Line","Pie","PolarArea","Radar","Scatter","Chart","ChartJs","ArcElement","BarElement","CategoryScale","Filler","Legend","LineElement","LinearScale","LogarithmicScale","PointElement","RadialLinearScale","Tooltip","ChartTooltip","ChartOptions","ChartType","Plugin","cn","chartOptions","chartSeriesColors","mergeChartOptions","resolveCssVariables","ChartScaleShape","registerChartPiece","piece","Parameters","register","swatch","CanvasRenderingContext2D","toCanvasColor","value","CSS","supports","undefined","canvas","document","createElement","width","height","getContext","willReadFrequently","globalCompositeOperation","fillStyle","fillRect","r","g","b","a","getImageData","data","Math","round","length","toCanvasValue","raw","match","exec","Number","parseFloat","getComputedStyle","documentElement","fontSize","createThemeResolver","element","HTMLElement","revision","invalidate","equals","onFontsLoaded","observer","MutationObserver","observe","attributes","fonts","addEventListener","disconnect","removeEventListener","ref","el","resolve","T","style","resolved","Map","name","has","getPropertyValue","trim","set","get","ChartFrameProps","title","description","actions","Element","children","class","ChartFrame","props","local","_el$","_tmpl$2","_el$2","firstChild","_el$3","_el$4","_$insert","_$createComponent","when","_el$5","_tmpl$","_$effect","_$className","SeriesChartProps","labels","series","label","color","options","stacked","datasetsFor","filled","map","entry","index","borderColor","backgroundColor","pointBackgroundColor","borderWidth","pointRadius","pointHoverRadius","tension","fill","seriesOptions","extra","shape","scales","x","y","LineChart","area","theme","_el$6","_tmpl$3","_ref$","_$use","datasets","BarChart","horizontal","_el$7","_ref$2","dataset","borderRadius","indexAxis","ScatterChart","_el$8","_ref$3","point","BubbleChart","_el$9","_ref$4","RadarChart","_el$0","_ref$5","restoreRadialScale","id","afterInit","chart","scale","PolarAreaChart","_el$1","_ref$6","plugins","DonutChart","cutout","component","_el$10","_ref$7","_","ChartLegend","_el$11","_tmpl$4","each","_el$12","_tmpl$5","_el$13","_$p","_$setStyleProperty","ChartJs","ChartTooltip","_$createComponent","_$className","_$use","_$setStyleProperty"],"sources":["../../../../src/components/ui/chart/chart.tsx"],"sourcesContent":["import { For, Show, createSignal, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, Scatter } from 'solid-chartjs'\nimport {\n Chart as ChartJs,\n ArcElement,\n BarElement,\n CategoryScale,\n Filler,\n Legend,\n LineElement,\n LinearScale,\n LogarithmicScale,\n PointElement,\n RadialLinearScale,\n Tooltip as ChartTooltip,\n} from 'chart.js'\nimport type { ChartOptions, ChartType, Plugin } from 'chart.js'\nimport { cn } from '#lib/utils'\nimport {\n chartOptions,\n chartSeriesColors,\n mergeChartOptions,\n resolveCssVariables,\n type ChartScaleShape,\n} from './chart-options'\n\n/**\n * Chart.\n *\n * A thin wrapper over Chart.js, themed through the same CSS custom properties as\n * everything else. The wrapper is thin on purpose: a design system's job here is\n * to make a chart *look like the rest of the application* — the palette, the\n * type scale, the tooltip surface, the grid lines — and not to re-implement\n * scales and axes, which is where a hand-rolled chart goes wrong.\n *\n * ## Registration, and why it is here rather than left to the caller\n *\n * Chart.js is tree-shakeable through explicit registration: nothing is bundled\n * until a controller, a scale or a plugin is registered. That is the whole reason\n * it was chosen over a batteries-included charting library, and it only pays off\n * if the registrations are scoped to what a component actually uses.\n *\n * This module registers the **shared** pieces once — scales, elements, tooltip,\n * legend, filler — and nothing else. The controllers are imported per component\n * so a `LineChart` does not carry the radar controller, and a consumer that\n * imports only `LineChart` gets only that. Measured: see the story for the\n * per-component figures the tree-shaking gate publishes.\n *\n * A caller with a chart type this file does not export registers its own\n * controller with `registerChartPiece`, which is the escape hatch rather than a\n * reason to widen the registration above.\n *\n * ## Theming\n *\n * Colours come from `--chart-1` through `--chart-5`, which every theme\n * defines, and the grid, ticks and labels from `--border` and\n * `--muted-foreground`. That means a chart follows the accent axis and the\n * appearance with no per-chart configuration — and a caller that wants a\n * specific series colour passes it explicitly, as a colour or as `var(--token)`.\n *\n * A canvas cannot read a custom property, so the options and datasets carry\n * `var(--token)` strings and each chart resolves them against its own element\n * when it renders, and again whenever the root's attributes change — the\n * `.dark` class, `data-accent`, `data-font`, an inline override. The type is\n * resolved the same way: `--font-sans` for the family and a type-scale rung for\n * the size, so a chart follows the font axis too. See `createThemeResolver`.\n */\n\n/**\n * Register a piece with Chart.js. The escape hatch for a caller's own chart type.\n *\n * `solid-chartjs` re-exports the typed components but not the registry, so\n * registration comes from `chart.js` itself — which is also the honest place for\n * it, since the registry is Chart.js's global.\n */\nexport function registerChartPiece(piece: Parameters<typeof ChartJs.register>[number]): void {\n ChartJs.register(piece)\n}\n\nChartJs.register(\n CategoryScale,\n LinearScale,\n LogarithmicScale,\n RadialLinearScale,\n PointElement,\n LineElement,\n BarElement,\n ArcElement,\n Filler,\n ChartTooltip,\n Legend\n)\n\nexport { chartOptions, chartSeriesColors }\n\n/**\n * One pixel to paint a colour on, shared by every chart.\n *\n * The canvas *paints* `oklch()`, but Chart.js also *parses* colours — to derive a\n * hover shade and to animate between two colours — and its parser reads only\n * rgb, hsl, hex and names. Painting the computed value and reading the pixel\n * back gives the sRGB colour the canvas would have drawn anyway, in a form both\n * understand, whatever syntax a theme uses (`oklch()`, `color-mix()`, …).\n */\nlet swatch: CanvasRenderingContext2D | null | undefined\n\nfunction toCanvasColor(value: string): string {\n if (typeof CSS === 'undefined' || !CSS.supports('color', value)) return value\n if (swatch === undefined) {\n const canvas = document.createElement('canvas')\n canvas.width = 1\n canvas.height = 1\n swatch = canvas.getContext('2d', { willReadFrequently: true })\n }\n if (!swatch) return value\n swatch.globalCompositeOperation = 'copy'\n swatch.fillStyle = value\n swatch.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = swatch.getImageData(0, 0, 1, 1).data\n return `rgba(${r}, ${g}, ${b}, ${Math.round(((a ?? 255) / 255) * 1000) / 1000})`\n}\n\nconst length = /^(-?\\d*\\.?\\d+)(px|rem)$/\n\n/**\n * A token's computed value as a canvas option: a colour as an sRGB colour, a\n * `px`/`rem` length (a type-scale rung) as the number of pixels Chart.js wants,\n * and anything else — a font stack — as written.\n */\nfunction toCanvasValue(raw: string): string | number {\n const match = length.exec(raw)\n if (match) {\n const value = Number(match[1])\n if (match[2] === 'px') return value\n return value * (Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16)\n }\n return toCanvasColor(raw)\n}\n\n/**\n * Resolves `var(--token)` strings against a chart's element, and re-resolves\n * them when the theme changes.\n *\n * The element rather than the root, so a chart inside a subtree with its own\n * inline tokens takes those. The observer watches every attribute on `<html>`,\n * because that is where both applications switch appearance, accent and theme\n * (`.dark`, `data-accent`, `data-theme`, inline variables); a theme axis added\n * later is covered without touching this. It also re-resolves when a web font\n * finishes loading: a canvas draws text once, so a chart rendered before the\n * face selected by `data-font` arrived would otherwise keep the fallback face\n * until something else redrew it. Both are released with the chart.\n */\nfunction createThemeResolver() {\n let element: HTMLElement | undefined\n const [revision, invalidate] = createSignal(undefined, { equals: false })\n const onFontsLoaded = () => invalidate()\n\n onMount(() => {\n const observer = new MutationObserver(() => invalidate())\n observer.observe(document.documentElement, { attributes: true })\n const fonts = typeof document.fonts === 'undefined' ? undefined : document.fonts\n fonts?.addEventListener('loadingdone', onFontsLoaded)\n onCleanup(() => {\n observer.disconnect()\n fonts?.removeEventListener('loadingdone', onFontsLoaded)\n })\n })\n\n return {\n ref: (el: HTMLElement) => {\n element = el\n },\n resolve<T>(value: T): T {\n revision()\n if (!element || typeof getComputedStyle === 'undefined') return value\n const style = getComputedStyle(element)\n const resolved = new Map<string, string | number | undefined>()\n return resolveCssVariables(value, (name) => {\n if (!resolved.has(name)) {\n const raw = style.getPropertyValue(name).trim()\n resolved.set(name, raw ? toCanvasValue(raw) : undefined)\n }\n return resolved.get(name)\n })\n },\n }\n}\n\n/** A chart's frame: a bordered surface with a title and an optional description. */\nexport type ChartFrameProps = {\n /** The chart's title. Required — a chart with no name is not readable. */\n title: string\n /** What the chart shows. Announced to assistive technology, and drawn. */\n description?: string\n /** Trailing controls. */\n actions?: JSX.Element\n children: JSX.Element\n class?: string\n}\n\nexport function ChartFrame(props: ChartFrameProps) {\n const [local] = splitProps(props, ['title', 'description', 'actions', 'children', 'class'])\n\n return (\n <figure class={cn('grid gap-3 rounded-lg border border-border bg-card p-4', local.class)}>\n <figcaption class=\"flex items-start justify-between gap-3\">\n <div>\n <h3 class=\"text-sm font-semibold text-foreground\">{local.title}</h3>\n <Show when={local.description}>\n <p class=\"text-xs text-muted-foreground\">{local.description}</p>\n </Show>\n </div>\n {local.actions}\n </figcaption>\n {local.children}\n </figure>\n )\n}\n\ntype SeriesChartProps = {\n /** The category labels along the axis. */\n labels: readonly string[]\n /** One entry per series. `data` is aligned to `labels`. */\n series: readonly { label: string; data: readonly number[]; color?: string }[]\n /** Chart.js options, merged deeply over the theme's defaults. */\n options?: ChartOptions\n /** Stack the series. */\n stacked?: boolean\n class?: string\n}\n\n/**\n * The data as Chart.js datasets, with the theme's colours applied in order and\n * the series' own colour winning when it has one.\n *\n * `fill: false` and a 2px border are deliberate: a filled line chart is a\n * different chart, and a 1px line at a 12px label size reads as a grid line.\n */\nfunction datasetsFor(series: SeriesChartProps['series'], filled: boolean) {\n return series.map((entry, index) => ({\n label: entry.label,\n data: [...entry.data],\n borderColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointBackgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n borderWidth: 2,\n pointRadius: 0,\n pointHoverRadius: 4,\n tension: 0.3,\n fill: filled,\n }))\n}\n\nfunction seriesOptions(\n props: SeriesChartProps,\n extra?: ChartOptions,\n shape: ChartScaleShape = 'cartesian'\n): ChartOptions {\n // Stacking is a cartesian idea; a radar has no x or y to stack, and naming\n // them would make Chart.js draw them.\n const stacked =\n props.stacked && shape === 'cartesian'\n ? { scales: { x: { stacked: true }, y: { stacked: true } } }\n : undefined\n return chartOptions(mergeChartOptions(extra, stacked, props.options), shape)\n}\n\n/** A line chart. The default for a series over time. */\nexport function LineChart(props: SeriesChartProps & { area?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Line\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, props.area ?? false),\n })}\n options={theme.resolve(seriesOptions(props))}\n />\n </div>\n )\n}\n\n/** A bar chart. `stacked` for parts of a whole over categories. */\nexport function BarChart(props: SeriesChartProps & { horizontal?: boolean }) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true).map((dataset) => ({\n ...dataset,\n borderWidth: 0,\n borderRadius: 3,\n })),\n })}\n options={theme.resolve(seriesOptions(props, { indexAxis: props.horizontal ? 'y' : 'x' }))}\n />\n </div>\n )\n}\n\n/** A scatter plot, for a correlation rather than a series. */\nexport function ScatterChart(props: {\n series: readonly { label: string; data: readonly { x: number; y: number }[]; color?: string }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Scatter\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n pointRadius: 3,\n pointHoverRadius: 5,\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A bubble chart: scatter with a third dimension carried by the radius. */\nexport function BubbleChart(props: {\n series: readonly {\n label: string\n data: readonly { x: number; y: number; r: number }[]\n color?: string\n }[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Bubble\n data={theme.resolve({\n datasets: props.series.map((entry, index) => ({\n label: entry.label,\n data: entry.data.map((point) => ({ ...point })),\n backgroundColor: entry.color ?? chartSeriesColors[index % chartSeriesColors.length],\n })),\n })}\n options={theme.resolve(chartOptions(props.options))}\n />\n </div>\n )\n}\n\n/** A radar chart, for a profile across fixed axes. */\nexport function RadarChart(props: SeriesChartProps) {\n const theme = createThemeResolver()\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Radar\n data={theme.resolve({\n labels: [...props.labels],\n datasets: datasetsFor(props.series, true),\n })}\n options={theme.resolve(seriesOptions(props, undefined, 'radial'))}\n />\n </div>\n )\n}\n\n/**\n * Puts the themed radial scale back on a chart `solid-chartjs` has just created.\n *\n * `solid-chartjs` deletes `options.scales.r` for every chart type but radar when\n * it first creates a chart. Today that delete lands on a throwaway copy — Solid\n * compiles `options={…}` to a getter, so its next read rebuilds the object with\n * `r` intact — but that is an accident of how the prop is passed: a memoised or\n * static options object would lose the scale, and the polar area would fall back\n * to Chart.js's defaults (grey ticks on a translucent white box, which is a white\n * box on a dark card). Restoring it from this component's own options makes the\n * themed scale independent of both. Later option updates (every theme change)\n * pass `r` through untouched; only creation drops it.\n *\n * `afterInit` runs inside Chart.js's constructor, after the options are read and\n * before the first update builds the scales and draws, so the themed scale is in\n * place for the first frame — no default-styled frame, and no extra update. The\n * plugin is per instance, passed through the chart's `plugins` prop, so nothing\n * is registered globally.\n */\nfunction restoreRadialScale(options: () => ChartOptions): Plugin {\n return {\n id: 'adea-radial-scale',\n afterInit(chart) {\n const scale = options().scales?.['r']\n if (!scale) return\n chart.options.scales = { ...chart.options.scales, r: scale }\n },\n }\n}\n\n/** A polar area chart: radial bars, for a composition. */\nexport function PolarAreaChart(props: {\n labels: readonly string[]\n data: readonly number[]\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n const options = () => theme.resolve(chartOptions(props.options, 'radial'))\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <PolarArea\n plugins={[restoreRadialScale(options)]}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: [...chartSeriesColors],\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={options()}\n />\n </div>\n )\n}\n\n/**\n * A doughnut or a pie, for a composition with few enough slices to name.\n *\n * Both are one component because the only difference is the hole, and a caller\n * choosing between them is choosing a ratio rather than a chart. `cutout` is the\n * hole's share of the radius: 0 is a pie, 60% is the doughnut most dashboards\n * mean. A composition with more than about six slices should be a bar chart —\n * past that, the smallest slices become unreadable and their labels collide.\n */\nexport function DonutChart(props: {\n labels: readonly string[]\n data: readonly number[]\n /** The hole, as a percentage of the radius. 0 for a pie. */\n cutout?: number\n options?: ChartOptions\n class?: string\n}) {\n const theme = createThemeResolver()\n // `Dynamic` rather than a local component accessor: Solid's JSX types require\n // a component reference, and an accessor returning one is a call in disguise.\n const component = () => (props.cutout === 0 ? Pie : Doughnut)\n return (\n <div ref={theme.ref} class={cn('h-64', props.class)}>\n <Dynamic\n component={component()}\n data={theme.resolve({\n labels: [...props.labels],\n datasets: [\n {\n data: [...props.data],\n backgroundColor: props.labels.map(\n (_, index) => chartSeriesColors[index % chartSeriesColors.length]\n ),\n borderColor: 'var(--card)',\n borderWidth: 2,\n },\n ],\n })}\n options={theme.resolve(\n chartOptions(\n mergeChartOptions(\n props.cutout === 0\n ? undefined\n : ({\n cutout: `${props.cutout ?? 60}%`,\n } satisfies ChartOptions<'doughnut'> as ChartOptions),\n props.options\n ),\n 'none'\n )\n )}\n />\n </div>\n )\n}\n\n/** A legend built from the same five colours, for a chart whose legend is elsewhere. */\nexport function ChartLegend(props: {\n series: readonly { label: string; color?: string }[]\n class?: string\n}) {\n return (\n <ul class={cn('flex flex-wrap items-center gap-x-3 gap-y-1', props.class)}>\n <For each={props.series}>\n {(entry, index) => (\n <li class=\"flex items-center gap-1.5 text-2xs text-muted-foreground\">\n <span\n class=\"size-2 shrink-0 rounded-full\"\n style={{\n background: entry.color ?? chartSeriesColors[index() % chartSeriesColors.length],\n }}\n aria-hidden=\"true\"\n />\n {entry.label}\n </li>\n )}\n </For>\n </ul>\n )\n}\n\nexport type { ChartType, ChartOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgBuC,mBAAmBC,OAA0D;CAC3FvB,MAAQyB,SAASF,KAAK;AACxB;AAEAvB,MAAQyB,SACNtB,eACAI,aACAC,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MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,eAEjE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,eAEhF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,MAAM,CAAC,eAE9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,eAY/E;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC7E;;;;OAIG;IACH,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACjC,qFAAqF;IACrF,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CACjC,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAiCtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASxD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASxD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,eAQ5E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAKxF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGxF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGlF"}
@@ -1,5 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { overlayMotion, overlayPositioner, overlayScrim, overlaySurface } from "../../../lib/overlay.js";
3
+ import { headingVariants } from "../typography/typography.js";
3
4
  import { className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
4
5
  import { X } from "lucide-solid";
5
6
  import { Show, createRenderEffect, onCleanup, splitProps } from "solid-js";
@@ -215,7 +216,10 @@ function DialogFooter(props) {
215
216
  function DialogTitle(props) {
216
217
  const [local, rest] = splitProps(props, ["class"]);
217
218
  return createComponent(Dialog.Title, mergeProps({ get ["class"]() {
218
- return cn("text-base leading-none font-semibold tracking-tight", local.class);
219
+ return cn(headingVariants({
220
+ size: "card",
221
+ leading: "none"
222
+ }), local.class);
219
223
  } }, rest));
220
224
  }
221
225
  function DialogDescription(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","overlayMotion","overlayPositioner","overlayScrim","overlaySurface","cn","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport { overlayMotion, overlayPositioner, overlayScrim, overlaySurface } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n <KobalteDialog.CloseButton\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Title\n class={cn('text-base leading-none font-semibold tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;AAyBA,SAASkC,gBAAgBC,QAA8B;CACrD,OACEA,OAAOC,eACPD,WAAWE,SAASC,QACpBH,WAAWE,SAASE,mBACpB,CAACJ,OAAOK,QAAQ,iCAA+B,KAC/C,CAACL,OAAOM,QAAQ,WAAW,KAC3BN,OAAOO,eAAe,CAAC,CAACC,SAAS;AAErC;AAEA,SAASC,gBAAgBxB,SAAsBE,QAA8B;CAC3E,OAAO,CAAC,GAAGe,SAASQ,iBAA8B,2CAAuC,CAAC,CAAC,CAACC,MACzFC,YACCA,YAAY3B,WACZ,CAACA,QAAQ4B,SAASD,OAAO,KACzB,CAACA,QAAQC,SAAS1B,MAAM,KACxB,CAACyB,QAAQP,QAAQ,iCAA+B,KAChDO,QAAQL,eAAe,CAAC,CAACC,SAAS,CACtC;AACF;;;;;;AAcA,SAAgBW,6BAA6B,EAC3CJ,MACAC,iBACAC,iBAAiBG,uBACjBF,kBAAkBG,0BACc;CAChC,MAAMC,8BAAc,IAAIC,QAAiC;CACzD,IAAIC;CACJ,IAAIC,gBAAoC;CACxC,IAAIC,wBAAwB;CAE5BnD,yBAAyB;EACvB,IAAI,CAACwC,KAAK,KAAK,OAAOb,aAAa,aAAa;GAC9CuB,gBAAgB;GAChBC,wBAAwB;GACxB;EACF;EACA,MAAMC,SAASX,kBAAkB,KAAKd,SAAS0B;EAC/C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version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","overlayMotion","overlayPositioner","overlayScrim","overlaySurface","cn","headingVariants","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","size","leading","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport { overlayMotion, overlayPositioner, overlayScrim, overlaySurface } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n <KobalteDialog.CloseButton\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Title\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local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E,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAElF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAalF;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG;IAC9F;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kCA8BtD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAQ9E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,kCAQ1F;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAGpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASxD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAStD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCASxD"}
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { headingVariants } from "../typography/typography.js";
2
3
  import { className, createComponent, effect, memo, mergeProps, spread, template } from "solid-js/web";
3
4
  import { splitProps } from "solid-js";
4
5
  import DrawerPrimitive from "@corvu/drawer";
@@ -55,7 +56,10 @@ function DrawerContent(props) {
55
56
  function DrawerTitle(props) {
56
57
  const [local, rest] = splitProps(props, ["class"]);
57
58
  return createComponent(DrawerPrimitive.Label, mergeProps({ get ["class"]() {
58
- return cn("text-base leading-none font-semibold tracking-tight", local.class);
59
+ return cn(headingVariants({
60
+ size: "card",
61
+ leading: "none"
62
+ }), local.class);
59
63
  } }, rest));
60
64
  }
61
65
  function DrawerDescription(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Omit","Content","side","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {\n /**\n * Not accepted here. corvu reads the side from the root `Drawer`, which uses it\n * for the drag axis and publishes it as `data-side`; a `side` on the content\n * would type-check through the polymorphic props and be silently ignored,\n * leaving the drawer on the bottom edge. Set `<Drawer side=\"right\">` instead.\n */\n side?: never\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn('text-base leading-none font-semibold tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBI,OAAOC,OAA+C;CACpE,OAAAC,gBAAQN,iBAAoBK,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQN,gBAAgBQ,SAAYH,KAAK;AAC3C;A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AK;EAAC,EAAA,GACrFF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA8B;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"drawer.js","names":["DrawerPrimitive","ComponentProps","splitProps","cn","headingVariants","Drawer","props","_$createComponent","DrawerTrigger","Trigger","DrawerOverlay","Overlay","local","rest","_$mergeProps","class","DrawerContentProps","Omit","Content","side","withHandle","DrawerContent","Portal","children","_$memo","_el$","_tmpl$","_$effect","_$className","DrawerTitle","Label","size","leading","DrawerDescription","Description","DrawerCloseButton","Close","DrawerHeader","_el$2","_tmpl$2","_$spread","DrawerBody","_el$3","_tmpl$3","DrawerFooter","_el$4","_tmpl$4","_$createComponent","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/drawer/drawer.tsx"],"sourcesContent":["import DrawerPrimitive from '@corvu/drawer'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Drawer.\n *\n * A sheet the user can drag away: it opens from an edge, carries a handle, and\n * closes by swipe as well as by button. That drag affordance is the reason to\n * choose it over Sheet — the gesture is for content the user is *finishing*\n * with (a summary, a queue, a confirmation), not for browsing.\n *\n * On a large window a Drawer is usually the wrong control: dragging is a touch\n * idiom, and on a desktop the same content is better as a Sheet or a Dialog.\n * The exceptions are the surfaces a pointer also drags naturally — a bottom\n * console, a media panel.\n *\n * corvu supplies the drag physics, the snap points and the pointer capture.\n */\nexport function Drawer(props: ComponentProps<typeof DrawerPrimitive>) {\n return <DrawerPrimitive {...props} />\n}\n\nexport function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger {...props} />\n}\n\nexport function DrawerOverlay(props: ComponentProps<typeof DrawerPrimitive.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <DrawerPrimitive.Overlay\n class={cn(\n 'fixed inset-0 z-(--z-drawer) bg-scrim/50',\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DrawerContentProps = Omit<ComponentProps<typeof DrawerPrimitive.Content>, 'side'> & {\n /**\n * Not accepted here. corvu reads the side from the root `Drawer`, which uses it\n * for the drag axis and publishes it as `data-side`; a `side` on the content\n * would type-check through the polymorphic props and be silently ignored,\n * leaving the drawer on the bottom edge. Set `<Drawer side=\"right\">` instead.\n */\n side?: never\n /**\n * Draw the grabber at the leading edge of the sheet.\n *\n * It is an affordance, not the drag target: corvu makes the whole sheet\n * draggable, exactly as the platform's own sheets behave. So this is\n * `aria-hidden` decoration that tells the user the sheet can be pulled — it\n * carries no behaviour and must not be the only thing that moves.\n */\n withHandle?: boolean\n}\n\nexport function DrawerContent(props: DrawerContentProps) {\n const [local, rest] = splitProps(props, ['class', 'withHandle', 'children'])\n\n return (\n <DrawerPrimitive.Portal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n class={cn(\n 'group/drawer bg-popover text-popover-foreground fixed z-(--z-drawer) flex flex-col border-border shadow-lg',\n 'data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:max-h-[85vh] data-[side=bottom]:rounded-t-xl data-[side=bottom]:border-t',\n 'data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:max-h-[85vh] data-[side=top]:rounded-b-xl data-[side=top]:border-b',\n 'data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:w-80 data-[side=left]:rounded-e-xl data-[side=left]:border-e',\n 'data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:w-80 data-[side=right]:rounded-s-xl data-[side=right]:border-s',\n local.class\n )}\n {...rest}\n >\n {local.withHandle ? (\n <span\n aria-hidden=\"true\"\n class={cn(\n 'bg-muted shrink-0 self-center',\n 'group-data-[side=bottom]/drawer:mt-2 group-data-[side=bottom]/drawer:h-1.5 group-data-[side=bottom]/drawer:w-10 group-data-[side=bottom]/drawer:rounded-full'\n )}\n />\n ) : null}\n {local.children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n )\n}\n\nexport function DrawerTitle(props: ComponentProps<typeof DrawerPrimitive.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Label\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerDescription(props: ComponentProps<typeof DrawerPrimitive.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <DrawerPrimitive.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerCloseButton(props: ComponentProps<typeof DrawerPrimitive.Close>) {\n const [local, rest] = splitProps(props, ['class'])\n return <DrawerPrimitive.Close class={cn('focus-ring', local.class)} {...rest} />\n}\n\nexport function DrawerHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-header\"\n class={cn('flex flex-col gap-1.5 p-5 pb-3 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto px-5 pb-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DrawerFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"drawer-footer\"\n class={cn('flex flex-col-reverse gap-2 p-5 pt-3 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBK,OAAOC,OAA+C;CACpE,OAAAC,gBAAQP,iBAAoBM,KAAK;AACnC;AAEA,SAAgBE,cAAcF,OAAuD;CACnF,OAAAC,gBAAQP,gBAAgBS,SAAYH,KAAK;AAC3C;AAEA,SAAgBI,c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KAAK,EAAE,cAAc,eAkE9C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,eAK9E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,WAAW,CAAC,eAQ1F;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,YAAY,CAAC,eAKrF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,eAiB9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAiBpF;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,eAGzD;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAGtD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,eAY7F;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;CAC9C,eAYA"}
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { headingVariants } from "../typography/typography.js";
2
3
  import { FormFieldContext, createFormFieldContext } from "../../../lib/form-field.js";
3
4
  import { Label } from "../label/label.js";
4
5
  import { createComponent, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
@@ -201,7 +202,7 @@ function FieldLegend(props) {
201
202
  return (() => {
202
203
  var _el$6 = _tmpl$6();
203
204
  spread(_el$6, mergeProps({ get ["class"]() {
204
- return cn("mb-1", local.variant === "label" ? "text-sm font-medium" : "text-base font-semibold tracking-tight", local.class);
205
+ return cn("mb-1", local.variant === "label" ? "text-sm font-medium" : headingVariants({ size: "card" }), local.class);
205
206
  } }, rest), false, false);
206
207
  return _el$6;
207
208
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","names":["TextField","KobalteTextField","ComponentProps","JSX","createUniqueId","Show","splitProps","Label","createFormFieldContext","FormFieldContext","cn","Field","props","local","rest","_$createComponent","_$mergeProps","class","FormFieldProps","Omit","label","hint","error","controlId","group","children","Element","FormField","fieldId","labelId","descriptionId","errorId","field","defaultControlId","help","when","_el$","_tmpl$","_$setAttribute","_$insert","_el$2","_tmpl$2","Provider","value","_el$3","_tmpl$3","_$spread","_c$","_$memo","FieldSet","aria-describedby","describedBy","aria-invalid","invalid","undefined","FieldLegend","id","variant","for","FieldLabel","FieldDescription","Description","FieldError","ErrorMessage","FieldInput","Input","FieldTextArea","TextArea","_el$4","_tmpl$4","FieldGroup","_el$5","_tmpl$5","_el$6","_tmpl$6","FieldSeparator","_el$7","_tmpl$8","_el$8","firstChild","_el$0","nextSibling","_el$9","_tmpl$7","_$createComponent","KobalteTextField","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/field/field.tsx"],"sourcesContent":["import { TextField as KobalteTextField } from '@kobalte/core/text-field'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { Label } from '../label/label'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Field.\n *\n * The wrapper that makes a form control describable and validatable: a label,\n * a description, an error message, and the ARIA relationships between them.\n *\n * This Kobalte TextField composition is for its own `FieldLabel`, `FieldInput`\n * and `FieldTextArea` parts. Use `FormField` to wire the standalone shared\n * controls, including checkboxes, switches and comboboxes.\n *\n * It is built on Kobalte's TextField specifically so `aria-describedby`,\n * `aria-invalid` and `aria-errormessage` are wired by construction. Those three\n * attributes are the difference between \"this field is required and empty\" and\n * a red border that only a sighted user can perceive — and they are also the\n * first thing a hand-rolled form drops.\n *\n * `Field` owns the description and the error slot, so its controls line up and\n * its messages land in the same place regardless of which TextField part is used.\n */\nexport function Field(props: ComponentProps<typeof KobalteTextField>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteTextField class={cn('flex flex-col gap-1.5', local.class)} {...rest} />\n}\n\nexport type FormFieldProps = Omit<ComponentProps<'div'>, 'children' | 'ref'> & {\n label: string\n hint?: string\n error?: string\n controlId?: string\n group?: boolean\n children: JSX.Element\n}\n\n/**\n * FormField.\n *\n * A shared label, help and validation wrapper for any one shared control. Its\n * context is consumed by Input, Textarea, NativeSelect, Checkbox, Switch,\n * RadioGroup and ComboboxInput, so the actual focusable element receives the\n * generated ID and description relationships. Set `group` when the label names\n * a set of controls; the wrapper then uses fieldset and legend semantics.\n */\nexport function FormField(props: FormFieldProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'hint',\n 'error',\n 'controlId',\n 'group',\n 'children',\n ])\n const fieldId = createUniqueId()\n const labelId = `${fieldId}-label`\n const descriptionId = `${fieldId}-description`\n const errorId = `${fieldId}-error`\n const field = createFormFieldContext({\n controlId: local.controlId,\n defaultControlId: fieldId,\n labelId,\n descriptionId,\n errorId,\n hint: () => local.hint,\n error: () => local.error,\n group: () => local.group ?? false,\n })\n const help = () => (\n <>\n <Show when={local.hint}>\n <p id={descriptionId} class=\"text-muted-foreground text-sm\">\n {local.hint}\n </p>\n </Show>\n <Show when={local.error}>\n <p id={errorId} role=\"alert\" class=\"text-foreground text-sm\">\n {local.error}\n </p>\n </Show>\n </>\n )\n\n return (\n <FormFieldContext.Provider value={field}>\n <div class={cn('flex flex-col gap-1.5', local.class)} {...rest}>\n {local.group ? (\n <FieldSet\n class=\"flex flex-col gap-1.5\"\n aria-describedby={field.describedBy()}\n aria-invalid={field.invalid() || undefined}\n >\n <FieldLegend id={labelId} variant=\"label\">\n {local.label}\n </FieldLegend>\n {local.children}\n {help()}\n </FieldSet>\n ) : (\n <>\n <Label id={labelId} for={field.controlId()}>\n {local.label}\n </Label>\n {local.children}\n {help()}\n </>\n )}\n </div>\n </FormFieldContext.Provider>\n )\n}\n\nexport function FieldLabel(props: ComponentProps<typeof KobalteTextField.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function FieldDescription(props: ComponentProps<typeof KobalteTextField.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function FieldError(props: ComponentProps<typeof KobalteTextField.ErrorMessage>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.ErrorMessage class={cn('text-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function FieldInput(props: ComponentProps<typeof KobalteTextField.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.Input\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldTextArea(props: ComponentProps<typeof KobalteTextField.TextArea>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.TextArea\n class={cn(\n 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none resize-y',\n 'placeholder:text-muted-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * A labelled group of fields with a single legend, for a real `<fieldset>`.\n * Grouping is what lets a screen reader announce \"Shipping address, group\"\n * before reading the four fields inside it.\n */\nexport function FieldSet(props: ComponentProps<'fieldset'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <fieldset class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\n/** A visual stack for related controls that does not imply fieldset semantics. */\nexport function FieldGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"field-group\" class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\nexport function FieldLegend(props: ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n const [local, rest] = splitProps(props, ['class', 'variant'])\n return (\n <legend\n class={cn(\n 'mb-1',\n local.variant === 'label'\n ? 'text-sm font-medium'\n : 'text-base font-semibold tracking-tight',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A horizontal rule with a word in it, for \"or continue with\" separators. */\nexport function FieldSeparator(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <div class={cn('relative flex items-center gap-3 py-1', local.class)} {...rest}>\n <span class=\"bg-border h-px flex-1\" />\n <Show when={local.children}>\n <span class=\"text-muted-foreground text-2xs tracking-wide uppercase\">{local.children}</span>\n </Show>\n <span class=\"bg-border h-px flex-1\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgBW,MAAMC,OAAgD;CACpE,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBA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,OAAAyB,OAAAvD,WAAA,EAAA,KAAA,WAAA;GAAA,OAA2CN,GAAG,uBAAuBG,MAAMI,KAAK;EAAC,EAAA,GAAMH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAyD;CAAA,EAAA,CAAA;AAC7F;AAEA,SAAgBhB,YAAY3C,OAAoE;CAC9F,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,SAAS,SAAS,CAAC;CAC5D,cAAA;EAAA,IAAA6D,QAAAC,QAAA;EAAA5B,OAAA2B,OAAAzD,WAAA,EAAA,KAAA,WAAA;GAAA,OAEWN,GACL,QACAG,MAAM4C,YAAY,UACd,wBACA,0CACJ5C,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA2D;CAAA,EAAA,CAAA;AAGd;;AAGA,SAAgBE,eAAe/D,OAG5B;CACD,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAgE,QAAAC,QAAA,GAAAG,QAAAJ,MAAAG,WAAAE;EAAAnC,OAAA8B,OAAA5D,WAAA,EAAA,KAAA,WAAA;GAAA,OACcN,GAAG,yCAAyCG,MAAMI,KAAK;EAAC,EAAA,GAAMH,IAAI,GAAA,OAAA,IAAA;EAAAyB,OAAAqC,OAAA7D,gBAE3EV,MAAI;GAAA,IAAC8B,OAAI;IAAA,OAAEtB,MAAMY;GAAQ;GAAA,IAAAA,WAAA;IAAA,IAAAyD,QAAAC,QAAA;IAAA5C,OAAA2C,aAC8CrE,MAAMY,QAAQ;IAAA,OAAAyD;GAAA;EAAA,CAAA,GAAAF,KAAA;EAAA,OAAAJ;CAAA,EAAA,CAAA;AAK5F"}
1
+ {"version":3,"file":"field.js","names":["TextField","KobalteTextField","ComponentProps","JSX","createUniqueId","Show","splitProps","Label","createFormFieldContext","FormFieldContext","cn","headingVariants","Field","props","local","rest","_$createComponent","_$mergeProps","class","FormFieldProps","Omit","label","hint","error","controlId","group","children","Element","FormField","fieldId","labelId","descriptionId","errorId","field","defaultControlId","help","when","_el$","_tmpl$","_$setAttribute","_$insert","_el$2","_tmpl$2","Provider","value","_el$3","_tmpl$3","_$spread","_c$","_$memo","FieldSet","aria-describedby","describedBy","aria-invalid","invalid","undefined","FieldLegend","id","variant","for","FieldLabel","FieldDescription","Description","FieldError","ErrorMessage","FieldInput","Input","FieldTextArea","TextArea","_el$4","_tmpl$4","FieldGroup","_el$5","_tmpl$5","_el$6","_tmpl$6","size","FieldSeparator","_el$7","_tmpl$8","_el$8","firstChild","_el$0","nextSibling","_el$9","_tmpl$7","_$createComponent","KobalteTextField","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/field/field.tsx"],"sourcesContent":["import { TextField as KobalteTextField } from '@kobalte/core/text-field'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { Label } from '../label/label'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Field.\n *\n * The wrapper that makes a form control describable and validatable: a label,\n * a description, an error message, and the ARIA relationships between them.\n *\n * This Kobalte TextField composition is for its own `FieldLabel`, `FieldInput`\n * and `FieldTextArea` parts. Use `FormField` to wire the standalone shared\n * controls, including checkboxes, switches and comboboxes.\n *\n * It is built on Kobalte's TextField specifically so `aria-describedby`,\n * `aria-invalid` and `aria-errormessage` are wired by construction. Those three\n * attributes are the difference between \"this field is required and empty\" and\n * a red border that only a sighted user can perceive — and they are also the\n * first thing a hand-rolled form drops.\n *\n * `Field` owns the description and the error slot, so its controls line up and\n * its messages land in the same place regardless of which TextField part is used.\n */\nexport function Field(props: ComponentProps<typeof KobalteTextField>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteTextField class={cn('flex flex-col gap-1.5', local.class)} {...rest} />\n}\n\nexport type FormFieldProps = Omit<ComponentProps<'div'>, 'children' | 'ref'> & {\n label: string\n hint?: string\n error?: string\n controlId?: string\n group?: boolean\n children: JSX.Element\n}\n\n/**\n * FormField.\n *\n * A shared label, help and validation wrapper for any one shared control. Its\n * context is consumed by Input, Textarea, NativeSelect, Checkbox, Switch,\n * RadioGroup and ComboboxInput, so the actual focusable element receives the\n * generated ID and description relationships. Set `group` when the label names\n * a set of controls; the wrapper then uses fieldset and legend semantics.\n */\nexport function FormField(props: FormFieldProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'hint',\n 'error',\n 'controlId',\n 'group',\n 'children',\n ])\n const fieldId = createUniqueId()\n const labelId = `${fieldId}-label`\n const descriptionId = `${fieldId}-description`\n const errorId = `${fieldId}-error`\n const field = createFormFieldContext({\n controlId: local.controlId,\n defaultControlId: fieldId,\n labelId,\n descriptionId,\n errorId,\n hint: () => local.hint,\n error: () => local.error,\n group: () => local.group ?? false,\n })\n const help = () => (\n <>\n <Show when={local.hint}>\n <p id={descriptionId} class=\"text-muted-foreground text-sm\">\n {local.hint}\n </p>\n </Show>\n <Show when={local.error}>\n <p id={errorId} role=\"alert\" class=\"text-foreground text-sm\">\n {local.error}\n </p>\n </Show>\n </>\n )\n\n return (\n <FormFieldContext.Provider value={field}>\n <div class={cn('flex flex-col gap-1.5', local.class)} {...rest}>\n {local.group ? (\n <FieldSet\n class=\"flex flex-col gap-1.5\"\n aria-describedby={field.describedBy()}\n aria-invalid={field.invalid() || undefined}\n >\n <FieldLegend id={labelId} variant=\"label\">\n {local.label}\n </FieldLegend>\n {local.children}\n {help()}\n </FieldSet>\n ) : (\n <>\n <Label id={labelId} for={field.controlId()}>\n {local.label}\n </Label>\n {local.children}\n {help()}\n </>\n )}\n </div>\n </FormFieldContext.Provider>\n )\n}\n\nexport function FieldLabel(props: ComponentProps<typeof KobalteTextField.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function FieldDescription(props: ComponentProps<typeof KobalteTextField.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function FieldError(props: ComponentProps<typeof KobalteTextField.ErrorMessage>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.ErrorMessage class={cn('text-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function FieldInput(props: ComponentProps<typeof KobalteTextField.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.Input\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldTextArea(props: ComponentProps<typeof KobalteTextField.TextArea>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.TextArea\n class={cn(\n 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none resize-y',\n 'placeholder:text-muted-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * A labelled group of fields with a single legend, for a real `<fieldset>`.\n * Grouping is what lets a screen reader announce \"Shipping address, group\"\n * before reading the four fields inside it.\n */\nexport function FieldSet(props: ComponentProps<'fieldset'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <fieldset class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\n/** A visual stack for related controls that does not imply fieldset semantics. */\nexport function FieldGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"field-group\" class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\nexport function FieldLegend(props: ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n const [local, rest] = splitProps(props, ['class', 'variant'])\n return (\n <legend\n class={cn(\n 'mb-1',\n local.variant === 'label' ? 'text-sm font-medium' : headingVariants({ size: 'card' }),\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A horizontal rule with a word in it, for \"or continue with\" separators. */\nexport function FieldSeparator(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <div class={cn('relative flex items-center gap-3 py-1', local.class)} {...rest}>\n <span class=\"bg-border h-px flex-1\" />\n <Show when={local.children}>\n <span class=\"text-muted-foreground text-2xs tracking-wide uppercase\">{local.children}</span>\n </Show>\n <span class=\"bg-border h-px flex-1\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgBY,MAAMC,OAAgD;CACpE,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,WAAgBgB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQP,GAAG,yBAAyBI,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACpF;;;;;;;;;;AAoBA,SAAgBa,UAAUf,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CACD,MAAMgB,UAAUzB,eAAe;CAC/B,MAAM0B,UAAU,GAAGD,QAAO;CAC1B,MAAME,gBAAgB,GAAGF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