@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.
- package/dist/LICENSE.txt +10 -3
- package/dist/styles.css +1 -1
- package/dist/text-area.cjs.js +6 -6
- package/dist/text-area.cjs.js.map +1 -1
- package/dist/text-area.d.ts.map +1 -1
- package/dist/text-area.es.js +291 -270
- package/dist/text-area.es.js.map +1 -1
- package/package.json +7 -6
- package/scripts/generate-assets.mts +10 -3
- package/src/assets/resize-handle-dark-disabled-icon.svg +4 -0
- package/src/assets/resize-handle-dark-icon.svg +4 -0
- package/src/text-area.module.scss +19 -7
- package/src/text-area.test.tsx +66 -27
- package/src/text-area.tsx +10 -3
- /package/src/assets/{resize-handle-disabled-icon.svg → resize-handle-light-disabled-icon.svg} +0 -0
- /package/src/assets/{resize-handle-default-icon.svg → resize-handle-light-icon.svg} +0 -0
package/dist/text-area.es.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsxs as f, jsx as s, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
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
|
|
6
|
-
return
|
|
5
|
+
function k(r) {
|
|
6
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
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
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
var w;
|
|
15
|
+
function H() {
|
|
16
|
+
return w || (w = 1, function(r) {
|
|
17
17
|
(function() {
|
|
18
|
-
var
|
|
18
|
+
var a = {}.hasOwnProperty;
|
|
19
19
|
function n() {
|
|
20
|
-
for (var
|
|
21
|
-
var
|
|
22
|
-
|
|
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
|
|
24
|
+
return e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
if (typeof
|
|
28
|
-
return this && this[
|
|
29
|
-
if (typeof
|
|
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(
|
|
32
|
-
return n.apply(this,
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
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
|
|
37
|
-
|
|
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
|
|
41
|
-
return t ?
|
|
40
|
+
function u(e, t) {
|
|
41
|
+
return t ? e ? e + " " + t : e + t : e;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
|
|
44
44
|
})();
|
|
45
|
-
}(
|
|
45
|
+
}($)), $.exports;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
const
|
|
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
|
-
},
|
|
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
|
-
|
|
62
|
-
],
|
|
63
|
-
return `<svg ${
|
|
64
|
-
},
|
|
65
|
-
const
|
|
66
|
-
content:
|
|
67
|
-
title:
|
|
68
|
-
}), t =
|
|
69
|
-
return /* @__PURE__ */ s("span", { className: t, dangerouslySetInnerHTML: { __html:
|
|
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
|
-
|
|
72
|
-
const
|
|
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
|
|
79
|
-
return
|
|
78
|
+
function te(r) {
|
|
79
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
80
80
|
}
|
|
81
|
-
var
|
|
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
|
|
88
|
-
function
|
|
89
|
-
return
|
|
87
|
+
var N;
|
|
88
|
+
function ne() {
|
|
89
|
+
return N || (N = 1, function(r) {
|
|
90
90
|
(function() {
|
|
91
|
-
var
|
|
91
|
+
var a = {}.hasOwnProperty;
|
|
92
92
|
function n() {
|
|
93
|
-
for (var
|
|
94
|
-
var
|
|
95
|
-
|
|
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
|
|
97
|
+
return e;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
if (typeof
|
|
101
|
-
return this && this[
|
|
102
|
-
if (typeof
|
|
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(
|
|
105
|
-
return n.apply(this,
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
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
|
|
110
|
-
|
|
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
|
|
114
|
-
return t ?
|
|
113
|
+
function u(e, t) {
|
|
114
|
+
return t ? e ? e + " " + t : e + t : e;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
|
|
117
117
|
})();
|
|
118
|
-
}(
|
|
118
|
+
}(S)), S.exports;
|
|
119
119
|
}
|
|
120
|
-
var
|
|
121
|
-
const
|
|
122
|
-
"purpur-field-error-text": "_purpur-field-error-
|
|
123
|
-
"purpur-field-error-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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:
|
|
134
|
+
className: O(a, x, {
|
|
135
|
+
[`${x}--negative`]: n
|
|
136
|
+
}),
|
|
133
137
|
"aria-live": "assertive",
|
|
134
|
-
"aria-relevant":
|
|
135
|
-
...
|
|
138
|
+
"aria-relevant": i,
|
|
139
|
+
...u,
|
|
136
140
|
children: [
|
|
137
|
-
/* @__PURE__ */ s(
|
|
138
|
-
|
|
141
|
+
/* @__PURE__ */ s(M, { svg: re, size: "xs", className: O(`${x}__icon`) }),
|
|
142
|
+
r
|
|
139
143
|
]
|
|
140
144
|
}
|
|
141
145
|
);
|
|
142
|
-
function
|
|
143
|
-
return
|
|
146
|
+
function le(r) {
|
|
147
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
144
148
|
}
|
|
145
|
-
var
|
|
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
|
|
153
|
-
return A || (A = 1, function(
|
|
156
|
+
function se() {
|
|
157
|
+
return A || (A = 1, function(r) {
|
|
154
158
|
(function() {
|
|
155
|
-
var
|
|
159
|
+
var a = {}.hasOwnProperty;
|
|
156
160
|
function n() {
|
|
157
|
-
for (var
|
|
158
|
-
var
|
|
159
|
-
|
|
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
|
|
165
|
+
return e;
|
|
162
166
|
}
|
|
163
|
-
function
|
|
164
|
-
if (typeof
|
|
165
|
-
return this && this[
|
|
166
|
-
if (typeof
|
|
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(
|
|
169
|
-
return n.apply(this,
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
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
|
|
174
|
-
|
|
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
|
|
178
|
-
return t ?
|
|
181
|
+
function u(e, t) {
|
|
182
|
+
return t ? e ? e + " " + t : e + t : e;
|
|
179
183
|
}
|
|
180
|
-
|
|
184
|
+
r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
|
|
181
185
|
})();
|
|
182
|
-
}(
|
|
186
|
+
}(j)), j.exports;
|
|
183
187
|
}
|
|
184
|
-
var
|
|
185
|
-
const
|
|
186
|
-
"purpur-field-helper-text": "_purpur-field-helper-
|
|
187
|
-
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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:
|
|
193
|
-
|
|
197
|
+
id: i,
|
|
198
|
+
negative: u,
|
|
199
|
+
...e
|
|
194
200
|
}) => {
|
|
195
|
-
const
|
|
196
|
-
[`${
|
|
201
|
+
const t = fe(a, h, {
|
|
202
|
+
[`${h}--disabled`]: n,
|
|
203
|
+
[`${h}--negative`]: u
|
|
197
204
|
});
|
|
198
|
-
return /* @__PURE__ */ s("span", { id:
|
|
205
|
+
return /* @__PURE__ */ s("span", { id: i, className: t, ...e, children: r });
|
|
199
206
|
};
|
|
200
|
-
function C(
|
|
201
|
-
if (typeof
|
|
202
|
-
return
|
|
203
|
-
|
|
207
|
+
function C(r, a) {
|
|
208
|
+
if (typeof r == "function")
|
|
209
|
+
return r(a);
|
|
210
|
+
r != null && (r.current = a);
|
|
204
211
|
}
|
|
205
|
-
function
|
|
206
|
-
return (
|
|
212
|
+
function xe(...r) {
|
|
213
|
+
return (a) => {
|
|
207
214
|
let n = !1;
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
return !n && typeof
|
|
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
|
|
215
|
-
const
|
|
216
|
-
typeof
|
|
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 =
|
|
222
|
-
const { children: n, ...
|
|
223
|
-
if (
|
|
224
|
-
const t =
|
|
225
|
-
return /* @__PURE__ */ s(
|
|
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(
|
|
234
|
+
return /* @__PURE__ */ s(y, { ...i, ref: a, children: n });
|
|
228
235
|
});
|
|
229
236
|
D.displayName = "Slot";
|
|
230
|
-
var
|
|
231
|
-
const { children: n, ...
|
|
232
|
-
if (
|
|
233
|
-
const
|
|
234
|
-
return n.type !==
|
|
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
|
|
243
|
+
return l.Children.count(n) > 1 ? l.Children.only(null) : null;
|
|
237
244
|
});
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
function
|
|
241
|
-
return
|
|
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
|
|
244
|
-
const n = { ...
|
|
245
|
-
for (const
|
|
246
|
-
const
|
|
247
|
-
/^on[A-Z]/.test(
|
|
248
|
-
|
|
249
|
-
} :
|
|
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 { ...
|
|
258
|
+
return { ...r, ...n };
|
|
252
259
|
}
|
|
253
|
-
function
|
|
254
|
-
var
|
|
255
|
-
let
|
|
256
|
-
return
|
|
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
|
|
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
|
-
],
|
|
276
|
-
const n =
|
|
277
|
-
const { asChild:
|
|
278
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(
|
|
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.${
|
|
281
|
-
}, {}),
|
|
282
|
-
|
|
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
|
-
...
|
|
285
|
-
ref:
|
|
291
|
+
...r,
|
|
292
|
+
ref: a,
|
|
286
293
|
onMouseDown: (n) => {
|
|
287
|
-
var
|
|
288
|
-
n.target.closest("button, input, select, textarea") || ((
|
|
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 =
|
|
293
|
-
var
|
|
294
|
-
function
|
|
295
|
-
return
|
|
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
|
|
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
|
|
305
|
-
return R || (R = 1, function(
|
|
311
|
+
function Se() {
|
|
312
|
+
return R || (R = 1, function(r) {
|
|
306
313
|
(function() {
|
|
307
|
-
var
|
|
314
|
+
var a = {}.hasOwnProperty;
|
|
308
315
|
function n() {
|
|
309
|
-
for (var
|
|
310
|
-
var
|
|
311
|
-
|
|
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
|
|
320
|
+
return e;
|
|
314
321
|
}
|
|
315
|
-
function
|
|
316
|
-
if (typeof
|
|
317
|
-
return this && this[
|
|
318
|
-
if (typeof
|
|
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(
|
|
321
|
-
return n.apply(this,
|
|
322
|
-
if (
|
|
323
|
-
return
|
|
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
|
|
326
|
-
|
|
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
|
|
330
|
-
return t ?
|
|
336
|
+
function u(e, t) {
|
|
337
|
+
return t ? e ? e + " " + t : e + t : e;
|
|
331
338
|
}
|
|
332
|
-
|
|
339
|
+
r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
|
|
333
340
|
})();
|
|
334
|
-
}(
|
|
341
|
+
}(P)), P.exports;
|
|
335
342
|
}
|
|
336
|
-
var
|
|
337
|
-
const
|
|
338
|
-
"purpur-label": "_purpur-
|
|
339
|
-
"purpur-label--negative": "_purpur-label--
|
|
340
|
-
"purpur-label--disabled": "_purpur-label--
|
|
341
|
-
},
|
|
342
|
-
children:
|
|
343
|
-
className:
|
|
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:
|
|
346
|
-
...
|
|
352
|
+
negative: i = !1,
|
|
353
|
+
...u
|
|
347
354
|
}) => {
|
|
348
|
-
const
|
|
349
|
-
[`${
|
|
350
|
-
[`${
|
|
355
|
+
const e = Ae(a, v, {
|
|
356
|
+
[`${v}--disabled`]: n,
|
|
357
|
+
[`${v}--negative`]: i
|
|
351
358
|
});
|
|
352
|
-
return /* @__PURE__ */ s(
|
|
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
|
|
355
|
-
return
|
|
369
|
+
function Me(r) {
|
|
370
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
356
371
|
}
|
|
357
|
-
var
|
|
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
|
|
364
|
-
function
|
|
365
|
-
return
|
|
378
|
+
var E;
|
|
379
|
+
function De() {
|
|
380
|
+
return E || (E = 1, function(r) {
|
|
366
381
|
(function() {
|
|
367
|
-
var
|
|
382
|
+
var a = {}.hasOwnProperty;
|
|
368
383
|
function n() {
|
|
369
|
-
for (var
|
|
370
|
-
var
|
|
371
|
-
|
|
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
|
|
388
|
+
return e;
|
|
374
389
|
}
|
|
375
|
-
function
|
|
376
|
-
if (typeof
|
|
377
|
-
return this && this[
|
|
378
|
-
if (typeof
|
|
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(
|
|
381
|
-
return n.apply(this,
|
|
382
|
-
if (
|
|
383
|
-
return
|
|
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
|
|
386
|
-
|
|
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
|
|
390
|
-
return t ?
|
|
404
|
+
function u(e, t) {
|
|
405
|
+
return t ? e ? e + " " + t : e + t : e;
|
|
391
406
|
}
|
|
392
|
-
|
|
407
|
+
r.exports ? (n.default = n, r.exports = n) : window.classNames = n;
|
|
393
408
|
})();
|
|
394
|
-
}(
|
|
409
|
+
}(m)), m.exports;
|
|
395
410
|
}
|
|
396
|
-
var
|
|
397
|
-
const
|
|
398
|
-
"purpur-text-area": "_purpur-text-
|
|
399
|
-
"purpur-text-area__label": "_purpur-text-
|
|
400
|
-
"purpur-text-area__label-text": "_purpur-text-area__label-
|
|
401
|
-
"purpur-text-area__frame": "_purpur-text-
|
|
402
|
-
"purpur-text-area__textarea-container": "_purpur-text-area__textarea-
|
|
403
|
-
"purpur-text-area__textarea-container--disabled": "_purpur-text-area__textarea-container--
|
|
404
|
-
"purpur-text-area__textarea-container--readonly": "_purpur-text-area__textarea-container--
|
|
405
|
-
"purpur-text-area__textarea": "_purpur-text-
|
|
406
|
-
"purpur-text-area__textarea--
|
|
407
|
-
"purpur-text-area__textarea--
|
|
408
|
-
|
|
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:
|
|
411
|
-
["data-testid"]:
|
|
427
|
+
id: r,
|
|
428
|
+
["data-testid"]: a,
|
|
412
429
|
className: n,
|
|
413
|
-
errorText:
|
|
414
|
-
helperText:
|
|
415
|
-
label:
|
|
430
|
+
errorText: i,
|
|
431
|
+
helperText: u,
|
|
432
|
+
label: e,
|
|
416
433
|
rows: t = 3,
|
|
417
|
-
cols:
|
|
434
|
+
cols: o = 90,
|
|
418
435
|
...p
|
|
419
436
|
}, V) => {
|
|
420
|
-
const d = (
|
|
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:
|
|
425
|
-
|
|
426
|
-
|
|
441
|
+
return /* @__PURE__ */ f("div", { className: g(n, c), "data-testid": a, children: [
|
|
442
|
+
e && /* @__PURE__ */ f(
|
|
443
|
+
Ce,
|
|
427
444
|
{
|
|
428
|
-
htmlFor:
|
|
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
|
-
|
|
451
|
+
e
|
|
435
452
|
]
|
|
436
453
|
}
|
|
437
454
|
),
|
|
438
|
-
/* @__PURE__ */ f("div", { className:
|
|
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:
|
|
461
|
+
id: r,
|
|
445
462
|
"data-testid": d("textarea"),
|
|
446
463
|
"aria-describedby": p["aria-describedby"] || _,
|
|
447
|
-
"aria-invalid": p["aria-invalid"] || !!
|
|
448
|
-
className:
|
|
449
|
-
|
|
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:
|
|
473
|
+
cols: o
|
|
453
474
|
}
|
|
454
475
|
),
|
|
455
476
|
/* @__PURE__ */ s("div", { className: b[`${c}__frame`] })
|
|
456
477
|
] }),
|
|
457
|
-
_ && /* @__PURE__ */ s(
|
|
458
|
-
|
|
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
|
-
|
|
483
|
+
Ze.displayName = "TextArea";
|
|
463
484
|
export {
|
|
464
|
-
|
|
485
|
+
Ze as TextArea
|
|
465
486
|
};
|
|
466
487
|
//# sourceMappingURL=text-area.es.js.map
|