@brightlocal/ui-components 2.10.0 → 2.12.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 (163) hide show
  1. package/README.md +3 -1
  2. package/component-meta.json +200 -17
  3. package/dist/badge.cjs +1 -1
  4. package/dist/badge.d.ts.map +1 -1
  5. package/dist/badge.js +42 -25
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.d.ts +16 -4
  8. package/dist/blocks/data-table.d.ts.map +1 -1
  9. package/dist/blocks/data-table.js +57 -53
  10. package/dist/blocks/input-list.cjs +2 -2
  11. package/dist/blocks/input-list.d.ts +7 -1
  12. package/dist/blocks/input-list.d.ts.map +1 -1
  13. package/dist/blocks/input-list.js +82 -81
  14. package/dist/blocks/sidebar.cjs +1 -1
  15. package/dist/blocks/sidebar.d.ts +19 -10
  16. package/dist/blocks/sidebar.d.ts.map +1 -1
  17. package/dist/blocks/sidebar.js +173 -169
  18. package/dist/breadcrumb.cjs +1 -1
  19. package/dist/breadcrumb.d.ts +14 -2
  20. package/dist/breadcrumb.d.ts.map +1 -1
  21. package/dist/breadcrumb.js +37 -37
  22. package/dist/button.cjs +1 -1
  23. package/dist/button.js +25 -25
  24. package/dist/callout.cjs +1 -1
  25. package/dist/callout.d.ts +3 -3
  26. package/dist/callout.d.ts.map +1 -1
  27. package/dist/callout.js +2 -1
  28. package/dist/card.cjs +1 -1
  29. package/dist/card.d.ts +10 -1
  30. package/dist/card.d.ts.map +1 -1
  31. package/dist/card.js +85 -82
  32. package/dist/carousel.cjs +1 -1
  33. package/dist/carousel.d.ts +37 -4
  34. package/dist/carousel.d.ts.map +1 -1
  35. package/dist/carousel.js +213 -163
  36. package/dist/chip.cjs +1 -1
  37. package/dist/chip.d.ts +11 -0
  38. package/dist/chip.d.ts.map +1 -1
  39. package/dist/chip.js +43 -38
  40. package/dist/combobox.cjs +3 -3
  41. package/dist/combobox.d.ts +12 -2
  42. package/dist/combobox.d.ts.map +1 -1
  43. package/dist/combobox.js +235 -230
  44. package/dist/command.cjs +1 -1
  45. package/dist/command.d.ts +106 -1
  46. package/dist/command.d.ts.map +1 -1
  47. package/dist/command.js +385 -120
  48. package/dist/date-picker.cjs +1 -1
  49. package/dist/date-picker.d.ts +10 -0
  50. package/dist/date-picker.d.ts.map +1 -1
  51. package/dist/date-picker.js +96 -96
  52. package/dist/dialog.cjs +1 -1
  53. package/dist/dialog.d.ts +7 -2
  54. package/dist/dialog.d.ts.map +1 -1
  55. package/dist/dialog.js +38 -30
  56. package/dist/drawer.d.ts +2 -2
  57. package/dist/global-layout.cjs +1 -1
  58. package/dist/global-layout.d.ts +5 -0
  59. package/dist/global-layout.d.ts.map +1 -1
  60. package/dist/global-layout.js +15 -7
  61. package/dist/hooks/use-breakpoint.cjs +1 -1
  62. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  63. package/dist/hooks/use-breakpoint.js +10 -10
  64. package/dist/index.cjs +1 -1
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +406 -395
  68. package/dist/input-chip.cjs +1 -1
  69. package/dist/input-chip.d.ts +8 -5
  70. package/dist/input-chip.d.ts.map +1 -1
  71. package/dist/input-chip.js +164 -170
  72. package/dist/input-group.d.ts +1 -1
  73. package/dist/input-password.cjs +1 -1
  74. package/dist/input-password.d.ts +10 -0
  75. package/dist/input-password.d.ts.map +1 -1
  76. package/dist/input-password.js +108 -106
  77. package/dist/link.cjs +1 -1
  78. package/dist/link.d.ts +1 -1
  79. package/dist/link.d.ts.map +1 -1
  80. package/dist/link.js +36 -37
  81. package/dist/list.d.ts +1 -1
  82. package/dist/logo.cjs +1 -1
  83. package/dist/logo.d.ts +6 -1
  84. package/dist/logo.d.ts.map +1 -1
  85. package/dist/logo.js +25 -22
  86. package/dist/map.cjs +1 -0
  87. package/dist/map.d.ts +207 -0
  88. package/dist/map.d.ts.map +1 -0
  89. package/dist/map.js +256 -0
  90. package/dist/pagination.cjs +1 -1
  91. package/dist/pagination.d.ts +29 -3
  92. package/dist/pagination.d.ts.map +1 -1
  93. package/dist/pagination.js +26 -25
  94. package/dist/rating.cjs +1 -1
  95. package/dist/rating.d.ts +6 -0
  96. package/dist/rating.d.ts.map +1 -1
  97. package/dist/rating.js +27 -19
  98. package/dist/resizable.d.ts +1 -1
  99. package/dist/select.cjs +2 -2
  100. package/dist/select.d.ts +7 -1
  101. package/dist/select.d.ts.map +1 -1
  102. package/dist/select.js +52 -51
  103. package/dist/separator.cjs +1 -1
  104. package/dist/separator.d.ts +16 -4
  105. package/dist/separator.d.ts.map +1 -1
  106. package/dist/separator.js +38 -35
  107. package/dist/sheet.cjs +1 -1
  108. package/dist/sheet.d.ts +6 -1
  109. package/dist/sheet.d.ts.map +1 -1
  110. package/dist/sheet.js +42 -41
  111. package/dist/skeleton.cjs +1 -1
  112. package/dist/skeleton.d.ts +5 -0
  113. package/dist/skeleton.d.ts.map +1 -1
  114. package/dist/skeleton.js +13 -11
  115. package/dist/sonner.cjs +1 -1
  116. package/dist/sonner.d.ts.map +1 -1
  117. package/dist/sonner.js +32 -30
  118. package/dist/tabs.cjs +1 -1
  119. package/dist/tabs.d.ts +4 -0
  120. package/dist/tabs.d.ts.map +1 -1
  121. package/dist/tabs.js +101 -52
  122. package/dist/text-reveal-motion.cjs +1 -1
  123. package/dist/text-reveal-motion.d.ts +5 -0
  124. package/dist/text-reveal-motion.d.ts.map +1 -1
  125. package/dist/text-reveal-motion.js +111 -110
  126. package/dist/typography.cjs +1 -1
  127. package/dist/typography.d.ts +1 -2
  128. package/dist/typography.d.ts.map +1 -1
  129. package/dist/typography.js +49 -50
  130. package/package.json +4 -5
  131. package/src/blocks/data-table.tsx +26 -9
  132. package/src/blocks/input-list.tsx +12 -1
  133. package/src/blocks/sidebar.tsx +61 -44
  134. package/src/components/badge.tsx +22 -5
  135. package/src/components/breadcrumb.tsx +43 -26
  136. package/src/components/button.tsx +13 -13
  137. package/src/components/callout.tsx +5 -4
  138. package/src/components/card.tsx +35 -19
  139. package/src/components/carousel.tsx +134 -13
  140. package/src/components/chip.tsx +22 -2
  141. package/src/components/combobox.tsx +18 -3
  142. package/src/components/command.tsx +644 -17
  143. package/src/components/date-picker.tsx +17 -3
  144. package/src/components/dialog.tsx +17 -4
  145. package/src/components/drawer.tsx +2 -2
  146. package/src/components/global-layout.tsx +15 -2
  147. package/src/components/input-chip.tsx +114 -66
  148. package/src/components/input-password.tsx +73 -49
  149. package/src/components/link.tsx +29 -17
  150. package/src/components/logo.tsx +10 -2
  151. package/src/components/map.tsx +597 -0
  152. package/src/components/pagination.tsx +44 -11
  153. package/src/components/rating.tsx +20 -2
  154. package/src/components/select.tsx +9 -1
  155. package/src/components/separator.tsx +40 -25
  156. package/src/components/sheet.tsx +28 -20
  157. package/src/components/skeleton.tsx +13 -2
  158. package/src/components/sonner.tsx +9 -3
  159. package/src/components/tabs.tsx +118 -22
  160. package/src/components/text-reveal-motion.tsx +7 -1
  161. package/src/components/typography.tsx +6 -7
  162. package/src/hooks/use-breakpoint.ts +2 -3
  163. package/src/index.ts +1 -0
