@alfadocs/ui-kit 0.67.0 → 0.67.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 (85) hide show
  1. package/dist/_chunks/{ai-tools-rail-DfmewPUN.js → ai-tools-rail-CInA_1-E.js} +2 -2
  2. package/dist/_chunks/{appointment-tray-CQJ3Nbi5.js → appointment-tray-BMl89NPW.js} +2 -2
  3. package/dist/_chunks/{care-plan-card-CJei-nl9.js → care-plan-card-BwVUyUBb.js} +3 -3
  4. package/dist/_chunks/{care-plan-entry-card-EmfrbHu8.js → care-plan-entry-card-VzdQHcOL.js} +2 -2
  5. package/dist/_chunks/{color-picker-B7xsn6tX.js → color-picker-FXpItIaF.js} +171 -167
  6. package/dist/_chunks/{editable-currency-cell-renderer-BVJ04DkB.js → editable-currency-cell-renderer-D1ewvJKO.js} +358 -351
  7. package/dist/_chunks/{marketplace-app-shell-Bu-HD3fy.js → marketplace-app-shell-D4-T9Qzz.js} +2 -2
  8. package/dist/_chunks/{patient-shell-DrV_iekt.js → patient-shell-BfgufL_q.js} +2 -2
  9. package/dist/_chunks/{patient-summary-card-ByfIU8N0.js → patient-summary-card-hEmr4eTW.js} +2 -2
  10. package/dist/_chunks/{payment-request-card-yTjzKQCU.js → payment-request-card-CYE5vhZ0.js} +2 -2
  11. package/dist/_chunks/{rich-text-editor-BOQr5lHx.js → rich-text-editor-DAeCXiQG.js} +646 -643
  12. package/dist/_chunks/{scroll-area-eccd_Uf-.js → scroll-area-5wNK0Cyz.js} +3 -3
  13. package/dist/_chunks/{sidebar-CGjIk_FQ.js → sidebar-DaB4ulxH.js} +344 -340
  14. package/dist/_chunks/{transaction-chip-BrW8P50O.js → transaction-chip-DK84XCBU.js} +31 -18
  15. package/dist/agent-catalog.json +1 -1
  16. package/dist/components/ai-tools-rail/index.js +1 -1
  17. package/dist/components/appointment-card/index.js +1 -1
  18. package/dist/components/care-plan-card/index.js +1 -1
  19. package/dist/components/care-plan-entry-card/index.js +1 -1
  20. package/dist/components/color-picker/index.js +1 -1
  21. package/dist/components/data-table/index.js +1 -1
  22. package/dist/components/patient-summary-card/index.js +1 -1
  23. package/dist/components/payment-card/index.js +1 -1
  24. package/dist/components/rich-text-editor/index.js +1 -1
  25. package/dist/components/scroll-area/index.js +1 -1
  26. package/dist/components/sidebar/index.js +1 -1
  27. package/dist/components/transaction-chip/index.js +1 -1
  28. package/dist/i18n/locales/ar.d.ts +4 -1
  29. package/dist/i18n/locales/ar.js +5 -2
  30. package/dist/i18n/locales/de.d.ts +4 -1
  31. package/dist/i18n/locales/de.js +5 -2
  32. package/dist/i18n/locales/el.d.ts +4 -1
  33. package/dist/i18n/locales/el.js +5 -2
  34. package/dist/i18n/locales/en.d.ts +4 -1
  35. package/dist/i18n/locales/en.js +5 -2
  36. package/dist/i18n/locales/es.d.ts +4 -1
  37. package/dist/i18n/locales/es.js +5 -2
  38. package/dist/i18n/locales/fr.d.ts +4 -1
  39. package/dist/i18n/locales/fr.js +5 -2
  40. package/dist/i18n/locales/hi.d.ts +4 -1
  41. package/dist/i18n/locales/hi.js +5 -2
  42. package/dist/i18n/locales/it.d.ts +4 -1
  43. package/dist/i18n/locales/it.js +5 -2
  44. package/dist/i18n/locales/ja.d.ts +4 -1
  45. package/dist/i18n/locales/ja.js +5 -2
  46. package/dist/i18n/locales/nl.d.ts +4 -1
  47. package/dist/i18n/locales/nl.js +5 -2
  48. package/dist/i18n/locales/pl.d.ts +4 -1
  49. package/dist/i18n/locales/pl.js +5 -2
  50. package/dist/i18n/locales/pt.d.ts +4 -1
  51. package/dist/i18n/locales/pt.js +5 -2
  52. package/dist/i18n/locales/ro.d.ts +4 -1
  53. package/dist/i18n/locales/ro.js +5 -2
  54. package/dist/i18n/locales/ru.d.ts +4 -1
  55. package/dist/i18n/locales/ru.js +5 -2
  56. package/dist/i18n/locales/sq.d.ts +4 -1
  57. package/dist/i18n/locales/sq.js +5 -2
  58. package/dist/i18n/locales/sv.d.ts +4 -1
  59. package/dist/i18n/locales/sv.js +5 -2
  60. package/dist/i18n/locales/tr.d.ts +4 -1
  61. package/dist/i18n/locales/tr.js +5 -2
  62. package/dist/i18n/locales/zh.d.ts +4 -1
  63. package/dist/i18n/locales/zh.js +5 -2
  64. package/dist/index.js +14 -14
  65. package/dist/locales/ar.json +5 -2
  66. package/dist/locales/de.json +5 -2
  67. package/dist/locales/el.json +5 -2
  68. package/dist/locales/en.json +5 -2
  69. package/dist/locales/es.json +5 -2
  70. package/dist/locales/fr.json +5 -2
  71. package/dist/locales/hi.json +5 -2
  72. package/dist/locales/it.json +5 -2
  73. package/dist/locales/ja.json +5 -2
  74. package/dist/locales/nl.json +5 -2
  75. package/dist/locales/pl.json +5 -2
  76. package/dist/locales/pt.json +5 -2
  77. package/dist/locales/ro.json +5 -2
  78. package/dist/locales/ru.json +5 -2
  79. package/dist/locales/sq.json +5 -2
  80. package/dist/locales/sv.json +5 -2
  81. package/dist/locales/tr.json +5 -2
  82. package/dist/locales/zh.json +5 -2
  83. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  84. package/dist/patterns/patient-shell/index.js +1 -1
  85. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- import { jsx as l, jsxs as h, Fragment as we } from "react/jsx-runtime";
