@epilot/volt-ui-experimental-griffel 0.2.3 → 0.3.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 (79) hide show
  1. package/ADOPTING.md +416 -0
  2. package/README.md +32 -31
  3. package/dist/components/alert-dialog/alert-dialog.js +61 -59
  4. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  5. package/dist/components/avatar/avatar.js +6 -6
  6. package/dist/components/avatar/avatar.js.map +1 -1
  7. package/dist/components/badge/badge.js +47 -39
  8. package/dist/components/badge/badge.js.map +1 -1
  9. package/dist/components/button/button.js +71 -68
  10. package/dist/components/button/button.js.map +1 -1
  11. package/dist/components/checkbox/checkbox.js +23 -20
  12. package/dist/components/checkbox/checkbox.js.map +1 -1
  13. package/dist/components/command/command.js +50 -35
  14. package/dist/components/command/command.js.map +1 -1
  15. package/dist/components/data-table/data-table.js +89 -88
  16. package/dist/components/data-table/data-table.js.map +1 -1
  17. package/dist/components/density-provider/density-provider.js +28 -0
  18. package/dist/components/density-provider/density-provider.js.map +1 -0
  19. package/dist/components/dialog/dialog.js +122 -100
  20. package/dist/components/dialog/dialog.js.map +1 -1
  21. package/dist/components/drawer/drawer.js +61 -59
  22. package/dist/components/drawer/drawer.js.map +1 -1
  23. package/dist/components/dropdown-menu/dropdown-menu.js +88 -85
  24. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  25. package/dist/components/field/field-combobox.js +121 -106
  26. package/dist/components/field/field-combobox.js.map +1 -1
  27. package/dist/components/field/field.js +105 -104
  28. package/dist/components/field/field.js.map +1 -1
  29. package/dist/components/list/list.js +282 -308
  30. package/dist/components/list/list.js.map +1 -1
  31. package/dist/components/pill/pill.js +58 -56
  32. package/dist/components/pill/pill.js.map +1 -1
  33. package/dist/components/popover/popover.js +47 -38
  34. package/dist/components/popover/popover.js.map +1 -1
  35. package/dist/components/radio/radio.js +21 -18
  36. package/dist/components/radio/radio.js.map +1 -1
  37. package/dist/components/select/select.js +185 -156
  38. package/dist/components/select/select.js.map +1 -1
  39. package/dist/components/skeleton/skeleton.js +2 -2
  40. package/dist/components/skeleton/skeleton.js.map +1 -1
  41. package/dist/components/switch/switch.js +34 -29
  42. package/dist/components/switch/switch.js.map +1 -1
  43. package/dist/components/table/table-pagination.js +92 -90
  44. package/dist/components/table/table-pagination.js.map +1 -1
  45. package/dist/components/table/table.js +109 -121
  46. package/dist/components/table/table.js.map +1 -1
  47. package/dist/components/toggle/toggle.js +29 -29
  48. package/dist/components/toggle/toggle.js.map +1 -1
  49. package/dist/components/tooltip/tooltip.js +36 -34
  50. package/dist/components/tooltip/tooltip.js.map +1 -1
  51. package/dist/index.d.ts +600 -427
  52. package/dist/index.js +215 -212
  53. package/dist/index.js.map +1 -1
  54. package/dist/packages/volt-runtime/dist/sheet.js +27 -10
  55. package/dist/packages/volt-runtime/dist/sheet.js.map +1 -1
  56. package/dist/packages/volt-runtime/dist/styles/recipe.js +76 -0
  57. package/dist/packages/volt-runtime/dist/styles/recipe.js.map +1 -0
  58. package/dist/styles/document-context.js +12 -0
  59. package/dist/styles/document-context.js.map +1 -0
  60. package/dist/styles/make-styles.js +18 -10
  61. package/dist/styles/make-styles.js.map +1 -1
  62. package/dist/tokens/core.generated.js +1238 -1166
  63. package/dist/tokens/core.generated.js.map +1 -1
  64. package/dist/tokens/index.d.ts +442 -415
  65. package/dist/tokens/index.js +1105 -1078
  66. package/dist/tokens/index.js.map +1 -1
  67. package/dist/tokens/install.js +9 -5
  68. package/dist/tokens/install.js.map +1 -1
  69. package/dist/tokens/use-palette-tokens.js +20 -0
  70. package/dist/tokens/use-palette-tokens.js.map +1 -0
  71. package/dist/tokens.json +83 -2
  72. package/package.json +13 -5
  73. package/scripts/migration-diagnostics-core.mjs +859 -0
  74. package/scripts/migration-diagnostics.mjs +353 -0
  75. package/scripts/migration-sweep.mjs +179 -0
  76. package/AGENTS.md +0 -153
  77. package/AUTHORING.md +0 -292
  78. package/dist/packages/volt-runtime/dist/styles/make-styles.js +0 -22
  79. package/dist/packages/volt-runtime/dist/styles/make-styles.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { jsx as t, jsxs as W } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { useSensors as Y, useSensor as K, DndContext as tt, closestCenter as et, DragOverlay as rt, KeyboardSensor as ot, PointerSensor as nt } from "../../vendor/@dnd-kit/core/dist/core.esm.js";
1
+ import { jsx as t, jsxs as D } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { useSensors as J, useSensor as V, DndContext as tt, closestCenter as et, DragOverlay as ot, KeyboardSensor as rt, PointerSensor as nt } from "../../vendor/@dnd-kit/core/dist/core.esm.js";
4
4
  import { SortableContext as it, verticalListSortingStrategy as st, arrayMove as at, useSortable as lt } from "../../vendor/@dnd-kit/sortable/dist/sortable.esm.js";
5
5
  import { shorthands as m } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/index.js";
