@blakesteve/roster 5.7.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +169 -5
  2. package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
  3. package/dist/components/atoms/Avatar/Avatar.d.ts +4 -0
  4. package/dist/components/atoms/Avatar/Avatar.js +1 -1
  5. package/dist/components/atoms/AvatarStrip/AvatarStrip.cjs +1 -1
  6. package/dist/components/atoms/AvatarStrip/AvatarStrip.d.ts +10 -1
  7. package/dist/components/atoms/AvatarStrip/AvatarStrip.js +34 -30
  8. package/dist/components/atoms/Button/button-variants.cjs +1 -1
  9. package/dist/components/atoms/Button/button-variants.js +5 -3
  10. package/dist/components/atoms/Eyebrow/eyebrow-variants.cjs +1 -1
  11. package/dist/components/atoms/Eyebrow/eyebrow-variants.js +8 -4
  12. package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
  13. package/dist/components/atoms/MultiSelect/MultiSelect.d.ts +3 -1
  14. package/dist/components/atoms/MultiSelect/MultiSelect.js +87 -89
  15. package/dist/components/atoms/Progress/Progress.cjs +1 -1
  16. package/dist/components/atoms/Progress/Progress.d.ts +1 -0
  17. package/dist/components/atoms/Progress/Progress.js +28 -27
  18. package/dist/components/atoms/Stat/Stat.cjs +1 -1
  19. package/dist/components/atoms/Stat/Stat.js +5 -5
  20. package/dist/components/atoms/Stat/stat-variants.cjs +1 -1
  21. package/dist/components/atoms/Stat/stat-variants.js +10 -8
  22. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.cjs +1 -1
  23. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +10 -1
  24. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +31 -29
  25. package/dist/components/molecules/CallToAction/CallToAction.cjs +1 -1
  26. package/dist/components/molecules/CallToAction/CallToAction.d.ts +8 -1
  27. package/dist/components/molecules/CallToAction/CallToAction.js +34 -29
  28. package/dist/components/molecules/Carousel/Carousel.cjs +1 -1
  29. package/dist/components/molecules/Carousel/Carousel.d.ts +7 -0
  30. package/dist/components/molecules/Carousel/Carousel.js +155 -155
  31. package/dist/components/molecules/ErrorState/ErrorState.cjs +1 -1
  32. package/dist/components/molecules/ErrorState/ErrorState.d.ts +8 -1
  33. package/dist/components/molecules/ErrorState/ErrorState.js +44 -39
  34. package/dist/components/molecules/FileUpload/FileUpload.cjs +1 -1
  35. package/dist/components/molecules/FileUpload/FileUpload.js +23 -22
  36. package/dist/components/molecules/MediaPreview/MediaPreview.cjs +1 -1
  37. package/dist/components/molecules/MediaPreview/MediaPreview.d.ts +3 -1
  38. package/dist/components/molecules/MediaPreview/MediaPreview.js +13 -12
  39. package/dist/components/molecules/Menu/Menu.cjs +1 -0
  40. package/dist/components/molecules/Menu/Menu.d.ts +169 -0
  41. package/dist/components/molecules/Menu/Menu.js +577 -0
  42. package/dist/components/molecules/Menu/menu-typeahead.cjs +1 -0
  43. package/dist/components/molecules/Menu/menu-typeahead.d.ts +7 -0
  44. package/dist/components/molecules/Menu/menu-typeahead.js +13 -0
  45. package/dist/components/molecules/Pagination/Pagination.cjs +1 -1
  46. package/dist/components/molecules/Pagination/Pagination.d.ts +1 -0
  47. package/dist/components/molecules/Pagination/Pagination.js +47 -46
  48. package/dist/components/molecules/ProgressField/ProgressField.d.ts +1 -0
  49. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
  50. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +2 -2
  51. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +17 -17
  52. package/dist/components/molecules/StepProgress/StepProgress.cjs +1 -1
  53. package/dist/components/molecules/StepProgress/StepProgress.d.ts +1 -0
  54. package/dist/components/molecules/StepProgress/StepProgress.js +9 -8
  55. package/dist/components/organisms/Countdown/Countdown.cjs +1 -1
  56. package/dist/components/organisms/Countdown/Countdown.d.ts +13 -0
  57. package/dist/components/organisms/Countdown/Countdown.js +54 -47
  58. package/dist/components/organisms/DataTable/DataTable.cjs +1 -1
  59. package/dist/components/organisms/DataTable/DataTable.d.ts +5 -3
  60. package/dist/components/organisms/DataTable/DataTable.js +27 -26
  61. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  62. package/dist/components/organisms/Dialog/Dialog.d.ts +8 -1
  63. package/dist/components/organisms/Dialog/Dialog.js +25 -23
  64. package/dist/components/organisms/Footer/Footer.cjs +1 -1
  65. package/dist/components/organisms/Footer/Footer.d.ts +9 -0
  66. package/dist/components/organisms/Footer/Footer.js +21 -23
  67. package/dist/components/organisms/ModerationQueue/ModerationQueue.cjs +1 -1
  68. package/dist/components/organisms/ModerationQueue/ModerationQueue.d.ts +40 -1
  69. package/dist/components/organisms/ModerationQueue/ModerationQueue.js +262 -237
  70. package/dist/components/organisms/ModerationQueue/QueueEditDialog.cjs +1 -1
  71. package/dist/components/organisms/ModerationQueue/QueueEditDialog.d.ts +1 -1
  72. package/dist/components/organisms/ModerationQueue/QueueEditDialog.js +23 -21
  73. package/dist/components/organisms/ModerationQueue/QueueEditSheet.cjs +1 -1
  74. package/dist/components/organisms/ModerationQueue/QueueEditSheet.d.ts +1 -1
  75. package/dist/components/organisms/ModerationQueue/QueueEditSheet.js +22 -20
  76. package/dist/components/organisms/ModerationQueue/queue-actions.d.ts +29 -10
  77. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  78. package/dist/components/organisms/Navbar/Navbar.d.ts +39 -4
  79. package/dist/components/organisms/Navbar/Navbar.js +297 -301
  80. package/dist/components/organisms/Navbar/navbar-variants.cjs +1 -1
  81. package/dist/components/organisms/Navbar/navbar-variants.js +4 -2
  82. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  83. package/dist/components/organisms/Sheet/Sheet.d.ts +8 -1
  84. package/dist/components/organisms/Sheet/Sheet.js +65 -63
  85. package/dist/index.d.ts +1 -0
  86. package/dist/lib/labels.cjs +1 -0
  87. package/dist/lib/labels.d.ts +7 -0
  88. package/dist/lib/labels.js +12 -0
  89. package/dist/meta.json +3 -3
  90. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +7 -7
  91. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
  92. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +5 -5
  93. package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js +6 -6
  94. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.cjs +1 -1
  95. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +52 -61
  96. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +6 -6
  97. package/dist/roster.cjs +1 -1
  98. package/dist/roster.css +1 -1
  99. package/dist/roster.js +127 -116
  100. package/package.json +2 -1
  101. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.cjs +0 -1
  102. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +0 -21
  103. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.cjs +0 -1
  104. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +0 -120
  105. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.cjs +0 -1
  106. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.js +0 -197
