@telia/teddy 0.0.6 → 0.0.7

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,14 +1,14 @@
1
1
  import './assets/badge.css';
2
2
  import { jsx as l, Fragment as le, jsxs as K } from "react/jsx-runtime";
3
- import { c as _ } from "./clsx-DB4S2d7J.js";
4
- import a, { forwardRef as S, useState as fe, useRef as E, createElement as v, useEffect as be, useCallback as ze } from "react";
5
- import { b as W, _ as m, a as ue, $ as je } from "./index-DpfSJps6.js";
6
- import { $ as Fe } from "./radio-group-0Oc9WTDf.js";
3
+ import { c as u } from "./clsx-DB4S2d7J.js";
4
+ import c, { forwardRef as T, useState as fe, useRef as E, createElement as v, useEffect as be, useCallback as je } from "react";
5
+ import { b as W, _ as m, a as _e, $ as Fe } from "./index-DpfSJps6.js";
6
+ import { $ as Ue } from "./radio-group-BR5SMJXJ.js";
7
7
  import "./components/box/box.js";
8
8
  import "./components/flex/flex.js";
9
9
  import "./components/grid/grid.js";
10
10
  import "./components/navigation-menu/navigation-menu.js";
11
- import { a as X, c as D, e as Y, i as Ue, f as _e, h as Ge, g as Ke, $ as We, b as Xe } from "./index-0Eg2mucA.js";
11
+ import { a as X, c as D, e as Y, i as ze, f as ue, h as Ge, g as Ke, $ as We, b as Xe } from "./index-0Eg2mucA.js";
12
12
  import { $ as P } from "./index-DM5e-Whg.js";
13
13
  import "./assets/5161b177f001ea1a.svg";
14
14
  import { Icon as J } from "./components/icon/icon.js";