2
- import { forwardRef as $e, useId as Ne, useState as z, useMemo as T, useCallback as Pe, useRef as B, useEffect as Z } from "react";
1
+ import { jsx as l, jsxs as h, Fragment as ke } from "react/jsx-runtime";
2
+ import { forwardRef as $e, useId as ye, useState as z, useMemo as T, useCallback as Ne, useRef as G, useEffect as Z } from "react";
3
3
  import * as H from "@radix-ui/react-popover";
4
- import { c as ae } from "./index-D2ZczOXr.js";
5
- import { useTranslation as ye } from "react-i18next";
4
+ import { c as te } from "./index-D2ZczOXr.js";
5
+ import { useTranslation as Pe } from "react-i18next";
6
6
  import { u as Ae } from "./form-field-context-B3APVHKx.js";
7
- import { S as te } from "./slider-BHWzXdjt.js";
8
- import { u as Me } from "./registry-nPAVE19X.js";
7
+ import { S as ae } from "./slider-BHWzXdjt.js";
8
+ import { u as Se } from "./registry-nPAVE19X.js";
9
9
  import { C as re } from "./check-DPdL_Sm7.js";
10
- import { X as Se } from "./x-CCcI3eJp.js";
10
+ import { X as Me } from "./x-CCcI3eJp.js";
11
11
  const ze = {
12
12
  id: "color-picker",
13
13
  capabilities: ["pick"],
@@ -25,8 +25,8 @@ const ze = {
25
25
  argsType: "{ hex: string }",
26
26
  descriptionKey: "ui.agent.colorPicker.actions.setValue",
27
27
  description: "Set the picked colour from a hex string.",
28
- invoke: (e, a) => {
29
- e.setValue(a.hex);
28
+ invoke: (e, t) => {
29
+ e.setValue(t.hex);
30
30
  }
31
31
  }
32
32
  },
@@ -44,50 +44,50 @@ const ze = {
44
44
  }
45
45
  };
46
46
  function Te(e) {
47
- let a = e.startsWith("#") ? e.slice(1) : e;
48
- (a.length === 3 || a.length === 4) && (a = a.split("").map((c) => c + c).join(""));
49
- const r = parseInt(a.slice(0, 2), 16) / 255, t = parseInt(a.slice(2, 4), 16) / 255, n = parseInt(a.slice(4, 6), 16) / 255, i = a.length === 8 ? parseInt(a.slice(6, 8), 16) / 255 : 1;
50
- return ne(r, t, n, i);
47
+ let t = e.startsWith("#") ? e.slice(1) : e;
48
+ (t.length === 3 || t.length === 4) && (t = t.split("").map((c) => c + c).join(""));
49
+ const r = parseInt(t.slice(0, 2), 16) / 255, a = parseInt(t.slice(2, 4), 16) / 255, n = parseInt(t.slice(4, 6), 16) / 255, d = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
50
+ return ne(r, a, n, d);
51
51
  }
