@purpur/library 9.2.2 → 9.2.3

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 (47) hide show
  1. package/CHANGELOG.json +15 -0
  2. package/CHANGELOG.md +9 -1
  3. package/dist/LICENSE.txt +1 -1
  4. package/dist/components/drawer/src/drawer-header.d.ts.map +1 -1
  5. package/dist/components/modal/src/modal-content.d.ts.map +1 -1
  6. package/dist/{date-picker-D3uJGCjl.js → date-picker-DVrcu2QU.js} +2 -2
  7. package/dist/{date-picker-D3uJGCjl.js.map → date-picker-DVrcu2QU.js.map} +1 -1
  8. package/dist/{date-picker-CpDZ0gK9.mjs → date-picker-DwFDRL5Z.mjs} +2 -2
  9. package/dist/{date-picker-CpDZ0gK9.mjs.map → date-picker-DwFDRL5Z.mjs.map} +1 -1
  10. package/dist/date-picker.cjs.js +1 -1
  11. package/dist/date-picker.es.js +1 -1
  12. package/dist/{drawer-BJ8xwriz.mjs → drawer-Db2Mujc6.mjs} +208 -205
  13. package/dist/drawer-Db2Mujc6.mjs.map +1 -0
  14. package/dist/drawer-DlwagnO4.js +2 -0
  15. package/dist/drawer-DlwagnO4.js.map +1 -0
  16. package/dist/drawer.cjs.js +1 -1
  17. package/dist/drawer.es.js +1 -1
  18. package/dist/library.cjs.js +1 -1
  19. package/dist/library.es.js +5 -5
  20. package/dist/modal-BMg43Fvd.mjs +211 -0
  21. package/dist/modal-BMg43Fvd.mjs.map +1 -0
  22. package/dist/modal-COF_UhvY.js +2 -0
  23. package/dist/modal-COF_UhvY.js.map +1 -0
  24. package/dist/modal.cjs.js +1 -1
  25. package/dist/modal.es.js +1 -1
  26. package/dist/purpur.css +1 -1
  27. package/dist/{search-field-CMBDkydb.mjs → search-field-CZ9mIyZ-.mjs} +56 -56
  28. package/dist/{search-field-CMBDkydb.mjs.map → search-field-CZ9mIyZ-.mjs.map} +1 -1
  29. package/dist/search-field-DD9UkOca.js +2 -0
  30. package/dist/{search-field-CU_tsmHb.js.map → search-field-DD9UkOca.js.map} +1 -1
  31. package/dist/search-field.cjs.js +1 -1
  32. package/dist/search-field.es.js +1 -1
  33. package/dist/{table-BVSBvTYG.js → table-DsgqX7Vv.js} +2 -2
  34. package/dist/{table-BVSBvTYG.js.map → table-DsgqX7Vv.js.map} +1 -1
  35. package/dist/{table-CuV3Gda_.mjs → table-Dx_dhGT6.mjs} +2 -2
  36. package/dist/{table-CuV3Gda_.mjs.map → table-Dx_dhGT6.mjs.map} +1 -1
  37. package/dist/table.cjs.js +1 -1
  38. package/dist/table.es.js +1 -1
  39. package/package.json +22 -22
  40. package/dist/drawer-BJ8xwriz.mjs.map +0 -1
  41. package/dist/drawer-CNs9K8Ca.js +0 -2
  42. package/dist/drawer-CNs9K8Ca.js.map +0 -1
  43. package/dist/modal-DCfN6q8I.mjs +0 -201
  44. package/dist/modal-DCfN6q8I.mjs.map +0 -1
  45. package/dist/modal-DZIdw9xy.js +0 -2
  46. package/dist/modal-DZIdw9xy.js.map +0 -1
  47. package/dist/search-field-CU_tsmHb.js +0 -2
@@ -1,56 +1,56 @@
1
- import { jsx as e, jsxs as b, Fragment as T } from "react/jsx-runtime";
2
- import R, { createContext as wr, forwardRef as j, useContext as hr, useRef as W, useEffect as fr } from "react";
3
- import { a as mr, T as H, P as yr, O as $r, C as vr, D as br, b as gr, R as Dr } from "./index-CKCTy3ZL.mjs";
1
+ import { jsx as e, jsxs as g, Fragment as T } from "react/jsx-runtime";
2
+ import R, { createContext as wr, forwardRef as P, useContext as fr, useRef as W, useEffect as hr } from "react";
3
+ import { a as mr, T as Y, P as $r, O as vr, C as yr, D as br, b as gr, R as Nr } from "./index-CKCTy3ZL.mjs";
4
4
  import { c as O } from "./bind-CU-R61T-.mjs";
5
5
  import { b as X, a as I } from "./button-4-yWOgtD.mjs";
6
6
  import { H as G, D as J } from "./heading-xwBuT_-9.mjs";
