@purpurds/text-area 7.13.1 → 8.0.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,51 +1,51 @@
1
- import { jsxs as f, jsx as s, Fragment as W } from "react/jsx-runtime";
2
- import * as u from "react";
3
- import { forwardRef as z } from "react";
1
+ import { jsxs as f, jsx as s, Fragment as T } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { createContext as z, useContext as I, forwardRef as L } from "react";
4
4
  import "react-dom";
5
- function I(e) {
6
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5
+ function k(r) {
6
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
7
7
  }
8
- var y = { exports: {} };
8
+ var $ = { exports: {} };
9
9
  /*!
10
10
  Copyright (c) 2018 Jed Watson.
11
11
  Licensed under the MIT License (MIT), see
12
12
  http://jedwatson.github.io/classnames
13
13
  */
14
- var g;
15
- function L() {
16
- return g || (g = 1, function(e) {
14
+ var w;
15
+ function H() {
16
+ return w || (w = 1, function(r) {
17
17
  (function() {
18
- var i = {}.hasOwnProperty;
18
+ var a = {}.hasOwnProperty;
19
19
  function n() {
20
- for (var r = "", t = 0; t < arguments.length; t++) {
21
- var l = arguments[t];
22
- l && (r = o(r, a.call(this, l)));
20
+ for (var e = "", t = 0; t < arguments.length; t++) {
21
+ var o = arguments[t];
22
+ o && (e = u(e, i.call(this, o)));
23
23
  }
24
- return r;
24
+ return e;
25
25
  }
26
- function a(r) {
27
- if (typeof r == "string" || typeof r == "number")
28
- return this && this[r] || r;
29
- if (typeof r != "object")
26
+ function i(e) {
27
+ if (typeof e == "string" || typeof e == "number")
28
+ return this && this[e] || e;
29
+ if (typeof e != "object")
30
30
  return "";
31
- if (Array.isArray(r))
32
- return n.apply(this, r);
33
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
34
- return r.toString();
31
+ if (Array.isArray(e))
32
+ return n.apply(this, e);
33
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
34
+ return e.toString();
35
35
  var t = "";
36
- for (var l in r)
37
- i.call(r, l) && r[l] && (t = o(t, this && this[l] || l));
36
+ for (var o in e)
37
+ a.call(e, o) && e[o] && (t = u(t, this && this[o] || o));
38
38
  return t;
39
39
  }
40
- function o(r, t) {
41
- return t ? r ? r + " " + t : r + t : r;
40
+ function u(e, t) {
41
+ return t ? e ? e + " " + t : e + t : e;
42
42
  }
43
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
43
+ r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
44
44
  })();
45
- }(y)), y.exports;
45
+ }($)), $.exports;
46
46
  }
47
- var H = L();
48
- const G = /* @__PURE__ */ I(H), J = {
47
+ var G = H();
48
+ const J = /* @__PURE__ */ k(G), K = {
49
49
  "purpur-icon": "_purpur-icon_8u1lq_1",
50
50
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
51
51
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -53,209 +53,216 @@ const G = /* @__PURE__ */ I(H), J = {
53
53
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
54
54
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
55
55
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
56
- }, K = G.bind(J), $ = "purpur-icon", Q = "md", T = (e) => e.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), U = ({ content: e = "", title: i } = {}) => {
56
+ }, Q = J.bind(K), q = "purpur-icon", U = "md", X = (r) => r.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), Y = ({ content: r = "", title: a } = {}) => {
57
57
  const n = [
58
58
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
59
59
  { name: "fill", value: "currentColor" },
60
60
  { name: "viewBox", value: "0 0 24 24" },
61
- i ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
62
- ], a = i ? `<title>${i}</title>` : "";
63
- return `<svg ${T(n)}>${a}${e}</svg>`;
64
- }, X = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), E = ({ svg: e, allyTitle: i, className: n, size: a = Q, ...o }) => {
65
- const r = U({
66
- content: X(e.svg),
67
- title: i
68
- }), t = K(n, $, `${$}--${a}`);
69
- return /* @__PURE__ */ s("span", { className: t, dangerouslySetInnerHTML: { __html: r }, ...o });
61
+ a ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
62
+ ], i = a ? `<title>${a}</title>` : "";
63
+ return `<svg ${X(n)}>${i}${r}</svg>`;
64
+ }, ee = (r) => r.replace(/<(\/?)svg([^>]*)>/g, "").trim(), M = ({ svg: r, allyTitle: a, className: n, size: i = U, ...u }) => {
65
+ const e = Y({
66
+ content: ee(r.svg),
67
+ title: a
68
+ }), t = Q(n, q, `${q}--${i}`);
69
+ return /* @__PURE__ */ s("span", { className: t, dangerouslySetInnerHTML: { __html: e }, ...u });
70
70
  };
71
- E.displayName = "Icon";
72
- const Y = {
71
+ M.displayName = "Icon";
72
+ const re = {
73
73
  name: "error-filled",
74
74
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
75
75
  keywords: ["error-filled"],
76
76
  category: "status"
77
77
  };
78
- function k(e) {
79
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
78
+ function te(r) {
79
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
80
80
  }
81
- var w = { exports: {} };
81
+ var S = { exports: {} };
82
82
  /*!
83
83
  Copyright (c) 2018 Jed Watson.
84
84
  Licensed under the MIT License (MIT), see
85
85
  http://jedwatson.github.io/classnames
86
86
  */
87
- var S;
88
- function rr() {
89
- return S || (S = 1, function(e) {
87
+ var N;
88
+ function ne() {
89
+ return N || (N = 1, function(r) {
90
90
  (function() {
91
- var i = {}.hasOwnProperty;
91
+ var a = {}.hasOwnProperty;
92
92
  function n() {
93
- for (var r = "", t = 0; t < arguments.length; t++) {
94
- var l = arguments[t];
95
- l && (r = o(r, a.call(this, l)));
93
+ for (var e = "", t = 0; t < arguments.length; t++) {
94
+ var o = arguments[t];
95
+ o && (e = u(e, i.call(this, o)));
96
96
  }
97
- return r;
97
+ return e;
98
98
  }
99
- function a(r) {
100
- if (typeof r == "string" || typeof r == "number")
101
- return this && this[r] || r;
102
- if (typeof r != "object")
99
+ function i(e) {
100
+ if (typeof e == "string" || typeof e == "number")
101
+ return this && this[e] || e;
102
+ if (typeof e != "object")
103
103
  return "";
104
- if (Array.isArray(r))
105
- return n.apply(this, r);
106
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
107
- return r.toString();
104
+ if (Array.isArray(e))
105
+ return n.apply(this, e);
106
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
107
+ return e.toString();
108
108
  var t = "";
109
- for (var l in r)
110
- i.call(r, l) && r[l] && (t = o(t, this && this[l] || l));
109
+ for (var o in e)
110
+ a.call(e, o) && e[o] && (t = u(t, this && this[o] || o));
111
111
  return t;
112
112
  }
113
- function o(r, t) {
114
- return t ? r ? r + " " + t : r + t : r;
113
+ function u(e, t) {
114
+ return t ? e ? e + " " + t : e + t : e;
115
115
  }
116
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
116
+ r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
117
117
  })();
118
- }(w)), w.exports;
118
+ }(S)), S.exports;
119
119
  }
120
- var er = rr();
121
- const tr = /* @__PURE__ */ k(er), nr = {
122
- "purpur-field-error-text": "_purpur-field-error-text_1lj7e_1",
123
- "purpur-field-error-text__icon": "_purpur-field-error-text__icon_1lj7e_11"
124
- }, j = tr.bind(nr), N = "purpur-field-error-text", ar = ({
125
- children: e,
126
- className: i,
127
- ["aria-relevant"]: n = "additions text",
128
- ...a
120
+ var ae = ne();
121
+ const ie = /* @__PURE__ */ te(ae), ue = {
122
+ "purpur-field-error-text": "_purpur-field-error-text_u1cy2_1",
123
+ "purpur-field-error-text--negative": "_purpur-field-error-text--negative_u1cy2_11",
124
+ "purpur-field-error-text__icon": "_purpur-field-error-text__icon_u1cy2_14"
125
+ }, O = ie.bind(ue), x = "purpur-field-error-text", oe = ({
126
+ children: r,
127
+ className: a,
128
+ negative: n = !1,
129
+ ["aria-relevant"]: i = "additions text",
130
+ ...u
129
131
  }) => /* @__PURE__ */ f(
130
132
  "div",
131
133
  {
132
- className: j(i, N),
134
+ className: O(a, x, {
135
+ [`${x}--negative`]: n
136
+ }),
133
137
  "aria-live": "assertive",
134
- "aria-relevant": n,
135
- ...a,
138
+ "aria-relevant": i,
139
+ ...u,
136
140
  children: [
137
- /* @__PURE__ */ s(E, { svg: Y, size: "xs", className: j(`${N}__icon`) }),
138
- e
141
+ /* @__PURE__ */ s(M, { svg: re, size: "xs", className: O(`${x}__icon`) }),
142
+ r
139
143
  ]
140
144
  }
141
145
  );
142
- function ir(e) {
143
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
146
+ function le(r) {
147
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
144
148
  }
145
- var O = { exports: {} };
149
+ var j = { exports: {} };
146
150
  /*!
147
151
  Copyright (c) 2018 Jed Watson.
148
152
  Licensed under the MIT License (MIT), see
149
153
  http://jedwatson.github.io/classnames
150
154
  */
151
155
  var A;
152
- function or() {
153
- return A || (A = 1, function(e) {
156
+ function se() {
157
+ return A || (A = 1, function(r) {
154
158
  (function() {
155
- var i = {}.hasOwnProperty;
159
+ var a = {}.hasOwnProperty;
156
160
  function n() {
157
- for (var r = "", t = 0; t < arguments.length; t++) {
158
- var l = arguments[t];
159
- l && (r = o(r, a.call(this, l)));
161
+ for (var e = "", t = 0; t < arguments.length; t++) {
162
+ var o = arguments[t];
163
+ o && (e = u(e, i.call(this, o)));
160
164
  }
161
- return r;
165
+ return e;
162
166
  }
163
- function a(r) {
164
- if (typeof r == "string" || typeof r == "number")
165
- return this && this[r] || r;
166
- if (typeof r != "object")
167
+ function i(e) {
168
+ if (typeof e == "string" || typeof e == "number")
169
+ return this && this[e] || e;
170
+ if (typeof e != "object")
167
171
  return "";
168
- if (Array.isArray(r))
169
- return n.apply(this, r);
170
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
171
- return r.toString();
172
+ if (Array.isArray(e))
173
+ return n.apply(this, e);
174
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
175
+ return e.toString();
172
176
  var t = "";
173
- for (var l in r)
174
- i.call(r, l) && r[l] && (t = o(t, this && this[l] || l));
177
+ for (var o in e)
178
+ a.call(e, o) && e[o] && (t = u(t, this && this[o] || o));
175
179
  return t;
176
180
  }
177
- function o(r, t) {
178
- return t ? r ? r + " " + t : r + t : r;
181
+ function u(e, t) {
182
+ return t ? e ? e + " " + t : e + t : e;
179
183
  }
180
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
184
+ r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
181
185
  })();
182
- }(O)), O.exports;
186
+ }(j)), j.exports;
183
187
  }
184
- var lr = or();
185
- const ur = /* @__PURE__ */ ir(lr), sr = {
186
- "purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
187
- "purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
188
- }, pr = ur.bind(sr), P = "purpur-field-helper-text", cr = ({
189
- children: e,
190
- className: i,
188
+ var pe = se();
189
+ const ce = /* @__PURE__ */ le(pe), de = {
190
+ "purpur-field-helper-text": "_purpur-field-helper-text_11nsh_1",
191
+ "purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_11nsh_9",
192
+ "purpur-field-helper-text--negative": "_purpur-field-helper-text--negative_11nsh_12"
193
+ }, fe = ce.bind(de), h = "purpur-field-helper-text", _e = ({
194
+ children: r,
195
+ className: a,
191
196
  disabled: n,
192
- id: a,
193
- ...o
197
+ id: i,
198
+ negative: u,
199
+ ...e
194
200
  }) => {
195
- const r = pr(i, P, {
196
- [`${P}--disabled`]: n
201
+ const t = fe(a, h, {
202
+ [`${h}--disabled`]: n,
203
+ [`${h}--negative`]: u
197
204
  });
198
- return /* @__PURE__ */ s("span", { id: a, className: r, ...o, children: e });
205
+ return /* @__PURE__ */ s("span", { id: i, className: t, ...e, children: r });
199
206
  };
200
- function C(e, i) {
201
- if (typeof e == "function")
202
- return e(i);
203
- e != null && (e.current = i);
207
+ function C(r, a) {
208
+ if (typeof r == "function")
209
+ return r(a);
210
+ r != null && (r.current = a);
204
211
  }
205
- function dr(...e) {
206
- return (i) => {
212
+ function xe(...r) {
213
+ return (a) => {
207
214
  let n = !1;
208
- const a = e.map((o) => {
209
- const r = C(o, i);
210
- return !n && typeof r == "function" && (n = !0), r;
215
+ const i = r.map((u) => {
216
+ const e = C(u, a);
217
+ return !n && typeof e == "function" && (n = !0), e;
211
218
  });
212
219
  if (n)
213
220
  return () => {
214
- for (let o = 0; o < a.length; o++) {
215
- const r = a[o];
216
- typeof r == "function" ? r() : C(e[o], null);
221
+ for (let u = 0; u < i.length; u++) {
222
+ const e = i[u];
223
+ typeof e == "function" ? e() : C(r[u], null);
217
224
  }
218
225
  };
219
226
  };
220
227
  }
221
- var D = u.forwardRef((e, i) => {
222
- const { children: n, ...a } = e, o = u.Children.toArray(n), r = o.find(_r);
223
- if (r) {
224
- const t = r.props.children, l = o.map((p) => p === r ? u.Children.count(t) > 1 ? u.Children.only(null) : u.isValidElement(t) ? t.props.children : null : p);
225
- return /* @__PURE__ */ s(x, { ...a, ref: i, children: u.isValidElement(t) ? u.cloneElement(t, void 0, l) : null });
228
+ var D = l.forwardRef((r, a) => {
229
+ const { children: n, ...i } = r, u = l.Children.toArray(n), e = u.find(ve);
230
+ if (e) {
231
+ const t = e.props.children, o = u.map((p) => p === e ? l.Children.count(t) > 1 ? l.Children.only(null) : l.isValidElement(t) ? t.props.children : null : p);
232
+ return /* @__PURE__ */ s(y, { ...i, ref: a, children: l.isValidElement(t) ? l.cloneElement(t, void 0, o) : null });
226
233
  }
227
- return /* @__PURE__ */ s(x, { ...a, ref: i, children: n });
234
+ return /* @__PURE__ */ s(y, { ...i, ref: a, children: n });
228
235
  });
229
236
  D.displayName = "Slot";
230
- var x = u.forwardRef((e, i) => {
231
- const { children: n, ...a } = e;
232
- if (u.isValidElement(n)) {
233
- const o = vr(n), r = mr(a, n.props);
234
- return n.type !== u.Fragment && (r.ref = i ? dr(i, o) : o), u.cloneElement(n, r);
237
+ var y = l.forwardRef((r, a) => {
238
+ const { children: n, ...i } = r;
239
+ if (l.isValidElement(n)) {
240
+ const u = ge(n), e = me(i, n.props);
241
+ return n.type !== l.Fragment && (e.ref = a ? xe(a, u) : u), l.cloneElement(n, e);
235
242
  }
236
- return u.Children.count(n) > 1 ? u.Children.only(null) : null;
243
+ return l.Children.count(n) > 1 ? l.Children.only(null) : null;
237
244
  });
238
- x.displayName = "SlotClone";
239
- var fr = ({ children: e }) => /* @__PURE__ */ s(W, { children: e });
240
- function _r(e) {
241
- return u.isValidElement(e) && e.type === fr;
245
+ y.displayName = "SlotClone";
246
+ var he = ({ children: r }) => /* @__PURE__ */ s(T, { children: r });
247
+ function ve(r) {
248
+ return l.isValidElement(r) && r.type === he;
242
249
  }
243
- function mr(e, i) {
244
- const n = { ...i };
245
- for (const a in i) {
246
- const o = e[a], r = i[a];
247
- /^on[A-Z]/.test(a) ? o && r ? n[a] = (...t) => {
248
- r(...t), o(...t);
249
- } : o && (n[a] = o) : a === "style" ? n[a] = { ...o, ...r } : a === "className" && (n[a] = [o, r].filter(Boolean).join(" "));
250
+ function me(r, a) {
251
+ const n = { ...a };
252
+ for (const i in a) {
253
+ const u = r[i], e = a[i];
254
+ /^on[A-Z]/.test(i) ? u && e ? n[i] = (...t) => {
255
+ e(...t), u(...t);
256
+ } : u && (n[i] = u) : i === "style" ? n[i] = { ...u, ...e } : i === "className" && (n[i] = [u, e].filter(Boolean).join(" "));
250
257
  }
251
- return { ...e, ...n };
258
+ return { ...r, ...n };
252
259
  }
253
- function vr(e) {
254
- var i, n;
255
- let a = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, o = a && "isReactWarning" in a && a.isReactWarning;
256
- return o ? e.ref : (a = (n = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : n.get, o = a && "isReactWarning" in a && a.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
260
+ function ge(r) {
261
+ var a, n;
262
+ let i = (a = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : a.get, u = i && "isReactWarning" in i && i.isReactWarning;
263
+ return u ? r.ref : (i = (n = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : n.get, u = i && "isReactWarning" in i && i.isReactWarning, u ? r.props.ref : r.props.ref || r.ref);
257
264
  }
258
- var hr = [
265
+ var ye = [
259
266
  "a",
260
267
  "button",
261
268
  "div",
@@ -272,195 +279,209 @@ var hr = [
272
279
  "span",
273
280
  "svg",
274
281
  "ul"
275
- ], xr = hr.reduce((e, i) => {
276
- const n = u.forwardRef((a, o) => {
277
- const { asChild: r, ...t } = a, l = r ? D : i;
278
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(l, { ...t, ref: o });
282
+ ], be = ye.reduce((r, a) => {
283
+ const n = l.forwardRef((i, u) => {
284
+ const { asChild: e, ...t } = i, o = e ? D : a;
285
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(o, { ...t, ref: u });
279
286
  });
280
- return n.displayName = `Primitive.${i}`, { ...e, [i]: n };
281
- }, {}), br = "Label", B = u.forwardRef((e, i) => /* @__PURE__ */ s(
282
- xr.label,
287
+ return n.displayName = `Primitive.${a}`, { ...r, [a]: n };
288
+ }, {}), $e = "Label", B = l.forwardRef((r, a) => /* @__PURE__ */ s(
289
+ be.label,
283
290
  {
284
- ...e,
285
- ref: i,
291
+ ...r,
292
+ ref: a,
286
293
  onMouseDown: (n) => {
287
- var a;
288
- n.target.closest("button, input, select, textarea") || ((a = e.onMouseDown) == null || a.call(e, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault());
294
+ var i;
295
+ n.target.closest("button, input, select, textarea") || ((i = r.onMouseDown) == null || i.call(r, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault());
289
296
  }
290
297
  }
291
298
  ));
292
- B.displayName = br;
293
- var yr = B;
294
- function gr(e) {
295
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
299
+ B.displayName = $e;
300
+ var we = B;
301
+ function qe(r) {
302
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
296
303
  }
297
- var q = { exports: {} };
304
+ var P = { exports: {} };
298
305
  /*!
299
306
  Copyright (c) 2018 Jed Watson.
300
307
  Licensed under the MIT License (MIT), see
301
308
  http://jedwatson.github.io/classnames
302
309
  */
303
310
  var R;
304
- function $r() {
305
- return R || (R = 1, function(e) {
311
+ function Se() {
312
+ return R || (R = 1, function(r) {
306
313
  (function() {
307
- var i = {}.hasOwnProperty;
314
+ var a = {}.hasOwnProperty;
308
315
  function n() {
309
- for (var r = "", t = 0; t < arguments.length; t++) {
310
- var l = arguments[t];
311
- l && (r = o(r, a.call(this, l)));
316
+ for (var e = "", t = 0; t < arguments.length; t++) {
317
+ var o = arguments[t];
318
+ o && (e = u(e, i.call(this, o)));
312
319
  }
313
- return r;
320
+ return e;
314
321
  }
315
- function a(r) {
316
- if (typeof r == "string" || typeof r == "number")
317
- return this && this[r] || r;
318
- if (typeof r != "object")
322
+ function i(e) {
323
+ if (typeof e == "string" || typeof e == "number")
324
+ return this && this[e] || e;
325
+ if (typeof e != "object")
319
326
  return "";
320
- if (Array.isArray(r))
321
- return n.apply(this, r);
322
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
323
- return r.toString();
327
+ if (Array.isArray(e))
328
+ return n.apply(this, e);
329
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
330
+ return e.toString();
324
331
  var t = "";
325
- for (var l in r)
326
- i.call(r, l) && r[l] && (t = o(t, this && this[l] || l));
332
+ for (var o in e)
333
+ a.call(e, o) && e[o] && (t = u(t, this && this[o] || o));
327
334
  return t;
328
335
  }
329
- function o(r, t) {
330
- return t ? r ? r + " " + t : r + t : r;
336
+ function u(e, t) {
337
+ return t ? e ? e + " " + t : e + t : e;
331
338
  }
332
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
339
+ r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
333
340
  })();
334
- }(q)), q.exports;
341
+ }(P)), P.exports;
335
342
  }
336
- var wr = $r();
337
- const Sr = /* @__PURE__ */ gr(wr), jr = {
338
- "purpur-label": "_purpur-label_1jndl_1",
339
- "purpur-label--negative": "_purpur-label--negative_1jndl_8",
340
- "purpur-label--disabled": "_purpur-label--disabled_1jndl_11"
341
- }, Nr = Sr.bind(jr), m = "purpur-label", Or = ({
342
- children: e,
343
- className: i,
343
+ var Ne = Se();
344
+ const Oe = /* @__PURE__ */ qe(Ne), je = {
345
+ "purpur-label": "_purpur-label_1x80u_1",
346
+ "purpur-label--negative": "_purpur-label--negative_1x80u_8",
347
+ "purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
348
+ }, Ae = Oe.bind(je), v = "purpur-label", Ce = ({
349
+ children: r,
350
+ className: a,
344
351
  disabled: n,
345
- negative: a = !1,
346
- ...o
352
+ negative: i = !1,
353
+ ...u
347
354
  }) => {
348
- const r = Nr(i, m, {
349
- [`${m}--disabled`]: n,
350
- [`${m}--negative`]: a
355
+ const e = Ae(a, v, {
356
+ [`${v}--disabled`]: n,
357
+ [`${v}--negative`]: i
351
358
  });
352
- return /* @__PURE__ */ s(yr, { className: r, ...o, children: e });
359
+ return /* @__PURE__ */ s(we, { className: e, ...u, children: r });
360
+ }, Pe = z(void 0), Re = () => {
361
+ const r = I(Pe);
362
+ if (!r)
363
+ throw new Error("useTheme must be used within a ThemeProvider");
364
+ return r;
365
+ }, Ee = () => {
366
+ const { colorScheme: r, setColorScheme: a } = Re();
367
+ return [r, a];
353
368
  };
354
- function Ar(e) {
355
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
369
+ function Me(r) {
370
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
356
371
  }
357
- var v = { exports: {} };
372
+ var m = { exports: {} };
358
373
  /*!
359
374
  Copyright (c) 2018 Jed Watson.
360
375
  Licensed under the MIT License (MIT), see
361
376
  http://jedwatson.github.io/classnames
362
377
  */
363
- var M;
364
- function Pr() {
365
- return M || (M = 1, function(e) {
378
+ var E;
379
+ function De() {
380
+ return E || (E = 1, function(r) {
366
381
  (function() {
367
- var i = {}.hasOwnProperty;
382
+ var a = {}.hasOwnProperty;
368
383
  function n() {
369
- for (var r = "", t = 0; t < arguments.length; t++) {
370
- var l = arguments[t];
371
- l && (r = o(r, a.call(this, l)));
384
+ for (var e = "", t = 0; t < arguments.length; t++) {
385
+ var o = arguments[t];
386
+ o && (e = u(e, i.call(this, o)));
372
387
  }
373
- return r;
388
+ return e;
374
389
  }
375
- function a(r) {
376
- if (typeof r == "string" || typeof r == "number")
377
- return this && this[r] || r;
378
- if (typeof r != "object")
390
+ function i(e) {
391
+ if (typeof e == "string" || typeof e == "number")
392
+ return this && this[e] || e;
393
+ if (typeof e != "object")
379
394
  return "";
380
- if (Array.isArray(r))
381
- return n.apply(this, r);
382
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
383
- return r.toString();
395
+ if (Array.isArray(e))
396
+ return n.apply(this, e);
397
+ if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
398
+ return e.toString();
384
399
  var t = "";
385
- for (var l in r)
386
- i.call(r, l) && r[l] && (t = o(t, this && this[l] || l));
400
+ for (var o in e)
401
+ a.call(e, o) && e[o] && (t = u(t, this && this[o] || o));
387
402
  return t;
388
403
  }
389
- function o(r, t) {
390
- return t ? r ? r + " " + t : r + t : r;
404
+ function u(e, t) {
405
+ return t ? e ? e + " " + t : e + t : e;
391
406
  }
392
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
407
+ r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
393
408
  })();
394
- }(v)), v.exports;
409
+ }(m)), m.exports;
395
410
  }
396
- var Cr = Pr();
397
- const qr = /* @__PURE__ */ Ar(Cr), b = {
398
- "purpur-text-area": "_purpur-text-area_15b4m_1",
399
- "purpur-text-area__label": "_purpur-text-area__label_15b4m_8",
400
- "purpur-text-area__label-text": "_purpur-text-area__label-text_15b4m_13",
401
- "purpur-text-area__frame": "_purpur-text-area__frame_15b4m_16",
402
- "purpur-text-area__textarea-container": "_purpur-text-area__textarea-container_15b4m_23",
403
- "purpur-text-area__textarea-container--disabled": "_purpur-text-area__textarea-container--disabled_15b4m_33",
404
- "purpur-text-area__textarea-container--readonly": "_purpur-text-area__textarea-container--readonly_15b4m_36",
405
- "purpur-text-area__textarea": "_purpur-text-area__textarea_15b4m_23",
406
- "purpur-text-area__textarea--valid": "_purpur-text-area__textarea--valid_15b4m_82",
407
- "purpur-text-area__textarea--error": "_purpur-text-area__textarea--error_15b4m_82"
408
- }, h = qr.bind(b), c = "purpur-text-area", Rr = z(
411
+ var Be = De();
412
+ const Ve = /* @__PURE__ */ Me(Be), b = {
413
+ "purpur-text-area": "_purpur-text-area_1qqf0_1",
414
+ "purpur-text-area__label": "_purpur-text-area__label_1qqf0_8",
415
+ "purpur-text-area__label-text": "_purpur-text-area__label-text_1qqf0_13",
416
+ "purpur-text-area__frame": "_purpur-text-area__frame_1qqf0_16",
417
+ "purpur-text-area__textarea-container": "_purpur-text-area__textarea-container_1qqf0_23",
418
+ "purpur-text-area__textarea-container--disabled": "_purpur-text-area__textarea-container--disabled_1qqf0_33",
419
+ "purpur-text-area__textarea-container--readonly": "_purpur-text-area__textarea-container--readonly_1qqf0_36",
420
+ "purpur-text-area__textarea": "_purpur-text-area__textarea_1qqf0_23",
421
+ "purpur-text-area__textarea--light": "_purpur-text-area__textarea--light_1qqf0_52",
422
+ "purpur-text-area__textarea--dark": "_purpur-text-area__textarea--dark_1qqf0_60",
423
+ "purpur-text-area__textarea--valid": "_purpur-text-area__textarea--valid_1qqf0_91",
424
+ "purpur-text-area__textarea--error": "_purpur-text-area__textarea--error_1qqf0_91"
425
+ }, g = Ve.bind(b), c = "purpur-text-area", Ze = L(
409
426
  ({
410
- id: e,
411
- ["data-testid"]: i,
427
+ id: r,
428
+ ["data-testid"]: a,
412
429
  className: n,
413
- errorText: a,
414
- helperText: o,
415
- label: r,
430
+ errorText: i,
431
+ helperText: u,
432
+ label: e,
416
433
  rows: t = 3,
417
- cols: l = 90,
434
+ cols: o = 90,
418
435
  ...p
419
436
  }, V) => {
420
- const d = (F) => i ? `${i}-${F}` : void 0, _ = o ? `${e}-helper-text` : void 0, Z = h(`${c}__textarea-container`, {
437
+ const [Z] = Ee(), d = (W) => a ? `${a}-${W}` : void 0, _ = u ? `${r}-helper-text` : void 0, F = g(`${c}__textarea-container`, {
421
438
  [`${c}__textarea-container--disabled`]: p.disabled,
422
439
  [`${c}__textarea-container--readonly`]: p.readOnly && !p.disabled
423
440
  });
424
- return /* @__PURE__ */ f("div", { className: h(n, c), "data-testid": i, children: [
425
- r && /* @__PURE__ */ f(
426
- Or,
441
+ return /* @__PURE__ */ f("div", { className: g(n, c), "data-testid": a, children: [
442
+ e && /* @__PURE__ */ f(
443
+ Ce,
427
444
  {
428
- htmlFor: e,
445
+ htmlFor: r,
429
446
  disabled: p.disabled,
430
447
  className: b[`${c}__label`],
431
448
  "data-testid": d("label"),
432
449
  children: [
433
450
  p.required && /* @__PURE__ */ s("span", { "aria-hidden": !0, children: "*" }),
434
- r
451
+ e
435
452
  ]
436
453
  }
437
454
  ),
438
- /* @__PURE__ */ f("div", { className: Z, children: [
455
+ /* @__PURE__ */ f("div", { className: F, children: [
439
456
  /* @__PURE__ */ s(
440
457
  "textarea",
441
458
  {
442
459
  ...p,
443
460
  ref: V,
444
- id: e,
461
+ id: r,
445
462
  "data-testid": d("textarea"),
446
463
  "aria-describedby": p["aria-describedby"] || _,
447
- "aria-invalid": p["aria-invalid"] || !!a,
448
- className: h(`${c}__textarea`, {
449
- [`${c}__textarea--error`]: !!a
450
- }),
464
+ "aria-invalid": p["aria-invalid"] || !!i,
465
+ className: g(
466
+ `${c}__textarea`,
467
+ `${c}__textarea--${Z}`,
468
+ {
469
+ [`${c}__textarea--error`]: !!i
470
+ }
471
+ ),
451
472
  rows: t,
452
- cols: l
473
+ cols: o
453
474
  }
454
475
  ),
455
476
  /* @__PURE__ */ s("div", { className: b[`${c}__frame`] })
456
477
  ] }),
457
- _ && /* @__PURE__ */ s(cr, { "data-testid": d("helper-text"), id: _, children: o }),
458
- a && /* @__PURE__ */ s(ar, { "data-testid": d("error-text"), children: a })
478
+ _ && /* @__PURE__ */ s(_e, { "data-testid": d("helper-text"), id: _, children: u }),
479
+ i && /* @__PURE__ */ s(oe, { "data-testid": d("error-text"), children: i })
459
480
  ] });
460
481
  }
461
482
  );
462
- Rr.displayName = "TextArea";
483
+ Ze.displayName = "TextArea";
463
484
  export {
464
- Rr as TextArea
485
+ Ze as TextArea
465
486
  };
466
487
  //# sourceMappingURL=text-area.es.js.map