@brightlocal/ui-components 1.0.1 → 1.1.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.
@@ -1,175 +1,187 @@
1
- import { jsx as n, jsxs as v } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { format as P } from "date-fns";
4
- import { Calendar as V } from "@brightlocal/icons";
5
- import { cn as p } from "@brightlocal/ui-components/lib/utils";
6
- import { inputVariants as R } from "./input.js";
7
- import { Calendar as S } from "@brightlocal/ui-components/calendar";
8
- import { PopoverContent as H, Popover as E, PopoverTrigger as M } from "@brightlocal/ui-components/popover";
9
- import { Select as I, SelectTrigger as L, SelectValue as j, SelectContent as O, SelectItem as _ } from "@brightlocal/ui-components/select";
10
- const x = f.createContext(
1
+ import { jsx as n, jsxs as R } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { format as C } from "date-fns";
4
+ import { Calendar as T } from "@brightlocal/icons";
5
+ import { cn as D } from "@brightlocal/ui-components/lib/utils";
6
+ import { inputVariants as V } from "./input.js";
7
+ import { Calendar as N } from "@brightlocal/ui-components/calendar";
8
+ import { PopoverContent as E, Popover as H, PopoverTrigger as L } from "@brightlocal/ui-components/popover";
9
+ import { Select as M, SelectTrigger as I, SelectValue as j, SelectContent as A, SelectItem as O } from "@brightlocal/ui-components/select";
10
+ const $ = u.createContext(
11
11
  null
12
12
  );
13
- function k() {
14
- const e = f.useContext(x);
13
+ function y() {
14
+ const e = u.useContext($);
15
15
  if (!e)
16
16
  throw new Error(
17
17
  "DatePicker compound components must be used within DatePickerRoot"
18
18
  );
19
19
  return e;
20
20
  }
21
- function A({
21
+ function _({
22
22
  children: e,
23
- dataHook: c,
24
- trackingEl: r,
25
- trackingLabel: l,
23
+ dataHook: s,
24
+ trackingEl: l,
25
+ trackingLabel: i,
26
26
  mode: a = "single",
27
- date: d,
28
- onDateChange: u,
29
- dateRange: o,
30
- onDateRangeChange: s,
27
+ date: o,
28
+ onDateChange: f,
29
+ dateRange: c,
30
+ onDateRangeChange: r,
31
31
  placeholder: t,
32
- disabled: i,
32
+ disabled: d,
33
33
  dateFormat: m,
34
34
  open: h,
35
- onOpenChange: D,
36
- defaultOpen: g = !1
35
+ onOpenChange: b,
36
+ defaultOpen: w = !1
37
37
  }) {
38
- const [N, $] = f.useState(g), w = h !== void 0, b = w ? h : N, C = f.useCallback(
39
- (y) => {
40
- w || $(y), D?.(y);
38
+ const [k, S] = u.useState(w), v = h !== void 0, p = v ? h : k, g = u.useCallback(
39
+ (x) => {
40
+ v || S(x), b?.(x);
41
41
  },
42
- [w, D]
43
- ), T = f.useMemo(
42
+ [v, b]
43
+ ), P = u.useMemo(
44
44
  () => ({
45
45
  mode: a,
46
- open: b,
47
- setOpen: C,
48
- disabled: i,
49
- date: d,
50
- onDateChange: u,
51
- dateRange: o,
52
- onDateRangeChange: s,
46
+ open: p,
47
+ setOpen: g,
48
+ disabled: d,
49
+ date: o,
50
+ onDateChange: f,
51
+ dateRange: c,
52
+ onDateRangeChange: r,
53
53
  dateFormat: m ?? (a === "single" ? "PPP" : "PP"),
54
54
  placeholder: t ?? (a === "single" ? "Pick a date" : "Pick a date range"),
55
- dataHook: c,
56
- trackingEl: r,
57
- trackingLabel: l
55
+ dataHook: s,
56
+ trackingEl: l,
57
+ trackingLabel: i
58
58
  }),
59
59
  [
60
60
  a,
61
- b,
62
- C,
63
- i,
61
+ p,
62
+ g,
64
63
  d,
65
- u,
66
64
  o,
67
- s,
68
- m,
69
- t,
65
+ f,
70
66
  c,
71
67
  r,
72
- l
68
+ m,
69
+ t,
70
+ s,
71
+ l,
72
+ i
73
73
  ]
74
74
  );
75
- return /* @__PURE__ */ n(x.Provider, { value: T, children: /* @__PURE__ */ n(E, { open: b, onOpenChange: C, children: e }) });
75
+ return /* @__PURE__ */ n($.Provider, { value: P, children: /* @__PURE__ */ n(H, { open: p, onOpenChange: g, children: e }) });
76
76
  }
77
- A.displayName = "DatePickerRoot";
78
- const F = f.forwardRef(({ className: e, children: c, id: r, ...l }, a) => {
79
- const { mode: d, date: u, dateRange: o, dateFormat: s, placeholder: t, disabled: i, dataHook: m } = k(), D = d === "single" ? u ? P(u, s) : null : o?.from ? o.to ? `${P(o.from, s)} - ${P(o.to, s)}` : P(o.from, s) : null, g = D !== null;
80
- return /* @__PURE__ */ n(M, { asChild: !0, children: /* @__PURE__ */ v(
77
+ _.displayName = "DatePickerRoot";
78
+ const F = u.forwardRef(({ className: e, children: s, id: l, error: i, ...a }, o) => {
79
+ const { mode: f, date: c, dateRange: r, dateFormat: t, placeholder: d, disabled: m, dataHook: h, open: b } = y(), w = !!i, k = u.useRef(null), S = u.useCallback(
80
+ (P) => {
81
+ k.current = P, typeof o == "function" ? o(P) : o && (o.current = P);
82
+ },
83
+ [o]
84
+ );
85
+ u.useLayoutEffect(() => {
86
+ !b && k.current && k.current.removeAttribute("aria-controls");
87
+ }, [b]);
88
+ const p = f === "single" ? c ? C(c, t) : null : r?.from ? r.to ? `${C(r.from, t)} - ${C(r.to, t)}` : C(r.from, t) : null, g = p !== null;
89
+ return /* @__PURE__ */ n(L, { asChild: !0, children: /* @__PURE__ */ R(
81
90
  "button",
82
91
  {
83
- ref: a,
84
- "aria-label": l["aria-label"] ?? (d === "single" ? "Select date" : "Select date range"),
85
- className: p(
86
- R({ hasIcon: !0 }),
87
- "relative cursor-pointer justify-start text-left",
92
+ ref: S,
93
+ "aria-label": a["aria-label"] ?? (f === "single" ? "Select date" : "Select date range"),
94
+ className: D(
95
+ V({ hasIcon: !0 }),
96
+ "relative cursor-pointer justify-start pb-0 text-left group-hover/field:bg-accent dark:group-hover/field:bg-input/50",
88
97
  !g && "text-muted-foreground",
98
+ w && "border-red-600/40 dark:border-red-400/60 focus-visible:border-destructive focus-visible:shadow-destructive",
89
99
  e
90
100
  ),
91
- "data-hook": `${m}-trigger`,
101
+ "data-error": w || void 0,
102
+ "data-hook": `${h}-trigger`,
92
103
  "data-slot": "date-picker-trigger",
93
- disabled: i,
94
- id: r,
104
+ disabled: m,
105
+ id: l,
95
106
  type: "button",
96
- ...l,
107
+ ...a,
97
108
  children: [
98
109
  /* @__PURE__ */ n(
99
- V,
110
+ T,
100
111
  {
101
- className: p(
112
+ className: D(
102
113
  "text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2",
103
- i && "opacity-50"
114
+ m && "opacity-50"
104
115
  ),
105
116
  "data-slot": "calendar-icon"
106
117
  }
107
118
  ),
108
- c ?? (g ? D : /* @__PURE__ */ n("span", { children: t }))
119
+ s ?? (g ? p : /* @__PURE__ */ n("span", { children: d }))
109
120
  ]
110
121
  }
111
122
  ) });
112
123
  });
113
124
  F.displayName = "DatePickerTrigger";
114
- const U = f.forwardRef(({ className: e, children: c, ...r }, l) => {
115
- const { dataHook: a } = k();
125
+ const U = u.forwardRef(({ className: e, children: s, ...l }, i) => {
126
+ const { dataHook: a, mode: o } = y();
116
127
  return /* @__PURE__ */ n(
117
- H,
128
+ E,
118
129
  {
119
- ref: l,
130
+ ref: i,
120
131
  align: "start",
121
- className: p("w-auto rounded-lg p-0", e),
132
+ "aria-label": o === "single" ? "Date picker" : "Date range picker",
133
+ className: D("w-auto rounded-lg p-0", e),
122
134
  dataHook: `${a}-content`,
123
- ...r,
124
- children: c
135
+ ...l,
136
+ children: s
125
137
  }
126
138
  );
127
139
  });
128
140
  U.displayName = "DatePickerContent";
129
141
  function q({
130
142
  className: e,
131
- closeOnSelect: c = !0,
132
- ...r
143
+ closeOnSelect: s = !0,
144
+ ...l
133
145
  }) {
134
146
  const {
135
- mode: l,
147
+ mode: i,
136
148
  date: a,
137
- onDateChange: d,
138
- dateRange: u,
139
- onDateRangeChange: o,
140
- setOpen: s,
149
+ onDateChange: o,
150
+ dateRange: f,
151
+ onDateRangeChange: c,
152
+ setOpen: r,
141
153
  disabled: t,
142
- dataHook: i
143
- } = k();
144
- return l === "single" ? /* @__PURE__ */ n(
145
- S,
154
+ dataHook: d
155
+ } = y();
156
+ return i === "single" ? /* @__PURE__ */ n(
157
+ N,
146
158
  {
147
159
  captionLayout: "dropdown",
148
- className: p("border-0 shadow-none", e),
149
- dataHook: `${i}-calendar`,
160
+ className: D("border-0 shadow-none", e),
161
+ dataHook: `${d}-calendar`,
150
162
  disabled: t,
151
163
  endMonth: new Date(2100, 11, 31),
152
164
  mode: "single",
153
165
  selected: a,
154
166
  startMonth: new Date(1900, 0, 1),
155
167
  onSelect: (m) => {
156
- d?.(m), c && s(!1);
168
+ o?.(m), s && r(!1);
157
169
  },
158
- ...r
170
+ ...l
159
171
  }
160
172
  ) : /* @__PURE__ */ n(
161
- S,
173
+ N,
162
174
  {
163
175
  captionLayout: "dropdown",
164
- className: p("border-0 shadow-none", e),
165
- dataHook: `${i}-calendar`,
176
+ className: D("border-0 shadow-none", e),
177
+ dataHook: `${d}-calendar`,
166
178
  disabled: t,
167
179
  endMonth: new Date(2100, 11, 31),
168
180
  mode: "range",
169
- selected: u,
181
+ selected: f,
170
182
  startMonth: new Date(1900, 0, 1),
171
- onSelect: o,
172
- ...r
183
+ onSelect: c,
184
+ ...l
173
185
  }
174
186
  );
175
187
  }
@@ -203,35 +215,35 @@ const z = [
203
215
  ];
204
216
  function B({
205
217
  presets: e = z,
206
- placeholder: c = "Select preset",
207
- className: r
218
+ placeholder: s = "Select preset",
219
+ className: l
208
220
  }) {
209
- const { mode: l, date: a, onDateChange: d, disabled: u, dataHook: o } = k();
210
- if (l !== "single")
221
+ const { mode: i, date: a, onDateChange: o, disabled: f, dataHook: c } = y();
222
+ if (i !== "single")
211
223
  return process.env.NODE_ENV !== "production" && console.warn("DatePickerPresets only works with mode='single'"), null;
212
- const s = a ? e.find((t) => t.date().toDateString() === a.toDateString())?.label : void 0;
213
- return /* @__PURE__ */ v(
214
- I,
224
+ const r = a ? e.find((t) => t.date().toDateString() === a.toDateString())?.label : void 0;
225
+ return /* @__PURE__ */ R(
226
+ M,
215
227
  {
216
- disabled: u,
217
- value: s,
228
+ disabled: f,
229
+ value: r,
218
230
  onValueChange: (t) => {
219
- const i = e.find((m) => m.label === t);
220
- i && d?.(i.date());
231
+ const d = e.find((m) => m.label === t);
232
+ d && o?.(d.date());
221
233
  },
222
234
  children: [
223
235
  /* @__PURE__ */ n(
224
- L,
236
+ I,
225
237
  {
226
- className: p("w-full", r),
227
- dataHook: `${o}-preset-select`,
228
- children: /* @__PURE__ */ n(j, { placeholder: c })
238
+ className: D("w-full", l),
239
+ dataHook: `${c}-preset-select`,
240
+ children: /* @__PURE__ */ n(j, { placeholder: s })
229
241
  }
230
242
  ),
231
- /* @__PURE__ */ n(O, { children: e.map((t) => /* @__PURE__ */ n(
232
- _,
243
+ /* @__PURE__ */ n(A, { children: e.map((t) => /* @__PURE__ */ n(
244
+ O,
233
245
  {
234
- "data-hook": `${o}-preset-${t.label.toLowerCase().replace(/\s+/g, "-")}`,
246
+ "data-hook": `${c}-preset-${t.label.toLowerCase().replace(/\s+/g, "-")}`,
235
247
  value: t.label,
236
248
  children: t.label
237
249
  },
@@ -247,6 +259,6 @@ export {
247
259
  q as DatePickerCalendar,
248
260
  U as DatePickerContent,
249
261
  B as DatePickerPresets,
250
- A as DatePickerRoot,
262
+ _ as DatePickerRoot,
251
263
  F as DatePickerTrigger
252
264
  };
package/dist/field.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils"),h=require("./description.cjs"),m=require("@brightlocal/ui-components/label");function n({className:a,...e}){return l.jsx("fieldset",{className:r.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),"data-slot":"field-set",...e})}n.displayName="FieldSet";const b=["legend","label"];function x({className:a,variant:e="legend",...t}){return l.jsx("legend",{className:r.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",a),"data-slot":"field-legend","data-variant":e,...t})}function v({className:a,...e}){return l.jsx("div",{className:r.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",a),"data-slot":"field-group",...e})}const F=g.cva(["group/field flex w-full gap-2","[[data-slot=radio-group]_&]:relative [[data-slot=radio-group]_&]:cursor-pointer [[data-slot=radio-group]_&]:gap-3 [[data-slot=radio-group]_&]:has-[[data-disabled]]:cursor-not-allowed","has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal"],{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center gap-x-2","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start"]},variant:{default:[],box:["relative cursor-pointer","rounded-lg border border-border bg-background p-3","transition-colors","[&_[data-slot=field-label]]:after:absolute [&_[data-slot=field-label]]:after:inset-0 [&_[data-slot=field-label]]:after:cursor-pointer","has-[:focus-visible]:shadow-default has-[:focus-visible]:border-ring","has-[[data-state=checked]:not([role=switch])]:border-primary has-[[data-state=checked]:not([role=switch])]:bg-primary/10","dark:has-[[data-state=checked]:not([role=switch])]:bg-alpha-10","[[aria-invalid=true]_&]:border-red-600/40 dark:[[aria-invalid=true]_&]:border-red-400/60","[[aria-invalid=true]_&]:has-[:focus-visible]:border-destructive [[aria-invalid=true]_&]:has-[:focus-visible]:shadow-destructive"]}},defaultVariants:{orientation:"vertical",variant:"default"}});function k({className:a,orientation:e="vertical",variant:t="default",align:i="start",...d}){return l.jsx("div",{className:r.cn(F({orientation:e,variant:t}),i==="end"&&e==="horizontal"&&"grid-cols-[1fr_auto]",a),"data-orientation":e,"data-slot":"field","data-variant":t,role:"group",...d})}function _({className:a,...e}){return l.jsx("div",{className:r.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug","[[data-variant=boxIconVertical]_&]:items-center [[data-variant=boxIconVertical]_&]:text-center",a),"data-slot":"field-content",...e})}function w({className:a,htmlFor:e,dataHook:t,...i}){return l.jsx(m.Label,{className:r.cn("group/field-label peer/field-label w-fit","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",a),"data-hook":t,"data-slot":"field-label",htmlFor:e,...i})}function j({className:a,dataHook:e,...t}){return l.jsx(h.Description,{className:r.cn("mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",a),"data-hook":e,"data-slot":"field-description",...t})}function y({icon:a=p.AlertCircle,className:e,...t}){return l.jsx(a,{"aria-hidden":"true",className:r.cn("inline-block shrink-0 align-text-bottom",e),...t})}function N({className:a,dataHook:e,children:t,errors:i,...d}){const o=i?.filter(s=>!!s?.message);if(!t&&(!o||o.length===0))return null;const c=r.cn("text-destructive-foreground text-sm font-normal leading-5","mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",a),u=o&&o.length>1;return l.jsx("div",{className:c,"data-hook":e,"data-slot":"field-error",role:"alert",...d,children:u?l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:o.map((s,f)=>l.jsx("li",{children:s.message},f))}):l.jsx("p",{className:"m-0",children:t||o?.[0]?.message})})}exports.Field=k;exports.FieldContent=_;exports.FieldDescription=j;exports.FieldError=N;exports.FieldErrorIcon=y;exports.FieldGroup=v;exports.FieldLabel=w;exports.FieldLegend=x;exports.FieldSet=n;exports.fieldLegendVariants=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils"),b=require("./description.cjs"),h=require("@brightlocal/ui-components/label");function n({className:e,...a}){return l.jsx("fieldset",{className:r.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",e),"data-slot":"field-set",...a})}n.displayName="FieldSet";const m=["legend","label"];function x({className:e,variant:a="legend",...t}){return l.jsx("legend",{className:r.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",e),"data-slot":"field-legend","data-variant":a,...t})}function v({className:e,...a}){return l.jsx("div",{className:r.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),"data-slot":"field-group",...a})}const _=g.cva(["group/field flex w-full gap-2","[[data-slot=radio-group]_&]:relative [[data-slot=radio-group]_&]:cursor-pointer [[data-slot=radio-group]_&]:gap-3 [[data-slot=radio-group]_&]:has-[[data-disabled]]:cursor-not-allowed","[[data-slot=radio-group]_&_[data-slot=field-label]]:after:absolute [[data-slot=radio-group]_&_[data-slot=field-label]]:after:inset-0 [[data-slot=radio-group]_&_[data-slot=field-label]]:after:cursor-pointer [[data-slot=radio-group]_&:has([data-disabled])_[data-slot=field-label]]:after:cursor-not-allowed","has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal"],{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center gap-x-2","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start"]},variant:{default:[],box:["relative cursor-pointer","rounded-lg border border-border bg-background p-3","transition-colors","[&_[data-slot=field-label]]:after:absolute [&_[data-slot=field-label]]:after:inset-0 [&_[data-slot=field-label]]:after:cursor-pointer","has-[:focus-visible]:shadow-default has-[:focus-visible]:border-ring","has-[[data-state=checked]:not([role=switch])]:border-primary has-[[data-state=checked]:not([role=switch])]:bg-primary/10","dark:has-[[data-state=checked]:not([role=switch])]:bg-alpha-10","[[aria-invalid=true]_&]:border-red-600/40 dark:[[aria-invalid=true]_&]:border-red-400/60","[[aria-invalid=true]_&]:has-[:focus-visible]:border-destructive [[aria-invalid=true]_&]:has-[:focus-visible]:shadow-destructive"]}},defaultVariants:{orientation:"vertical",variant:"default"}});function F({className:e,orientation:a="vertical",variant:t="default",align:d="start",...i}){return l.jsx("div",{className:r.cn(_({orientation:a,variant:t}),d==="end"&&a==="horizontal"&&"grid-cols-[1fr_auto]",e),"data-orientation":a,"data-slot":"field","data-variant":t,role:"group",...i})}function k({className:e,...a}){return l.jsx("div",{className:r.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug","[[data-variant=boxIconVertical]_&]:items-center [[data-variant=boxIconVertical]_&]:text-center",e),"data-slot":"field-content",...a})}function w({className:e,htmlFor:a,dataHook:t,...d}){return l.jsx(h.Label,{className:r.cn("group/field-label peer/field-label w-fit","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),"data-hook":t,"data-slot":"field-label",htmlFor:a,...d})}function j({className:e,dataHook:a,...t}){return l.jsx(b.Description,{className:r.cn("mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",e),"data-hook":a,"data-slot":"field-description",...t})}function y({icon:e=p.AlertCircle,className:a,...t}){return l.jsx(e,{"aria-hidden":"true",className:r.cn("inline-block shrink-0 align-text-bottom",a),...t})}function N({className:e,dataHook:a,children:t,errors:d,...i}){const o=d?.filter(s=>!!s?.message);if(!t&&(!o||o.length===0))return null;const c=r.cn("text-destructive-foreground text-sm font-normal leading-5","mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",e),u=o&&o.length>1;return l.jsx("div",{className:c,"data-hook":a,"data-slot":"field-error",role:"alert",...i,children:u?l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:o.map((s,f)=>l.jsx("li",{children:s.message},f))}):l.jsx("p",{className:"m-0",children:t||o?.[0]?.message})})}exports.Field=F;exports.FieldContent=k;exports.FieldDescription=j;exports.FieldError=N;exports.FieldErrorIcon=y;exports.FieldGroup=v;exports.FieldLabel=w;exports.FieldLegend=x;exports.FieldSet=n;exports.fieldLegendVariants=m;
package/dist/field.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { LucideProps } from '@brightlocal/icons';
3
- import { LabelProps } from '@brightlocal/ui-components/label';
3
+ import { LabelProps } from './label';
4
4
  declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
5
5
  declare namespace FieldSet {
6
6
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGnE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,k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OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,YAAY,GACb,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC"}
package/dist/field.js CHANGED
@@ -58,6 +58,8 @@ const b = u(
58
58
  "group/field flex w-full gap-2",
59
59
  // RadioGroup context: positioned ancestor for RadioGroupItem click overlay + pointer cursor
60
60
  "[[data-slot=radio-group]_&]:relative [[data-slot=radio-group]_&]:cursor-pointer [[data-slot=radio-group]_&]:gap-3 [[data-slot=radio-group]_&]:has-[[data-disabled]]:cursor-not-allowed",
61
+ // RadioGroup context: label overlay spans the full Field for clickable row
62
+ "[[data-slot=radio-group]_&_[data-slot=field-label]]:after:absolute [[data-slot=radio-group]_&_[data-slot=field-label]]:after:inset-0 [[data-slot=radio-group]_&_[data-slot=field-label]]:after:cursor-pointer [[data-slot=radio-group]_&:has([data-disabled])_[data-slot=field-label]]:after:cursor-not-allowed",
61
63
  // Label leading overrides: use leading-normal for wrap-capable labels (checkbox)
62
64
  "has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal"
63
65
  ],
@@ -1,4 +1,4 @@
1
- import { InputGroupInput, InputGroupButton } from '@brightlocal/ui-components/input-group';
1
+ import { InputGroupInput, InputGroupButton } from './input-group';
2
2
  import * as React from "react";
3
3
  /**
4
4
  * Default password strength levels (industry standard)
package/dist/sonner.d.ts CHANGED
@@ -61,7 +61,7 @@ declare function sonner(toast: ToastInput, options?: SonnerCustomOptions): void;
61
61
  *
62
62
  * @example
63
63
  * // CORRECT: Mount in your app root (App.tsx or layout.tsx)
64
- * import { Sonner } from '@brightlocal/ui-components/sonner';
64
+ * import { Sonner } from './sonner';
65
65
  *
66
66
  * function App() {
67
67
  * return (
@@ -98,7 +98,7 @@ declare function sonner(toast: ToastInput, options?: SonnerCustomOptions): void;
98
98
  *
99
99
  * @example
100
100
  * // Then use sonner() anywhere in your app
101
- * import { sonner } from '@brightlocal/ui-components/sonner';
101
+ * import { sonner } from './sonner';
102
102
  *
103
103
  * function MyComponent() {
104
104
  * const handleClick = () => {
@@ -129,13 +129,13 @@ declare namespace Sonner {
129
129
  * @example
130
130
  * ```tsx
131
131
  * // 1. Mount the Sonner component in your app root
132
- * import { Sonner } from '@brightlocal/ui-components/sonner';
132
+ * import { Sonner } from './sonner';
133
133
  * import { toast } from 'sonner';
134
134
  *
135
135
  * <Sonner />
136
136
  *
137
137
  * // 2. Show toasts anywhere in your app
138
- * import { sonner } from '@brightlocal/ui-components/sonner';
138
+ * import { sonner } from './sonner';
139
139
  *
140
140
  * // Simple toast
141
141
  * sonner({ title: "Hello world" });
package/dist/tooltip.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),m=require("@radix-ui/react-tooltip"),j=require("@brightlocal/ui-components/lib/utils");function a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const l=a(T),i=a(m);function x({delayDuration:t=0,skipDelayDuration:e=0,...o}){return r.jsx(i.Provider,{"data-slot":"tooltip-provider",delayDuration:t,skipDelayDuration:e,...o})}function y({...t}){return r.jsx(i.Root,{"data-slot":"tooltip",...t})}const s=l.forwardRef(({...t},e)=>r.jsx(i.Trigger,{ref:e,"data-slot":"tooltip-trigger",...t}));s.displayName="TooltipTrigger";const c=l.forwardRef(({className:t,sideOffset:e=0,dataHook:o,trackingEl:n,trackingLabel:d,hideArrow:p=!1,children:u,...g},f)=>r.jsx(i.Portal,{children:r.jsxs(i.Content,{ref:f,className:j.cn("bg-secondary text-secondary-foreground z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs leading-4 font-normal",t),"data-hook":o,"data-slot":"tooltip-content","data-tracking-el":n,"data-tracking-label":d,sideOffset:e,...g,children:[u,!p&&r.jsx(i.Arrow,{className:"fill-secondary",height:5.5,width:10})]})}));c.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=c;exports.TooltipProvider=x;exports.TooltipTrigger=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),m=require("@radix-ui/react-tooltip"),j=require("@brightlocal/ui-components/lib/utils");function a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const l=a(T),i=a(m);function x({delayDuration:t=0,skipDelayDuration:e=0,...o}){return r.jsx(i.Provider,{"data-slot":"tooltip-provider",delayDuration:t,skipDelayDuration:e,...o})}function y({...t}){return r.jsx(i.Root,{"data-slot":"tooltip",...t})}const s=l.forwardRef(({...t},e)=>r.jsx(i.Trigger,{ref:e,"data-slot":"tooltip-trigger",...t}));s.displayName="TooltipTrigger";const c=l.forwardRef(({className:t,sideOffset:e=0,dataHook:o,trackingEl:n,trackingLabel:d,hideArrow:p=!1,children:u,...g},f)=>r.jsx(i.Portal,{children:r.jsxs(i.Content,{ref:f,className:j.cn("bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal",t),"data-hook":o,"data-slot":"tooltip-content","data-tracking-el":n,"data-tracking-label":d,sideOffset:e,...g,children:[u,!p&&r.jsx(i.Arrow,{className:"fill-secondary",height:5.5,width:10})]})}));c.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=c;exports.TooltipProvider=x;exports.TooltipTrigger=s;
package/dist/tooltip.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import * as a from "react";
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import * as i from "react";
3
3
  import * as t from "@radix-ui/react-tooltip";
4
- import { cn as m } from "@brightlocal/ui-components/lib/utils";
5
- function x({
4
+ import { cn as f } from "@brightlocal/ui-components/lib/utils";
5
+ function h({
6
6
  delayDuration: o = 0,
7
7
  skipDelayDuration: r = 0,
8
- ...i
8
+ ...a
9
9
  }) {
10
10
  return /* @__PURE__ */ e(
11
11
  t.Provider,
@@ -13,7 +13,7 @@ function x({
13
13
  "data-slot": "tooltip-provider",
14
14
  delayDuration: o,
15
15
  skipDelayDuration: r,
16
- ...i
16
+ ...a
17
17
  }
18
18
  );
19
19
  }
@@ -22,7 +22,7 @@ function y({
22
22
  }) {
23
23
  return /* @__PURE__ */ e(t.Root, { "data-slot": "tooltip", ...o });
24
24
  }
25
- const g = a.forwardRef(({ ...o }, r) => /* @__PURE__ */ e(
25
+ const g = i.forwardRef(({ ...o }, r) => /* @__PURE__ */ e(
26
26
  t.Trigger,
27
27
  {
28
28
  ref: r,
@@ -31,25 +31,25 @@ const g = a.forwardRef(({ ...o }, r) => /* @__PURE__ */ e(
31
31
  }
32
32
  ));
33
33
  g.displayName = "TooltipTrigger";
34
- const T = a.forwardRef(
34
+ const T = i.forwardRef(
35
35
  ({
36
36
  className: o,
37
37
  sideOffset: r = 0,
38
- dataHook: i,
38
+ dataHook: a,
39
39
  trackingEl: n,
40
40
  trackingLabel: l,
41
41
  hideArrow: d = !1,
42
42
  children: s,
43
43
  ...p
44
- }, c) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ f(
44
+ }, c) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ m(
45
45
  t.Content,
46
46
  {
47
47
  ref: c,
48
- className: m(
49
- "bg-secondary text-secondary-foreground z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs leading-4 font-normal",
48
+ className: f(
49
+ "bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal",
50
50
  o
51
51
  ),
52
- "data-hook": i,
52
+ "data-hook": a,
53
53
  "data-slot": "tooltip-content",
54
54
  "data-tracking-el": n,
55
55
  "data-tracking-label": l,
@@ -73,6 +73,6 @@ T.displayName = "TooltipContent";
73
73
  export {
74
74
  y as Tooltip,
75
75
  T as TooltipContent,
76
- x as TooltipProvider,
76
+ h as TooltipProvider,
77
77
  g as TooltipTrigger
78
78
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),w=require("react"),p=require("@radix-ui/react-slot"),c=require("class-variance-authority"),y=require("@brightlocal/ui-components/lib/utils");function R(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(o,t,e.get?e:{enumerable:!0,get:()=>a[t]})}}return o.default=a,Object.freeze(o)}const g=R(w),V=c.cva("self-stretch text-foreground text-4xl font-extrabold font-sans leading-10 lg:text-5xl lg:font-medium lg:font-display lg:leading-12"),i=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h1";return d.jsx(l,{ref:s,className:y.cn(V(),a),"data-hook":t,"data-slot":"typography-h1","data-tracking-el":e,"data-tracking-label":r,...n})});i.displayName="TypographyH1";const q=c.cva("text-foreground text-3xl font-semibold font-sans leading-9"),f=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h2";return d.jsx(l,{ref:s,className:y.cn(q(),a),"data-hook":t,"data-slot":"typography-h2","data-tracking-el":e,"data-tracking-label":r,...n})});f.displayName="TypographyH2";const H=c.cva("text-foreground text-2xl font-semibold font-sans leading-8"),h=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h3";return d.jsx(l,{ref:s,className:y.cn(H(),a),"data-hook":t,"data-slot":"typography-h3","data-tracking-el":e,"data-tracking-label":r,...n})});h.displayName="TypographyH3";const L=c.cva("text-foreground text-xl font-semibold font-sans leading-7"),m=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h4";return d.jsx(l,{ref:s,className:y.cn(L(),a),"data-hook":t,"data-slot":"typography-h4","data-tracking-el":e,"data-tracking-label":r,...n})});m.displayName="TypographyH4";const O=c.cva("text-foreground text-base font-normal font-sans"),u=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(O(),a),"data-hook":t,"data-slot":"typography-p","data-tracking-el":e,"data-tracking-label":r,...n})});u.displayName="TypographyP";const x=c.cva("mt-6 border-l-2 pl-6 text-foreground text-base font-normal font-sans"),k=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"blockquote";return d.jsx(l,{ref:s,className:y.cn(x(),a),"data-hook":t,"data-slot":"typography-blockquote","data-tracking-el":e,"data-tracking-label":r,...n})});k.displayName="TypographyBlockquote";const P=c.cva("self-stretch ml-6 list-disc text-foreground text-base font-normal font-sans leading-6"),b=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"ul";return d.jsx(l,{ref:s,className:y.cn(P(),a),"data-hook":t,"data-slot":"typography-list","data-tracking-el":e,"data-tracking-label":r,...n})});b.displayName="TypographyList";const M=c.cva("inline-flex justify-center items-center gap-2 bg-muted rounded-md px-[4.80px] py-[3.20px] text-foreground text-sm font-normal font-mono leading-5"),T=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"code";return d.jsx(l,{ref:s,className:y.cn(M(),a),"data-hook":t,"data-slot":"typography-inline-code","data-tracking-el":e,"data-tracking-label":r,...n})});T.displayName="TypographyInlineCode";const B=c.cva("block w-full p-4 bg-zinc-900 rounded-lg border border-border text-white/50 text-base font-normal font-mono leading-6 overflow-x-auto"),N=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"pre";return d.jsx(l,{ref:s,className:y.cn(B(),a),"data-hook":t,"data-slot":"typography-code","data-tracking-el":e,"data-tracking-label":r,...n})});N.displayName="TypographyCode";const I=c.cva("text-muted-foreground text-xl font-normal font-sans leading-7"),S=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(I(),a),"data-hook":t,"data-slot":"typography-lead","data-tracking-el":e,"data-tracking-label":r,...n})});S.displayName="TypographyLead";const _=c.cva("text-foreground text-lg font-semibold font-sans leading-7"),j=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"div";return d.jsx(l,{ref:s,className:y.cn(_(),a),"data-hook":t,"data-slot":"typography-large","data-tracking-el":e,"data-tracking-label":r,...n})});j.displayName="TypographyLarge";const z=c.cva("text-foreground text-sm font-medium font-sans leading-5"),C=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"small";return d.jsx(l,{ref:s,className:y.cn(z(),a),"data-hook":t,"data-slot":"typography-small","data-tracking-el":e,"data-tracking-label":r,...n})});C.displayName="TypographySmall";const D=c.cva("text-muted-foreground text-sm font-medium font-sans leading-5"),v=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(D(),a),"data-hook":t,"data-slot":"typography-muted","data-tracking-el":e,"data-tracking-label":r,...n})});v.displayName="TypographyMuted";exports.TypographyBlockquote=k;exports.TypographyCode=N;exports.TypographyH1=i;exports.TypographyH2=f;exports.TypographyH3=h;exports.TypographyH4=m;exports.TypographyInlineCode=T;exports.TypographyLarge=j;exports.TypographyLead=S;exports.TypographyList=b;exports.TypographyMuted=v;exports.TypographyP=u;exports.TypographySmall=C;exports.blockquoteVariants=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),w=require("react"),p=require("@radix-ui/react-slot"),c=require("class-variance-authority"),y=require("@brightlocal/ui-components/lib/utils");function R(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(o,t,e.get?e:{enumerable:!0,get:()=>a[t]})}}return o.default=a,Object.freeze(o)}const g=R(w),V=c.cva("self-stretch text-foreground text-4xl font-extrabold font-sans leading-10 lg:text-5xl lg:font-medium lg:font-display lg:leading-12"),i=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h1";return d.jsx(l,{ref:s,className:y.cn(V(),a),"data-hook":t,"data-slot":"typography-h1","data-tracking-el":e,"data-tracking-label":r,...n})});i.displayName="TypographyH1";const q=c.cva("text-foreground text-3xl font-semibold font-sans leading-9"),f=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h2";return d.jsx(l,{ref:s,className:y.cn(q(),a),"data-hook":t,"data-slot":"typography-h2","data-tracking-el":e,"data-tracking-label":r,...n})});f.displayName="TypographyH2";const H=c.cva("text-foreground text-2xl font-semibold font-sans leading-8"),h=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h3";return d.jsx(l,{ref:s,className:y.cn(H(),a),"data-hook":t,"data-slot":"typography-h3","data-tracking-el":e,"data-tracking-label":r,...n})});h.displayName="TypographyH3";const L=c.cva("text-foreground text-xl font-semibold font-sans leading-7"),m=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"h4";return d.jsx(l,{ref:s,className:y.cn(L(),a),"data-hook":t,"data-slot":"typography-h4","data-tracking-el":e,"data-tracking-label":r,...n})});m.displayName="TypographyH4";const O=c.cva("text-foreground text-base font-normal font-sans"),u=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(O(),a),"data-hook":t,"data-slot":"typography-p","data-tracking-el":e,"data-tracking-label":r,...n})});u.displayName="TypographyP";const x=c.cva("mt-6 border-l-2 pl-6 text-foreground text-base font-normal font-sans"),k=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"blockquote";return d.jsx(l,{ref:s,className:y.cn(x(),a),"data-hook":t,"data-slot":"typography-blockquote","data-tracking-el":e,"data-tracking-label":r,...n})});k.displayName="TypographyBlockquote";const P=c.cva("self-stretch ml-6 list-disc text-foreground text-base font-normal font-sans leading-6"),b=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"ul";return d.jsx(l,{ref:s,className:y.cn(P(),a),"data-hook":t,"data-slot":"typography-list","data-tracking-el":e,"data-tracking-label":r,...n})});b.displayName="TypographyList";const M=c.cva("inline-flex justify-center items-center gap-2 bg-muted rounded-md px-[4.80px] py-[3.20px] text-foreground text-sm font-normal font-mono leading-5"),T=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"code";return d.jsx(l,{ref:s,className:y.cn(M(),a),"data-hook":t,"data-slot":"typography-inline-code","data-tracking-el":e,"data-tracking-label":r,...n})});T.displayName="TypographyInlineCode";const I=c.cva("block w-full p-4 bg-zinc-900 rounded-lg border border-border text-white/50 text-base font-normal font-mono leading-6 overflow-x-auto"),N=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"pre";return d.jsx(l,{ref:s,className:y.cn(I(),a),"data-hook":t,"data-slot":"typography-code","data-tracking-el":e,"data-tracking-label":r,tabIndex:0,...n})});N.displayName="TypographyCode";const B=c.cva("text-muted-foreground text-xl font-normal font-sans leading-7"),S=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(B(),a),"data-hook":t,"data-slot":"typography-lead","data-tracking-el":e,"data-tracking-label":r,...n})});S.displayName="TypographyLead";const _=c.cva("text-foreground text-lg font-semibold font-sans leading-7"),j=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"div";return d.jsx(l,{ref:s,className:y.cn(_(),a),"data-hook":t,"data-slot":"typography-large","data-tracking-el":e,"data-tracking-label":r,...n})});j.displayName="TypographyLarge";const z=c.cva("text-foreground text-sm font-medium font-sans leading-5"),C=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"small";return d.jsx(l,{ref:s,className:y.cn(z(),a),"data-hook":t,"data-slot":"typography-small","data-tracking-el":e,"data-tracking-label":r,...n})});C.displayName="TypographySmall";const D=c.cva("text-muted-foreground text-sm font-medium font-sans leading-5"),v=g.forwardRef(({className:a,asChild:o=!1,dataHook:t,trackingEl:e,trackingLabel:r,...n},s)=>{const l=o?p.Slot:"p";return d.jsx(l,{ref:s,className:y.cn(D(),a),"data-hook":t,"data-slot":"typography-muted","data-tracking-el":e,"data-tracking-label":r,...n})});v.displayName="TypographyMuted";exports.TypographyBlockquote=k;exports.TypographyCode=N;exports.TypographyH1=i;exports.TypographyH2=f;exports.TypographyH3=h;exports.TypographyH4=m;exports.TypographyInlineCode=T;exports.TypographyLarge=j;exports.TypographyLead=S;exports.TypographyList=b;exports.TypographyMuted=v;exports.TypographyP=u;exports.TypographySmall=C;exports.blockquoteVariants=x;
@@ -1 +1 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/components/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,UAAU,mBAAmB;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAUF;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAUF;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAUF;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAQF;;;GAGG;AACH,UAAU,gBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,mBAAmB;CAAG;AAE3D;;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AE3D;;;GAGG;AACH,QAAA,MAAM,eAAe,gHA4BpB,CAAC;AAMF,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,GAChB,CAAC;AAEF,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,CAAC"}
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/components/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,UAAU,mBAAmB;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAUF;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM,YAAY,2GAyBjB,CAAC;AAUF;;;GAGG;AACH,UAAU,iBACR,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,mBAAmB;CAAG;AAE5D;;;GAGG;AACH,QAAA,MAAM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