52
- function ne(e, a, r, t) {
53
- const n = Math.max(e, a, r), i = Math.min(e, a, r), c = (n + i) / 2;
54
- let m = 0, k = 0;
55
- if (n !== i) {
56
- const x = n - i;
57
- k = c > 0.5 ? x / (2 - n - i) : x / (n + i), n === e ? m = ((a - r) / x + (a < r ? 6 : 0)) / 6 : n === a ? m = ((r - e) / x + 2) / 6 : m = ((e - a) / x + 4) / 6;
52
+ function ne(e, t, r, a) {
53
+ const n = Math.max(e, t, r), d = Math.min(e, t, r), c = (n + d) / 2;
54
+ let m = 0, w = 0;
55
+ if (n !== d) {
56
+ const x = n - d;
57
+ w = c > 0.5 ? x / (2 - n - d) : x / (n + d), n === e ? m = ((t - r) / x + (t < r ? 6 : 0)) / 6 : n === t ? m = ((r - e) / x + 2) / 6 : m = ((e - t) / x + 4) / 6;
58
58
  }
59
59
  return {
60
60
  h: Math.round(m * 360),
61
- s: Math.round(k * 100),
61
+ s: Math.round(w * 100),
62
62
  l: Math.round(c * 100),
63
- a: Math.round(t * 100) / 100
63
+ a: Math.round(a * 100) / 100
64
64
  };
65
65
  }
66
66
  function C(e) {
67
- const { r: a, g: r, b: t } = K(e), n = (c) => Math.round(c * 255).toString(16).padStart(2, "0"), i = `#${n(a)}${n(r)}${n(t)}`;
68
- return e.a < 1 ? `${i}${n(e.a)}` : i;
67
+ const { r: t, g: r, b: a } = W(e), n = (c) => Math.round(c * 255).toString(16).padStart(2, "0"), d = `#${n(t)}${n(r)}${n(a)}`;
68
+ return e.a < 1 ? `${d}${n(e.a)}` : d;
69
69
  }
70
70
  function Ee(e) {
71
- const { r: a, g: r, b: t } = K(e), n = Math.round(a * 255), i = Math.round(r * 255), c = Math.round(t * 255);
72
- return e.a < 1 ? `rgba(${n}, ${i}, ${c}, ${e.a})` : `rgba(${n}, ${i}, ${c}, 1)`;
71
+ const { r: t, g: r, b: a } = W(e), n = Math.round(t * 255), d = Math.round(r * 255), c = Math.round(a * 255);
72
+ return e.a < 1 ? `rgba(${n}, ${d}, ${c}, ${e.a})` : `rgba(${n}, ${d}, ${c}, 1)`;
73
73
  }
74
- function K(e) {
75
- const a = e.h / 360, r = e.s / 100, t = e.l / 100;
74
+ function W(e) {
75
+ const t = e.h / 360, r = e.s / 100, a = e.l / 100;
76
76
  if (r === 0)
77
- return { r: t, g: t, b: t };
78
- const n = t < 0.5 ? t * (1 + r) : t + r - t * r, i = 2 * t - n;
77
+ return { r: a, g: a, b: a };
78
+ const n = a < 0.5 ? a * (1 + r) : a + r - a * r, d = 2 * a - n;
79
79
  return {
80
- r: G(i, n, a + 1 / 3),
81
- g: G(i, n, a),
82
- b: G(i, n, a - 1 / 3)
80
+ r: j(d, n, t + 1 / 3),
81
+ g: j(d, n, t),
82
+ b: j(d, n, t - 1 / 3)
83
83
  };
84
84
  }
85
- function G(e, a, r) {
86
- let t = r;
87
- return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (a - e) * 6 * t : t < 1 / 2 ? a : t < 2 / 3 ? e + (a - e) * (2 / 3 - t) * 6 : e;
85
+ function j(e, t, r) {
86
+ let a = r;
87
+ return a < 0 && (a += 1), a > 1 && (a -= 1), a < 1 / 6 ? e + (t - e) * 6 * a : a < 1 / 2 ? t : a < 2 / 3 ? e + (t - e) * (2 / 3 - a) * 6 : e;
88
88
  }
89
- function j(e, a) {
90
- switch (a) {
89
+ function D(e, t) {
90
+ switch (t) {
91
91
  case "hex":
92
92
  return C(e);
93
93
  case "hsl":
@@ -96,14 +96,14 @@ function j(e, a) {
96
96
  return Ee(e);
97
97
  }
98
98
  }
99
- function w(e) {
100
- const a = e.trim();
101
- if (!a) return null;
102
- if (a.startsWith("#")) {
103
- const n = a.slice(1);
104
- return !/^[0-9a-fA-F]{3,8}$/.test(n) || ![3, 4, 6, 8].includes(n.length) ? null : Te(a);
99
+ function $(e) {
100
+ const t = e.trim();
101
+ if (!t) return null;
102
+ if (t.startsWith("#")) {
103
+ const n = t.slice(1);
104
+ return !/^[0-9a-fA-F]{3,8}$/.test(n) || ![3, 4, 6, 8].includes(n.length) ? null : Te(t);
105
105
  }
106
- const r = a.match(
106
+ const r = t.match(
107
107
  /^hsla?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)%?\s*[,/]\s*([\d.]+)%?\s*(?:[,/]\s*([\d.]+))?\s*\)$/
108
108
  );
109
109
  if (r)
@@ -113,30 +113,30 @@ function w(e) {
113
113
  l: Math.round(parseFloat(r[3])),
114
114
  a: r[4] !== void 0 ? parseFloat(r[4]) : 1
115
115
  };
116
- const t = a.match(
116
+ const a = t.match(
117
117
  /^rgba?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+))?\s*\)$/
118
118
  );
119
- if (t) {
120
- const n = parseFloat(t[1]) / 255, i = parseFloat(t[2]) / 255, c = parseFloat(t[3]) / 255, m = t[4] !== void 0 ? parseFloat(t[4]) : 1;
121
- return ne(n, i, c, m);
119
+ if (a) {
120
+ const n = parseFloat(a[1]) / 255, d = parseFloat(a[2]) / 255, c = parseFloat(a[3]) / 255, m = a[4] !== void 0 ? parseFloat(a[4]) : 1;
121
+ return ne(n, d, c, m);
122
122
  }
123
123
  return null;
124
124
  }
125
125
  function ee(e) {
126
- const { r: a, g: r, b: t } = K(e), n = (i) => i <= 0.03928 ? i / 12.92 : Math.pow((i + 0.055) / 1.055, 2.4);
127
- return 0.2126 * n(a) + 0.7152 * n(r) + 0.0722 * n(t);
126
+ const { r: t, g: r, b: a } = W(e), n = (d) => d <= 0.03928 ? d / 12.92 : Math.pow((d + 0.055) / 1.055, 2.4);
127
+ return 0.2126 * n(t) + 0.7152 * n(r) + 0.0722 * n(a);
128
128
  }
129
- function Ie(e, a) {
130
- const r = ee(e), t = ee(a), n = Math.max(r, t), i = Math.min(r, t);
131
- return Math.round((n + 0.05) / (i + 0.05) * 100) / 100;
129
+ function Ie(e, t) {
130
+ const r = ee(e), a = ee(t), n = Math.max(r, a), d = Math.min(r, a);
131
+ return Math.round((n + 0.05) / (d + 0.05) * 100) / 100;
132
132
  }
133
133
  function Le(e) {
134
134
  return e >= 4.5;
135
135
  }
136
- function He(e) {
136
+ function Re(e) {
137
137
  return e >= 7;
138
138
  }
139
- const Re = [
139
+ const He = [
140
140
  { name: "Pink 500", hex: "#e91e63", textColor: "#ffffff" },
141
141
  { name: "Black", hex: "#000000", textColor: "#ffffff" },
142
142
  { name: "Blue 500", hex: "#2196f3", textColor: "#ffffff" },
@@ -167,7 +167,7 @@ const Re = [
167
167
  { name: "Orange 900", hex: "#e65100", textColor: "#000000" },
168
168
  { name: "White", hex: "#ffffff", textColor: "#000000" },
169
169
  { name: "Yellow 500", hex: "#ffeb3b", textColor: "#000000" }
170
- ], as = [
170
+ ], ts = [
171
171
  { name: "Blue 300", hex: "#70738c" },
172
172
  { name: "Blue 500", hex: "#292e53" },
173
173
  { name: "Blue 700", hex: "#1d213b" },
@@ -186,7 +186,7 @@ const Re = [
186
186
  { name: "Grey 300", hex: "#f9f6f3" },
187
187
  { name: "Grey 500", hex: "#f6f1ed" },
188
188
  { name: "Grey 700", hex: "#afaba8" }
189
- ], u = 6, Fe = ae(
189
+ ], u = 6, Fe = te(
190
190
  [
191
191
  "ds:inline-flex ds:items-center ds:w-full",
192
192
  "ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
@@ -205,7 +205,7 @@ const Re = [
205
205
  },
206
206
  defaultVariants: { size: "md" }
207
207
  }
208
- ), _e = ae(
208
+ ), _e = te(
209
209
  [
210
210
  "ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer",
211
211
  "ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
@@ -230,6 +230,9 @@ const Re = [
230
230
  // bump (48px) — a dense colour grid is opt-in and the full roving-tabindex
231
231
  // keyboard path is the mitigation for the sub-AAA pointer target.
232
232
  size: {
233
+ // sm = 28px: clears WCAG 2.5.8 (AA, 24px) but intentionally opts out of
234
+ // the accessible-theme 48px min-target bump — a conscious, signed-off
235
+ // trade-off (dense opt-in grid; keyboard roving-tabindex is the mitigation).
233
236
  sm: "ds:min-w-7 ds:min-h-7",
234
237
  md: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
235
238
  lg: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]"
@@ -260,85 +263,86 @@ const Re = [
260
263
  "ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2"
261
264
  ].join(" "), De = [
262
265
  "ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]",
263
- "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[var(--font-size-sm)]",
266
+ "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)]",
264
267
  "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
265
268
  "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
266
269
  "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
267
270
  "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
268
271
  ].join(" "), oe = "ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent", Ke = $e(
269
- (e, a) => {
272
+ (e, t) => {
270
273
  const {
271
274
  value: r,
272
- defaultValue: t,
275
+ defaultValue: a,
273
276
  onChange: n,
274
- format: i = "hex",
277
+ format: d = "hex",
275
278
  allowOpacity: c = !1,
276
279
  palette: m,
277
- against: k,
280
+ against: w,
278
281
  size: x = "md",
279
282
  disabled: ie = !1,
280
283
  variant: de = "inline",
281
- compact: A = !0,
282
- className: W
283
- } = e, { t: g } = ye(), P = Ae(), le = Ne(), $ = P.id || le, v = P.disabled || ie, E = r !== void 0, [U, ce] = z(() => {
284
- const s = r ?? t;
284
+ compact: M = !0,
285
+ className: U
286
+ } = e, { t: g } = Pe(), P = Ae(), le = ye(), y = P.id || le, v = P.disabled || ie, E = r !== void 0, [X, ce] = z(() => {
287
+ const s = r ?? a;
285
288
  if (s) {
286
- const d = w(s);
287
- if (d) return d;
289
+ const i = $(s);
290
+ if (i) return i;
288
291
  }
289
292
  return { h: 0, s: 100, l: 50, a: 1 };
290
293
  }), o = T(() => {
291
294
  if (E && r) {
292
- const s = w(r);
295
+ const s = $(r);
293
296
  if (s) return s;
294
297
  }
295
- return U;
296
- }, [E, r, U]), b = Pe(
298
+ return X;
299
+ }, [E, r, X]), b = Ne(
297
300
  (s) => {
298
- const d = c ? s : { ...s, a: 1 };
299
- E || ce(d), n == null || n(j(d, i));
301
+ const i = c ? s : { ...s, a: 1 };
302
+ E || ce(i), n == null || n(D(i, d));
300
303
  },
301
- [c, i, E, n]
302
- ), [X, R] = z(() => C(o)), [fe, I] = z(!1), N = B(void 0), F = B(o);
303
- F.current = o, Z(() => {
304
- R(C(o)), I(!1), N.current !== void 0 && (clearTimeout(N.current), N.current = void 0);
304
+ [c, d, E, n]
305
+ ), [Y, F] = z(() => C(o)), [fe, I] = z(!1), N = G(void 0), _ = G(o);
306
+ _.current = o, Z(() => {
307
+ F(C(o)), I(!1), N.current !== void 0 && (clearTimeout(N.current), N.current = void 0);
305
308
  }, [o]), Z(() => () => {
306
309
  N.current !== void 0 && clearTimeout(N.current);
307
310
  }, []);
308
311
  const ue = () => {
309
- const s = w(X);
312
+ const s = $(Y);
310
313
  s ? (I(!1), b(s)) : (I(!0), N.current = setTimeout(() => {
311
- N.current = void 0, I(!1), R(C(F.current));
314
+ N.current = void 0, I(!1), F(C(_.current));
312
315
  }, 800));
313
- }, y = T(() => m ? m.map(
316
+ }, A = T(() => m ? m.map(
314
317
  (s) => typeof s == "string" ? { name: s.toUpperCase(), hex: s } : s
315
- ) : Re, [m]), he = C(o), _ = T(
316
- () => y.map((s) => {
317
- const d = w(s.hex);
318
- return d ? C(d).toLowerCase() : null;
318
+ ) : He, [m]), he = C(o), V = T(
319
+ () => A.map((s) => {
320
+ const i = $(s.hex);
321
+ return i ? C(i).toLowerCase() : null;
319
322
  }),
320
- [y]
323
+ [A]
321
324
  ).findIndex(
322
325
  (s) => s !== null && s === he.toLowerCase()
323
- ), Y = B(null), [p, q] = z(
324
- _ >= 0 ? _ : 0
326
+ ), L = G(null), [p, q] = z(
327
+ V >= 0 ? V : 0
325
328
  ), me = (s) => {
326
329
  var f;
327
- const d = (f = Y.current) == null ? void 0 : f.querySelectorAll('[role="gridcell"]');
328
- d != null && d[s] && (d[s].focus(), q(s));
330
+ const i = (f = L.current) == null ? void 0 : f.querySelectorAll('[role="gridcell"]');
331
+ i != null && i[s] && (i[s].focus(), q(s));
329
332
  }, ge = (s) => {
330
333
  if (v) return;
331
- const d = y.length;
334
+ const i = A.length;
332
335
  let f = p;
336
+ const k = (typeof window < "u" && L.current ? window.getComputedStyle(L.current).direction === "rtl" : !1) ? -1 : 1;
333
337
  switch (s.key) {
334
338
  case "ArrowRight":
335
- f = (p + 1) % d;
339
+ f = (p + k + i) % i;
336
340
  break;
337
341
  case "ArrowLeft":
338
- f = (p - 1 + d) % d;
342
+ f = (p - k + i) % i;
339
343
  break;
340
344
  case "ArrowDown":
341
- f = Math.min(p + u, d - 1);
345
+ f = Math.min(p + u, i - 1);
342
346
  break;
343
347
  case "ArrowUp":
344
348
  f = Math.max(p - u, 0);
@@ -349,22 +353,22 @@ const Re = [
349
353
  case "End":
350
354
  f = Math.min(
351
355
  Math.floor(p / u) * u + u - 1,
352
- d - 1
356
+ i - 1
353
357
  );
354
358
  break;
355
359
  case "PageUp":
356
360
  f = p % u;
357
361
  break;
358
362
  case "PageDown": {
359
- const M = Math.floor((d - 1) / u) * u;
360
- f = Math.min(M + p % u, d - 1);
363
+ const S = Math.floor((i - 1) / u) * u;
364
+ f = Math.min(S + p % u, i - 1);
361
365
  break;
362
366
  }
363
367
  case "Enter":
364
368
  case " ": {
365
369
  s.preventDefault();
366
- const M = w(y[p].hex);
367
- M && b(M);
370
+ const S = $(A[p].hex);
371
+ S && b(S);
368
372
  return;
369
373
  }
370
374
  default:
@@ -373,55 +377,55 @@ const Re = [
373
377
  s.preventDefault(), me(f);
374
378
  }, [pe, xe] = z(!1), ve = T(
375
379
  () => ({
376
- getValue: () => C(F.current),
380
+ getValue: () => C(_.current),
377
381
  setValue: (s) => {
378
- const d = w(s);
379
- d && b(d);
382
+ const i = $(s);
383
+ i && b(i);
380
384
  }
381
385
  }),
382
386
  [b]
383
387
  );
384
- Me(ze, ve, $);
385
- const L = T(() => {
386
- if (!k) return null;
387
- const s = w(k);
388
+ Se(ze, ve, y);
389
+ const R = T(() => {
390
+ if (!w) return null;
391
+ const s = $(w);
388
392
  if (!s) return null;
389
- const d = Ie(o, s);
390
- return { ratio: d, aa: Le(d), aaa: He(d) };
391
- }, [k, o]), be = (
393
+ const i = Ie(o, s);
394
+ return { ratio: i, aa: Le(i), aaa: Re(i) };
395
+ }, [w, o]), be = (
392
396
  // eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex
393
397
  /* @__PURE__ */ l(
394
398
  "div",
395
399
  {
396
- ref: Y,
400
+ ref: L,
397
401
  role: "grid",
398
- "aria-label": g("inputs.colorPicker.paletteLabel", "Colour swatches"),
402
+ "aria-label": g("inputs.colorPicker.paletteLabel", "Colour palette"),
399
403
  onKeyDown: ge,
400
404
  className: "ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]",
401
- children: y.map((s, d) => {
402
- const f = Math.floor(d / u) * u;
403
- return d === f ? /* @__PURE__ */ l("div", { role: "row", className: "ds:contents", children: y.slice(f, f + u).map((S, ke) => {
404
- const V = f + ke, O = V === _;
405
+ children: A.map((s, i) => {
406
+ const f = Math.floor(i / u) * u;
407
+ return i === f ? /* @__PURE__ */ l("div", { role: "row", className: "ds:contents", children: A.slice(f, f + u).map((k, S) => {
408
+ const O = f + S, B = O === V;
405
409
  return (
406
410
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown
407
411
  /* @__PURE__ */ l(
408
412
  "div",
409
413
  {
410
414
  role: "gridcell",
411
- "aria-selected": O,
415
+ "aria-selected": B,
412
416
  "aria-label": g("inputs.colorPicker.swatchLabel", {
413
- name: S.name,
414
- hex: S.hex
417
+ name: k.name,
418
+ hex: k.hex
415
419
  }),
416
- tabIndex: V === p ? 0 : -1,
420
+ tabIndex: O === p ? 0 : -1,
417
421
  onClick: () => {
418
422
  if (v) return;
419
- const Q = w(S.hex);
420
- Q && b(Q), q(V);
423
+ const Q = $(k.hex);
424
+ Q && b(Q), q(O);
421
425
  },
422
- className: _e({ selected: O, size: x }),
423
- style: { "--swatch-bg": S.hex },
424
- children: O ? /* @__PURE__ */ l(
426
+ className: _e({ selected: B, size: x }),
427
+ style: { "--swatch-bg": k.hex },
428
+ children: B ? /* @__PURE__ */ l(
425
429
  re,
426
430
  {
427
431
  "aria-hidden": "true",
@@ -429,19 +433,19 @@ const Re = [
429
433
  }
430
434
  ) : null
431
435
  },
432
- S.hex
436
+ k.hex
433
437
  )
434
438
  );
435
- }) }, d) : null;
439
+ }) }, i) : null;
436
440
  })
437
441
  }
438
442
  )
439
- ), Ce = A ? null : /* @__PURE__ */ h(we, { children: [
443
+ ), Ce = M ? null : /* @__PURE__ */ h(ke, { children: [
440
444
  /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
441
445
  /* @__PURE__ */ l(
442
446
  "label",
443
447
  {
444
- htmlFor: `${$}-hex`,
448
+ htmlFor: `${y}-hex`,
445
449
  className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
446
450
  children: g("inputs.colorPicker.hex", "Hex")
447
451
  }
@@ -449,11 +453,11 @@ const Re = [
449
453
  /* @__PURE__ */ l("bdi", { dir: "ltr", children: /* @__PURE__ */ l(
450
454
  "input",
451
455
  {
452
- id: `${$}-hex`,
456
+ id: `${y}-hex`,
453
457
  type: "text",
454
- value: X,
458
+ value: Y,
455
459
  disabled: v,
456
- onChange: (s) => R(s.target.value),
460
+ onChange: (s) => F(s.target.value),
457
461
  onBlur: ue,
458
462
  className: `${De} ${fe ? "ds:border-[var(--destructive)]" : "ds:border-[color:var(--border)]"}`
459
463
  }
@@ -461,7 +465,7 @@ const Re = [
461
465
  ] }),
462
466
  /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
463
467
  /* @__PURE__ */ l(
464
- D,
468
+ K,
465
469
  {
466
470
  label: g("inputs.colorPicker.hue", "Hue"),
467
471
  gradient: "linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))",
@@ -474,7 +478,7 @@ const Re = [
474
478
  }
475
479
  ),
476
480
  /* @__PURE__ */ l(
477
- D,
481
+ K,
478
482
  {
479
483
  label: g("inputs.colorPicker.saturation", "Saturation"),
480
484
  gradient: `linear-gradient(to right, hsl(${o.h},0%,${o.l}%), hsl(${o.h},100%,${o.l}%))`,
@@ -487,7 +491,7 @@ const Re = [
487
491
  }
488
492
  ),
489
493
  /* @__PURE__ */ l(
490
- D,
494
+ K,
491
495
  {
492
496
  label: g("inputs.colorPicker.lightness", "Lightness"),
493
497
  gradient: `linear-gradient(to right, hsl(${o.h},${o.s}%,0%), hsl(${o.h},${o.s}%,50%), hsl(${o.h},${o.s}%,100%))`,
@@ -520,7 +524,7 @@ const Re = [
520
524
  }
521
525
  ),
522
526
  /* @__PURE__ */ l(
523
- te,
527
+ ae,
524
528
  {
525
529
  min: 0,
526
530
  max: 100,
@@ -536,7 +540,7 @@ const Re = [
536
540
  ] })
537
541
  ] }) : null
538
542
  ] }),
539
- L ? /* @__PURE__ */ h(
543
+ R ? /* @__PURE__ */ h(
540
544
  "div",
541
545
  {
542
546
  className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]",
@@ -544,10 +548,10 @@ const Re = [
544
548
  "aria-live": "polite",
545
549
  children: [
546
550
  /* @__PURE__ */ l("span", { className: "ds:tabular-nums", children: g("inputs.colorPicker.contrastRatio", {
547
- ratio: L.ratio.toFixed(1)
551
+ ratio: R.ratio.toFixed(1)
548
552
  }) }),
549
- /* @__PURE__ */ l(se, { level: "AA", passes: L.aa, t: g }),
550
- /* @__PURE__ */ l(se, { level: "AAA", passes: L.aaa, t: g })
553
+ /* @__PURE__ */ l(se, { level: "AA", passes: R.aa, t: g }),
554
+ /* @__PURE__ */ l(se, { level: "AAA", passes: R.aaa, t: g })
551
555
  ]
552
556
  }
553
557
  ) : null,
@@ -560,12 +564,12 @@ const Re = [
560
564
  "aria-hidden": "true"
561
565
  }
562
566
  ),
563
- /* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: j(o, i) })
567
+ /* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: D(o, d) })
564
568
  ] })
565
569
  ] }), J = /* @__PURE__ */ h(
566
570
  "div",
567
571
  {
568
- className: A ? x === "sm" ? Ge : Be : Ve,
572
+ className: M ? x === "sm" ? Ge : Be : Ve,
569
573
  children: [
570
574
  be,
571
575
  Ce
@@ -575,14 +579,14 @@ const Re = [
575
579
  return de === "inline" ? /* @__PURE__ */ l(
576
580
  "div",
577
581
  {
578
- ref: a,
579
- id: $,
580
- className: W,
582
+ ref: t,
583
+ id: y,
584
+ className: U,
581
585
  "aria-describedby": P.describedBy || void 0,
582
586
  "aria-invalid": P.invalid || void 0,
583
587
  "aria-disabled": v || void 0,
584
588
  "data-component": "color-picker",
585
- "data-component-id": $,
589
+ "data-component-id": y,
586
590
  "data-testid": "color-picker",
587
591
  children: J
588
592
  }
@@ -590,26 +594,26 @@ const Re = [
590
594
  /* @__PURE__ */ l(H.Trigger, { asChild: !0, disabled: v, children: /* @__PURE__ */ h(
591
595
  "button",
592
596
  {
593
- ref: a,
597
+ ref: t,
594
598
  type: "button",
595
- id: $,
599
+ id: y,
596
600
  "aria-describedby": P.describedBy || void 0,
597
601
  "aria-invalid": P.invalid || void 0,
598
- "aria-label": A ? g("inputs.colorPicker.triggerLabel", "Choose a colour") : void 0,
599
- className: Fe({ size: x, className: W }),
602
+ "aria-label": M ? g("inputs.colorPicker.triggerLabel", "Choose colour") : void 0,
603
+ className: Fe({ size: x, className: U }),
600
604
  "data-component": "color-picker",
601
- "data-component-id": $,
605
+ "data-component-id": y,
602
606
  "data-testid": "color-picker-trigger",
603
607
  children: [
604
608
  /* @__PURE__ */ l(
605
609
  "span",
606
610
  {
607
- className: `ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${A ? "" : " ds:me-[var(--spacing-sm)]"}`,
611
+ className: `ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${M ? "" : " ds:me-[var(--spacing-sm)]"}`,
608
612
  "aria-hidden": "true",
609
613
  style: { "--swatch-bg": C(o) }
610
614
  }
611
615
  ),
612
- A ? null : /* @__PURE__ */ l("span", { className: "ds:text-start ds:truncate ds:tabular-nums", children: j(o, i) })
616
+ M ? null : /* @__PURE__ */ l("span", { className: "ds:text-start ds:truncate ds:tabular-nums", children: D(o, d) })
613
617
  ]
614
618
  }
615
619
  ) }),
@@ -628,7 +632,7 @@ const Re = [
628
632
  Ke.displayName = "ColorPicker";
629
633
  function se({
630
634
  level: e,
631
- passes: a,
635
+ passes: t,
632
636
  t: r
633
637
  }) {
634
638
  return /* @__PURE__ */ h("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
@@ -640,29 +644,29 @@ function se({
640
644
  children: e
641
645
  }
642
646
  ),
643
- a ? /* @__PURE__ */ l(
647
+ t ? /* @__PURE__ */ l(
644
648
  re,
645
649
  {
646
650
  "aria-hidden": "true",
647
651
  className: "ds:size-4 ds:text-[var(--success)]"
648
652
  }
649
653
  ) : /* @__PURE__ */ l(
650
- Se,
654
+ Me,
651
655
  {
652
656
  "aria-hidden": "true",
653
657
  className: "ds:size-4 ds:text-[var(--destructive)]"
654
658
  }
655
659
  ),
656
- /* @__PURE__ */ l("span", { className: "ds:sr-only", children: a ? r("inputs.colorPicker.contrastPass", "Pass") : r("inputs.colorPicker.contrastFail", "Fail") })
660
+ /* @__PURE__ */ l("span", { className: "ds:sr-only", children: t ? r("inputs.colorPicker.contrastPass", "Pass") : r("inputs.colorPicker.contrastFail", "Fail") })
657
661
  ] });
658
662
  }
659
- function D({
663
+ function K({
660
664
  label: e,
661
- gradient: a,
665
+ gradient: t,
662
666
  min: r,
663
- max: t,
667
+ max: a,
664
668
  value: n,
665
- onChange: i,
669
+ onChange: d,
666
670
  formatValue: c,
667
671
  disabled: m
668
672
  }) {
@@ -673,18 +677,18 @@ function D({
673
677
  "div",
674
678
  {
675
679
  className: "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--slider-gradient)]",
676
- style: { "--slider-gradient": a },
680
+ style: { "--slider-gradient": t },
677
681
  "aria-hidden": "true"
678
682
  }
679
683
  ),
680
684
  /* @__PURE__ */ l(
681
- te,
685
+ ae,
682
686
  {
683
687
  min: r,
684
- max: t,
688
+ max: a,
685
689
  step: 1,
686
690
  value: [n],
687
- onValueChange: ([k]) => i(k),
691
+ onValueChange: ([w]) => d(w),
688
692
  "aria-label": e,
689
693
  formatValue: c,
690
694
  disabled: m,
@@ -695,8 +699,8 @@ function D({
695
699
  ] });
696
700
  }
697
701
  export {
698
- Re as A,
699
- as as B,
702
+ He as A,
703
+ ts as B,
700
704
  Ke as C
701
705
  };
702
- //# sourceMappingURL=color-picker-B7xsn6tX.js.map
706
+ //# sourceMappingURL=color-picker-FXpItIaF.js.map