6
- import { SLOT_ATTR as h } from "../../packages/volt-runtime/dist/renderer/contract.js";
7
- import { mergeClasses as g } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
6
+ import { SLOT_ATTR as g } from "../../packages/volt-runtime/dist/renderer/contract.js";
7
+ import { mergeClasses as f } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
8
8
  import { makeVoltStyles as ct } from "../../styles/make-styles.js";
9
- import { spacingElement3 as z, grayA5 as dt, spacingElement1 as B, spacingElement2 as y, radiusMd as P, semSuccessLight as mt, semWarningLight as pt, semErrorLight as ut, spacingGroup2 as _, grayA12 as q, fontWeightSemibold as gt, leadingSm as V, textSm as j, grayA10 as ft, fontWeightMedium as ht, semAccentSolid as xt, accentA8 as vt, grayA11 as F, grayA8 as yt, leadingXs as bt, textXs as wt, grayA2 as Q, semSuccessSoftHover as St, semWarningSoftHover as It, semErrorSoftHover as Ct, semAccentSoft as Lt, semSuccessDefault as kt, semSuccessSoft as Dt, semWarningDefault as Tt, semWarningSoft as Wt, semErrorDefault as Et, semErrorSoft as Nt } from "../../tokens/index.js";
10
- const At = (l) => /* @__PURE__ */ W(
9
+ import { spacingElement3 as dt, grayA5 as ut, spacingElement1 as mt, spacingElement2 as pt, listItemPaddingY as G, listItemPaddingX as j, listItemGap as gt, radiusMd as B, semSuccessLight as ft, semWarningLight as ht, semErrorLight as xt, spacingGroup2 as F, grayA12 as X, fontWeightSemibold as vt, leadingSm as $, textSm as K, grayA10 as yt, fontWeightMedium as bt, semAccentSolid as wt, accentA8 as It, grayA11 as P, grayA8 as St, leadingXs as Lt, textXs as kt, listIndexPaddingX as _, listIndexMinWidth as Ct, grayA2 as q, semSuccessSoftHover as Dt, semWarningSoftHover as Tt, semErrorSoftHover as Wt, semAccentSoft as Et, semSuccessDefault as Nt, semSuccessSoft as At, semWarningDefault as Ot, semWarningSoft as Gt, semErrorDefault as Bt, semErrorSoft as Pt, listItemMinHeight as Rt } from "../../tokens/index.js";
10
+ const Ht = (n) => /* @__PURE__ */ D(
11
11
  "svg",
12
12
  {
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -16,7 +16,7 @@ const At = (l) => /* @__PURE__ */ W(
16
16
  viewBox: "0 0 24 24",
17
17
  fill: "currentColor",
18
18
  "aria-hidden": "true",
19
- ...l,
19
+ ...n,
20
20
  children: [
21
21
  /* @__PURE__ */ t("circle", { cx: "9", cy: "5", r: "1.5" }),
22
22
  /* @__PURE__ */ t("circle", { cx: "15", cy: "5", r: "1.5" }),
@@ -26,7 +26,7 @@ const At = (l) => /* @__PURE__ */ W(
26
26
  /* @__PURE__ */ t("circle", { cx: "15", cy: "19", r: "1.5" })
27
27
  ]
28
28
  }
29
- ), U = (l) => /* @__PURE__ */ W(
29
+ ), Q = (n) => /* @__PURE__ */ D(
30
30
  "svg",
31
31
  {
32
32
  xmlns: "http://www.w3.org/2000/svg",
@@ -37,14 +37,14 @@ const At = (l) => /* @__PURE__ */ W(
37
37
  strokeLinecap: "round",
38
38
  strokeLinejoin: "round",
39
39
  "aria-hidden": "true",
40
- ...l,
40
+ ...n,
41
41
  children: [
42
42
  /* @__PURE__ */ t("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }),
43
43
  /* @__PURE__ */ t("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
44
44
  /* @__PURE__ */ t("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
45
45
  ]
46
46
  }
47
- ), Ot = (l) => /* @__PURE__ */ W(
47
+ ), zt = (n) => /* @__PURE__ */ D(
48
48
  "svg",
49
49
  {
50
50
  xmlns: "http://www.w3.org/2000/svg",
@@ -55,13 +55,13 @@ const At = (l) => /* @__PURE__ */ W(
55
55
  strokeLinecap: "round",
56
56
  strokeLinejoin: "round",
57
57
  "aria-hidden": "true",
58
- ...l,
58
+ ...n,
59
59
  children: [
60
60
  /* @__PURE__ */ t("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
61
61
  /* @__PURE__ */ t("polyline", { points: "22 4 12 14.01 9 11.01" })
62
62
  ]
63
63
  }
64
- ), Rt = (l) => /* @__PURE__ */ t(
64
+ ), Mt = (n) => /* @__PURE__ */ t(
65
65
  "svg",
66
66
  {
67
67
  xmlns: "http://www.w3.org/2000/svg",
@@ -72,10 +72,10 @@ const At = (l) => /* @__PURE__ */ W(
72
72
  strokeLinecap: "round",
73
73
  strokeLinejoin: "round",
74
74
  "aria-hidden": "true",
75
- ...l,
75
+ ...n,
76
76
  children: /* @__PURE__ */ t("polyline", { points: "9 18 15 12 9 6" })
77
77
  }
78
- ), b = ct({
78
+ ), y = ct({
79
79
  list: {
80
80
  display: "flex",
81
81
  width: "100%",
@@ -85,41 +85,29 @@ const At = (l) => /* @__PURE__ */ W(
85
85
  ...m.padding(0),
86
86
  ...m.margin(0)
87
87
  },
88
- // ListItem base
88
+ // ListItem base — density-bound (DENSITY-SPEC.md §2.2, WP9B2A-ACCEPTANCE-LIST). One style, not
89
+ // a compact/relaxed pair: the three CSS tiers are resolved by [data-density] inheritance, so
90
+ // there is no longer a JS branch to pick between "compact" and "everything else" — normal
91
+ // resolves to the same values `itemRelaxed` used to hardcode, and an explicit `relaxed` is
92
+ // normalized to the DOM's canonical `data-density="normal"` before it ever reaches this class,
93
+ // so it resolves through the identical selector. Typography is unchanged across every tier.
89
94
  item: {
90
95
  position: "relative",
91
96
  display: "flex",
92
97
  width: "100%",
93
98
  alignItems: "center",
94
- ...m.borderRadius(P),
95
- color: q,
99
+ ...m.borderRadius(B),
100
+ color: X,
96
101
  transitionProperty: "color, background-color, border-color, text-decoration-color, fill, stroke",
97
102
  transitionDuration: "150ms",
98
103
  transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
104
+ minHeight: Rt,
105
+ ...m.gap(gt),
106
+ ...m.padding(G, j),
107
+ fontSize: K,
108
+ lineHeight: $,
99
109
  "& > svg": {
100
- flexShrink: 0
101
- }
102
- },
103
- // Density variants
104
- itemCompact: {
105
- minHeight: "2rem",
106
- ...m.gap(y),
107
- ...m.padding(B, y),
108
- fontSize: j,
109
- lineHeight: V,
110
- "& > svg": {
111
- width: "1rem",
112
- height: "1rem"
113
- }
114
- },
115
- itemRelaxed: {
116
- minHeight: "2.5rem",
117
- // v1 gap-3 is 0.75rem.
118
- ...m.gap(z),
119
- ...m.padding(y, z),
120
- fontSize: j,
121
- lineHeight: V,
122
- "& > svg": {
110
+ flexShrink: 0,
123
111
  width: "1rem",
124
112
  height: "1rem"
125
113
  }
@@ -127,42 +115,42 @@ const At = (l) => /* @__PURE__ */ W(
127
115
  // Status variants
128
116
  statusDefault: {},
129
117
  statusError: {
130
- backgroundColor: Nt,
131
- color: Et
118
+ backgroundColor: Pt,
119
+ color: Bt
132
120
  },
133
121
  statusWarning: {
134
- backgroundColor: Wt,
135
- color: Tt
122
+ backgroundColor: Gt,
123
+ color: Ot
136
124
  },
137
125
  statusSuccess: {
138
- backgroundColor: Dt,
139
- color: kt
126
+ backgroundColor: At,
127
+ color: Nt
140
128
  },
141
129
  // Striped variant (only neutral rows)
142
130
  stripedEven: {
143
131
  "&:nth-child(even)": {
144
- backgroundColor: Q
132
+ backgroundColor: q
145
133
  }
146
134
  },
147
135
  // Interactive hovers
148
136
  interactiveDefault: {
149
137
  ":hover": {
150
- backgroundColor: Lt
138
+ backgroundColor: Et
151
139
  }
152
140
  },
153
141
  interactiveError: {
154
142
  ":hover": {
155
- backgroundColor: Ct
143
+ backgroundColor: Wt
156
144
  }
157
145
  },
158
146
  interactiveWarning: {
159
147
  ":hover": {
160
- backgroundColor: It
148
+ backgroundColor: Tt
161
149
  }
162
150
  },
163
151
  interactiveSuccess: {
164
152
  ":hover": {
165
- backgroundColor: St
153
+ backgroundColor: Dt
166
154
  }
167
155
  },
168
156
  // Sortable modifiers
@@ -176,7 +164,12 @@ const At = (l) => /* @__PURE__ */ W(
176
164
  itemDragging: {
177
165
  opacity: 0.4
178
166
  },
179
- // Index gutter
167
+ // Index gutter — density-bound. The negative margins cancel the ITEM's own (now density-bound)
168
+ // padding to keep the index flush to the row edge at every tier; `calc(-1 * var(...))`
169
+ // (WP9B2A-ACCEPTANCE-LIST: "negative token expressions for that existing cancellation are
170
+ // authorized") tracks whichever tier is active without a separate JS branch, same reasoning as
171
+ // `item` above. `index-padding-x` is the one matrix completion this slice adds (DENSITY-SPEC.md
172
+ // §2.2): 6/8/8px — comfortable reuses the normal inset, no separate source value exists for it.
180
173
  indexBase: {
181
174
  display: "flex",
182
175
  flexShrink: 0,
@@ -184,28 +177,18 @@ const At = (l) => /* @__PURE__ */ W(
184
177
  alignItems: "center",
185
178
  justifyContent: "center",
186
179
  alignSelf: "stretch",
187
- borderTopLeftRadius: P,
188
- borderBottomLeftRadius: P,
189
- backgroundColor: Q,
180
+ borderTopLeftRadius: B,
181
+ borderBottomLeftRadius: B,
182
+ backgroundColor: q,
190
183
  textAlign: "center",
191
- color: F,
192
- fontVariantNumeric: "tabular-nums"
193
- },
194
- indexCompact: {
195
- marginTop: `-${B}`,
196
- marginBottom: `-${B}`,
197
- marginLeft: `-${y}`,
198
- minWidth: "1.5rem",
199
- paddingLeft: "0.375rem",
200
- paddingRight: "0.375rem"
201
- },
202
- indexRelaxed: {
203
- marginTop: `-${y}`,
204
- marginBottom: `-${y}`,
205
- marginLeft: "-0.75rem",
206
- minWidth: "1.75rem",
207
- paddingLeft: y,
208
- paddingRight: y
184
+ color: P,
185
+ fontVariantNumeric: "tabular-nums",
186
+ minWidth: Ct,
187
+ marginTop: `calc(-1 * ${G})`,
188
+ marginBottom: `calc(-1 * ${G})`,
189
+ marginLeft: `calc(-1 * ${j})`,
190
+ paddingLeft: _,
191
+ paddingRight: _
209
192
  },
210
193
  // Content
211
194
  content: {
@@ -215,7 +198,7 @@ const At = (l) => /* @__PURE__ */ W(
215
198
  flexShrink: 1,
216
199
  flexBasis: "0%",
217
200
  alignItems: "center",
218
- ...m.gap(y),
201
+ ...m.gap(pt),
219
202
  overflow: "hidden",
220
203
  textOverflow: "ellipsis",
221
204
  whiteSpace: "nowrap",
@@ -232,7 +215,7 @@ const At = (l) => /* @__PURE__ */ W(
232
215
  display: "flex",
233
216
  flexShrink: 0,
234
217
  alignItems: "center",
235
- ...m.gap(B)
218
+ ...m.gap(mt)
236
219
  },
237
220
  // Text
238
221
  text: {
@@ -249,9 +232,9 @@ const At = (l) => /* @__PURE__ */ W(
249
232
  overflow: "hidden",
250
233
  textOverflow: "ellipsis",
251
234
  whiteSpace: "nowrap",
252
- fontSize: wt,
253
- lineHeight: bt,
254
- color: F
235
+ fontSize: kt,
236
+ lineHeight: Lt,
237
+ color: P
255
238
  },
256
239
  // Drag handle button
257
240
  dragHandle: {
@@ -261,12 +244,12 @@ const At = (l) => /* @__PURE__ */ W(
261
244
  flexShrink: 0,
262
245
  cursor: "grab",
263
246
  alignItems: "center",
264
- color: yt,
247
+ color: St,
265
248
  backgroundColor: "transparent",
266
249
  ...m.border("0"),
267
250
  ...m.padding(0),
268
251
  ":hover": {
269
- color: F
252
+ color: P
270
253
  },
271
254
  ":active": {
272
255
  cursor: "grabbing"
@@ -275,7 +258,7 @@ const At = (l) => /* @__PURE__ */ W(
275
258
  outlineWidth: "2px",
276
259
  outlineStyle: "solid",
277
260
  outlineOffset: "2px",
278
- outlineColor: vt
261
+ outlineColor: It
279
262
  },
280
263
  "& svg": {
281
264
  width: "1rem",
@@ -292,7 +275,7 @@ const At = (l) => /* @__PURE__ */ W(
292
275
  height: "0.125rem",
293
276
  transformOrigin: "center",
294
277
  ...m.borderRadius("9999px"),
295
- backgroundColor: xt,
278
+ backgroundColor: wt,
296
279
  animationName: {
297
280
  from: {
298
281
  transform: "scaleX(0)",
@@ -317,7 +300,7 @@ const At = (l) => /* @__PURE__ */ W(
317
300
  transformOrigin: "center",
318
301
  transform: "scale(0.95)",
319
302
  cursor: "grabbing",
320
- ...m.border("1px", "solid", dt),
303
+ ...m.border("1px", "solid", ut),
321
304
  backgroundColor: "rgb(255 255 255 / 55%)",
322
305
  boxShadow: "0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",
323
306
  backdropFilter: "blur(12px)",
@@ -338,7 +321,7 @@ const At = (l) => /* @__PURE__ */ W(
338
321
  groupTrigger: {
339
322
  cursor: "pointer",
340
323
  textAlign: "left",
341
- fontWeight: ht,
324
+ fontWeight: bt,
342
325
  backgroundColor: "transparent",
343
326
  ...m.border("0")
344
327
  },
@@ -346,7 +329,7 @@ const At = (l) => /* @__PURE__ */ W(
346
329
  width: "1rem",
347
330
  height: "1rem",
348
331
  flexShrink: 0,
349
- color: ft,
332
+ color: yt,
350
333
  transitionProperty: "transform",
351
334
  transitionDuration: "150ms",
352
335
  transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)"
@@ -364,20 +347,20 @@ const At = (l) => /* @__PURE__ */ W(
364
347
  whiteSpace: "nowrap"
365
348
  },
366
349
  standaloneGroupLabel: {
367
- marginTop: _,
350
+ marginTop: F,
368
351
  display: "block",
369
352
  listStyleType: "none",
370
- ...m.padding("0.375rem", z),
371
- fontSize: j,
372
- lineHeight: V,
373
- fontWeight: gt,
374
- color: q,
353
+ ...m.padding("0.375rem", dt),
354
+ fontSize: K,
355
+ lineHeight: $,
356
+ fontWeight: vt,
357
+ color: X,
375
358
  "&:first-child": {
376
359
  marginTop: 0
377
360
  }
378
361
  },
379
362
  groupContentList: {
380
- paddingLeft: _
363
+ paddingLeft: F
381
364
  },
382
365
  collapseWrapper: {
383
366
  display: "grid",
@@ -401,201 +384,197 @@ const At = (l) => /* @__PURE__ */ W(
401
384
  width: "1rem",
402
385
  height: "1rem",
403
386
  flexShrink: 0,
404
- color: ut
387
+ color: xt
405
388
  },
406
389
  statusIconWarning: {
407
390
  width: "1rem",
408
391
  height: "1rem",
409
392
  flexShrink: 0,
410
- color: pt
393
+ color: ht
411
394
  },
412
395
  statusIconSuccess: {
413
396
  width: "1rem",
414
397
  height: "1rem",
415
398
  flexShrink: 0,
416
- color: mt
399
+ color: ft
417
400
  }
418
- }), Bt = ({ status: l }) => {
419
- const r = b();
420
- return l === "error" ? /* @__PURE__ */ t(U, { className: r.statusIconError }) : l === "warning" ? /* @__PURE__ */ t(U, { className: r.statusIconWarning }) : l === "success" ? /* @__PURE__ */ t(Ot, { className: r.statusIconSuccess }) : null;
421
- }, J = s.createContext({
422
- density: "relaxed",
401
+ }), Vt = ({ status: n }) => {
402
+ const o = y();
403
+ return n === "error" ? /* @__PURE__ */ t(Q, { className: o.statusIconError }) : n === "warning" ? /* @__PURE__ */ t(Q, { className: o.statusIconWarning }) : n === "success" ? /* @__PURE__ */ t(zt, { className: o.statusIconSuccess }) : null;
404
+ }, Y = i.createContext({
423
405
  striped: !1,
424
406
  showIndex: !1,
425
407
  sortable: !1
426
- }), $ = () => s.useContext(J), Kt = s.forwardRef(function({
427
- className: r,
428
- density: a = "relaxed",
408
+ }), Z = () => i.useContext(Y), jt = (n) => n === void 0 ? void 0 : n === "relaxed" ? "normal" : n, Jt = i.forwardRef(function({
409
+ className: o,
410
+ density: l,
429
411
  striped: e = !1,
430
412
  showIndex: c = !1,
431
- sortable: n = !1,
432
- onReorder: i,
433
- children: f,
434
- ...x
413
+ sortable: s = !1,
414
+ onReorder: r,
415
+ children: x,
416
+ ...b
435
417
  }, w) {
436
- const v = b(), p = s.Children.toArray(f).filter(
437
- s.isValidElement
438
- ), I = p.map(
439
- (d, T) => d.type === Z ? s.cloneElement(d, { index: T }) : d
440
- ), C = p.filter((d) => d.type === Z), u = C.map((d) => d.props.value).filter((d) => typeof d == "string"), [o, L] = s.useState(null), G = o ? u.indexOf(o) : -1, k = o != null ? C.find((d) => d.props.value === o) : void 0, D = Y(
441
- K(nt, { activationConstraint: { distance: 3 } }),
442
- K(ot)
443
- ), H = (d) => {
444
- L(d.active.id);
445
- }, A = (d) => {
446
- L(null);
447
- const { active: T, over: N } = d;
448
- if (!N || T.id === N.id) return;
449
- const O = u.indexOf(T.id), R = u.indexOf(N.id);
450
- O === -1 || R === -1 || i == null || i(at(u, O, R));
451
- }, E = /* @__PURE__ */ t(
418
+ const v = y(), u = jt(l), I = i.Children.toArray(x).filter(
419
+ i.isValidElement
420
+ ), T = I.map(
421
+ (d, C) => d.type === U ? i.cloneElement(d, { index: C }) : d
422
+ ), h = I.filter((d) => d.type === U), a = h.map((d) => d.props.value).filter((d) => typeof d == "string"), [S, W] = i.useState(null), L = S ? a.indexOf(S) : -1, k = S != null ? h.find((d) => d.props.value === S) : void 0, E = J(
423
+ V(nt, { activationConstraint: { distance: 3 } }),
424
+ V(rt)
425
+ ), N = (d) => {
426
+ W(d.active.id);
427
+ }, O = (d) => {
428
+ W(null);
429
+ const { active: C, over: p } = d;
430
+ if (!p || C.id === p.id) return;
431
+ const z = a.indexOf(C.id), M = a.indexOf(p.id);
432
+ z === -1 || M === -1 || r == null || r(at(a, z, M));
433
+ }, A = /* @__PURE__ */ t(
452
434
  "ol",
453
435
  {
454
436
  ref: w,
455
437
  "data-slot": "list",
456
- [h]: "list",
457
- "data-density": a,
458
- className: g(v.list, r),
459
- ...x,
460
- children: I
438
+ [g]: "list",
439
+ ...u !== void 0 ? { "data-density": u } : {},
440
+ className: f(v.list, o),
441
+ ...b,
442
+ children: T
461
443
  }
462
444
  );
463
- return /* @__PURE__ */ t(J.Provider, { value: { density: a, striped: e, showIndex: c, sortable: n }, children: n ? /* @__PURE__ */ W(
445
+ return /* @__PURE__ */ t(Y.Provider, { value: { striped: e, showIndex: c, sortable: s }, children: s ? /* @__PURE__ */ D(
464
446
  tt,
465
447
  {
466
- sensors: D,
448
+ sensors: E,
467
449
  collisionDetection: et,
468
- onDragStart: H,
469
- onDragEnd: A,
470
- onDragCancel: () => L(null),
450
+ onDragStart: N,
451
+ onDragEnd: O,
452
+ onDragCancel: () => W(null),
471
453
  children: [
472
454
  /* @__PURE__ */ t(
473
455
  it,
474
456
  {
475
- items: u,
457
+ items: a,
476
458
  strategy: st,
477
- children: E
459
+ children: A
478
460
  }
479
461
  ),
480
- /* @__PURE__ */ t(rt, { children: k ? /* @__PURE__ */ t(
481
- M,
462
+ /* @__PURE__ */ t(ot, { children: k ? /* @__PURE__ */ t(
463
+ R,
482
464
  {
483
465
  value: k.props.value,
484
466
  status: k.props.status,
485
- index: G,
467
+ index: L,
486
468
  className: v.dragOverlayItem,
469
+ ...u !== void 0 ? { "data-density": u } : {},
487
470
  children: k.props.children
488
471
  }
489
472
  ) : null })
490
473
  ]
491
474
  }
492
- ) : E });
493
- }), Gt = s.forwardRef(function({ className: r, children: a, ...e }, c) {
494
- const n = b();
475
+ ) : A });
476
+ }), Ft = i.forwardRef(function({ className: o, children: l, ...e }, c) {
477
+ const s = y();
495
478
  return /* @__PURE__ */ t(
496
479
  "span",
497
480
  {
498
481
  ref: c,
499
482
  "data-slot": "list-item-actions",
500
- [h]: "list-item-actions",
501
- onPointerDown: (i) => i.stopPropagation(),
502
- className: g(n.actions, r),
483
+ [g]: "list-item-actions",
484
+ onPointerDown: (r) => r.stopPropagation(),
485
+ className: f(s.actions, o),
503
486
  ...e,
504
- children: a
487
+ children: l
505
488
  }
506
489
  );
507
- }), _t = s.forwardRef(function({ className: r, ...a }, e) {
508
- const c = b();
490
+ }), te = i.forwardRef(function({ className: o, ...l }, e) {
491
+ const c = y();
509
492
  return /* @__PURE__ */ t(
510
493
  "span",
511
494
  {
512
495
  ref: e,
513
496
  "data-slot": "list-item-text",
514
- [h]: "list-item-text",
515
- className: g(c.text, r),
516
- ...a
497
+ [g]: "list-item-text",
498
+ className: f(c.text, o),
499
+ ...l
517
500
  }
518
501
  );
519
- }), qt = s.forwardRef(function({ className: r, ...a }, e) {
520
- const c = b();
502
+ }), ee = i.forwardRef(function({ className: o, ...l }, e) {
503
+ const c = y();
521
504
  return /* @__PURE__ */ t(
522
505
  "span",
523
506
  {
524
507
  ref: e,
525
508
  "data-slot": "list-item-description",
526
- [h]: "list-item-description",
527
- className: g(c.description, r),
528
- ...a
509
+ [g]: "list-item-description",
510
+ className: f(c.description, o),
511
+ ...l
529
512
  }
530
513
  );
531
- }), M = s.forwardRef(
514
+ }), R = i.forwardRef(
532
515
  function({
533
- className: r,
534
- value: a,
516
+ className: o,
517
+ value: l,
535
518
  status: e = "default",
536
519
  index: c,
537
- children: n,
538
- setNodeRef: i,
539
- setActivatorNodeRef: f,
540
- style: x,
520
+ children: s,
521
+ setNodeRef: r,
522
+ setActivatorNodeRef: x,
523
+ style: b,
541
524
  isDragging: w,
542
525
  dropEdge: v,
543
- listeners: p,
526
+ listeners: u,
544
527
  attributes: I,
545
- ...C
546
- }, u) {
547
- const o = b(), { density: L, striped: G, showIndex: k, sortable: D } = $(), H = D && !w, A = s.Children.toArray(n), E = A.find(
548
- (S) => s.isValidElement(S) && S.type === Gt
549
- ), d = A.filter((S) => S !== E), T = s.useCallback(
550
- (S) => {
551
- i == null || i(S), typeof u == "function" ? u(S) : u && (u.current = S);
528
+ ...T
529
+ }, h) {
530
+ const a = y(), { striped: S, showIndex: W, sortable: L } = Z(), k = L && !w, E = i.Children.toArray(s), N = E.find(
531
+ (p) => i.isValidElement(p) && p.type === Ft
532
+ ), O = E.filter((p) => p !== N), A = i.useCallback(
533
+ (p) => {
534
+ r == null || r(p), typeof h == "function" ? h(p) : h && (h.current = p);
552
535
  },
553
- [i, u]
554
- ), N = e === "error" ? o.statusError : e === "warning" ? o.statusWarning : e === "success" ? o.statusSuccess : o.statusDefault, O = H ? e === "error" ? o.interactiveError : e === "warning" ? o.interactiveWarning : e === "success" ? o.interactiveSuccess : o.interactiveDefault : void 0, R = L === "compact" ? o.itemCompact : o.itemRelaxed;
555
- return /* @__PURE__ */ W(
536
+ [r, h]
537
+ ), d = e === "error" ? a.statusError : e === "warning" ? a.statusWarning : e === "success" ? a.statusSuccess : a.statusDefault, C = k ? e === "error" ? a.interactiveError : e === "warning" ? a.interactiveWarning : e === "success" ? a.interactiveSuccess : a.interactiveDefault : void 0;
538
+ return /* @__PURE__ */ D(
556
539
  "li",
557
540
  {
558
- ref: T,
559
- style: x,
541
+ ref: A,
542
+ style: b,
560
543
  "data-slot": "list-item",
561
- [h]: "list-item",
544
+ [g]: "list-item",
562
545
  "data-status": e,
563
- "data-value": a,
564
- onPointerDown: D ? p == null ? void 0 : p.onPointerDown : void 0,
565
- className: g(
566
- o.item,
567
- R,
568
- N,
569
- G && e === "default" && o.stripedEven,
570
- O,
571
- D && o.sortableItem,
572
- w && o.itemDragging,
573
- r
546
+ "data-value": l,
547
+ onPointerDown: L ? u == null ? void 0 : u.onPointerDown : void 0,
548
+ className: f(
549
+ a.item,
550
+ d,
551
+ S && e === "default" && a.stripedEven,
552
+ C,
553
+ L && a.sortableItem,
554
+ w && a.itemDragging,
555
+ o
574
556
  ),
575
- ...C,
557
+ ...T,
576
558
  children: [
577
559
  v && /* @__PURE__ */ t(
578
560
  "span",
579
561
  {
580
562
  "data-slot": "list-drop-indicator",
581
- [h]: "list-drop-indicator",
563
+ [g]: "list-drop-indicator",
582
564
  "aria-hidden": "true",
583
- className: g(
584
- o.dropIndicator,
585
- v === "top" ? o.dropIndicatorTop : o.dropIndicatorBottom
565
+ className: f(
566
+ a.dropIndicator,
567
+ v === "top" ? a.dropIndicatorTop : a.dropIndicatorBottom
586
568
  )
587
569
  }
588
570
  ),
589
- k && /* @__PURE__ */ t(
571
+ W && /* @__PURE__ */ t(
590
572
  "span",
591
573
  {
592
574
  "data-slot": "list-item-index",
593
- [h]: "list-item-index",
575
+ [g]: "list-item-index",
594
576
  "aria-hidden": "true",
595
- className: g(
596
- o.indexBase,
597
- L === "compact" ? o.indexCompact : o.indexRelaxed
598
- ),
577
+ className: a.indexBase,
599
578
  children: (c ?? 0) + 1
600
579
  }
601
580
  ),
@@ -603,172 +582,167 @@ const At = (l) => /* @__PURE__ */ W(
603
582
  "span",
604
583
  {
605
584
  "data-slot": "list-item-content",
606
- [h]: "list-item-content",
607
- className: o.content,
608
- children: d
585
+ [g]: "list-item-content",
586
+ className: a.content,
587
+ children: O
609
588
  }
610
589
  ),
611
- /* @__PURE__ */ t(Bt, { status: e }),
612
- E,
613
- D && /* @__PURE__ */ t(
590
+ /* @__PURE__ */ t(Vt, { status: e }),
591
+ N,
592
+ L && /* @__PURE__ */ t(
614
593
  "button",
615
594
  {
616
- ref: f,
595
+ ref: x,
617
596
  type: "button",
618
- "aria-label": `Drag to reorder ${a ?? "item"}`,
619
- className: o.dragHandle,
597
+ "aria-label": `Drag to reorder ${l ?? "item"}`,
598
+ className: a.dragHandle,
620
599
  ...I,
621
- onKeyDown: p == null ? void 0 : p.onKeyDown,
622
- children: /* @__PURE__ */ t(At, {})
600
+ onKeyDown: u == null ? void 0 : u.onKeyDown,
601
+ children: /* @__PURE__ */ t(Ht, {})
623
602
  }
624
603
  )
625
604
  ]
626
605
  }
627
606
  );
628
607
  }
629
- ), Ht = s.forwardRef(
630
- function(r, a) {
631
- const e = s.useId();
632
- process.env.NODE_ENV !== "production" && r.value === void 0 && console.warn(
608
+ ), Xt = i.forwardRef(
609
+ function(o, l) {
610
+ const e = i.useId();
611
+ process.env.NODE_ENV !== "production" && o.value === void 0 && console.warn(
633
612
  "List: a sortable `ListItem` is missing a `value`. Give each sortable item a unique `value` so it can be reordered — items without one are excluded from `onReorder`."
634
613
  );
635
614
  const {
636
615
  attributes: c,
637
- listeners: n,
638
- setNodeRef: i,
639
- setActivatorNodeRef: f,
640
- isDragging: x,
616
+ listeners: s,
617
+ setNodeRef: r,
618
+ setActivatorNodeRef: x,
619
+ isDragging: b,
641
620
  isOver: w,
642
621
  activeIndex: v,
643
- overIndex: p
622
+ overIndex: u
644
623
  } = lt({
645
- id: r.value ?? e,
624
+ id: o.value ?? e,
646
625
  animateLayoutChanges: () => !1
647
- }), I = w && !x && v !== -1 ? v < p ? "bottom" : "top" : null;
626
+ }), I = w && !b && v !== -1 ? v < u ? "bottom" : "top" : null;
648
627
  return /* @__PURE__ */ t(
649
- M,
628
+ R,
650
629
  {
651
- ref: a,
652
- ...r,
653
- setNodeRef: i,
654
- setActivatorNodeRef: f,
655
- isDragging: x,
630
+ ref: l,
631
+ ...o,
632
+ setNodeRef: r,
633
+ setActivatorNodeRef: x,
634
+ isDragging: b,
656
635
  dropEdge: I,
657
- listeners: n,
636
+ listeners: s,
658
637
  attributes: c
659
638
  }
660
639
  );
661
640
  }
662
- ), Z = s.forwardRef(
663
- function(r, a) {
664
- const { sortable: e } = $();
665
- return e ? /* @__PURE__ */ t(Ht, { ref: a, ...r }) : /* @__PURE__ */ t(M, { ref: a, ...r });
641
+ ), U = i.forwardRef(
642
+ function(o, l) {
643
+ const { sortable: e } = Z();
644
+ return e ? /* @__PURE__ */ t(Xt, { ref: l, ...o }) : /* @__PURE__ */ t(R, { ref: l, ...o });
666
645
  }
667
- ), X = s.createContext(null), Qt = s.forwardRef(
646
+ ), H = i.createContext(null), oe = i.forwardRef(
668
647
  function({
669
- open: r,
670
- defaultOpen: a = !1,
648
+ open: o,
649
+ defaultOpen: l = !1,
671
650
  onOpenChange: e,
672
651
  className: c,
673
- children: n,
674
- ...i
675
- }, f) {
676
- const x = b(), [w, v] = s.useState(a), p = r ?? w, I = s.useId(), C = (u) => {
677
- r === void 0 && v(u), e == null || e(u);
652
+ children: s,
653
+ ...r
654
+ }, x) {
655
+ const b = y(), [w, v] = i.useState(l), u = o ?? w, I = i.useId(), T = (h) => {
656
+ o === void 0 && v(h), e == null || e(h);
678
657
  };
679
- return /* @__PURE__ */ t(X.Provider, { value: { open: p, setOpen: C, contentId: I }, children: /* @__PURE__ */ t(
658
+ return /* @__PURE__ */ t(H.Provider, { value: { open: u, setOpen: T, contentId: I }, children: /* @__PURE__ */ t(
680
659
  "li",
681
660
  {
682
- ref: f,
661
+ ref: x,
683
662
  "data-slot": "list-group",
684
- [h]: "list-group",
685
- "data-state": p ? "open" : "closed",
686
- className: g(x.group, c),
687
- ...i,
688
- children: n
663
+ [g]: "list-group",
664
+ "data-state": u ? "open" : "closed",
665
+ className: f(b.group, c),
666
+ ...r,
667
+ children: s
689
668
  }
690
669
  ) });
691
670
  }
692
- ), Ut = s.forwardRef(function({ className: r, children: a, ...e }, c) {
693
- const n = b(), i = s.useContext(X), { density: f } = $();
694
- if (i) {
695
- const x = f === "compact" ? n.itemCompact : n.itemRelaxed;
696
- return /* @__PURE__ */ W(
697
- "button",
698
- {
699
- ref: c,
700
- type: "button",
701
- "data-slot": "list-group-trigger",
702
- [h]: "list-group-trigger",
703
- "aria-expanded": i.open,
704
- "aria-controls": i.contentId,
705
- onClick: () => i.setOpen(!i.open),
706
- className: g(
707
- n.item,
708
- x,
709
- n.interactiveDefault,
710
- n.groupTrigger,
711
- r
671
+ ), re = i.forwardRef(function({ className: o, children: l, ...e }, c) {
672
+ const s = y(), r = i.useContext(H);
673
+ return r ? /* @__PURE__ */ D(
674
+ "button",
675
+ {
676
+ ref: c,
677
+ type: "button",
678
+ "data-slot": "list-group-trigger",
679
+ [g]: "list-group-trigger",
680
+ "aria-expanded": r.open,
681
+ "aria-controls": r.contentId,
682
+ onClick: () => r.setOpen(!r.open),
683
+ className: f(
684
+ s.item,
685
+ s.interactiveDefault,
686
+ s.groupTrigger,
687
+ o
688
+ ),
689
+ ...e,
690
+ children: [
691
+ /* @__PURE__ */ t(
692
+ Mt,
693
+ {
694
+ className: f(
695
+ s.groupChevron,
696
+ r.open && s.groupChevronOpen
697
+ )
698
+ }
712
699
  ),
713
- ...e,
714
- children: [
715
- /* @__PURE__ */ t(
716
- Rt,
717
- {
718
- className: g(
719
- n.groupChevron,
720
- i.open && n.groupChevronOpen
721
- )
722
- }
723
- ),
724
- /* @__PURE__ */ t("span", { className: n.groupTriggerText, children: a })
725
- ]
726
- }
727
- );
728
- }
729
- return /* @__PURE__ */ t(
700
+ /* @__PURE__ */ t("span", { className: s.groupTriggerText, children: l })
701
+ ]
702
+ }
703
+ ) : /* @__PURE__ */ t(
730
704
  "li",
731
705
  {
732
706
  ref: c,
733
707
  "data-slot": "list-group-label",
734
- [h]: "list-group-label",
735
- className: g(n.standaloneGroupLabel, r),
736
- children: a
708
+ [g]: "list-group-label",
709
+ className: f(s.standaloneGroupLabel, o),
710
+ children: l
737
711
  }
738
712
  );
739
- }), Zt = s.forwardRef(function({ className: r, children: a, ...e }, c) {
740
- const n = b(), i = s.useContext(X), f = /* @__PURE__ */ t(
713
+ }), ne = i.forwardRef(function({ className: o, children: l, ...e }, c) {
714
+ const s = y(), r = i.useContext(H), x = /* @__PURE__ */ t(
741
715
  "ul",
742
716
  {
743
717
  ref: c,
744
718
  "data-slot": "list-group-content",
745
- [h]: "list-group-content",
746
- className: g(n.list, n.groupContentList, r),
719
+ [g]: "list-group-content",
720
+ className: f(s.list, s.groupContentList, o),
747
721
  ...e,
748
- children: a
722
+ children: l
749
723
  }
750
724
  );
751
- return i ? /* @__PURE__ */ t(
725
+ return r ? /* @__PURE__ */ t(
752
726
  "div",
753
727
  {
754
- id: i.contentId,
755
- "data-state": i.open ? "open" : "closed",
756
- className: g(
757
- n.collapseWrapper,
758
- i.open && n.collapseWrapperOpen
728
+ id: r.contentId,
729
+ "data-state": r.open ? "open" : "closed",
730
+ className: f(
731
+ s.collapseWrapper,
732
+ r.open && s.collapseWrapperOpen
759
733
  ),
760
- children: /* @__PURE__ */ t("div", { className: n.collapseInner, children: f })
734
+ children: /* @__PURE__ */ t("div", { className: s.collapseInner, children: x })
761
735
  }
762
- ) : f;
736
+ ) : x;
763
737
  });
764
738
  export {
765
- Kt as List,
766
- Qt as ListGroup,
767
- Zt as ListGroupContent,
768
- Ut as ListGroupLabel,
769
- Z as ListItem,
770
- Gt as ListItemActions,
771
- qt as ListItemDescription,
772
- _t as ListItemText
739
+ Jt as List,
740
+ oe as ListGroup,
741
+ ne as ListGroupContent,
742
+ re as ListGroupLabel,
743
+ U as ListItem,
744
+ Ft as ListItemActions,
745
+ ee as ListItemDescription,
746
+ te as ListItemText
773
747
  };
774
748
  //# sourceMappingURL=list.js.map