@@ -1,6 +1,6 @@
1
- import { jsx as r, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as R } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
- import { format as C } from "date-fns";
3
+ import { format as S } from "date-fns";
4
4
  import { Calendar as T } from "@brightlocal/icons";
5
5
  import { cn as D } from "@brightlocal/ui-components/lib/utils";
6
6
  import { inputVariants as V } from "./input.js";
@@ -10,7 +10,7 @@ import { Select as M, SelectTrigger as I, SelectValue as j, SelectContent as A,
10
10
  const $ = u.createContext(
11
11
  null
12
12
  );
13
- function y() {
13
+ function x() {
14
14
  const e = u.useContext($);
15
15
  if (!e)
16
16
  throw new Error(
@@ -22,126 +22,126 @@ function _({
22
22
  children: e,
23
23
  dataHook: l,
24
24
  trackingEl: i,
25
- trackingLabel: s,
26
- mode: a = "single",
27
- date: o,
28
- onDateChange: f,
29
- dateRange: c,
30
- onDateRangeChange: n,
25
+ trackingLabel: c,
26
+ mode: o = "single",
27
+ date: s,
28
+ onDateChange: a,
29
+ dateRange: d,
30
+ onDateRangeChange: f,
31
31
  placeholder: t,
32
- disabled: d,
32
+ disabled: r,
33
33
  dateFormat: m,
34
- open: P,
35
- onOpenChange: k,
34
+ open: k,
35
+ onOpenChange: P,
36
36
  defaultOpen: w = !1
37
37
  }) {
38
- const [b, S] = u.useState(w), v = P !== void 0, p = v ? P : b, g = u.useCallback(
39
- (x) => {
40
- v || S(x), k?.(x);
38
+ const [v, b] = u.useState(w), h = k !== void 0, C = h ? k : v, p = u.useCallback(
39
+ (g) => {
40
+ h || b(g), P?.(g);
41
41
  },
42
- [v, k]
43
- ), h = u.useMemo(
42
+ [h, P]
43
+ ), y = u.useMemo(
44
44
  () => ({
45
- mode: a,
46
- open: p,
47
- setOpen: g,
48
- disabled: d,
49
- date: o,
50
- onDateChange: f,
51
- dateRange: c,
52
- onDateRangeChange: n,
53
- dateFormat: m ?? (a === "single" ? "PPP" : "PP"),
54
- placeholder: t ?? (a === "single" ? "Pick a date" : "Pick a date range"),
45
+ mode: o,
46
+ open: C,
47
+ setOpen: p,
48
+ disabled: r,
49
+ date: s,
50
+ onDateChange: a,
51
+ dateRange: d,
52
+ onDateRangeChange: f,
53
+ dateFormat: m ?? (o === "single" ? "PPP" : "PP"),
54
+ placeholder: t ?? (o === "single" ? "Pick a date" : "Pick a date range"),
55
55
  dataHook: l,
56
56
  trackingEl: i,
57
- trackingLabel: s
57
+ trackingLabel: c
58
58
  }),
59
59
  [
60
- a,
60
+ o,
61
+ C,
61
62
  p,
62
- g,
63
+ r,
64
+ s,
65
+ a,
63
66
  d,
64
- o,
65
67
  f,
66
- c,
67
- n,
68
68
  m,
69
69
  t,
70
70
  l,
71
71
  i,
72
- s
72
+ c
73
73
  ]
74
74
  );
75
- return /* @__PURE__ */ r($.Provider, { value: h, children: /* @__PURE__ */ r(H, { open: p, onOpenChange: g, children: /* @__PURE__ */ r("div", { "data-hook": l, "data-slot": "date-picker", children: e }) }) });
75
+ return /* @__PURE__ */ n($.Provider, { value: y, children: /* @__PURE__ */ n(H, { open: C, onOpenChange: p, children: /* @__PURE__ */ n("div", { "data-hook": l, "data-slot": "date-picker", children: e }) }) });
76
76
  }
77
77
  _.displayName = "DatePickerRoot";
78
- const F = u.forwardRef(({ className: e, children: l, id: i, error: s, ...a }, o) => {
78
+ const F = u.forwardRef(({ className: e, children: l, id: i, error: c, triggerLabel: o, ...s }, a) => {
79
79
  const {
80
- mode: f,
81
- date: c,
82
- dateRange: n,
83
- dateFormat: t,
84
- placeholder: d,
85
- disabled: m,
80
+ mode: d,
81
+ date: f,
82
+ dateRange: t,
83
+ dateFormat: r,
84
+ placeholder: m,
85
+ disabled: k,
86
86
  dataHook: P,
87
- open: k
88
- } = y(), w = !!s, b = u.useRef(null), S = u.useCallback(
89
- (h) => {
90
- b.current = h, typeof o == "function" ? o(h) : o && (o.current = h);
87
+ open: w
88
+ } = x(), v = !!c, b = u.useRef(null), h = u.useCallback(
89
+ (g) => {
90
+ b.current = g, typeof a == "function" ? a(g) : a && (a.current = g);
91
91
  },
92
- [o]
92
+ [a]
93
93
  );
94
94
  u.useLayoutEffect(() => {
95
- !k && b.current && b.current.removeAttribute("aria-controls");
96
- }, [k]);
97
- const p = f === "single" ? c ? C(c, t) : null : n?.from ? n.to ? `${C(n.from, t)} - ${C(n.to, t)}` : C(n.from, t) : null, g = p !== null;
98
- return /* @__PURE__ */ r(L, { asChild: !0, children: /* @__PURE__ */ R(
95
+ !w && b.current && b.current.removeAttribute("aria-controls");
96
+ }, [w]);
97
+ const p = d === "single" ? f ? S(f, r) : null : t?.from ? t.to ? `${S(t.from, r)} - ${S(t.to, r)}` : S(t.from, r) : null, y = p !== null;
98
+ return /* @__PURE__ */ n(L, { asChild: !0, children: /* @__PURE__ */ R(
99
99
  "button",
100
100
  {
101
- ref: S,
102
- "aria-label": a["aria-label"] ?? (f === "single" ? "Select date" : "Select date range"),
101
+ ref: h,
102
+ "aria-label": s["aria-label"] ?? o ?? (d === "single" ? "Select date" : "Select date range"),
103
103
  className: D(
104
104
  V({ hasIcon: !0 }),
105
105
  "group-hover/field:bg-accent dark:group-hover/field:bg-input/50 relative cursor-pointer justify-start pb-0 text-left",
106
- !g && "text-muted-foreground",
107
- w && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
106
+ !y && "text-muted-foreground",
107
+ v && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
108
108
  e
109
109
  ),
110
- "data-error": w || void 0,
110
+ "data-error": v || void 0,
111
111
  "data-hook": `${P}-trigger`,
112
112
  "data-slot": "date-picker-trigger",
113
- disabled: m,
113
+ disabled: k,
114
114
  id: i,
115
115
  type: "button",
116
- ...a,
116
+ ...s,
117
117
  children: [
118
- /* @__PURE__ */ r(
118
+ /* @__PURE__ */ n(
119
119
  T,
120
120
  {
121
121
  className: D(
122
122
  "text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2",
123
- m && "opacity-50"
123
+ k && "opacity-50"
124
124
  ),
125
125
  "data-slot": "calendar-icon"
126
126
  }
127
127
  ),
128
- l ?? (g ? p : /* @__PURE__ */ r("span", { children: d }))
128
+ l ?? (y ? p : /* @__PURE__ */ n("span", { children: m }))
129
129
  ]
130
130
  }
131
131
  ) });
132
132
  });
133
133
  F.displayName = "DatePickerTrigger";
134
- const U = u.forwardRef(({ className: e, children: l, ...i }, s) => {
135
- const { dataHook: a, mode: o } = y();
136
- return /* @__PURE__ */ r(
134
+ const U = u.forwardRef(({ className: e, children: l, contentLabel: i, ...c }, o) => {
135
+ const { dataHook: s, mode: a } = x();
136
+ return /* @__PURE__ */ n(
137
137
  E,
138
138
  {
139
- ref: s,
139
+ ref: o,
140
140
  align: "start",
141
- "aria-label": o === "single" ? "Date picker" : "Date range picker",
141
+ "aria-label": i ?? (a === "single" ? "Date picker" : "Date range picker"),
142
142
  className: D("w-auto rounded-lg p-0", e),
143
- dataHook: `${a}-content`,
144
- ...i,
143
+ dataHook: `${s}-content`,
144
+ ...c,
145
145
  children: l
146
146
  }
147
147
  );
@@ -153,43 +153,43 @@ function q({
153
153
  ...i
154
154
  }) {
155
155
  const {
156
- mode: s,
157
- date: a,
158
- onDateChange: o,
159
- dateRange: f,
160
- onDateRangeChange: c,
161
- setOpen: n,
156
+ mode: c,
157
+ date: o,
158
+ onDateChange: s,
159
+ dateRange: a,
160
+ onDateRangeChange: d,
161
+ setOpen: f,
162
162
  disabled: t,
163
- dataHook: d
164
- } = y();
165
- return s === "single" ? /* @__PURE__ */ r(
163
+ dataHook: r
164
+ } = x();
165
+ return c === "single" ? /* @__PURE__ */ n(
166
166
  N,
167
167
  {
168
168
  captionLayout: "dropdown",
169
169
  className: D("border-0 shadow-none", e),
170
- dataHook: `${d}-calendar`,
170
+ dataHook: `${r}-calendar`,
171
171
  disabled: t,
172
172
  endMonth: new Date(2100, 11, 31),
173
173
  mode: "single",
174
- selected: a,
174
+ selected: o,
175
175
  startMonth: new Date(1900, 0, 1),
176
176
  onSelect: (m) => {
177
- o?.(m), l && n(!1);
177
+ s?.(m), l && f(!1);
178
178
  },
179
179
  ...i
180
180
  }
181
- ) : /* @__PURE__ */ r(
181
+ ) : /* @__PURE__ */ n(
182
182
  N,
183
183
  {
184
184
  captionLayout: "dropdown",
185
185
  className: D("border-0 shadow-none", e),
186
- dataHook: `${d}-calendar`,
186
+ dataHook: `${r}-calendar`,
187
187
  disabled: t,
188
188
  endMonth: new Date(2100, 11, 31),
189
189
  mode: "range",
190
- selected: f,
190
+ selected: a,
191
191
  startMonth: new Date(1900, 0, 1),
192
- onSelect: c,
192
+ onSelect: d,
193
193
  ...i
194
194
  }
195
195
  );
@@ -227,32 +227,32 @@ function B({
227
227
  placeholder: l = "Select preset",
228
228
  className: i
229
229
  }) {
230
- const { mode: s, date: a, onDateChange: o, disabled: f, dataHook: c } = y();
231
- if (s !== "single")
230
+ const { mode: c, date: o, onDateChange: s, disabled: a, dataHook: d } = x();
231
+ if (c !== "single")
232
232
  return process.env.NODE_ENV !== "production" && console.warn("DatePickerPresets only works with mode='single'"), null;
233
- const n = a ? e.find((t) => t.date().toDateString() === a.toDateString())?.label : void 0;
233
+ const f = o ? e.find((t) => t.date().toDateString() === o.toDateString())?.label : void 0;
234
234
  return /* @__PURE__ */ R(
235
235
  M,
236
236
  {
237
- disabled: f,
238
- value: n,
237
+ disabled: a,
238
+ value: f,
239
239
  onValueChange: (t) => {
240
- const d = e.find((m) => m.label === t);
241
- d && o?.(d.date());
240
+ const r = e.find((m) => m.label === t);
241
+ r && s?.(r.date());
242
242
  },
243
243
  children: [
244
- /* @__PURE__ */ r(
244
+ /* @__PURE__ */ n(
245
245
  I,
246
246
  {
247
247
  className: D("w-full", i),
248
- dataHook: `${c}-preset-select`,
249
- children: /* @__PURE__ */ r(j, { placeholder: l })
248
+ dataHook: `${d}-preset-select`,
249
+ children: /* @__PURE__ */ n(j, { placeholder: l })
250
250
  }
251
251
  ),
252
- /* @__PURE__ */ r(A, { children: e.map((t) => /* @__PURE__ */ r(
252
+ /* @__PURE__ */ n(A, { children: e.map((t) => /* @__PURE__ */ n(
253
253
  O,
254
254
  {
255
- "data-hook": `${c}-preset-${t.label.toLowerCase().replace(/\s+/g, "-")}`,
255
+ "data-hook": `${d}-preset-${t.label.toLowerCase().replace(/\s+/g, "-")}`,
256
256
  value: t.label,
257
257
  children: t.label
258
258
  },
package/dist/dialog.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),h=require("@brightlocal/icons"),s=require("@brightlocal/ui-components/lib/utils");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=c(v),i=c(w),g=i.Root;g.displayName="Dialog";const f=l.forwardRef(({dataHook:e,...a},t)=>o.jsx(i.Trigger,{ref:t,"data-hook":e,"data-slot":"dialog-trigger",...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(i.Portal,{...e})}n.displayName="DialogPortal";const u=l.forwardRef(({...e},a)=>o.jsx(i.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Overlay,{ref:t,className:s.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=l.forwardRef(({className:e,children:a,dataHook:t,trackingEl:r,trackingLabel:b,...j},N)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(i.Content,{ref:N,className:s.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":b,...j,children:[a,o.jsxs(i.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[o.jsx(h.X,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName="DialogContent";const p=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Title,{ref:t,className:s.cn("text-lg leading-none font-semibold",e),"data-slot":"dialog-title",...a}));x.displayName="DialogTitle";const y=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Description,{ref:t,className:s.cn("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...a}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),w=require("react"),h=require("@radix-ui/react-dialog"),R=require("@brightlocal/icons"),s=require("@brightlocal/ui-components/lib/utils");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=c(w),i=c(h),g=i.Root;g.displayName="Dialog";const f=l.forwardRef(({dataHook:e,...a},t)=>o.jsx(i.Trigger,{ref:t,"data-hook":e,"data-slot":"dialog-trigger",...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(i.Portal,{...e})}n.displayName="DialogPortal";const u=l.forwardRef(({...e},a)=>o.jsx(i.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Overlay,{ref:t,className:s.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=l.forwardRef(({className:e,children:a,dataHook:t,trackingEl:r,trackingLabel:b,closeLabel:j,...N},v)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(i.Content,{ref:v,className:s.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":b,...N,children:[a,o.jsxs(i.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[o.jsx(R.X,{}),o.jsx("span",{className:"sr-only",children:j??"Close"})]})]})]}));m.displayName="DialogContent";const p=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Title,{ref:t,className:s.cn("text-lg leading-none font-semibold",e),"data-slot":"dialog-title",...a}));x.displayName="DialogTitle";const y=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Description,{ref:t,className:s.cn("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...a}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;
package/dist/dialog.d.ts CHANGED
@@ -53,6 +53,11 @@ interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive
53
53
  * Tracking label for analytics context
54
54
  */
55
55
  trackingLabel?: string;
56
+ /**
57
+ * Accessible label for the close button.
58
+ * @default "Close"
59
+ */
60
+ closeLabel?: string;
56
61
  }
57
62
  /**
58
63
  * DialogContent - The main dialog content container
@@ -60,12 +65,12 @@ interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive
60
65
  */
61
66
  declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
62
67
  /**
63
- * DialogHeader - Container for dialog title and description
68
+ * DialogHeader - Container for dialog title and description.
64
69
  * @description Groups the title and description at the top of the dialog
65
70
  */
66
71
  declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
67
72
  /**
68
- * DialogFooter - Container for dialog action buttons
73
+ * DialogFooter - Container for dialog action buttons.
69
74
  * @description Groups action buttons at the bottom of the dialog
70
75
  */
71
76
  declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D;;;GAGG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAA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YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
package/dist/dialog.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
3
  import * as l from "@radix-ui/react-dialog";
4
- import { X as p } from "@brightlocal/icons";
4
+ import { X as u } from "@brightlocal/icons";
5
5
  import { cn as s } from "@brightlocal/ui-components/lib/utils";
6
- const u = l.Root;
7
- u.displayName = "Dialog";
8
- const D = i.forwardRef(({ dataHook: a, ...e }, o) => /* @__PURE__ */ t(
6
+ const D = l.Root;
7
+ D.displayName = "Dialog";
8
+ const x = i.forwardRef(({ dataHook: a, ...e }, o) => /* @__PURE__ */ t(
9
9
  l.Trigger,
10
10
  {
11
11
  ref: o,
@@ -14,15 +14,15 @@ const D = i.forwardRef(({ dataHook: a, ...e }, o) => /* @__PURE__ */ t(
14
14
  ...e
15
15
  }
16
16
  ));
17
- D.displayName = "DialogTrigger";
17
+ x.displayName = "DialogTrigger";
18
18
  function d({
19
19
  ...a
20
20
  }) {
21
21
  return /* @__PURE__ */ t(l.Portal, { ...a });
22
22
  }
23
23
  d.displayName = "DialogPortal";
24
- const x = i.forwardRef(({ ...a }, e) => /* @__PURE__ */ t(l.Close, { ref: e, "data-slot": "dialog-close", ...a }));
25
- x.displayName = "DialogClose";
24
+ const y = i.forwardRef(({ ...a }, e) => /* @__PURE__ */ t(l.Close, { ref: e, "data-slot": "dialog-close", ...a }));
25
+ y.displayName = "DialogClose";
26
26
  const n = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
27
27
  l.Overlay,
28
28
  {
@@ -36,13 +36,21 @@ const n = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
36
36
  }
37
37
  ));
38
38
  n.displayName = "DialogOverlay";
39
- const y = i.forwardRef(
40
- ({ className: a, children: e, dataHook: o, trackingEl: g, trackingLabel: c, ...f }, m) => /* @__PURE__ */ r(d, { children: [
39
+ const N = i.forwardRef(
40
+ ({
41
+ className: a,
42
+ children: e,
43
+ dataHook: o,
44
+ trackingEl: g,
45
+ trackingLabel: c,
46
+ closeLabel: f,
47
+ ...m
48
+ }, p) => /* @__PURE__ */ r(d, { children: [
41
49
  /* @__PURE__ */ t(n, {}),
42
50
  /* @__PURE__ */ r(
43
51
  l.Content,
44
52
  {
45
- ref: m,
53
+ ref: p,
46
54
  className: s(
47
55
  "bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",
48
56
  a
@@ -51,20 +59,20 @@ const y = i.forwardRef(
51
59
  "data-slot": "dialog-content",
52
60
  "data-tracking-el": g,
53
61
  "data-tracking-label": c,
54
- ...f,
62
+ ...m,
55
63
  children: [
56
64
  e,
57
65
  /* @__PURE__ */ r(l.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0", children: [
58
- /* @__PURE__ */ t(p, {}),
59
- /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
66
+ /* @__PURE__ */ t(u, {}),
67
+ /* @__PURE__ */ t("span", { className: "sr-only", children: f ?? "Close" })
60
68
  ] })
61
69
  ]
62
70
  }
63
71
  )
64
72
  ] })
65
73
  );
66
- y.displayName = "DialogContent";
67
- const N = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
74
+ N.displayName = "DialogContent";
75
+ const b = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
68
76
  "div",
69
77
  {
70
78
  ref: o,
@@ -73,8 +81,8 @@ const N = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
73
81
  ...e
74
82
  }
75
83
  ));
76
- N.displayName = "DialogHeader";
77
- const b = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
84
+ b.displayName = "DialogHeader";
85
+ const v = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
78
86
  "div",
79
87
  {
80
88
  ref: o,
@@ -86,8 +94,8 @@ const b = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
86
94
  ...e
87
95
  }
88
96
  ));
89
- b.displayName = "DialogFooter";
90
- const v = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
97
+ v.displayName = "DialogFooter";
98
+ const w = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
91
99
  l.Title,
92
100
  {
93
101
  ref: o,
@@ -96,8 +104,8 @@ const v = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
96
104
  ...e
97
105
  }
98
106
  ));
99
- v.displayName = "DialogTitle";
100
- const w = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
107
+ w.displayName = "DialogTitle";
108
+ const h = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
101
109
  l.Description,
102
110
  {
103
111
  ref: o,
@@ -106,16 +114,16 @@ const w = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ t(
106
114
  ...e
107
115
  }
108
116
  ));
109
- w.displayName = "DialogDescription";
117
+ h.displayName = "DialogDescription";
110
118
  export {
111
- u as Dialog,
112
- x as DialogClose,
113
- y as DialogContent,
114
- w as DialogDescription,
115
- b as DialogFooter,
116
- N as DialogHeader,
119
+ D as Dialog,
120
+ y as DialogClose,
121
+ N as DialogContent,
122
+ h as DialogDescription,
123
+ v as DialogFooter,
124
+ b as DialogHeader,
117
125
  n as DialogOverlay,
118
126
  d as DialogPortal,
119
- v as DialogTitle,
120
- D as DialogTrigger
127
+ w as DialogTitle,
128
+ x as DialogTrigger
121
129
  };
package/dist/drawer.d.ts CHANGED
@@ -70,7 +70,7 @@ declare namespace DrawerContent {
70
70
  var displayName: string;
71
71
  }
72
72
  /**
73
- * DrawerHeader - Container for drawer title and description
73
+ * DrawerHeader - Container for drawer title and description.
74
74
  * @description Groups the title and description at the top of the drawer
75
75
  */
76
76
  declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -86,7 +86,7 @@ declare namespace DrawerBody {
86
86
  var displayName: string;
87
87
  }
88
88
  /**
89
- * DrawerFooter - Container for drawer action buttons
89
+ * DrawerFooter - Container for drawer action buttons.
90
90
  * @description Groups action buttons at the bottom of the drawer
91
91
  */
92
92
  declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),d=require("@brightlocal/ui-components/lib/utils"),h=require("./header.cjs"),k=require("./scroll-area.cjs");function w(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=w(g),i=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:t,trackingEl:o,trackingLabel:l,children:n,...r},x)=>{const p=typeof a=="number"?`${a}px`:a;return s.jsx(k.ScrollArea,{className:d.cn("h-dvh w-full",e),dataHook:`${t}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:x,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":t,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":l,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:p},children:n})})})});i.displayName="GlobalLayout";const G="224px",u=c.forwardRef(({className:e,width:a=G,dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:d.cn("sticky hidden shrink-0 self-start outline-none lg:block",e),"data-hook":t,"data-slot":"sidebar-container",style:{width:r,top:"var(--ds-section-padding-y-sm)"},...l,children:o})});u.displayName="GlobalLayoutSidebar";const b=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:d.cn("px-section-xs flex min-w-0 flex-1 flex-col",e),"data-hook":t,"data-slot":"content-wrapper",style:{"--content-max-width":r},...l,children:o})});b.displayName="GlobalLayoutContent";const y=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx(h.Header,{ref:r,className:d.cn("mx-auto w-full justify-between",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:o,...n,children:l}));y.displayName="GlobalLayoutContentHeader";const f=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,className:d.cn("mx-auto mt-6 flex w-full flex-1 flex-col gap-6",e),"data-hook":a,"data-slot":"content-body","data-tracking-el":t,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...n,children:l}));f.displayName="GlobalLayoutContentBody";const m=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,"aria-label":"Mobile navigation",className:d.cn("flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",e),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":t,"data-tracking-label":o,role:"toolbar",...n,children:l}));m.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=i;exports.GlobalLayoutContent=b;exports.GlobalLayoutContentBody=f;exports.GlobalLayoutContentHeader=y;exports.GlobalLayoutMobileHeader=m;exports.GlobalLayoutSidebar=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),d=require("@brightlocal/ui-components/lib/utils"),h=require("./header.cjs"),k=require("./scroll-area.cjs");function w(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=w(g),u=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:t,trackingEl:o,trackingLabel:l,children:n,...r},i)=>{const p=typeof a=="number"?`${a}px`:a;return s.jsx(k.ScrollArea,{className:d.cn("h-dvh w-full",e),dataHook:`${t}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:i,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":t,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":l,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:p},children:n})})})});u.displayName="GlobalLayout";const G="224px",b=c.forwardRef(({className:e,width:a=G,dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:d.cn("sticky hidden shrink-0 self-start outline-none lg:block",e),"data-hook":t,"data-slot":"sidebar-container",style:{width:r,top:"var(--ds-section-padding-y-sm)"},...l,children:o})});b.displayName="GlobalLayoutSidebar";const y=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:d.cn("px-section-xs flex min-w-0 flex-1 flex-col",e),"data-hook":t,"data-slot":"content-wrapper",style:{"--content-max-width":r},...l,children:o})});y.displayName="GlobalLayoutContent";const f=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx(h.Header,{ref:r,className:d.cn("mx-auto w-full justify-between",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:o,...n,children:l}));f.displayName="GlobalLayoutContentHeader";const m=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,className:d.cn("mx-auto mt-6 flex w-full flex-1 flex-col gap-6",e),"data-hook":a,"data-slot":"content-body","data-tracking-el":t,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...n,children:l}));m.displayName="GlobalLayoutContentBody";const x=c.forwardRef(({className:e,dataHook:a,ariaLabel:t,trackingEl:o,trackingLabel:l,children:n,...r},i)=>s.jsx("div",{ref:i,"aria-label":t??"Mobile navigation",className:d.cn("flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",e),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":o,"data-tracking-label":l,role:"toolbar",...r,children:n}));x.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=u;exports.GlobalLayoutContent=y;exports.GlobalLayoutContentBody=m;exports.GlobalLayoutContentHeader=f;exports.GlobalLayoutMobileHeader=x;exports.GlobalLayoutSidebar=b;
@@ -77,6 +77,11 @@ interface GlobalLayoutMobileHeaderProps extends React.ComponentProps<"div"> {
77
77
  * Data hook for automated testing (required)
78
78
  */
79
79
  dataHook: string;
80
+ /**
81
+ * Accessible label for the mobile navigation toolbar.
82
+ * @default "Mobile navigation"
83
+ */
84
+ ariaLabel?: string;
80
85
  /**
81
86
  * Tracking element identifier for analytics
82
87
  */
@@ -1 +1 @@
1
- {"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,iBAAkB,SAAQ,KAAK,C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.forwardRef(
133
- ({ className: o, dataHook: a, trackingEl: t, trackingLabel: e, children: l, ...r }, n) => /* @__PURE__ */ s(
133
+ ({
134
+ className: o,
135
+ dataHook: a,
136
+ ariaLabel: t,
137
+ trackingEl: e,
138
+ trackingLabel: l,
139
+ children: r,
140
+ ...n
141
+ }, c) => /* @__PURE__ */ s(
134
142
  "div",
135
143
  {
136
- ref: n,
137
- "aria-label": "Mobile navigation",
144
+ ref: c,
145
+ "aria-label": t ?? "Mobile navigation",
138
146
  className: i(
139
147
  "flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
140
148
  o
141
149
  ),
142
150
  "data-hook": a,
143
151
  "data-slot": "mobile-header",
144
- "data-tracking-el": t,
145
- "data-tracking-label": e,
152
+ "data-tracking-el": e,
153
+ "data-tracking-label": l,
146
154
  role: "toolbar",
147
- ...r,
148
- children: l
155
+ ...n,
156
+ children: r
149
157
  }
150
158
  )
151
159
  );
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react");function d(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=d(s),c={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function l(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(void 0);return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),t(window.innerWidth<o),()=>i.removeEventListener("change",a)},[e]),!!n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=l;exports.useIsBelowBreakpoint=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
@@ -1 +1 @@
1
- {"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAWpD,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,UAAiB,GAAG,MAAM,CASlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,UAAiB,GAAG,OAAO,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,UAAiB,WAe3D;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAWpD,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,UAAiB,GAAG,MAAM,CASlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,UAAiB,GAAG,OAAO,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,UAAiB,WAc3D;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}