@@ -44,25 +44,25 @@ const p = {
44
44
  "teddy-card__image--inset-bottom": "_teddy-card__image--inset-bottom_18dt8_163",
45
45
  "teddy-card__image--inset-left": "_teddy-card__image--inset-left_18dt8_166",
46
46
  "teddy-card__image--inset-right": "_teddy-card__image--inset-right_18dt8_169"
47
- }, h = "teddy-card", U = `${h}__action`, tt = ["purple-light", "purple-dark", "gray", "white", "beige"], Z = a.createContext(void 0), pe = a.forwardRef(
48
- ({ className: e, children: n, backgroundImageSrc: t, variant: r, bordered: o, ...c }, d) => {
49
- const s = a.useRef(null), i = a.useRef(null), f = _(
50
- [p[`${h}`]],
47
+ }, y = "teddy-card", z = `${y}__action`, tt = ["purple-light", "purple-dark", "gray", "white", "beige"], Z = c.createContext(void 0), pe = c.forwardRef(
48
+ ({ className: e, children: n, backgroundImageSrc: t, variant: r, bordered: o, ...a }, d) => {
49
+ const s = c.useRef(null), i = c.useRef(null), f = u(
50
+ [p[`${y}`]],
51
51
  {
52
- [p[`${h}--${r}`]]: r,
53
- [p[`${h}--border`]]: o,
54
- [p[`${h}--background-image`]]: t
52
+ [p[`${y}--${r}`]]: r,
53
+ [p[`${y}--border`]]: o,
54
+ [p[`${y}--background-image`]]: t
55
55
  },
56
56
  e
57
57
  );
58
58
  return /* @__PURE__ */ l(
59
59
  Ze,
60
60
  {
61
- ...c,
62
- style: t ? { background: `url(${t})`, ...c.style } : c.style,
63
- onClick: et(c.onClick, (u) => {
61
+ ...a,
62
+ style: t ? { background: `url(${t})`, ...a.style } : a.style,
63
+ onClick: et(a.onClick, (_) => {
64
64
  var b;
65
- if (!u.isDefaultPrevented()) {
65
+ if (!_.isDefaultPrevented()) {
66
66
  if (i.current)
67
67
  return i.current.click();
68
68
  (b = s.current) == null || b.click();
@@ -76,9 +76,9 @@ const p = {
76
76
  }
77
77
  );
78
78
  pe.displayName = "Card";
79
- const me = a.forwardRef(
79
+ const me = c.forwardRef(
80
80
  ({ className: e, variant: n = "title-200", as: t = "h2", ...r }, o) => {
81
- const c = _([p[`${h}__heading`]], e);
81
+ const a = u([p[`${y}__heading`]], e);
82
82
  return /* @__PURE__ */ l(
83
83
  Q,
84
84
  {
@@ -86,14 +86,14 @@ const me = a.forwardRef(
86
86
  ...r.asChild ? { as: void 0, asChild: !0 } : { as: t, asChild: !1 },
87
87
  variant: n,
88
88
  ref: o,
89
- className: c
89
+ className: a
90
90
  }
91
91
  );
92
92
  }
93
93
  );
94
94
  me.displayName = "Card.Heading";
95
- const ge = a.forwardRef(({ className: e, ...n }, t) => {
96
- const r = _([p[`${h}__content`]], e);
95
+ const ge = c.forwardRef(({ className: e, ...n }, t) => {
96
+ const r = u([p[`${y}__content`]], e);
97
97
  return /* @__PURE__ */ l("div", { ...n, ref: t, className: r });
98
98
  });
99
99
  ge.displayName = "Card.Content";
@@ -111,21 +111,21 @@ const ot = [
111
111
  "bottom-right",
112
112
  "top-bottom",
113
113
  "left-right"
114
- ], he = a.forwardRef(({ className: e, ...n }, t) => {
115
- var o, c, d, s, i, f, u, b;
116
- const r = _(
117
- [p[`${h}__image`]],
114
+ ], ye = c.forwardRef(({ className: e, ...n }, t) => {
115
+ var o, a, d, s, i, f, _, b;
116
+ const r = u(
117
+ [p[`${y}__image`]],
118
118
  {
119
- [p[`${h}__image--inset-top`]]: ((o = n.inset) == null ? void 0 : o.includes("top")) || ((c = n.inset) == null ? void 0 : c.includes("all")),
120
- [p[`${h}__image--inset-bottom`]]: ((d = n.inset) == null ? void 0 : d.includes("bottom")) || ((s = n.inset) == null ? void 0 : s.includes("all")),
121
- [p[`${h}__image--inset-left`]]: ((i = n.inset) == null ? void 0 : i.includes("left")) || ((f = n.inset) == null ? void 0 : f.includes("all")),
122
- [p[`${h}__image--inset-right`]]: ((u = n.inset) == null ? void 0 : u.includes("right")) || ((b = n.inset) == null ? void 0 : b.includes("all"))
119
+ [p[`${y}__image--inset-top`]]: ((o = n.inset) == null ? void 0 : o.includes("top")) || ((a = n.inset) == null ? void 0 : a.includes("all")),
120
+ [p[`${y}__image--inset-bottom`]]: ((d = n.inset) == null ? void 0 : d.includes("bottom")) || ((s = n.inset) == null ? void 0 : s.includes("all")),
121
+ [p[`${y}__image--inset-left`]]: ((i = n.inset) == null ? void 0 : i.includes("left")) || ((f = n.inset) == null ? void 0 : f.includes("all")),
122
+ [p[`${y}__image--inset-right`]]: ((_ = n.inset) == null ? void 0 : _.includes("right")) || ((b = n.inset) == null ? void 0 : b.includes("all"))
123
123
  },
124
124
  e
125
125
  );
126
126
  return /* @__PURE__ */ l("img", { ...n, ref: t, className: r });
127
127
  });
128
- he.displayName = "Card.Image";
128
+ ye.displayName = "Card.Image";
129
129
  function nt(e) {
130
130
  switch (e) {
131
131
  case "purple-dark":
@@ -134,13 +134,13 @@ function nt(e) {
134
134
  return "primary";
135
135
  }
136
136
  }
137
- const ye = a.forwardRef(
137
+ const he = c.forwardRef(
138
138
  ({ className: e, iconOnly: n = !1, ...t }, r) => {
139
- const o = a.useContext(Z), c = _(
140
- [p[`${h}__button`]],
141
- p[U],
139
+ const o = c.useContext(Z), a = u(
140
+ [p[`${y}__button`]],
141
+ p[z],
142
142
  {
143
- [p[`${U}--disabled`]]: t.disabled
143
+ [p[`${z}--disabled`]]: t.disabled
144
144
  },
145
145
  e
146
146
  ), d = $e(o == null ? void 0 : o.buttonRef, r);
@@ -151,85 +151,85 @@ const ye = a.forwardRef(
151
151
  ...t,
152
152
  ref: d,
153
153
  variant: nt(o == null ? void 0 : o.variant),
154
- className: c
154
+ className: a
155
155
  }
156
156
  ) });
157
157
  }
158
158
  );
159
- ye.displayName = "Card.Button";
160
- const Ce = a.forwardRef(
159
+ he.displayName = "Card.Button";
160
+ const Ce = c.forwardRef(
161
161
  ({ className: e, ...n }, t) => {
162
- const r = a.useContext(Z), o = _([p[`${h}__link`]], p[U], e), c = $e(r == null ? void 0 : r.linkRef, t);
163
- return /* @__PURE__ */ l(Ye, { ...n, ref: c, className: o });
162
+ const r = c.useContext(Z), o = u([p[`${y}__link`]], p[z], e), a = $e(r == null ? void 0 : r.linkRef, t);
163
+ return /* @__PURE__ */ l(Ye, { ...n, ref: a, className: o });
164
164
  }
165
165
  );
166
166
  Ce.displayName = "Card.Link";
167
167
  const vo = Object.assign(pe, {
168
168
  Heading: me,
169
169
  Content: ge,
170
- Image: he,
171
- Button: ye,
170
+ Image: ye,
171
+ Button: he,
172
172
  Link: Ce,
173
173
  variantOptions: tt,
174
174
  insetOptions: ot
175
- }), ve = "Switch", [rt, wo] = X(ve), [ct, at] = rt(ve), dt = /* @__PURE__ */ S((e, n) => {
176
- const { __scopeSwitch: t, name: r, checked: o, defaultChecked: c, required: d, disabled: s, value: i = "on", onCheckedChange: f, ...u } = e, [b, w] = fe(null), A = W(
175
+ }), ve = "Switch", [rt, xo] = X(ve), [at, ct] = rt(ve), dt = /* @__PURE__ */ T((e, n) => {
176
+ const { __scopeSwitch: t, name: r, checked: o, defaultChecked: a, required: d, disabled: s, value: i = "on", onCheckedChange: f, ..._ } = e, [b, x] = fe(null), A = W(
177
177
  n,
178
- ($) => w($)
179
- ), x = E(!1), I = b ? !!b.closest("form") : !0, [y = !1, C] = D({
178
+ ($) => x($)
179
+ ), w = E(!1), N = b ? !!b.closest("form") : !0, [h = !1, C] = D({
180
180
  prop: o,
181
- defaultProp: c,
181
+ defaultProp: a,
182
182
  onChange: f
183
183
  });
184
- return /* @__PURE__ */ v(ct, {
184
+ return /* @__PURE__ */ v(at, {
185
185
  scope: t,
186
- checked: y,
186
+ checked: h,
187
187
  disabled: s
188
188
  }, /* @__PURE__ */ v(P.button, m({
189
189
  type: "button",
190
190
  role: "switch",
191
- "aria-checked": y,
191
+ "aria-checked": h,
192
192
  "aria-required": d,
193
- "data-state": we(y),
193
+ "data-state": xe(h),
194
194
  "data-disabled": s ? "" : void 0,
195
195
  disabled: s,
196
196
  value: i
197
- }, u, {
197
+ }, _, {
198
198
  ref: A,
199
199
  onClick: Y(e.onClick, ($) => {
200
200
  C(
201
201
  (g) => !g
202
- ), I && (x.current = $.isPropagationStopped(), x.current || $.stopPropagation());
202
+ ), N && (w.current = $.isPropagationStopped(), w.current || $.stopPropagation());
203
203
  })
204
- })), I && /* @__PURE__ */ v(lt, {
204
+ })), N && /* @__PURE__ */ v(lt, {
205
205
  control: b,
206
- bubbles: !x.current,
206
+ bubbles: !w.current,
207
207
  name: r,
208
208
  value: i,
209
- checked: y,
209
+ checked: h,
210
210
  required: d,
211
211
  disabled: s,
212
212
  style: {
213
213
  transform: "translateX(-100%)"
214
214
  }
215
215
  }));
216
- }), st = "SwitchThumb", it = /* @__PURE__ */ S((e, n) => {
217
- const { __scopeSwitch: t, ...r } = e, o = at(st, t);
216
+ }), st = "SwitchThumb", it = /* @__PURE__ */ T((e, n) => {
217
+ const { __scopeSwitch: t, ...r } = e, o = ct(st, t);
218
218
  return /* @__PURE__ */ v(P.span, m({
219
- "data-state": we(o.checked),
219
+ "data-state": xe(o.checked),
220
220
  "data-disabled": o.disabled ? "" : void 0
221
221
  }, r, {
222
222
  ref: n
223
223
  }));
224
224
  }), lt = (e) => {
225
- const { control: n, checked: t, bubbles: r = !0, ...o } = e, c = E(null), d = Ue(t), s = Fe(n);
225
+ const { control: n, checked: t, bubbles: r = !0, ...o } = e, a = E(null), d = ze(t), s = Ue(n);
226
226
  return be(() => {
227
- const i = c.current, f = window.HTMLInputElement.prototype, b = Object.getOwnPropertyDescriptor(f, "checked").set;
227
+ const i = a.current, f = window.HTMLInputElement.prototype, b = Object.getOwnPropertyDescriptor(f, "checked").set;
228
228
  if (d !== t && b) {
229
- const w = new Event("click", {
229
+ const x = new Event("click", {
230
230
  bubbles: r
231
231
  });
232
- b.call(i, t), i.dispatchEvent(w);
232
+ b.call(i, t), i.dispatchEvent(x);
233
233
  }
234
234
  }, [
235
235
  d,
@@ -241,7 +241,7 @@ const vo = Object.assign(pe, {
241
241
  defaultChecked: t
242
242
  }, o, {
243
243
  tabIndex: -1,
244
- ref: c,
244
+ ref: a,
245
245
  style: {
246
246
  ...e.style,
247
247
  ...s,
@@ -252,24 +252,24 @@ const vo = Object.assign(pe, {
252
252
  }
253
253
  }));
254
254
  };
255
- function we(e) {
255
+ function xe(e) {
256
256
  return e ? "checked" : "unchecked";
257
257
  }
258
- const ft = dt, bt = it, O = {
259
- "teddy-switch": "_teddy-switch_czkrx_3",
260
- "teddy-switch__input": "_teddy-switch__input_czkrx_10",
261
- "teddy-switch__thumb": "_teddy-switch__thumb_czkrx_78",
262
- "teddy-switch__indicator": "_teddy-switch__indicator_czkrx_104"
263
- }, T = "teddy-switch", ee = a.createContext(void 0), xe = a.forwardRef(
258
+ const ft = dt, bt = it, S = {
259
+ "teddy-toggle": "_teddy-toggle_1rp8d_3",
260
+ "teddy-toggle__input": "_teddy-toggle__input_1rp8d_10",
261
+ "teddy-toggle__thumb": "_teddy-toggle__thumb_1rp8d_78",
262
+ "teddy-toggle__indicator": "_teddy-toggle__indicator_1rp8d_104"
263
+ }, O = "teddy-toggle", ee = c.createContext(void 0), we = c.forwardRef(
264
264
  ({ className: e, id: n, children: t, ...r }, o) => {
265
- const c = _([O[`${T}`]], e), d = a.useId(), [s, i] = a.useState(!1), [f, u] = a.useState(!1);
266
- return /* @__PURE__ */ l("div", { ...r, ref: o, className: c, children: /* @__PURE__ */ l(ee.Provider, { value: { id: n ?? d, isDisabled: s, setIsDisabled: i, isRequired: f, setIsRequired: u }, children: t }) });
265
+ const a = u([S[`${O}`]], e), d = c.useId(), [s, i] = c.useState(!1), [f, _] = c.useState(!1);
266
+ return /* @__PURE__ */ l("div", { ...r, ref: o, className: a, children: /* @__PURE__ */ l(ee.Provider, { value: { id: n ?? d, isDisabled: s, setIsDisabled: i, isRequired: f, setIsRequired: _ }, children: t }) });
267
267
  }
268
268
  );
269
- xe.displayName = "Switch";
270
- const Ae = a.forwardRef(
269
+ we.displayName = "Toggle";
270
+ const Ae = c.forwardRef(
271
271
  ({ className: e, ...n }, t) => {
272
- const r = _([O[`${T}__label`]], e), o = a.useContext(ee);
272
+ const r = u([S[`${O}__label`]], e), o = c.useContext(ee);
273
273
  return /* @__PURE__ */ l(
274
274
  Qe,
275
275
  {
@@ -283,65 +283,66 @@ const Ae = a.forwardRef(
283
283
  );
284
284
  }
285
285
  );
286
- Ae.displayName = "Switch.Label";
287
- const Re = a.forwardRef(
286
+ Ae.displayName = "Toggle.Label";
287
+ const Re = c.forwardRef(
288
288
  ({ className: e, children: n, ...t }, r) => {
289
- const o = _([O[`${T}__input`]], e), c = a.useContext(ee);
290
- return a.useEffect(() => {
291
- c && c.setIsDisabled(t.disabled === !0);
292
- }, [c, t.disabled]), a.useEffect(() => {
293
- c && c.setIsRequired(t.required === !0);
294
- }, [c, t.required]), /* @__PURE__ */ l(ft, { ...t, id: c == null ? void 0 : c.id, ref: r, className: o, children: n || /* @__PURE__ */ K(le, { children: [
289
+ const o = u([S[`${O}__input`]], e), a = c.useContext(ee);
290
+ return c.useEffect(() => {
291
+ a && a.setIsDisabled(t.disabled === !0);
292
+ }, [a, t.disabled]), c.useEffect(() => {
293
+ a && a.setIsRequired(t.required === !0);
294
+ }, [a, t.required]), /* @__PURE__ */ l(ft, { ...t, id: a == null ? void 0 : a.id, ref: r, className: o, children: n || /* @__PURE__ */ K(le, { children: [
295
295
  /* @__PURE__ */ l(M, {}),
296
- /* @__PURE__ */ l(ke, {})
296
+ /* @__PURE__ */ l(Ie, {})
297
297
  ] }) });
298
298
  }
299
299
  );
300
- Re.displayName = "Switch.Input";
301
- const M = a.forwardRef(
300
+ Re.displayName = "Toggle.Input";
301
+ const M = c.forwardRef(
302
302
  ({ className: e, ...n }, t) => {
303
- const r = _([O[`${T}__thumb`]], e);
303
+ const r = u([S[`${O}__thumb`]], e);
304
304
  return /* @__PURE__ */ l(bt, { ...n, ref: t, className: r });
305
305
  }
306
306
  );
307
- M.displayName = "Switch.Thumb";
308
- const ke = a.forwardRef(
307
+ M.displayName = "Toggle.Thumb";
308
+ const Ie = c.forwardRef(
309
309
  ({ className: e, ...n }, t) => {
310
- const r = _([O[`${T}__indicator`]], e);
310
+ const r = u([S[`${O}__indicator`]], e);
311
311
  return /* @__PURE__ */ l(J, { name: "checkmark-bold", size: "xxs", ...n, ref: t, className: r });
312
312
  }
313
313
  );
314
- M.displayName = "Switch.Indicator";
315
- const xo = Object.assign(xe, {
314
+ M.displayName = "Toggle.Indicator";
315
+ const wo = Object.assign(we, {
316
316
  Label: Ae,
317
317
  Input: Re,
318
318
  Thumb: M,
319
- Indicator: ke
320
- }), ut = "_slideDown_989e7_1", _t = "_slideUp_989e7_1", R = {
321
- "teddy-accordion--indented": "_teddy-accordion--indented_989e7_3",
322
- "teddy-accordion__trigger": "_teddy-accordion__trigger_989e7_3",
323
- "teddy-accordion__content": "_teddy-accordion__content_989e7_4",
324
- "teddy-accordion": "_teddy-accordion_989e7_3",
325
- "teddy-accordion__title": "_teddy-accordion__title_989e7_16",
326
- "teddy-accordion__item": "_teddy-accordion__item_989e7_24",
327
- "teddy-accordion__header": "_teddy-accordion__header_989e7_33",
328
- "teddy-accordion__indicator": "_teddy-accordion__indicator_989e7_86",
329
- slideDown: ut,
330
- slideUp: _t
331
- }, Ie = "Collapsible", [$t, Ne] = X(Ie), [pt, te] = $t(Ie), mt = /* @__PURE__ */ S((e, n) => {
332
- const { __scopeCollapsible: t, open: r, defaultOpen: o, disabled: c, onOpenChange: d, ...s } = e, [i = !1, f] = D({
319
+ Indicator: Ie
320
+ }), _t = "_slideDown_1nr64_1", ut = "_slideUp_1nr64_1", R = {
321
+ "teddy-accordion--indented": "_teddy-accordion--indented_1nr64_3",
322
+ "teddy-accordion__trigger": "_teddy-accordion__trigger_1nr64_3",
323
+ "teddy-accordion__content": "_teddy-accordion__content_1nr64_4",
324
+ "teddy-accordion--negative": "_teddy-accordion--negative_1nr64_13",
325
+ "teddy-accordion__header": "_teddy-accordion__header_1nr64_13",
326
+ "teddy-accordion__title": "_teddy-accordion__title_1nr64_17",
327
+ "teddy-accordion__item": "_teddy-accordion__item_1nr64_28",
328
+ "teddy-accordion": "_teddy-accordion_1nr64_3",
329
+ "teddy-accordion__indicator": "_teddy-accordion__indicator_1nr64_107",
330
+ slideDown: _t,
331
+ slideUp: ut
332
+ }, Ne = "Collapsible", [$t, ke] = X(Ne), [pt, te] = $t(Ne), mt = /* @__PURE__ */ T((e, n) => {
333
+ const { __scopeCollapsible: t, open: r, defaultOpen: o, disabled: a, onOpenChange: d, ...s } = e, [i = !1, f] = D({
333
334
  prop: r,
334
335
  defaultProp: o,
335
336
  onChange: d
336
337
  });
337
338
  return /* @__PURE__ */ v(pt, {
338
339
  scope: t,
339
- disabled: c,
340
- contentId: _e(),
340
+ disabled: a,
341
+ contentId: ue(),
341
342
  open: i,
342
- onOpenToggle: ze(
343
+ onOpenToggle: je(
343
344
  () => f(
344
- (u) => !u
345
+ (_) => !_
345
346
  ),
346
347
  [
347
348
  f
@@ -349,11 +350,11 @@ const xo = Object.assign(xe, {
349
350
  )
350
351
  }, /* @__PURE__ */ v(P.div, m({
351
352
  "data-state": oe(i),
352
- "data-disabled": c ? "" : void 0
353
+ "data-disabled": a ? "" : void 0
353
354
  }, s, {
354
355
  ref: n
355
356
  })));
356
- }), gt = "CollapsibleTrigger", ht = /* @__PURE__ */ S((e, n) => {
357
+ }), gt = "CollapsibleTrigger", yt = /* @__PURE__ */ T((e, n) => {
357
358
  const { __scopeCollapsible: t, ...r } = e, o = te(gt, t);
358
359
  return /* @__PURE__ */ v(P.button, m({
359
360
  type: "button",
@@ -366,23 +367,23 @@ const xo = Object.assign(xe, {
366
367
  ref: n,
367
368
  onClick: Y(e.onClick, o.onOpenToggle)
368
369
  }));
369
- }), Ee = "CollapsibleContent", yt = /* @__PURE__ */ S((e, n) => {
370
+ }), Ee = "CollapsibleContent", ht = /* @__PURE__ */ T((e, n) => {
370
371
  const { forceMount: t, ...r } = e, o = te(Ee, e.__scopeCollapsible);
371
372
  return /* @__PURE__ */ v(
372
373
  Ge,
373
374
  {
374
375
  present: t || o.open
375
376
  },
376
- ({ present: c }) => /* @__PURE__ */ v(Ct, m({}, r, {
377
+ ({ present: a }) => /* @__PURE__ */ v(Ct, m({}, r, {
377
378
  ref: n,
378
- present: c
379
+ present: a
379
380
  }))
380
381
  );
381
- }), Ct = /* @__PURE__ */ S((e, n) => {
382
- const { __scopeCollapsible: t, present: r, children: o, ...c } = e, d = te(Ee, t), [s, i] = fe(r), f = E(null), u = W(n, f), b = E(0), w = b.current, A = E(0), x = A.current, I = d.open || s, y = E(I), C = E();
382
+ }), Ct = /* @__PURE__ */ T((e, n) => {
383
+ const { __scopeCollapsible: t, present: r, children: o, ...a } = e, d = te(Ee, t), [s, i] = fe(r), f = E(null), _ = W(n, f), b = E(0), x = b.current, A = E(0), w = A.current, N = d.open || s, h = E(N), C = E();
383
384
  return be(() => {
384
385
  const $ = requestAnimationFrame(
385
- () => y.current = !1
386
+ () => h.current = !1
386
387
  );
387
388
  return () => cancelAnimationFrame($);
388
389
  }, []), Ke(() => {
@@ -393,7 +394,7 @@ const xo = Object.assign(xe, {
393
394
  animationName: $.style.animationName
394
395
  }, $.style.transitionDuration = "0s", $.style.animationName = "none";
395
396
  const g = $.getBoundingClientRect();
396
- b.current = g.height, A.current = g.width, y.current || ($.style.transitionDuration = C.current.transitionDuration, $.style.animationName = C.current.animationName), i(r);
397
+ b.current = g.height, A.current = g.width, h.current || ($.style.transitionDuration = C.current.transitionDuration, $.style.animationName = C.current.animationName), i(r);
397
398
  }
398
399
  }, [
399
400
  d.open,
@@ -402,36 +403,36 @@ const xo = Object.assign(xe, {
402
403
  "data-state": oe(d.open),
403
404
  "data-disabled": d.disabled ? "" : void 0,
404
405
  id: d.contentId,
405
- hidden: !I
406
- }, c, {
407
- ref: u,
406
+ hidden: !N
407
+ }, a, {
408
+ ref: _,
408
409
  style: {
409
- "--radix-collapsible-content-height": w ? `${w}px` : void 0,
410
- "--radix-collapsible-content-width": x ? `${x}px` : void 0,
410
+ "--radix-collapsible-content-height": x ? `${x}px` : void 0,
411
+ "--radix-collapsible-content-width": w ? `${w}px` : void 0,
411
412
  ...e.style
412
413
  }
413
- }), I && o);
414
+ }), N && o);
414
415
  });
415
416
  function oe(e) {
416
417
  return e ? "open" : "closed";
417
418
  }
418
- const vt = mt, wt = ht, xt = yt, N = "Accordion", At = [
419
+ const vt = mt, xt = yt, wt = ht, k = "Accordion", At = [
419
420
  "Home",
420
421
  "End",
421
422
  "ArrowDown",
422
423
  "ArrowUp",
423
424
  "ArrowLeft",
424
425
  "ArrowRight"
425
- ], [ne, Rt, kt] = We(N), [V, Ao] = X(N, [
426
- kt,
427
- Ne
428
- ]), re = Ne(), Pe = /* @__PURE__ */ a.forwardRef((e, n) => {
429
- const { type: t, ...r } = e, o = r, c = r;
430
- return /* @__PURE__ */ a.createElement(ne.Provider, {
426
+ ], [ne, Rt, It] = We(k), [V, Ao] = X(k, [
427
+ It,
428
+ ke
429
+ ]), re = ke(), Pe = /* @__PURE__ */ c.forwardRef((e, n) => {
430
+ const { type: t, ...r } = e, o = r, a = r;
431
+ return /* @__PURE__ */ c.createElement(ne.Provider, {
431
432
  scope: e.__scopeAccordion
432
- }, t === "multiple" ? /* @__PURE__ */ a.createElement(Pt, m({}, c, {
433
+ }, t === "multiple" ? /* @__PURE__ */ c.createElement(Pt, m({}, a, {
433
434
  ref: n
434
- })) : /* @__PURE__ */ a.createElement(Et, m({}, o, {
435
+ })) : /* @__PURE__ */ c.createElement(Et, m({}, o, {
435
436
  ref: n
436
437
  })));
437
438
  });
@@ -444,89 +445,89 @@ Pe.propTypes = {
444
445
  ].includes(e.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : e.type === "multiple" && typeof n == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : e.type === "single" && Array.isArray(n) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null;
445
446
  }
446
447
  };
447
- const [Se, It] = V(N), [Oe, Nt] = V(N, {
448
+ const [Te, Nt] = V(k), [Se, kt] = V(k, {
448
449
  collapsible: !1
449
- }), Et = /* @__PURE__ */ a.forwardRef((e, n) => {
450
+ }), Et = /* @__PURE__ */ c.forwardRef((e, n) => {
450
451
  const { value: t, defaultValue: r, onValueChange: o = () => {
451
- }, collapsible: c = !1, ...d } = e, [s, i] = D({
452
+ }, collapsible: a = !1, ...d } = e, [s, i] = D({
452
453
  prop: t,
453
454
  defaultProp: r,
454
455
  onChange: o
455
456
  });
456
- return /* @__PURE__ */ a.createElement(Se, {
457
+ return /* @__PURE__ */ c.createElement(Te, {
457
458
  scope: e.__scopeAccordion,
458
459
  value: s ? [
459
460
  s
460
461
  ] : [],
461
462
  onItemOpen: i,
462
- onItemClose: a.useCallback(
463
- () => c && i(""),
463
+ onItemClose: c.useCallback(
464
+ () => a && i(""),
464
465
  [
465
- c,
466
+ a,
466
467
  i
467
468
  ]
468
469
  )
469
- }, /* @__PURE__ */ a.createElement(Oe, {
470
+ }, /* @__PURE__ */ c.createElement(Se, {
470
471
  scope: e.__scopeAccordion,
471
- collapsible: c
472
- }, /* @__PURE__ */ a.createElement(Te, m({}, d, {
472
+ collapsible: a
473
+ }, /* @__PURE__ */ c.createElement(Oe, m({}, d, {
473
474
  ref: n
474
475
  }))));
475
- }), Pt = /* @__PURE__ */ a.forwardRef((e, n) => {
476
+ }), Pt = /* @__PURE__ */ c.forwardRef((e, n) => {
476
477
  const { value: t, defaultValue: r, onValueChange: o = () => {
477
- }, ...c } = e, [d = [], s] = D({
478
+ }, ...a } = e, [d = [], s] = D({
478
479
  prop: t,
479
480
  defaultProp: r,
480
481
  onChange: o
481
- }), i = a.useCallback(
482
- (u) => s(
482
+ }), i = c.useCallback(
483
+ (_) => s(
483
484
  (b = []) => [
484
485
  ...b,
485
- u
486
+ _
486
487
  ]
487
488
  ),
488
489
  [
489
490
  s
490
491
  ]
491
- ), f = a.useCallback(
492
- (u) => s(
492
+ ), f = c.useCallback(
493
+ (_) => s(
493
494
  (b = []) => b.filter(
494
- (w) => w !== u
495
+ (x) => x !== _
495
496
  )
496
497
  ),
497
498
  [
498
499
  s
499
500
  ]
500
501
  );
501
- return /* @__PURE__ */ a.createElement(Se, {
502
+ return /* @__PURE__ */ c.createElement(Te, {
502
503
  scope: e.__scopeAccordion,
503
504
  value: d,
504
505
  onItemOpen: i,
505
506
  onItemClose: f
506
- }, /* @__PURE__ */ a.createElement(Oe, {
507
+ }, /* @__PURE__ */ c.createElement(Se, {
507
508
  scope: e.__scopeAccordion,
508
509
  collapsible: !0
509
- }, /* @__PURE__ */ a.createElement(Te, m({}, c, {
510
+ }, /* @__PURE__ */ c.createElement(Oe, m({}, a, {
510
511
  ref: n
511
512
  }))));
512
- }), [St, L] = V(N), Te = /* @__PURE__ */ a.forwardRef((e, n) => {
513
- const { __scopeAccordion: t, disabled: r, dir: o, orientation: c = "vertical", ...d } = e, s = a.useRef(null), i = W(s, n), f = Rt(t), b = Xe(o) === "ltr", w = Y(e.onKeyDown, (A) => {
514
- var x;
513
+ }), [Tt, L] = V(k), Oe = /* @__PURE__ */ c.forwardRef((e, n) => {
514
+ const { __scopeAccordion: t, disabled: r, dir: o, orientation: a = "vertical", ...d } = e, s = c.useRef(null), i = W(s, n), f = Rt(t), b = Xe(o) === "ltr", x = Y(e.onKeyDown, (A) => {
515
+ var w;
515
516
  if (!At.includes(A.key))
516
517
  return;
517
- const I = A.target, y = f().filter((j) => {
518
- var F;
519
- return !((F = j.ref.current) !== null && F !== void 0 && F.disabled);
520
- }), C = y.findIndex(
521
- (j) => j.ref.current === I
522
- ), $ = y.length;
518
+ const N = A.target, h = f().filter((F) => {
519
+ var U;
520
+ return !((U = F.ref.current) !== null && U !== void 0 && U.disabled);
521
+ }), C = h.findIndex(
522
+ (F) => F.ref.current === N
523
+ ), $ = h.length;
523
524
  if (C === -1)
524
525
  return;
525
526
  A.preventDefault();
526
527
  let g = C;
527
528
  const B = 0, H = $ - 1, q = () => {
528
529
  g = C + 1, g > H && (g = B);
529
- }, z = () => {
530
+ }, j = () => {
530
531
  g = C - 1, g < B && (g = H);
531
532
  };
532
533
  switch (A.key) {
@@ -537,76 +538,76 @@ const [Se, It] = V(N), [Oe, Nt] = V(N, {
537
538
  g = H;
538
539
  break;
539
540
  case "ArrowRight":
540
- c === "horizontal" && (b ? q() : z());
541
+ a === "horizontal" && (b ? q() : j());
541
542
  break;
542
543
  case "ArrowDown":
543
- c === "vertical" && q();
544
+ a === "vertical" && q();
544
545
  break;
545
546
  case "ArrowLeft":
546
- c === "horizontal" && (b ? z() : q());
547
+ a === "horizontal" && (b ? j() : q());
547
548
  break;
548
549
  case "ArrowUp":
549
- c === "vertical" && z();
550
+ a === "vertical" && j();
550
551
  break;
551
552
  }
552
553
  const qe = g % $;
553
- (x = y[qe].ref.current) === null || x === void 0 || x.focus();
554
+ (w = h[qe].ref.current) === null || w === void 0 || w.focus();
554
555
  });
555
- return /* @__PURE__ */ a.createElement(St, {
556
+ return /* @__PURE__ */ c.createElement(Tt, {
556
557
  scope: t,
557
558
  disabled: r,
558
559
  direction: o,
559
- orientation: c
560
- }, /* @__PURE__ */ a.createElement(ne.Slot, {
560
+ orientation: a
561
+ }, /* @__PURE__ */ c.createElement(ne.Slot, {
561
562
  scope: t
562
- }, /* @__PURE__ */ a.createElement(P.div, m({}, d, {
563
- "data-orientation": c,
563
+ }, /* @__PURE__ */ c.createElement(P.div, m({}, d, {
564
+ "data-orientation": a,
564
565
  ref: i,
565
- onKeyDown: r ? void 0 : w
566
+ onKeyDown: r ? void 0 : x
566
567
  }))));
567
- }), G = "AccordionItem", [Ot, ce] = V(G), Tt = /* @__PURE__ */ a.forwardRef((e, n) => {
568
- const { __scopeAccordion: t, value: r, ...o } = e, c = L(G, t), d = It(G, t), s = re(t), i = _e(), f = r && d.value.includes(r) || !1, u = c.disabled || e.disabled;
569
- return /* @__PURE__ */ a.createElement(Ot, {
568
+ }), G = "AccordionItem", [St, ae] = V(G), Ot = /* @__PURE__ */ c.forwardRef((e, n) => {
569
+ const { __scopeAccordion: t, value: r, ...o } = e, a = L(G, t), d = Nt(G, t), s = re(t), i = ue(), f = r && d.value.includes(r) || !1, _ = a.disabled || e.disabled;
570
+ return /* @__PURE__ */ c.createElement(St, {
570
571
  scope: t,
571
572
  open: f,
572
- disabled: u,
573
+ disabled: _,
573
574
  triggerId: i
574
- }, /* @__PURE__ */ a.createElement(vt, m({
575
- "data-orientation": c.orientation,
575
+ }, /* @__PURE__ */ c.createElement(vt, m({
576
+ "data-orientation": a.orientation,
576
577
  "data-state": De(f)
577
578
  }, s, o, {
578
579
  ref: n,
579
- disabled: u,
580
+ disabled: _,
580
581
  open: f,
581
582
  onOpenChange: (b) => {
582
583
  b ? d.onItemOpen(r) : d.onItemClose(r);
583
584
  }
584
585
  })));
585
- }), Dt = "AccordionHeader", Mt = /* @__PURE__ */ a.forwardRef((e, n) => {
586
- const { __scopeAccordion: t, ...r } = e, o = L(N, t), c = ce(Dt, t);
587
- return /* @__PURE__ */ a.createElement(P.h3, m({
586
+ }), Dt = "AccordionHeader", Mt = /* @__PURE__ */ c.forwardRef((e, n) => {
587
+ const { __scopeAccordion: t, ...r } = e, o = L(k, t), a = ae(Dt, t);
588
+ return /* @__PURE__ */ c.createElement(P.h3, m({
588
589
  "data-orientation": o.orientation,
589
- "data-state": De(c.open),
590
- "data-disabled": c.disabled ? "" : void 0
590
+ "data-state": De(a.open),
591
+ "data-disabled": a.disabled ? "" : void 0
591
592
  }, r, {
592
593
  ref: n
593
594
  }));
594
- }), de = "AccordionTrigger", Vt = /* @__PURE__ */ a.forwardRef((e, n) => {
595
- const { __scopeAccordion: t, ...r } = e, o = L(N, t), c = ce(de, t), d = Nt(de, t), s = re(t);
596
- return /* @__PURE__ */ a.createElement(ne.ItemSlot, {
595
+ }), de = "AccordionTrigger", Vt = /* @__PURE__ */ c.forwardRef((e, n) => {
596
+ const { __scopeAccordion: t, ...r } = e, o = L(k, t), a = ae(de, t), d = kt(de, t), s = re(t);
597
+ return /* @__PURE__ */ c.createElement(ne.ItemSlot, {
597
598
  scope: t
598
- }, /* @__PURE__ */ a.createElement(wt, m({
599
- "aria-disabled": c.open && !d.collapsible || void 0,
599
+ }, /* @__PURE__ */ c.createElement(xt, m({
600
+ "aria-disabled": a.open && !d.collapsible || void 0,
600
601
  "data-orientation": o.orientation,
601
- id: c.triggerId
602
+ id: a.triggerId
602
603
  }, s, r, {
603
604
  ref: n
604
605
  })));
605
- }), Lt = "AccordionContent", Bt = /* @__PURE__ */ a.forwardRef((e, n) => {
606
- const { __scopeAccordion: t, ...r } = e, o = L(N, t), c = ce(Lt, t), d = re(t);
607
- return /* @__PURE__ */ a.createElement(xt, m({
606
+ }), Lt = "AccordionContent", Bt = /* @__PURE__ */ c.forwardRef((e, n) => {
607
+ const { __scopeAccordion: t, ...r } = e, o = L(k, t), a = ae(Lt, t), d = re(t);
608
+ return /* @__PURE__ */ c.createElement(wt, m({
608
609
  role: "region",
609
- "aria-labelledby": c.triggerId,
610
+ "aria-labelledby": a.triggerId,
610
611
  "data-orientation": o.orientation
611
612
  }, d, r, {
612
613
  ref: n,
@@ -620,60 +621,60 @@ const [Se, It] = V(N), [Oe, Nt] = V(N, {
620
621
  function De(e) {
621
622
  return e ? "open" : "closed";
622
623
  }
623
- const Ht = Pe, qt = Tt, zt = Mt, jt = Vt, Ft = Bt, k = "teddy-accordion", Me = a.forwardRef(
624
- ({ className: e, variant: n = "default", children: t, indented: r = !1, ...o }, c) => {
625
- const d = _(
626
- R[k],
627
- R[`${k}--${n}`],
624
+ const Ht = Pe, qt = Ot, jt = Mt, Ft = Vt, Ut = Bt, I = "teddy-accordion", Me = c.forwardRef(
625
+ ({ className: e, variant: n = "default", children: t, indented: r = !1, ...o }, a) => {
626
+ const d = u(
627
+ R[I],
628
+ R[`${I}--${n}`],
628
629
  {
629
- [R[`${k}--indented`]]: r
630
+ [R[`${I}--indented`]]: r
630
631
  },
631
632
  e
632
633
  );
633
- return /* @__PURE__ */ l(Ht, { ...o, ref: c, className: d, children: t });
634
+ return /* @__PURE__ */ l(Ht, { ...o, ref: a, className: d, children: t });
634
635
  }
635
636
  );
636
637
  Me.displayName = "Accordion";
637
- const Ut = a.forwardRef(
638
+ const zt = c.forwardRef(
638
639
  ({ className: e, children: n, ...t }, r) => {
639
- const o = _([R[`${k}__item`]], e);
640
+ const o = u([R[`${I}__item`]], e);
640
641
  return /* @__PURE__ */ l(qt, { ...t, ref: r, className: o, children: n });
641
642
  }
642
- ), Ve = a.forwardRef(
643
+ ), Ve = c.forwardRef(
643
644
  ({ className: e, children: n, ...t }, r) => {
644
- const o = _([R[`${k}__header`]], e);
645
- return /* @__PURE__ */ l(zt, { ...t, ref: r, asChild: !0, className: o, children: /* @__PURE__ */ l(Q, { variant: "title-100", ...t.asChild ? { asChild: !0 } : { as: "h3" }, children: n }) });
645
+ const o = u([R[`${I}__header`]], e);
646
+ return /* @__PURE__ */ l(jt, { ...t, ref: r, asChild: !0, className: o, children: /* @__PURE__ */ l(Q, { variant: "title-100", ...t.asChild ? { asChild: !0 } : { as: "h3" }, children: n }) });
646
647
  }
647
648
  );
648
649
  Ve.displayName = "Accordion.Header";
649
- const Le = a.forwardRef(
650
+ const Le = c.forwardRef(
650
651
  ({ className: e, children: n, hideIndicator: t, ...r }, o) => {
651
- const c = _([R[`${k}__trigger`]], e);
652
- return /* @__PURE__ */ K(jt, { ...r, ref: o, className: c, children: [
653
- /* @__PURE__ */ l(ue, { children: n }),
654
- !t && /* @__PURE__ */ l(ae, {})
652
+ const a = u([R[`${I}__trigger`]], e);
653
+ return /* @__PURE__ */ K(Ft, { ...r, ref: o, className: a, children: [
654
+ /* @__PURE__ */ l(_e, { children: n }),
655
+ !t && /* @__PURE__ */ l(ce, {})
655
656
  ] });
656
657
  }
657
658
  );
658
659
  Le.displayName = "Accordion.Trigger";
659
- const ae = a.forwardRef(
660
+ const ce = c.forwardRef(
660
661
  ({ className: e, children: n, ...t }, r) => {
661
- const o = _([R[`${k}__indicator`]], e);
662
+ const o = u([R[`${I}__indicator`]], e);
662
663
  return /* @__PURE__ */ l(J, { "aria-hidden": !0, name: "chevron-down", ...t, ref: r, className: o, children: n });
663
664
  }
664
665
  );
665
- ae.displayName = "Accordion.Indicator";
666
- const Be = a.forwardRef(
666
+ ce.displayName = "Accordion.Indicator";
667
+ const Be = c.forwardRef(
667
668
  ({ className: e, children: n, ...t }, r) => {
668
- const o = _([R[`${k}__content`]], e);
669
- return /* @__PURE__ */ l(Ft, { ...t, ref: r, className: o, children: n });
669
+ const o = u([R[`${I}__content`]], e);
670
+ return /* @__PURE__ */ l(Ut, { ...t, ref: r, className: o, children: n });
670
671
  }
671
672
  );
672
673
  Be.displayName = "Accordion.Content";
673
- const He = a.forwardRef(
674
+ const He = c.forwardRef(
674
675
  ({ className: e, children: n, variant: t = "title-300", ...r }, o) => {
675
- const c = _([R[`${k}__title`]], e);
676
- return /* @__PURE__ */ l(Q, { ...r, variant: t, ref: o, className: c, children: n });
676
+ const a = u([R[`${I}__title`]], e);
677
+ return /* @__PURE__ */ l(Q, { ...r, variant: t, ref: o, className: a, children: n });
677
678
  }
678
679
  );
679
680
  He.displayName = "Accordion.Title";
@@ -681,8 +682,8 @@ const Ro = Object.assign(Me, {
681
682
  Trigger: Le,
682
683
  Content: Be,
683
684
  Header: Ve,
684
- Item: Ut,
685
- Indicator: ae,
685
+ Item: zt,
686
+ Indicator: ce,
686
687
  Title: He
687
688
  }), se = {
688
689
  "teddy-badge": "_teddy-badge_sg6ab_1",
@@ -702,12 +703,12 @@ function Gt(e) {
702
703
  if (e === "error")
703
704
  return "error";
704
705
  }
705
- const Kt = a.forwardRef(
706
- ({ className: e, variant: n, asChild: t, children: r, ...o }, c) => {
707
- const d = _([se[`${ie}`]], [se[`${ie}--${n}`]], e), s = t ? je : "span", i = Gt(n);
708
- return /* @__PURE__ */ K(s, { ...o, ref: c, className: d, children: [
706
+ const Kt = c.forwardRef(
707
+ ({ className: e, variant: n, asChild: t, children: r, ...o }, a) => {
708
+ const d = u([se[`${ie}`]], [se[`${ie}--${n}`]], e), s = t ? Fe : "span", i = Gt(n);
709
+ return /* @__PURE__ */ K(s, { ...o, ref: a, className: d, children: [
709
710
  !o.hideIcon && i && /* @__PURE__ */ l(J, { name: i }),
710
- /* @__PURE__ */ l(ue, { children: r })
711
+ /* @__PURE__ */ l(_e, { children: r })
711
712
  ] });
712
713
  }
713
714
  );
@@ -716,5 +717,5 @@ export {
716
717
  Ro as A,
717
718
  Kt as B,
718
719
  vo as C,
719
- xo as S
720
+ wo as T
720
721
  };