7
- import { l as Nr } from "./chevron-left.es-UFhf3v35.mjs";
7
+ import { l as Dr } from "./chevron-left.es-UFhf3v35.mjs";
8
8
  import { r as jr } from "./close.es-BPmk2wkU.mjs";
9
9
  import { V as Q } from "./visually-hidden-BYFkJEp1.mjs";
10
10
  import { R as Pr, V as zr, S as Sr, T as xr } from "./index-B8Mazo6u.mjs";
11
- const rr = wr(null), Or = "_slideUp_9zrj7_1", Ar = "_slideDown_9zrj7_1", Cr = "_slideInRight_9zrj7_1", Er = "_slideInLeft_9zrj7_1", Vr = "_slideOutRight_9zrj7_1", Lr = "_slideOutLeft_9zrj7_1", Mr = "_fadeIn_9zrj7_1", Ur = "_fadeOut_9zrj7_1", Yr = {
11
+ const rr = wr(null), Or = "_slideUp_9zrj7_1", kr = "_slideDown_9zrj7_1", Ar = "_slideInRight_9zrj7_1", Cr = "_slideInLeft_9zrj7_1", Er = "_slideOutRight_9zrj7_1", Vr = "_slideOutLeft_9zrj7_1", Lr = "_fadeIn_9zrj7_1", Mr = "_fadeOut_9zrj7_1", Ur = {
12
12
  "purpur-drawer-content": "_purpur-drawer-content_9zrj7_1",
13
13
  slideUp: Or,
14
- slideDown: Ar,
14
+ slideDown: kr,
15
15
  "purpur-drawer-content--left": "_purpur-drawer-content--left_9zrj7_21",
16
16
  "purpur-drawer-content--right": "_purpur-drawer-content--right_9zrj7_24",
17
17
  "purpur-drawer-content--fit-to-content": "_purpur-drawer-content--fit-to-content_9zrj7_27",
18
- slideInRight: Cr,
19
- slideInLeft: Er,
20
- slideOutRight: Vr,
21
- slideOutLeft: Lr,
18
+ slideInRight: Ar,
19
+ slideInLeft: Cr,
20
+ slideOutRight: Er,
21
+ slideOutLeft: Vr,
22
22
  "purpur-drawer-content__content-container": "_purpur-drawer-content__content-container_9zrj7_63",
23
23
  "purpur-drawer-content__description": "_purpur-drawer-content__description_9zrj7_68",
24
24
  "purpur-drawer-content--ai": "_purpur-drawer-content--ai_9zrj7_78",
25
25
  "purpur-drawer-overlay": "_purpur-drawer-overlay_9zrj7_82",
26
- fadeIn: Mr,
27
- fadeOut: Ur
28
- }, Hr = {
26
+ fadeIn: Lr,
27
+ fadeOut: Mr
28
+ }, Yr = {
29
29
  "purpur-drawer-container--header": "_purpur-drawer-container--header_1csed_1",
30
30
  "purpur-drawer-container--ai": "_purpur-drawer-container--ai_1csed_4",
31
31
  "purpur-drawer-container--body": "_purpur-drawer-container--body_1csed_7",
32
32
  "purpur-drawer-container--sticky": "_purpur-drawer-container--sticky_1csed_15",
33
33
  "purpur-drawer-container--footer": "_purpur-drawer-container--footer_1csed_23"
34
- }, kr = O.bind(Hr), k = "purpur-drawer-container", x = j(
34
+ }, Hr = O.bind(Yr), H = "purpur-drawer-container", x = P(
35
35
  ({
36
36
  ["data-testid"]: r = "purpur-drawer-container",
37
37
  children: a,
38
38
  className: n,
39
- drawerVariant: o = "default",
40
- variant: s = "body",
39
+ drawerVariant: s = "default",
40
+ variant: o = "body",
41
41
  stickyFooter: p,
42
42
  ...u
43
- }, i) => {
44
- const d = kr([
45
- k,
43
+ }, d) => {
44
+ const i = Hr([
45
+ H,
46
46
  {
47
- [`${k}--${s}`]: s,
48
- [`${k}--sticky`]: p,
49
- [`${k}--ai`]: o === "ai"
47
+ [`${H}--${o}`]: o,
48
+ [`${H}--sticky`]: p,
49
+ [`${H}--ai`]: s === "ai"
50
50
  },
51
51
  n
52
52
  ]);
53
- return /* @__PURE__ */ e("div", { className: d, "data-testid": r, ref: i, ...u, children: a });
53
+ return /* @__PURE__ */ e("div", { className: i, "data-testid": r, ref: d, ...u, children: a });
54
54
  }
55
55
  );
56
56
  x.displayName = "DrawerContainer";
@@ -71,42 +71,42 @@ const Rr = {
71
71
  }, Ir = {
72
72
  "purpur-drawer-handle": "_purpur-drawer-handle_lz3ca_1",
73
73
  "purpur-drawer-handle--ai": "_purpur-drawer-handle--ai_lz3ca_22"
74
- }, Tr = (r, a, n, o, s, p) => ({
74
+ }, Tr = (r, a, n, s, o, p) => ({
75
75
  onPointerDown: (t) => {
76
76
  r.current = { y: t.clientY };
77
77
  },
78
78
  onPointerMove: (t) => {
79
79
  if (!r.current)
80
80
  return;
81
- const c = t.clientY - r.current.y, l = !!a.current, m = Math.max(0, c), w = t.pointerType === "touch" ? 10 : 2, _ = { y: m }, $ = { originalEvent: t, delta: _ };
82
- l ? (a.current = _, o($)) : Z(_, 0) ? (a.current = _, n(), t.target.setPointerCapture(t.pointerId)) : Math.abs(c) > w && (r.current = null);
81
+ const c = t.clientY - r.current.y, l = !!a.current, m = Math.max(0, c), w = t.pointerType === "touch" ? 10 : 2, _ = { y: m }, y = { originalEvent: t, delta: _ };
82
+ l ? (a.current = _, s(y)) : Z(_, 0) ? (a.current = _, n(), t.target.setPointerCapture(t.pointerId)) : Math.abs(c) > w && (r.current = null);
83
83
  },
84
84
  onPointerUp: (t) => {
85
85
  const c = a.current, l = t.target;
86
86
  if (l.hasPointerCapture(t.pointerId) && l.releasePointerCapture(t.pointerId), a.current = null, r.current = null, c) {
87
87
  const m = t.currentTarget, w = { originalEvent: t, delta: c };
88
- Z(c, 0) && c.y > 200 ? p(w) : s(), m.addEventListener("click", (_) => _.preventDefault(), {
88
+ Z(c, 0) && c.y > 200 ? p(w) : o(), m.addEventListener("click", (_) => _.preventDefault(), {
89
89
  once: !0
90
90
  });
91
91
  }
92
92
  }
93
- }), Z = (r, a = 0) => Math.abs(r.y) > a, Fr = O.bind(Ir), B = "purpur-drawer-handle", er = j(
93
+ }), Z = (r, a = 0) => Math.abs(r.y) > a, Fr = O.bind(Ir), B = "purpur-drawer-handle", er = P(
94
94
  ({
95
95
  ["data-testid"]: r = "purpur-drawer-handle",
96
96
  className: a,
97
97
  onSwipeStart: n,
98
- onSwipeMove: o,
99
- onSwipeCancel: s,
98
+ onSwipeMove: s,
99
+ onSwipeCancel: o,
100
100
  onSwipeEnd: p,
101
101
  variant: u = "default",
102
- ...i
103
- }, d) => {
102
+ ...d
103
+ }, i) => {
104
104
  const t = Fr([B, { [`${B}--ai`]: u === "ai" }, a]), c = R.useRef(null), l = R.useRef(null), { onPointerDown: m, onPointerMove: w, onPointerUp: _ } = Tr(
105
105
  l,
106
106
  c,
107
107
  n,
108
- o,
109
108
  s,
109
+ o,
110
110
  p
111
111
  );
112
112
  return /* @__PURE__ */ e(
@@ -117,92 +117,94 @@ const Rr = {
117
117
  onPointerDown: m,
118
118
  onPointerMove: w,
119
119
  onPointerUp: _,
120
- ref: d,
121
- ...i
120
+ ref: i,
121
+ ...d
122
122
  }
123
123
  );
124
124
  }
125
125
  );
126
126
  er.displayName = "DrawerHandle";
127
127
  const Kr = {
128
- "purpur-drawer-header": "_purpur-drawer-header_1iujy_1",
129
- "purpur-drawer-header__row": "_purpur-drawer-header__row_1iujy_4",
130
- "purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1iujy_7",
131
- "purpur-drawer-header__left": "_purpur-drawer-header__left_1iujy_10",
132
- "purpur-drawer-header__right": "_purpur-drawer-header__right_1iujy_13",
133
- "purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1iujy_16",
134
- "purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1iujy_27"
135
- }, z = O.bind(Kr), g = "purpur-drawer-header", tr = j(
128
+ "purpur-drawer-header": "_purpur-drawer-header_1dlfk_1",
129
+ "purpur-drawer-header__row": "_purpur-drawer-header__row_1dlfk_4",
130
+ "purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1dlfk_7",
131
+ "purpur-drawer-header__left": "_purpur-drawer-header__left_1dlfk_10",
132
+ "purpur-drawer-header__right": "_purpur-drawer-header__right_1dlfk_13",
133
+ "purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1dlfk_16",
134
+ "purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1dlfk_27",
135
+ "purpur-drawer-header__title": "_purpur-drawer-header__title_1dlfk_30"
136
+ }, N = O.bind(Kr), v = "purpur-drawer-header", tr = P(
136
137
  ({
137
138
  ["data-testid"]: r = "purpur-drawer-header",
138
139
  backButton: a,
139
140
  backButtonText: n,
140
- backButtonOnlyIcon: o,
141
- className: s,
141
+ backButtonOnlyIcon: s,
142
+ className: o,
142
143
  closeButtonAriaLabel: p,
143
144
  headerContent: u,
144
- onBackButtonClick: i,
145
- onCloseClick: d,
145
+ onBackButtonClick: d,
146
+ onCloseClick: i,
146
147
  title: t,
147
148
  variant: c = "default",
148
149
  ...l
149
150
  }, m) => {
150
- const w = z([g, { [`${g}--ai`]: c === "ai" }, s]), _ = !!(a && n && i), $ = c === "ai", P = d ? R.Fragment : mr;
151
- return /* @__PURE__ */ b("div", { className: w, "data-testid": r, ref: m, ...l, children: [
152
- /* @__PURE__ */ b(
151
+ const w = N([v, { [`${v}--ai`]: c === "ai" }, o]), _ = !!(a && n && d), y = c === "ai", z = i ? R.Fragment : mr;
152
+ return /* @__PURE__ */ g("div", { className: w, "data-testid": r, ref: m, ...l, children: [
153
+ /* @__PURE__ */ g(
153
154
  "div",
154
155
  {
155
- className: z([
156
- `${g}__row`,
156
+ className: N([
157
+ `${v}__row`,
157
158
  {
158
- [`${g}__row--with-back-button`]: _
159
+ [`${v}__row--with-back-button`]: _
159
160
  }
160
161
  ]),
161
162
  "data-testid": `${r}-row`,
162
163
  children: [
163
- /* @__PURE__ */ e("div", { className: z(`${g}__left`), children: _ ? /* @__PURE__ */ b(
164
+ /* @__PURE__ */ e("div", { className: N(`${v}__left`), children: _ ? /* @__PURE__ */ g(
164
165
  X,
165
166
  {
166
- "aria-label": o ? n : "",
167
- className: z([
168
- `${g}__back-button`,
167
+ "aria-label": s ? n : "",
168
+ className: N([
169
+ `${v}__back-button`,
169
170
  {
170
- [`${g}__back-button--only-icon`]: o
171
+ [`${v}__back-button--only-icon`]: s
171
172
  }
172
173
  ]),
173
174
  "data-testid": `${r}-back-button`,
174
- iconOnly: o,
175
- negative: $,
176
- onClick: i,
175
+ iconOnly: s,
176
+ negative: y,
177
+ onClick: d,
177
178
  size: "sm",
178
- variant: o ? I.TERTIARY_PURPLE : I.TEXT,
179
+ variant: s ? I.TERTIARY_PURPLE : I.TEXT,
179
180
  children: [
180
- /* @__PURE__ */ e(Nr, { size: "sm" }),
181
- !o && n
181
+ /* @__PURE__ */ e(Dr, { size: "sm" }),
182
+ !s && n
182
183
  ]
183
184
  }
184
- ) : u ? /* @__PURE__ */ b(T, { children: [
185
+ ) : u ? /* @__PURE__ */ g(T, { children: [
185
186
  u,
186
- /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(H, { children: t }) })
187
- ] }) : /* @__PURE__ */ e(H, { asChild: !0, children: /* @__PURE__ */ e(
187
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(Y, { children: t }) })
188
+ ] }) : /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
188
189
  G,
189
190
  {
191
+ className: N(`${v}__title`),
190
192
  "data-testid": `${r}-title`,
191
- negative: $,
193
+ negative: y,
192
194
  tag: "h2",
193
195
  variant: J.DISPLAY10,
194
196
  tabIndex: -1,
195
197
  children: t
196
198
  }
197
199
  ) }) }),
198
- /* @__PURE__ */ e("div", { className: z(`${g}__right`), children: /* @__PURE__ */ e(P, { ...d ? {} : { asChild: !0 }, children: /* @__PURE__ */ e(
200
+ /* @__PURE__ */ e("div", { className: N(`${v}__right`), children: /* @__PURE__ */ e(z, { ...i ? {} : { asChild: !0 }, children: /* @__PURE__ */ e(
199
201
  X,
200
202
  {
201
203
  "aria-label": p,
202
- className: z(`${g}__close-button`),
204
+ className: N(`${v}__close-button`),
203
205
  iconOnly: !0,
204
- negative: $,
205
- onClick: d,
206
+ negative: y,
207
+ onClick: i,
206
208
  size: "sm",
207
209
  variant: I.TERTIARY_PURPLE,
208
210
  children: /* @__PURE__ */ e(jr, { size: "sm" })
@@ -211,14 +213,15 @@ const Kr = {
211
213
  ]
212
214
  }
213
215
  ),
214
- _ && (u ? /* @__PURE__ */ b(T, { children: [
216
+ _ && (u ? /* @__PURE__ */ g(T, { children: [
215
217
  u,
216
- /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(H, { children: t }) })
217
- ] }) : /* @__PURE__ */ e(H, { asChild: !0, children: /* @__PURE__ */ e(
218
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(Y, { children: t }) })
219
+ ] }) : /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
218
220
  G,
219
221
  {
220
222
  "data-testid": `${r}-title-with-back-button`,
221
- negative: $,
223
+ className: N(`${v}__title`),
224
+ negative: y,
222
225
  tag: "h2",
223
226
  tabIndex: -1,
224
227
  variant: J.DISPLAY10,
@@ -236,34 +239,34 @@ const qr = {
236
239
  "purpur-drawer-scroll-area__scrollbar": "_purpur-drawer-scroll-area__scrollbar_vzgxi_14",
237
240
  "purpur-drawer-scroll-area--ai": "_purpur-drawer-scroll-area--ai_vzgxi_25",
238
241
  "purpur-drawer-scroll-area__thumb": "_purpur-drawer-scroll-area__thumb_vzgxi_29"
239
- }, A = O.bind(qr), N = "purpur-drawer-scroll-area", F = j(
242
+ }, k = O.bind(qr), j = "purpur-drawer-scroll-area", F = P(
240
243
  ({
241
244
  ["data-testid"]: r = "purpur-drawer-scroll-area",
242
245
  children: a,
243
246
  className: n,
244
- drawerVariant: o = "default",
245
- fitToContent: s = !1,
247
+ drawerVariant: s = "default",
248
+ fitToContent: o = !1,
246
249
  ...p
247
250
  }, u) => {
248
- const i = A([
249
- N,
250
- { [`${N}--ai`]: o === "ai" },
251
+ const d = k([
252
+ j,
253
+ { [`${j}--ai`]: s === "ai" },
251
254
  n
252
255
  ]);
253
- return /* @__PURE__ */ e("div", { className: i, "data-testid": r, ref: u, ...p, children: /* @__PURE__ */ b(
256
+ return /* @__PURE__ */ e("div", { className: d, "data-testid": r, ref: u, ...p, children: /* @__PURE__ */ g(
254
257
  Pr,
255
258
  {
256
- className: A(`${N}__root`, {
257
- [`${N}__root--fit-to-content`]: s
259
+ className: k(`${j}__root`, {
260
+ [`${j}__root--fit-to-content`]: o
258
261
  }),
259
262
  children: [
260
- /* @__PURE__ */ e(zr, { className: A(`${N}__viewport`), children: a }),
263
+ /* @__PURE__ */ e(zr, { className: k(`${j}__viewport`), children: a }),
261
264
  /* @__PURE__ */ e(
262
265
  Sr,
263
266
  {
264
- className: A(`${N}__scrollbar`),
267
+ className: k(`${j}__scrollbar`),
265
268
  orientation: "vertical",
266
- children: /* @__PURE__ */ e(xr, { className: A(`${N}__thumb`) })
269
+ children: /* @__PURE__ */ e(xr, { className: k(`${j}__thumb`) })
267
270
  }
268
271
  )
269
272
  ]
@@ -272,123 +275,123 @@ const qr = {
272
275
  }
273
276
  );
274
277
  F.displayName = "DrawerScrollArea";
275
- const S = O.bind(Rr), f = "purpur-drawer-frame", ar = j(
278
+ const S = O.bind(Rr), h = "purpur-drawer-frame", ar = P(
276
279
  ({
277
280
  ["data-testid"]: r = "purpur-drawer-frame",
278
281
  backButton: a,
279
282
  backButtonText: n,
280
- backButtonOnlyIcon: o,
281
- children: s,
283
+ backButtonOnlyIcon: s,
284
+ children: o,
282
285
  className: p,
283
286
  closeButtonAriaLabel: u,
284
- fitToContent: i = !1,
285
- footerContent: d,
287
+ fitToContent: d = !1,
288
+ footerContent: i,
286
289
  headerContent: t,
287
290
  onBackButtonClick: c,
288
291
  onCloseClick: l,
289
292
  onSwipeStart: m,
290
293
  onSwipeMove: w,
291
294
  onSwipeCancel: _,
292
- onSwipeEnd: $,
293
- title: P,
294
- stickyFooter: v,
295
- position: E = "right",
296
- variant: h = "default",
297
- ...V
298
- }, L) => {
299
- const M = !!(a && n && c), U = h === "ai", Y = S([
300
- f,
295
+ onSwipeEnd: y,
296
+ title: z,
297
+ stickyFooter: b,
298
+ position: C = "right",
299
+ variant: f = "default",
300
+ ...E
301
+ }, V) => {
302
+ const L = !!(a && n && c), M = f === "ai", U = S([
303
+ h,
301
304
  {
302
- [`${f}--fit-to-content`]: i,
303
- [`${f}--sticky-footer`]: v,
304
- [`${f}--left`]: E === "left",
305
- [`${f}--right`]: E === "right",
306
- [`${f}--without-back-button`]: !M,
307
- [`${f}--with-back-button`]: M,
308
- [`${f}--ai`]: U
305
+ [`${h}--fit-to-content`]: d,
306
+ [`${h}--sticky-footer`]: b,
307
+ [`${h}--left`]: C === "left",
308
+ [`${h}--right`]: C === "right",
309
+ [`${h}--without-back-button`]: !L,
310
+ [`${h}--with-back-button`]: L,
311
+ [`${h}--ai`]: M
309
312
  },
310
313
  p
311
314
  ]);
312
- return /* @__PURE__ */ b("div", { className: Y, "data-testid": r, ref: L, ...V, children: [
315
+ return /* @__PURE__ */ g("div", { className: U, "data-testid": r, ref: V, ...E, children: [
313
316
  /* @__PURE__ */ e(
314
317
  er,
315
318
  {
316
319
  onSwipeStart: m,
317
320
  onSwipeMove: w,
318
321
  onSwipeCancel: _,
319
- onSwipeEnd: $,
320
- variant: h
322
+ onSwipeEnd: y,
323
+ variant: f
321
324
  }
322
325
  ),
323
326
  /* @__PURE__ */ e(
324
327
  x,
325
328
  {
326
- className: S(`${f}__header`),
329
+ className: S(`${h}__header`),
327
330
  variant: "header",
328
- stickyFooter: v,
329
- drawerVariant: h,
331
+ stickyFooter: b,
332
+ drawerVariant: f,
330
333
  children: /* @__PURE__ */ e(
331
334
  tr,
332
335
  {
333
- title: P,
336
+ title: z,
334
337
  headerContent: t,
335
- backButtonOnlyIcon: o,
338
+ backButtonOnlyIcon: s,
336
339
  backButton: a,
337
340
  backButtonText: n,
338
341
  closeButtonAriaLabel: u,
339
342
  onBackButtonClick: c,
340
343
  onCloseClick: l,
341
- variant: h
344
+ variant: f
342
345
  }
343
346
  )
344
347
  }
345
348
  ),
346
- v ? /* @__PURE__ */ b(T, { children: [
349
+ b ? /* @__PURE__ */ g(T, { children: [
347
350
  /* @__PURE__ */ e(
348
351
  F,
349
352
  {
350
- className: S(`${f}__body`),
353
+ className: S(`${h}__body`),
351
354
  "data-testid": `${r}-sticky-footer-scroll-area`,
352
- fitToContent: i,
353
- drawerVariant: h,
354
- children: /* @__PURE__ */ e(x, { stickyFooter: !0, drawerVariant: h, children: s })
355
+ fitToContent: d,
356
+ drawerVariant: f,
357
+ children: /* @__PURE__ */ e(x, { stickyFooter: !0, drawerVariant: f, children: o })
355
358
  }
356
359
  ),
357
- d && /* @__PURE__ */ e(
360
+ i && /* @__PURE__ */ e(
358
361
  x,
359
362
  {
360
- className: S(`${f}__footer`),
363
+ className: S(`${h}__footer`),
361
364
  "data-testid": `${r}-sticky-footer`,
362
365
  variant: "footer",
363
- stickyFooter: v,
364
- drawerVariant: h,
365
- children: d
366
+ stickyFooter: b,
367
+ drawerVariant: f,
368
+ children: i
366
369
  }
367
370
  )
368
371
  ] }) : /* @__PURE__ */ e(
369
372
  F,
370
373
  {
371
- className: S(`${f}__body`),
374
+ className: S(`${h}__body`),
372
375
  "data-testid": `${r}-scroll-area`,
373
- fitToContent: i,
374
- drawerVariant: h,
375
- children: /* @__PURE__ */ b(
376
+ fitToContent: d,
377
+ drawerVariant: f,
378
+ children: /* @__PURE__ */ g(
376
379
  "div",
377
380
  {
378
381
  className: S([
379
- `${f}__content-container`,
380
- { [`${f}__content-container--no-footer`]: !d }
382
+ `${h}__content-container`,
383
+ { [`${h}__content-container--no-footer`]: !i }
381
384
  ]),
382
385
  children: [
383
- /* @__PURE__ */ e(x, { stickyFooter: v, drawerVariant: h, children: s }),
384
- d && /* @__PURE__ */ e(
386
+ /* @__PURE__ */ e(x, { stickyFooter: b, drawerVariant: f, children: o }),
387
+ i && /* @__PURE__ */ e(
385
388
  x,
386
389
  {
387
390
  "data-testid": `${r}-footer`,
388
- stickyFooter: v,
391
+ stickyFooter: b,
389
392
  variant: "footer",
390
- drawerVariant: h,
391
- children: d
393
+ drawerVariant: f,
394
+ children: i
392
395
  }
393
396
  )
394
397
  ]
@@ -407,8 +410,8 @@ const Wr = (r, a) => ({
407
410
  onSwipeMove: (u) => {
408
411
  if (!r.current)
409
412
  return;
410
- const { y: i } = u.delta;
411
- r.current.setAttribute("data-swipe", "move"), r.current.style.setProperty("--purpur-drawer-swipe-move-y", `${i}px`);
413
+ const { y: d } = u.delta;
414
+ r.current.setAttribute("data-swipe", "move"), r.current.style.setProperty("--purpur-drawer-swipe-move-y", `${d}px`);
412
415
  },
413
416
  onSwipeCancel: () => {
414
417
  r.current && (r.current.setAttribute("data-swipe", "cancel"), r.current.style.removeProperty("--purpur-drawer-swipe-move-y"), r.current.style.removeProperty("--purpur-drawer-swipe-end-y"));
@@ -416,108 +419,108 @@ const Wr = (r, a) => ({
416
419
  onSwipeEnd: (u) => {
417
420
  if (!r.current)
418
421
  return;
419
- const { y: i } = u.delta;
420
- r.current.setAttribute("data-swipe", "end"), r.current.style.removeProperty("--purpur-drawer-swipe-move-y"), r.current.style.setProperty("--purpur-drawer-swipe-end-y", `${i}px`), a?.(!1);
422
+ const { y: d } = u.delta;
423
+ r.current.setAttribute("data-swipe", "end"), r.current.style.removeProperty("--purpur-drawer-swipe-move-y"), r.current.style.setProperty("--purpur-drawer-swipe-end-y", `${d}px`), a?.(!1);
421
424
  }
422
- }), C = O.bind(Yr), D = "purpur-drawer-content", nr = j(
425
+ }), A = O.bind(Ur), D = "purpur-drawer-content", nr = P(
423
426
  ({
424
427
  ["data-testid"]: r = "purpur-drawer-content",
425
428
  backButton: a = !1,
426
429
  backButtonText: n,
427
- backButtonOnlyIcon: o = !1,
428
- bodyText: s,
430
+ backButtonOnlyIcon: s = !1,
431
+ bodyText: o,
429
432
  children: p,
430
433
  className: u,
431
- closeButtonAriaLabel: i,
432
- disableCloseOnClickOutside: d = !1,
434
+ closeButtonAriaLabel: d,
435
+ disableCloseOnClickOutside: i = !1,
433
436
  fitToContent: t = !1,
434
437
  footerContent: c,
435
438
  headerContent: l,
436
439
  onBackButtonClick: m,
437
440
  onCloseClick: w,
438
441
  stickyFooter: _ = !1,
439
- title: $,
440
- zIndex: P,
441
- position: v = "right",
442
- ...E
443
- }, h) => {
444
- const V = hr(rr), L = V?.variant ?? "default", M = C([
442
+ title: y,
443
+ zIndex: z,
444
+ position: b = "right",
445
+ ...C
446
+ }, f) => {
447
+ const E = fr(rr), V = E?.variant ?? "default", L = A([
445
448
  D,
446
449
  {
447
450
  [`${D}--fit-to-content`]: t,
448
- [`${D}--left`]: v === "left",
449
- [`${D}--right`]: v === "right",
450
- [`${D}--ai`]: L === "ai"
451
+ [`${D}--left`]: b === "left",
452
+ [`${D}--right`]: b === "right",
453
+ [`${D}--ai`]: V === "ai"
451
454
  },
452
455
  u
453
- ]), U = W(null), Y = W(null), sr = (y) => {
454
- Y.current = y, typeof h == "function" ? h(y) : h && (h.current = y);
455
- }, { onSwipeStart: ur, onSwipeMove: ir, onSwipeCancel: dr, onSwipeEnd: cr } = Wr(
456
- Y,
457
- V?.onOpenChange ?? null
458
- ), pr = (y) => {
459
- if (d) {
460
- y.preventDefault();
456
+ ]), M = W(null), U = W(null), or = ($) => {
457
+ U.current = $, typeof f == "function" ? f($) : f && (f.current = $);
458
+ }, { onSwipeStart: ur, onSwipeMove: dr, onSwipeCancel: ir, onSwipeEnd: cr } = Wr(
459
+ U,
460
+ E?.onOpenChange ?? null
461
+ ), pr = ($) => {
462
+ if (i) {
463
+ $.preventDefault();
461
464
  return;
462
465
  }
463
- w && (y.preventDefault(), w());
464
- }, _r = (y) => {
465
- w && (y.preventDefault(), w());
466
+ w && ($.preventDefault(), w());
467
+ }, _r = ($) => {
468
+ w && ($.preventDefault(), w());
466
469
  }, lr = () => {
467
- const y = U.current;
468
- if (y) {
469
- const q = y.querySelector("h2");
470
+ const $ = M.current;
471
+ if ($) {
472
+ const q = $.querySelector("h2");
470
473
  q && setTimeout(() => {
471
474
  q.focus();
472
475
  });
473
476
  }
474
477
  };
475
- return /* @__PURE__ */ e(yr, { children: /* @__PURE__ */ e(
476
- $r,
478
+ return /* @__PURE__ */ e($r, { children: /* @__PURE__ */ e(
479
+ vr,
477
480
  {
478
- className: C("purpur-drawer-overlay"),
479
- style: P ? { zIndex: P } : void 0,
481
+ className: A("purpur-drawer-overlay"),
482
+ style: z ? { zIndex: z } : void 0,
480
483
  "data-testid": `${r}-overlay`,
481
484
  children: /* @__PURE__ */ e(
482
- vr,
485
+ yr,
483
486
  {
484
487
  onPointerDownOutside: pr,
485
488
  onEscapeKeyDown: _r,
486
489
  onOpenAutoFocus: lr,
487
- className: M,
490
+ className: L,
488
491
  "data-testid": r,
489
- ref: sr,
490
- ...!s && { "aria-describedby": void 0 },
491
- ...E,
492
+ ref: or,
493
+ ...!o && { "aria-describedby": void 0 },
494
+ ...C,
492
495
  children: /* @__PURE__ */ e(
493
496
  ar,
494
497
  {
495
498
  backButton: a,
496
499
  backButtonText: n,
497
- backButtonOnlyIcon: o,
498
- closeButtonAriaLabel: i,
499
- className: C(`${D}__drawer-frame`),
500
+ backButtonOnlyIcon: s,
501
+ closeButtonAriaLabel: d,
502
+ className: A(`${D}__drawer-frame`),
500
503
  fitToContent: t,
501
504
  footerContent: c,
502
505
  headerContent: l,
503
- ref: U,
506
+ ref: M,
504
507
  onBackButtonClick: m,
505
508
  onCloseClick: w,
506
509
  onSwipeStart: ur,
507
- onSwipeMove: ir,
508
- onSwipeCancel: dr,
510
+ onSwipeMove: dr,
511
+ onSwipeCancel: ir,
509
512
  onSwipeEnd: cr,
510
513
  stickyFooter: _,
511
- title: $,
512
- position: v,
513
- variant: L,
514
- children: s ? /* @__PURE__ */ b("div", { className: C(`${D}__content-container`), children: [
514
+ title: y,
515
+ position: b,
516
+ variant: V,
517
+ children: o ? /* @__PURE__ */ g("div", { className: A(`${D}__content-container`), children: [
515
518
  /* @__PURE__ */ e(
516
519
  br,
517
520
  {
518
- className: C(`${D}__description`),
521
+ className: A(`${D}__description`),
519
522
  "data-testid": `${r}-description`,
520
- children: s
523
+ children: o
521
524
  }
522
525
  ),
523
526
  /* @__PURE__ */ e("div", { children: p })
@@ -531,32 +534,32 @@ const Wr = (r, a) => ({
531
534
  }
532
535
  );
533
536
  nr.displayName = "DrawerContent";
534
- const or = j(
535
- ({ ["data-testid"]: r = "purpur-drawer-trigger", children: a, ...n }, o) => /* @__PURE__ */ e(gr, { asChild: !0, "data-testid": r, ref: o, ...n, children: a })
537
+ const sr = P(
538
+ ({ ["data-testid"]: r = "purpur-drawer-trigger", children: a, ...n }, s) => /* @__PURE__ */ e(gr, { asChild: !0, "data-testid": r, ref: s, ...n, children: a })
536
539
  );
537
- or.displayName = "DrawerTrigger";
540
+ sr.displayName = "DrawerTrigger";
538
541
  const K = ({
539
542
  ["data-testid"]: r = "purpur-drawer",
540
543
  children: a,
541
544
  className: n,
542
- onOpenChange: o,
543
- open: s = !1,
545
+ onOpenChange: s,
546
+ open: o = !1,
544
547
  variant: p = "default",
545
548
  ...u
546
549
  }) => {
547
- const [i, d] = R.useState(s), t = (l) => {
548
- d(l), o?.(l);
550
+ const [d, i] = R.useState(o), t = (l) => {
551
+ i(l), s?.(l);
549
552
  };
550
- fr(() => {
551
- d(s);
552
- }, [s]);
553
+ hr(() => {
554
+ i(o);
555
+ }, [o]);
553
556
  const c = { onOpenChange: t, variant: p };
554
- return /* @__PURE__ */ e(rr.Provider, { value: c, children: /* @__PURE__ */ e("div", { className: n, "data-testid": r, ...u, children: /* @__PURE__ */ e(Dr, { open: i, onOpenChange: t, children: a }) }) });
557
+ return /* @__PURE__ */ e(rr.Provider, { value: c, children: /* @__PURE__ */ e("div", { className: n, "data-testid": r, ...u, children: /* @__PURE__ */ e(Nr, { open: d, onOpenChange: t, children: a }) }) });
555
558
  };
556
- K.Trigger = or;
559
+ K.Trigger = sr;
557
560
  K.Content = nr;
558
561
  K.displayName = "Drawer";
559
562
  export {
560
563
  K as D
561
564
  };
562
- //# sourceMappingURL=drawer-BJ8xwriz.mjs.map
565
+ //# sourceMappingURL=drawer-Db2Mujc6.mjs.map