@@ -1,65 +1,66 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
3
- import H, { Fragment as V } from "react";
4
- import { Description as W } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Field as Y } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
- import { Label as C } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
- import { Listbox as K, ListboxButton as X, ListboxOptions as Z, ListboxOption as q } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
- import { Transition as G } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
- import { FontAwesomeIcon as _ } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
- import { faChevronDown as J, faXmark as Q } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
11
- import { cn as s } from "../../../lib/utils.js";
12
- import { isFieldInvalid as z, withoutInvalidProps as tt } from "../../../internal/field-invalid.js";
13
- import { selectTriggerVariants as rt } from "../Select/select-variants.js";
14
- import { Chip as T } from "../Chip/Chip.js";
15
- import { PopupOption as et } from "../../../internal/PopupOption.js";
16
- import { useDarkScope as st, POPUP_ANCHOR as nt, POPUP_WIDTH_OF_BUTTON as ot, POPUP_PANEL as at, popupInDarkPalette as it } from "../../../internal/popup.js";
17
- const It = ({
2
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
3
+ import V, { Fragment as W } from "react";
4
+ import { Description as Y } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
+ import { Field as C } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
+ import { Label as K } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
+ import { Listbox as X, ListboxButton as Z, ListboxOptions as q, ListboxOption as G } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
+ import { Transition as J } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
+ import { FontAwesomeIcon as T } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
+ import { faChevronDown as Q, faXmark as z } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
11
+ import { cn as n } from "../../../lib/utils.js";
12
+ import { isFieldInvalid as tt, withoutInvalidProps as rt } from "../../../internal/field-invalid.js";
13
+ import { selectTriggerVariants as et } from "../Select/select-variants.js";
14
+ import { Chip as F } from "../Chip/Chip.js";
15
+ import { PopupOption as st } from "../../../internal/PopupOption.js";
16
+ import { useDarkScope as nt, POPUP_ANCHOR as ot, POPUP_WIDTH_OF_BUTTON as it, POPUP_PANEL as at, popupInDarkPalette as lt } from "../../../internal/popup.js";
17
+ const Pt = ({
18
18
  options: u,
19
- value: n,
19
+ value: o,
20
20
  onChange: p,
21
21
  placeholder: f = "Select options",
22
- disabled: i = !1,
22
+ disabled: l = !1,
23
23
  variant: v,
24
- size: o,
25
- error: F,
26
- className: L,
27
- triggerClassName: R,
28
- optionsClassName: D,
24
+ size: i,
25
+ error: R,
26
+ className: D,
27
+ triggerClassName: L,
28
+ optionsClassName: j,
29
29
  helperText: x,
30
30
  errorMessage: h,
31
31
  label: b,
32
- display: m = "chips",
32
+ display: c = "chips",
33
33
  maxChips: g,
34
34
  clearable: N = !1,
35
35
  chipColorScheme: k = "neutral",
36
36
  chipVariant: w = "outline",
37
- clearLabel: j = "Clear selection",
38
- removeLabel: E = (l) => `Remove ${l}`,
39
- ...I
37
+ clearLabel: E = "Clear selection",
38
+ removeLabel: U = (e) => `Remove ${e}`,
39
+ countLabel: I = (e) => `${e} selected`,
40
+ ...P
40
41
  }) => {
41
- const l = !!h || F, U = z(l, I), $ = tt(I), a = n.length > 0, P = new Map(u.map((t, e) => [t.value, e])), d = n.map((t) => ({
42
+ const e = !!h || R, $ = tt(e, P), A = rt(P), a = o.length > 0, y = new Map(u.map((t, s) => [t.value, s])), m = o.map((t) => ({
42
43
  value: t,
43
- label: u.find((e) => e.value === t)?.label ?? String(t)
44
+ label: u.find((s) => s.value === t)?.label ?? String(t)
44
45
  })).sort(
45
- (t, e) => (P.get(t.value) ?? Number.POSITIVE_INFINITY) - (P.get(e.value) ?? Number.POSITIVE_INFINITY)
46
- ), y = g === void 0 ? d : d.slice(0, g), O = d.length - y.length, { ref: A, inDarkScope: B } = st(), S = H.useRef(null);
47
- return /* @__PURE__ */ c(
48
- Y,
46
+ (t, s) => (y.get(t.value) ?? Number.POSITIVE_INFINITY) - (y.get(s.value) ?? Number.POSITIVE_INFINITY)
47
+ ), O = g === void 0 ? m : m.slice(0, g), S = m.length - O.length, { ref: B, inDarkScope: M } = nt(), _ = V.useRef(null);
48
+ return /* @__PURE__ */ d(
49
+ C,
49
50
  {
50
- disabled: i,
51
- className: s("rst:flex rst:flex-col rst:gap-1.5", L),
52
- ...$,
51
+ disabled: l,
52
+ className: n("rst:flex rst:flex-col rst:gap-1.5", D),
53
+ ...A,
53
54
  children: [
54
- b && /* @__PURE__ */ r(C, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: b }),
55
- /* @__PURE__ */ r(K, { value: n, onChange: p, disabled: i, multiple: !0, children: /* @__PURE__ */ c("div", { ref: A, className: "rst:relative", children: [
56
- /* @__PURE__ */ c(
55
+ b && /* @__PURE__ */ r(K, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: b }),
56
+ /* @__PURE__ */ r(X, { value: o, onChange: p, disabled: l, multiple: !0, children: /* @__PURE__ */ d("div", { ref: B, className: "rst:relative", children: [
57
+ /* @__PURE__ */ d(
57
58
  "div",
58
59
  {
59
- className: s(
60
- rt({ variant: v, size: o, error: l }),
60
+ className: n(
61
+ et({ variant: v, size: i, error: e }),
61
62
  "rst:h-auto rst:flex-wrap rst:items-center rst:gap-1.5 rst:py-1.5",
62
- o === "sm" ? "rst:min-h-9" : o === "lg" ? "rst:min-h-11" : "rst:min-h-10",
63
+ i === "sm" ? "rst:min-h-9" : i === "lg" ? "rst:min-h-11" : "rst:min-h-10",
63
64
  N && a && "rst:pr-16",
64
65
  /* The ring is on the shell and fires from `focus-within`, because
65
66
  the element that actually takes focus is the invisible button
@@ -67,17 +68,17 @@ const It = ({
67
68
  control too: those are inside the field and should light it.
68
69
  One pixel heavier than the edge, as Select's trigger is. */
69
70
  "rst:focus-within:ring-[length:calc(var(--roster-border-width,1px)+1px)] rst:focus-within:ring-ring",
70
- i && "rst:opacity-50 rst:cursor-not-allowed",
71
- R
71
+ l && "rst:opacity-50 rst:cursor-not-allowed",
72
+ L
72
73
  ),
73
74
  children: [
74
75
  /* @__PURE__ */ r(
75
- X,
76
+ Z,
76
77
  {
77
- ref: S,
78
- "aria-invalid": U || void 0,
78
+ ref: _,
79
+ "aria-invalid": $ || void 0,
79
80
  className: "rst:absolute rst:inset-0 rst:h-full rst:w-full rst:cursor-pointer rst:rounded-md rst:focus:outline-hidden rst:disabled:cursor-not-allowed",
80
- children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children: a ? m === "count" ? `${n.length} selected` : d.map((t) => t.label).join(", ") : f })
81
+ children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children: a ? c === "count" ? I(o.length) : m.map((t) => t.label).join(", ") : f })
81
82
  }
82
83
  ),
83
84
  !a && /* @__PURE__ */ r(
@@ -88,37 +89,34 @@ const It = ({
88
89
  children: f
89
90
  }
90
91
  ),
91
- a && m === "count" && /* @__PURE__ */ c(
92
+ a && c === "count" && /* @__PURE__ */ r(
92
93
  "span",
93
94
  {
94
95
  "aria-hidden": "true",
95
96
  className: "rst:pointer-events-none rst:relative rst:block rst:truncate",
96
- children: [
97
- n.length,
98
- " selected"
99
- ]
97
+ children: I(o.length)
100
98
  }
101
99
  ),
102
- a && m === "chips" && y.map((t, e) => /* @__PURE__ */ r(
103
- T,
100
+ a && c === "chips" && O.map((t, s) => /* @__PURE__ */ r(
101
+ F,
104
102
  {
105
103
  size: "sm",
106
104
  variant: w,
107
105
  colorScheme: k,
108
- disabled: i,
109
- onRemove: () => p(n.filter((M) => M !== t.value)),
110
- removeLabel: E(t.label),
111
- className: s(
106
+ disabled: l,
107
+ onRemove: () => p(o.filter((H) => H !== t.value)),
108
+ removeLabel: U(t.label),
109
+ className: n(
112
110
  "rst:relative rst:max-w-[12rem] rst:pointer-events-none",
113
111
  "rst:[&_button]:pointer-events-auto",
114
112
  "rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70"
115
113
  ),
116
114
  children: /* @__PURE__ */ r("span", { className: "rst:block rst:truncate", children: t.label })
117
115
  },
118
- `${e}-${String(t.value)}`
116
+ `${s}-${String(t.value)}`
119
117
  )),
120
- O > 0 && m === "chips" && /* @__PURE__ */ c(
121
- T,
118
+ S > 0 && c === "chips" && /* @__PURE__ */ d(
119
+ F,
122
120
  {
123
121
  size: "sm",
124
122
  variant: w,
@@ -127,21 +125,21 @@ const It = ({
127
125
  className: "rst:pointer-events-none rst:relative rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70",
128
126
  children: [
129
127
  "+",
130
- O
128
+ S
131
129
  ]
132
130
  }
133
131
  ),
134
132
  /* @__PURE__ */ r(
135
133
  "span",
136
134
  {
137
- className: s(
135
+ className: n(
138
136
  "rst:pointer-events-none rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:items-center",
139
- o === "sm" ? "rst:pr-2.5" : "rst:pr-3"
137
+ i === "sm" ? "rst:pr-2.5" : "rst:pr-3"
140
138
  ),
141
139
  children: /* @__PURE__ */ r(
142
- _,
140
+ T,
143
141
  {
144
- icon: J,
142
+ icon: Q,
145
143
  className: "rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500",
146
144
  "aria-hidden": "true"
147
145
  }
@@ -152,12 +150,12 @@ const It = ({
152
150
  "button",
153
151
  {
154
152
  type: "button",
155
- disabled: i,
153
+ disabled: l,
156
154
  onClick: () => {
157
- p([]), S.current?.focus();
155
+ p([]), _.current?.focus();
158
156
  },
159
- "aria-label": j,
160
- className: s(
157
+ "aria-label": E,
158
+ className: n(
161
159
  /* `w-6` is not decoration: WCAG 2.5.8 asks 24x24 CSS px and
162
160
  a bare 14px icon measured 20px wide. The spacing exception
163
161
  does not apply, because this sits inside the trigger's own
@@ -166,12 +164,12 @@ const It = ({
166
164
  "rst:cursor-pointer rst:disabled:cursor-not-allowed",
167
165
  "rst:text-current rst:opacity-70 rst:hover:opacity-100 rst:disabled:opacity-40",
168
166
  "rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:rounded-sm",
169
- o === "sm" ? "rst:right-7" : "rst:right-8"
167
+ i === "sm" ? "rst:right-7" : "rst:right-8"
170
168
  ),
171
169
  children: /* @__PURE__ */ r(
172
- _,
170
+ T,
173
171
  {
174
- icon: Q,
172
+ icon: z,
175
173
  className: "rst:h-3.5 rst:w-3.5",
176
174
  "aria-hidden": "true"
177
175
  }
@@ -182,29 +180,29 @@ const It = ({
182
180
  }
183
181
  ),
184
182
  /* @__PURE__ */ r(
185
- G,
183
+ J,
186
184
  {
187
- as: V,
185
+ as: W,
188
186
  leave: "rst:transition rst:ease-in rst:duration-100",
189
187
  leaveFrom: "rst:opacity-100",
190
188
  leaveTo: "rst:opacity-0",
191
189
  children: /* @__PURE__ */ r(
192
- Z,
190
+ q,
193
191
  {
194
- anchor: nt,
195
- className: s(
196
- it(B, v) && "dark",
192
+ anchor: ot,
193
+ className: n(
194
+ lt(M, v) && "dark",
197
195
  at,
198
- ot,
199
- D
196
+ it,
197
+ j
200
198
  ),
201
199
  children: u.map((t) => /* @__PURE__ */ r(
202
- et,
200
+ st,
203
201
  {
204
- as: q,
202
+ as: G,
205
203
  value: t.value,
206
204
  disabled: t.disabled,
207
- size: o,
205
+ size: i,
208
206
  children: t.label
209
207
  },
210
208
  t.value
@@ -215,11 +213,11 @@ const It = ({
215
213
  )
216
214
  ] }) }),
217
215
  (x || h) && /* @__PURE__ */ r(
218
- W,
216
+ Y,
219
217
  {
220
- className: s(
218
+ className: n(
221
219
  "rst:text-xs rst:text-left",
222
- l ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
220
+ e ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
223
221
  ),
224
222
  children: h || x
225
223
  }
@@ -229,5 +227,5 @@ const It = ({
229
227
  );
230
228
  };
231
229
  export {
232
- It as MultiSelect
230
+ Pt as MultiSelect
233
231
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("react"),c=require("../../../lib/utils.cjs"),G=require("./progress-values.cjs"),H={percent:r=>`${r}%`,count:(r,s)=>`${r} of ${s}`,indeterminate:"Loading",status:(r,s)=>r?`${r}: ${s}`:s},b={default:"rst:bg-primary-600 rst:dark:bg-primary-400",success:"rst:bg-success-600 rst:dark:bg-success-400",warning:"rst:bg-amber-700 rst:dark:bg-amber-400",error:"rst:bg-error-600 rst:dark:bg-error-400"},O={default:"rst:border-primary-600 rst:dark:border-primary-400",success:"rst:border-success-600 rst:dark:border-success-400",warning:"rst:border-amber-700 rst:dark:border-amber-400",error:"rst:border-error-600 rst:dark:border-error-400"},p="rst:bg-[var(--roster-skeleton)]",R="rst:forced-colors:outline-solid rst:forced-colors:outline-1",h="rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight]",T={sm:"rst:h-1.5",md:"rst:h-2.5"};function P(r,s,t){const[m,n]=u.useState(r),e=u.useRef(r),l=u.useRef(Number.NEGATIVE_INFINITY),a=u.useRef(r);return u.useEffect(()=>{if(a.current=r,r===e.current)return;const f=t?0:Math.max(0,l.current+s-Date.now()),g=setTimeout(()=>{a.current!==e.current&&(l.current=Date.now(),e.current=a.current,n(a.current))},f);return()=>clearTimeout(g)},[r,s,t]),m}function V({value:r,max:s=100,variant:t="continuous",segments:m,status:n="default",size:e="md",rounded:l=!0,busy:a=!1,label:f,valueText:g,announce:j=!0,announceEvery:y=1500,labels:v,className:x}){const i={...H,...v},{known:w,fraction:k,percent:I,states:E,done:L,applicable:S,complete:$}=G.progressValues({value:r,max:s,variant:t,segments:m}),F=g??(t==="segmented"?i.count(L,S):w?i.percent(I):i.indeterminate),q=$,A=P(i.status(f,F),y,q),N=a&&"rst:animate-pulse rst:motion-reduce:animate-none",C=t==="segmented"?o.jsx("div",{"aria-hidden":"true",className:c.cn("rst:flex rst:w-full",e==="sm"?"rst:gap-0.5":"rst:gap-1",T[e],N),"data-progress-track":"",children:E.map((d,D)=>o.jsx("span",{className:c.cn("rst:h-full rst:min-w-0 rst:flex-1",l?"rst:rounded-full":"rst:rounded-sm",d==="done"&&[b[n],h],d==="current"&&[p,"rst:border-2",O[n]],d==="remaining"&&[p,R],d==="na"&&"rst:border rst:border-dashed rst:border-gray-500 rst:dark:border-gray-400"),"data-segment":d},D))}):o.jsx("div",{"aria-hidden":"true",className:c.cn("rst:relative rst:w-full rst:overflow-hidden rst:rounded-full",T[e],p,R,N),"data-progress-track":"",children:w?o.jsx("div",{className:c.cn("rst:h-full rst:rounded-full rst:transition-[width] rst:motion-reduce:transition-none",b[n],h),style:{width:`${k*100}%`,minWidth:k>0?e==="sm"?"0.375rem":"0.625rem":void 0},"data-progress-fill":""}):o.jsx("div",{className:c.cn("rst:absolute rst:inset-y-0 rst:left-0 rst:w-[30%] rst:rounded-full rst:animate-progress-travel",b[n],h),"data-progress-fill":"indeterminate"})});return o.jsxs("div",{className:c.cn("rst:w-full",x),"data-progress":t,"data-status":n,children:[C,j&&o.jsx("span",{role:"status",className:"rst:sr-only","data-progress-status":"",children:A})]})}exports.Progress=V;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("react"),c=require("../../../lib/utils.cjs"),G=require("../../../lib/labels.cjs"),H=require("./progress-values.cjs"),O={percent:r=>`${r}%`,count:(r,s)=>`${r} of ${s}`,indeterminate:"Loading",status:(r,s)=>r?`${r}: ${s}`:s},b={default:"rst:bg-primary-600 rst:dark:bg-primary-400",success:"rst:bg-success-600 rst:dark:bg-success-400",warning:"rst:bg-amber-700 rst:dark:bg-amber-400",error:"rst:bg-error-600 rst:dark:bg-error-400"},P={default:"rst:border-primary-600 rst:dark:border-primary-400",success:"rst:border-success-600 rst:dark:border-success-400",warning:"rst:border-amber-700 rst:dark:border-amber-400",error:"rst:border-error-600 rst:dark:border-error-400"},p="rst:bg-[var(--roster-skeleton)]",R="rst:forced-colors:outline-solid rst:forced-colors:outline-1",h="rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight]",T={sm:"rst:h-1.5",md:"rst:h-2.5"};function V(r,s,t){const[m,n]=u.useState(r),e=u.useRef(r),l=u.useRef(Number.NEGATIVE_INFINITY),a=u.useRef(r);return u.useEffect(()=>{if(a.current=r,r===e.current)return;const f=t?0:Math.max(0,l.current+s-Date.now()),g=setTimeout(()=>{a.current!==e.current&&(l.current=Date.now(),e.current=a.current,n(a.current))},f);return()=>clearTimeout(g)},[r,s,t]),m}function _({value:r,max:s=100,variant:t="continuous",segments:m,status:n="default",size:e="md",rounded:l=!0,busy:a=!1,label:f,valueText:g,announce:j=!0,announceEvery:y=1500,labels:v,className:x}){const i=G.withLabels(O,v),{known:w,fraction:k,percent:I,states:L,done:E,applicable:S,complete:$}=H.progressValues({value:r,max:s,variant:t,segments:m}),q=g??(t==="segmented"?i.count(E,S):w?i.percent(I):i.indeterminate),F=$,A=V(i.status(f,q),y,F),N=a&&"rst:animate-pulse rst:motion-reduce:animate-none",C=t==="segmented"?o.jsx("div",{"aria-hidden":"true",className:c.cn("rst:flex rst:w-full",e==="sm"?"rst:gap-0.5":"rst:gap-1",T[e],N),"data-progress-track":"",children:L.map((d,D)=>o.jsx("span",{className:c.cn("rst:h-full rst:min-w-0 rst:flex-1",l?"rst:rounded-full":"rst:rounded-sm",d==="done"&&[b[n],h],d==="current"&&[p,"rst:border-2",P[n]],d==="remaining"&&[p,R],d==="na"&&"rst:border rst:border-dashed rst:border-gray-500 rst:dark:border-gray-400"),"data-segment":d},D))}):o.jsx("div",{"aria-hidden":"true",className:c.cn("rst:relative rst:w-full rst:overflow-hidden rst:rounded-full",T[e],p,R,N),"data-progress-track":"",children:w?o.jsx("div",{className:c.cn("rst:h-full rst:rounded-full rst:transition-[width] rst:motion-reduce:transition-none",b[n],h),style:{width:`${k*100}%`,minWidth:k>0?e==="sm"?"0.375rem":"0.625rem":void 0},"data-progress-fill":""}):o.jsx("div",{className:c.cn("rst:absolute rst:inset-y-0 rst:left-0 rst:w-[30%] rst:rounded-full rst:animate-progress-travel",b[n],h),"data-progress-fill":"indeterminate"})});return o.jsxs("div",{className:c.cn("rst:w-full",x),"data-progress":t,"data-status":n,children:[C,j&&o.jsx("span",{role:"status",className:"rst:sr-only","data-progress-status":"",children:A})]})}exports.Progress=_;
@@ -46,6 +46,7 @@ export interface ProgressProps {
46
46
  announce?: boolean;
47
47
  /** The least time between two announcements, in milliseconds. */
48
48
  announceEvery?: number;
49
+ /** The component's own words, replaced; any left out stay English. */
49
50
  labels?: Partial<ProgressLabels>;
50
51
  className?: string;
51
52
  }
@@ -1,55 +1,56 @@
1
1
  "use client";
2
2
  import { jsx as a, jsxs as H } from "react/jsx-runtime";
3
- import { useState as _, useRef as g, useEffect as K } from "react";
3
+ import { useState as _, useRef as b, useEffect as K } from "react";
4
4
  import { cn as d } from "../../../lib/utils.js";
5
- import { progressValues as O } from "./progress-values.js";
6
- const V = {
5
+ import { withLabels as O } from "../../../lib/labels.js";
6
+ import { progressValues as V } from "./progress-values.js";
7
+ const B = {
7
8
  percent: (r) => `${r}%`,
8
9
  count: (r, s) => `${r} of ${s}`,
9
10
  indeterminate: "Loading",
10
11
  status: (r, s) => r ? `${r}: ${s}` : s
11
- }, b = {
12
+ }, g = {
12
13
  default: "rst:bg-primary-600 rst:dark:bg-primary-400",
13
14
  success: "rst:bg-success-600 rst:dark:bg-success-400",
14
15
  warning: "rst:bg-amber-700 rst:dark:bg-amber-400",
15
16
  error: "rst:bg-error-600 rst:dark:bg-error-400"
16
- }, B = {
17
+ }, M = {
17
18
  default: "rst:border-primary-600 rst:dark:border-primary-400",
18
19
  success: "rst:border-success-600 rst:dark:border-success-400",
19
20
  warning: "rst:border-amber-700 rst:dark:border-amber-400",
20
21
  error: "rst:border-error-600 rst:dark:border-error-400"
21
22
  }, p = "rst:bg-[var(--roster-skeleton)]", T = "rst:forced-colors:outline-solid rst:forced-colors:outline-1", h = "rst:forced-colors:forced-color-adjust-none rst:forced-colors:bg-[Highlight]", y = { sm: "rst:h-1.5", md: "rst:h-2.5" };
22
- function M(r, s, t) {
23
- const [u, o] = _(r), e = g(r), l = g(Number.NEGATIVE_INFINITY), n = g(r);
23
+ function P(r, s, e) {
24
+ const [u, o] = _(r), t = b(r), l = b(Number.NEGATIVE_INFINITY), n = b(r);
24
25
  return K(() => {
25
- if (n.current = r, r === e.current) return;
26
- const m = t ? 0 : Math.max(0, l.current + s - Date.now()), f = setTimeout(() => {
27
- n.current !== e.current && (l.current = Date.now(), e.current = n.current, o(n.current));
26
+ if (n.current = r, r === t.current) return;
27
+ const m = e ? 0 : Math.max(0, l.current + s - Date.now()), f = setTimeout(() => {
28
+ n.current !== t.current && (l.current = Date.now(), t.current = n.current, o(n.current));
28
29
  }, m);
29
30
  return () => clearTimeout(f);
30
- }, [r, s, t]), u;
31
+ }, [r, s, e]), u;
31
32
  }
32
- function J({
33
+ function U({
33
34
  value: r,
34
35
  max: s = 100,
35
- variant: t = "continuous",
36
+ variant: e = "continuous",
36
37
  segments: u,
37
38
  status: o = "default",
38
- size: e = "md",
39
+ size: t = "md",
39
40
  rounded: l = !0,
40
41
  busy: n = !1,
41
42
  label: m,
42
43
  valueText: f,
43
44
  announce: I = !0,
44
- announceEvery: v = 1500,
45
- labels: E,
46
- className: L
45
+ announceEvery: L = 1500,
46
+ labels: v,
47
+ className: E
47
48
  }) {
48
- const i = { ...V, ...E }, { known: w, fraction: k, percent: R, states: $, done: F, applicable: A, complete: C } = O({ value: r, max: s, variant: t, segments: u }), D = f ?? (t === "segmented" ? i.count(F, A) : w ? i.percent(R) : i.indeterminate), S = C, j = M(i.status(m, D), v, S), N = n && "rst:animate-pulse rst:motion-reduce:animate-none", x = t === "segmented" ? /* @__PURE__ */ a(
49
+ const i = O(B, v), { known: w, fraction: k, percent: R, states: $, done: F, applicable: A, complete: C } = V({ value: r, max: s, variant: e, segments: u }), D = f ?? (e === "segmented" ? i.count(F, A) : w ? i.percent(R) : i.indeterminate), S = C, j = P(i.status(m, D), L, S), N = n && "rst:animate-pulse rst:motion-reduce:animate-none", x = e === "segmented" ? /* @__PURE__ */ a(
49
50
  "div",
50
51
  {
51
52
  "aria-hidden": "true",
52
- className: d("rst:flex rst:w-full", e === "sm" ? "rst:gap-0.5" : "rst:gap-1", y[e], N),
53
+ className: d("rst:flex rst:w-full", t === "sm" ? "rst:gap-0.5" : "rst:gap-1", y[t], N),
53
54
  "data-progress-track": "",
54
55
  children: $.map((c, G) => /* @__PURE__ */ a(
55
56
  "span",
@@ -57,9 +58,9 @@ function J({
57
58
  className: d(
58
59
  "rst:h-full rst:min-w-0 rst:flex-1",
59
60
  l ? "rst:rounded-full" : "rst:rounded-sm",
60
- c === "done" && [b[o], h],
61
+ c === "done" && [g[o], h],
61
62
  /* Under way: the track inside a border of the fill's color. */
62
- c === "current" && [p, "rst:border-2", B[o]],
63
+ c === "current" && [p, "rst:border-2", M[o]],
63
64
  c === "remaining" && [p, T],
64
65
  /* Not part of this one: a dashed outline, neither filled nor to
65
66
  fill. Gray-500 on light and gray-400 on dark clear 3:1. */
@@ -74,33 +75,33 @@ function J({
74
75
  "div",
75
76
  {
76
77
  "aria-hidden": "true",
77
- className: d("rst:relative rst:w-full rst:overflow-hidden rst:rounded-full", y[e], p, T, N),
78
+ className: d("rst:relative rst:w-full rst:overflow-hidden rst:rounded-full", y[t], p, T, N),
78
79
  "data-progress-track": "",
79
80
  children: w ? /* @__PURE__ */ a(
80
81
  "div",
81
82
  {
82
83
  className: d(
83
84
  "rst:h-full rst:rounded-full rst:transition-[width] rst:motion-reduce:transition-none",
84
- b[o],
85
+ g[o],
85
86
  h
86
87
  ),
87
- style: { width: `${k * 100}%`, minWidth: k > 0 ? e === "sm" ? "0.375rem" : "0.625rem" : void 0 },
88
+ style: { width: `${k * 100}%`, minWidth: k > 0 ? t === "sm" ? "0.375rem" : "0.625rem" : void 0 },
88
89
  "data-progress-fill": ""
89
90
  }
90
91
  ) : /* @__PURE__ */ a(
91
92
  "div",
92
93
  {
93
- className: d("rst:absolute rst:inset-y-0 rst:left-0 rst:w-[30%] rst:rounded-full rst:animate-progress-travel", b[o], h),
94
+ className: d("rst:absolute rst:inset-y-0 rst:left-0 rst:w-[30%] rst:rounded-full rst:animate-progress-travel", g[o], h),
94
95
  "data-progress-fill": "indeterminate"
95
96
  }
96
97
  )
97
98
  }
98
99
  );
99
- return /* @__PURE__ */ H("div", { className: d("rst:w-full", L), "data-progress": t, "data-status": o, children: [
100
+ return /* @__PURE__ */ H("div", { className: d("rst:w-full", E), "data-progress": e, "data-status": o, children: [
100
101
  x,
101
102
  I && /* @__PURE__ */ a("span", { role: "status", className: "rst:sr-only", "data-progress-status": "", children: j })
102
103
  ] });
103
104
  }
104
105
  export {
105
- J as Progress
106
+ U as Progress
106
107
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),t=require("../../../lib/utils.cjs"),x=require("./stat-variants.cjs"),d=require("../Eyebrow/Eyebrow.cjs"),o=x.statSourceClass,j=w.forwardRef(({value:a,label:n,source:r,size:m,colorScheme:u,semantics:h="definition",className:c,...i},l)=>{const e=x.statValueVariants({size:m,colorScheme:u});return h==="standalone"?s.jsxs("div",{ref:l,className:t.cn("rst:flex rst:flex-col rst:gap-[3px]",c),...i,children:[s.jsx("span",{className:e,children:a}),s.jsx(d.Eyebrow,{size:"xs",children:n}),r&&s.jsx("span",{className:o,children:r})]}):s.jsxs("div",{ref:l,className:t.cn("rst:grid rst:content-start rst:gap-[3px]",c),...i,children:[s.jsx("dt",{className:"rst:relative rst:col-start-1 rst:row-start-2",children:s.jsx(d.Eyebrow,{size:"xs",children:n})}),r?s.jsxs("dd",{className:t.cn("rst:m-0",e,"rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"),children:[s.jsx("span",{className:"rst:row-start-1",children:a}),s.jsx("span",{className:t.cn(o,"rst:row-start-3"),children:r})]}):s.jsx("dd",{className:t.cn("rst:m-0 rst:col-start-1 rst:row-start-1",e),children:a})]})});j.displayName="Stat";exports.Stat=j;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),t=require("../../../lib/utils.cjs"),x=require("./stat-variants.cjs"),d=require("../Eyebrow/Eyebrow.cjs"),o=x.statSourceClass,j=w.forwardRef(({value:e,label:n,source:r,size:m,colorScheme:u,semantics:h="definition",className:c,...i},l)=>{const a=x.statValueVariants({size:m,colorScheme:u});return h==="standalone"?s.jsxs("div",{ref:l,className:t.cn("rst:flex rst:flex-col rst:gap-[3px]",c),...i,children:[s.jsx("span",{className:a,children:e}),s.jsx(d.Eyebrow,{size:"xs",children:n}),r&&s.jsx("span",{className:o,children:r})]}):s.jsxs("div",{ref:l,className:t.cn("rst:grid rst:content-start rst:gap-[3px]",c),...i,children:[s.jsx("dt",{className:"rst:relative rst:col-start-1 rst:row-start-2 rst:flex",children:s.jsx(d.Eyebrow,{size:"xs",children:n})}),r?s.jsxs("dd",{className:t.cn("rst:m-0",a,"rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"),children:[s.jsx("span",{className:"rst:row-start-1",children:e}),s.jsx("span",{className:t.cn(o,"rst:row-start-3"),children:r})]}):s.jsx("dd",{className:t.cn("rst:m-0 rst:col-start-1 rst:row-start-1",a),children:e})]})});j.displayName="Stat";exports.Stat=j;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as s } from "react/jsx-runtime";
3
- import w from "react";
3
+ import x from "react";
4
4
  import { cn as r } from "../../../lib/utils.js";
5
- import { statValueVariants as x, statSourceClass as N } from "./stat-variants.js";
5
+ import { statValueVariants as w, statSourceClass as N } from "./stat-variants.js";
6
6
  import { Eyebrow as o } from "../Eyebrow/Eyebrow.js";
7
- const m = N, g = w.forwardRef(
7
+ const m = N, g = x.forwardRef(
8
8
  ({ value: a, label: l, source: t, size: p, colorScheme: f, semantics: h = "definition", className: n, ...c }, d) => {
9
- const e = x({ size: p, colorScheme: f });
9
+ const e = w({ size: p, colorScheme: f });
10
10
  return h === "standalone" ? /* @__PURE__ */ i("div", { ref: d, className: r("rst:flex rst:flex-col rst:gap-[3px]", n), ...c, children: [
11
11
  /* @__PURE__ */ s("span", { className: e, children: a }),
12
12
  /* @__PURE__ */ s(o, { size: "xs", children: l }),
@@ -17,7 +17,7 @@ const m = N, g = w.forwardRef(
17
17
  which pushed the label of a Stat without a source down to meet
18
18
  nothing. The flex column this replaced never did. */
19
19
  /* @__PURE__ */ i("div", { ref: d, className: r("rst:grid rst:content-start rst:gap-[3px]", n), ...c, children: [
20
- /* @__PURE__ */ s("dt", { className: "rst:relative rst:col-start-1 rst:row-start-2", children: /* @__PURE__ */ s(o, { size: "xs", children: l }) }),
20
+ /* @__PURE__ */ s("dt", { className: "rst:relative rst:col-start-1 rst:row-start-2 rst:flex", children: /* @__PURE__ */ s(o, { size: "xs", children: l }) }),
21
21
  t ? /* @__PURE__ */ i(
22
22
  "dd",
23
23
  {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/class-variance-authority/dist/index.cjs"),r=t.cva("rst:block rst:font-bold rst:leading-none rst:tracking-[-0.04em] rst:tabular-nums",{variants:{size:{sm:"rst:text-xl",md:"rst:text-[clamp(1.5rem,3.6vw,2.25rem)]",lg:"rst:text-[clamp(2rem,5vw,3rem)]"},colorScheme:{primary:"rst:text-primary-600 rst:dark:text-primary-400",success:"rst:text-success-600 rst:dark:text-success-400",error:"rst:text-error-600 rst:dark:text-error-400",amber:"rst:text-amber-600 rst:dark:text-amber-400",neutral:"rst:text-gray-900 rst:dark:text-gray-100",current:"rst:text-current"}},defaultVariants:{size:"md",colorScheme:"neutral"}}),e="rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400";exports.statSourceClass=e;exports.statValueVariants=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/class-variance-authority/dist/index.cjs"),r=t.cva("rst:block rst:font-bold rst:tracking-[-0.04em] rst:tabular-nums",{variants:{size:{sm:"rst:text-xl rst:leading-none",md:"rst:text-[clamp(1.5rem,3.6vw,2.25rem)] rst:leading-none",lg:"rst:text-[clamp(2rem,5vw,3rem)] rst:leading-none"},colorScheme:{primary:"rst:text-primary-600 rst:dark:text-primary-400",success:"rst:text-success-600 rst:dark:text-success-400",error:"rst:text-error-600 rst:dark:text-error-400",amber:"rst:text-amber-600 rst:dark:text-amber-400",neutral:"rst:text-gray-900 rst:dark:text-gray-100",current:"rst:text-current"}},defaultVariants:{size:"md",colorScheme:"neutral"}}),e="rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400";exports.statSourceClass=e;exports.statValueVariants=r;
@@ -1,12 +1,14 @@
1
1
  import { cva as t } from "../../../node_modules/class-variance-authority/dist/index.js";
2
- const s = /* @__PURE__ */ t(
3
- "rst:block rst:font-bold rst:leading-none rst:tracking-[-0.04em] rst:tabular-nums",
2
+ const e = /* @__PURE__ */ t(
3
+ "rst:block rst:font-bold rst:tracking-[-0.04em] rst:tabular-nums",
4
4
  {
5
5
  variants: {
6
+ /* `leading-none` after each size, as in Eyebrow: before it,
7
+ tailwind-merge drops it in favor of the size. */
6
8
  size: {
7
- sm: "rst:text-xl",
8
- md: "rst:text-[clamp(1.5rem,3.6vw,2.25rem)]",
9
- lg: "rst:text-[clamp(2rem,5vw,3rem)]"
9
+ sm: "rst:text-xl rst:leading-none",
10
+ md: "rst:text-[clamp(1.5rem,3.6vw,2.25rem)] rst:leading-none",
11
+ lg: "rst:text-[clamp(2rem,5vw,3rem)] rst:leading-none"
10
12
  },
11
13
  colorScheme: {
12
14
  primary: "rst:text-primary-600 rst:dark:text-primary-400",
@@ -19,8 +21,8 @@ const s = /* @__PURE__ */ t(
19
21
  },
20
22
  defaultVariants: { size: "md", colorScheme: "neutral" }
21
23
  }
22
- ), e = "rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400";
24
+ ), s = "rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400";
23
25
  export {
24
- e as statSourceClass,
25
- s as statValueVariants
26
+ s as statSourceClass,
27
+ e as statValueVariants
26
28
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const j=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),N=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),s=require("../../../lib/utils.cjs"),o=require("./breadcrumb-variants.cjs"),p=require("../../atoms/Link/Link.cjs"),g=({items:c,separator:d,showHomeIcon:m,homeHref:u="/",linkComponent:x,currentClassName:h,variant:t,className:b,...f})=>{const l=x??p.Link,i=d??e.jsx("span",{className:"rst:text-gray-300 rst:dark:text-gray-600 rst:text-sm rst:transition-colors",children:"/"});return e.jsx("nav",{"aria-label":"Breadcrumb",className:s.cn("rst:flex",b),...f,children:e.jsxs("ol",{className:"rst:flex rst:items-center rst:space-x-2",children:[m&&e.jsxs("li",{className:"rst:flex rst:items-center",children:[e.jsx(l,{href:u,className:s.cn(o.breadcrumbVariants({variant:t}),"rst:hover:no-underline"),"aria-label":"Home",children:e.jsx(j.FontAwesomeIcon,{icon:N.faHome,className:"rst:h-4 rst:w-4"})}),e.jsx("span",{className:"rst:ml-2 rst:flex rst:select-none rst:items-center","aria-hidden":"true",children:i})]}),c.map((r,a)=>{const n=a===c.length-1;return e.jsxs("li",{className:"rst:flex rst:items-center",children:[a>0&&e.jsx("span",{className:"rst:mr-2 rst:flex rst:select-none rst:items-center","aria-hidden":"true",children:i}),n||!r.href?e.jsx("span",{className:s.cn("rst:font-semibold rst:text-sm rst:cursor-default rst:transition-colors",t==="inverse"?"rst:text-white":"rst:text-gray-900 rst:dark:text-gray-100",n&&h,r.className),"aria-current":n?"page":void 0,children:r.label}):e.jsx(l,{href:r.href,className:s.cn(o.breadcrumbVariants({variant:t}),"rst:hover:underline",r.className),children:r.label})]},a)})]})})};exports.Breadcrumbs=g;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const p=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),g=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),r=require("../../../lib/utils.cjs"),q=require("../../../lib/labels.cjs"),m=require("./breadcrumb-variants.cjs"),v=require("../../atoms/Link/Link.cjs"),y={nav:"Breadcrumb",home:"Home"},L=({items:c,separator:d,showHomeIcon:u,homeHref:x="/",linkComponent:h,currentClassName:b,labels:f,variant:t,className:j,...N})=>{const l=q.withLabels(y,f),i=h??v.Link,o=d??e.jsx("span",{className:"rst:text-gray-300 rst:dark:text-gray-600 rst:text-sm rst:transition-colors",children:"/"});return e.jsx("nav",{"aria-label":l.nav,className:r.cn("rst:flex",j),...N,children:e.jsxs("ol",{className:"rst:flex rst:items-center rst:space-x-2",children:[u&&e.jsxs("li",{className:"rst:flex rst:items-center",children:[e.jsx(i,{href:x,className:r.cn(m.breadcrumbVariants({variant:t}),"rst:hover:no-underline"),"aria-label":l.home,children:e.jsx(p.FontAwesomeIcon,{icon:g.faHome,className:"rst:h-4 rst:w-4"})}),e.jsx("span",{className:"rst:ml-2 rst:flex rst:select-none rst:items-center","aria-hidden":"true",children:o})]}),c.map((s,a)=>{const n=a===c.length-1;return e.jsxs("li",{className:"rst:flex rst:items-center",children:[a>0&&e.jsx("span",{className:"rst:mr-2 rst:flex rst:select-none rst:items-center","aria-hidden":"true",children:o}),n||!s.href?e.jsx("span",{className:r.cn("rst:font-semibold rst:text-sm rst:cursor-default rst:transition-colors",t==="inverse"?"rst:text-white":"rst:text-gray-900 rst:dark:text-gray-100",n&&b,s.className),"aria-current":n?"page":void 0,children:s.label}):e.jsx(i,{href:s.href,className:r.cn(m.breadcrumbVariants({variant:t}),"rst:hover:underline",s.className),children:s.label})]},a)})]})})};exports.Breadcrumbs=L;
@@ -22,6 +22,13 @@ export type BreadcrumbItem = {
22
22
  /** Applied to this crumb only. */
23
23
  className?: string;
24
24
  };
25
+ /** Every word Breadcrumbs says of its own. Pass any of them in `labels` to replace it. */
26
+ export interface BreadcrumbsLabels {
27
+ /** The trail's name. */
28
+ nav: string;
29
+ /** The home icon's name, with `showHomeIcon`. */
30
+ home: string;
31
+ }
25
32
  export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof breadcrumbVariants> {
26
33
  items: BreadcrumbItem[];
27
34
  separator?: React.ReactNode;
@@ -48,6 +55,8 @@ export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement>, Var
48
55
  linkComponent?: React.ComponentType<BreadcrumbLinkProps>;
49
56
  /** Applied to the current (last) crumb, for a per-page accent. */
50
57
  currentClassName?: string;
58
+ /** The component's own words, replaced; any left out stay English. */
59
+ labels?: Partial<BreadcrumbsLabels>;
51
60
  }
52
- declare const Breadcrumbs: ({ items, separator, showHomeIcon, homeHref, linkComponent, currentClassName, variant, className, ...props }: BreadcrumbsProps) => import("react/jsx-runtime").JSX.Element;
61
+ declare const Breadcrumbs: ({ items, separator, showHomeIcon, homeHref, linkComponent, currentClassName, labels, variant, className, ...props }: BreadcrumbsProps) => import("react/jsx-runtime").JSX.Element;
53
62
  export { Breadcrumbs };