@sanity/ui 5.0.0-alpha.11 → 5.0.0-alpha.13
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/index.d.ts +47 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +293 -272
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/icon/Icon.tsx +21 -11
- package/src/components/icon/icon.props.ts +1 -1
- package/src/components/index.css +1 -0
- package/src/components/select/Select.tsx +1 -7
- package/src/components/select/select.css +2 -2
- package/src/components/select/select.props.ts +6 -14
- package/src/components/text-input/TextInput.tsx +32 -0
- package/src/components/text-input/text-input.css +49 -0
- package/src/components/text-input/textInput.props.ts +41 -0
- package/src/css/tokens/semantic.css +1 -1
- package/src/index.ts +2 -1
- package/src/version.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { Activity, Children, Suspense, cloneElement, createElement, isValidElement, lazy, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Activity, Children, Suspense, cloneElement, isValidElement, lazy, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
|
|
6
6
|
import { SpinnerIcon } from "@sanity/icons/Spinner";
|
|
7
7
|
import { CheckmarkIcon } from "@sanity/icons/Checkmark";
|
|
8
8
|
import { RemoveIcon } from "@sanity/icons/Remove";
|
|
@@ -81,7 +81,251 @@ function getCompositeValue(propValue, propDef, key) {
|
|
|
81
81
|
return compositeValue;
|
|
82
82
|
}
|
|
83
83
|
function suffixClassName(className) {
|
|
84
|
-
return `${className}-
|
|
84
|
+
return `${className}-0ef1ec`;
|
|
85
|
+
}
|
|
86
|
+
const SPACE = [
|
|
87
|
+
0,
|
|
88
|
+
1,
|
|
89
|
+
2,
|
|
90
|
+
3,
|
|
91
|
+
4,
|
|
92
|
+
5,
|
|
93
|
+
6,
|
|
94
|
+
7,
|
|
95
|
+
8,
|
|
96
|
+
9
|
|
97
|
+
], SPACE_AUTO = [...SPACE, "auto"], SPACE_INHERIT = [...SPACE, "inherit"], SPACE_AUTO_NEGATIVE = [
|
|
98
|
+
-9,
|
|
99
|
+
-8,
|
|
100
|
+
-7,
|
|
101
|
+
-6,
|
|
102
|
+
-5,
|
|
103
|
+
-4,
|
|
104
|
+
-3,
|
|
105
|
+
-2,
|
|
106
|
+
-1,
|
|
107
|
+
...SPACE,
|
|
108
|
+
"auto"
|
|
109
|
+
], marginProps = {
|
|
110
|
+
margin: {
|
|
111
|
+
type: "union",
|
|
112
|
+
className: "m",
|
|
113
|
+
values: SPACE_AUTO_NEGATIVE
|
|
114
|
+
},
|
|
115
|
+
marginX: {
|
|
116
|
+
type: "union",
|
|
117
|
+
className: "mx",
|
|
118
|
+
values: SPACE_AUTO_NEGATIVE
|
|
119
|
+
},
|
|
120
|
+
marginY: {
|
|
121
|
+
type: "union",
|
|
122
|
+
className: "my",
|
|
123
|
+
values: SPACE_AUTO_NEGATIVE
|
|
124
|
+
},
|
|
125
|
+
marginTop: {
|
|
126
|
+
type: "union",
|
|
127
|
+
className: "mt",
|
|
128
|
+
values: SPACE_AUTO_NEGATIVE
|
|
129
|
+
},
|
|
130
|
+
marginRight: {
|
|
131
|
+
type: "union",
|
|
132
|
+
className: "mr",
|
|
133
|
+
values: SPACE_AUTO_NEGATIVE
|
|
134
|
+
},
|
|
135
|
+
marginBottom: {
|
|
136
|
+
type: "union",
|
|
137
|
+
className: "mb",
|
|
138
|
+
values: SPACE_AUTO_NEGATIVE
|
|
139
|
+
},
|
|
140
|
+
marginLeft: {
|
|
141
|
+
type: "union",
|
|
142
|
+
className: "ml",
|
|
143
|
+
values: SPACE_AUTO_NEGATIVE
|
|
144
|
+
}
|
|
145
|
+
}, toneProps = { tone: {
|
|
146
|
+
type: "union",
|
|
147
|
+
className: "tone",
|
|
148
|
+
values: [
|
|
149
|
+
"neutral",
|
|
150
|
+
"positive",
|
|
151
|
+
"suggest",
|
|
152
|
+
"caution",
|
|
153
|
+
"critical"
|
|
154
|
+
]
|
|
155
|
+
} }, typographyProps = {
|
|
156
|
+
align: {
|
|
157
|
+
type: "union",
|
|
158
|
+
className: "text",
|
|
159
|
+
values: [
|
|
160
|
+
"left",
|
|
161
|
+
"center",
|
|
162
|
+
"right",
|
|
163
|
+
"justify"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
muted: {
|
|
167
|
+
type: "boolean",
|
|
168
|
+
className: "text-muted",
|
|
169
|
+
inverseClassName: "text-default"
|
|
170
|
+
},
|
|
171
|
+
trim: {
|
|
172
|
+
type: "boolean",
|
|
173
|
+
className: "text-trim",
|
|
174
|
+
inverseClassName: "text-trim-none"
|
|
175
|
+
},
|
|
176
|
+
truncate: {
|
|
177
|
+
type: "conditional",
|
|
178
|
+
resolve: (value) => value === 1 ? {
|
|
179
|
+
type: "number",
|
|
180
|
+
className: "text-overflow"
|
|
181
|
+
} : {
|
|
182
|
+
type: "number",
|
|
183
|
+
className: "line-clamp",
|
|
184
|
+
variable: "--line-clamp"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
weight: {
|
|
188
|
+
type: "union",
|
|
189
|
+
className: "weight",
|
|
190
|
+
values: [
|
|
191
|
+
"regular",
|
|
192
|
+
"medium",
|
|
193
|
+
"semibold",
|
|
194
|
+
"bold"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
...marginProps,
|
|
198
|
+
...toneProps
|
|
199
|
+
}, ICON_SIZE = [
|
|
200
|
+
0,
|
|
201
|
+
1,
|
|
202
|
+
2,
|
|
203
|
+
3,
|
|
204
|
+
4
|
|
205
|
+
], iconProps = {
|
|
206
|
+
icon: { type: "string" },
|
|
207
|
+
size: {
|
|
208
|
+
type: "union",
|
|
209
|
+
className: "icon-body",
|
|
210
|
+
values: ICON_SIZE
|
|
211
|
+
},
|
|
212
|
+
muted: typographyProps.muted,
|
|
213
|
+
...toneProps,
|
|
214
|
+
...marginProps
|
|
215
|
+
}, iconClassName = suffixClassName("sui-Icon");
|
|
216
|
+
/** @public */
|
|
217
|
+
function Icon({ icon, size = 2, ...props }) {
|
|
218
|
+
let { className, style, ...rest } = getProps({
|
|
219
|
+
size,
|
|
220
|
+
...props
|
|
221
|
+
}, iconProps), iconElement = isValidElement(icon) ? icon : null, ariaLabel = props["aria-label"] || (iconElement ? iconElement.props["aria-label"] : void 0), svgProps = {
|
|
222
|
+
className: clsx(iconClassName, className, iconElement ? iconElement.props.className : void 0),
|
|
223
|
+
style: iconElement ? {
|
|
224
|
+
...iconElement.props.style,
|
|
225
|
+
...style
|
|
226
|
+
} : style,
|
|
227
|
+
"data-ui": "Icon",
|
|
228
|
+
"aria-hidden": !ariaLabel || void 0,
|
|
229
|
+
...rest
|
|
230
|
+
};
|
|
231
|
+
return iconElement ? cloneElement(iconElement, svgProps) : createElement(icon, svgProps);
|
|
232
|
+
}
|
|
233
|
+
const textProps = {
|
|
234
|
+
as: { type: "string" },
|
|
235
|
+
size: {
|
|
236
|
+
type: "union",
|
|
237
|
+
className: "text-body",
|
|
238
|
+
values: [
|
|
239
|
+
0,
|
|
240
|
+
1,
|
|
241
|
+
2,
|
|
242
|
+
3,
|
|
243
|
+
4
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
...typographyProps
|
|
247
|
+
}, textClassName = suffixClassName("sui-Text");
|
|
248
|
+
/** @public */
|
|
249
|
+
function Text(t0) {
|
|
250
|
+
let $ = c(15), T0, children, rest, style, t1, t2;
|
|
251
|
+
if ($[0] !== t0) {
|
|
252
|
+
t2 = Symbol.for("react.early_return_sentinel");
|
|
253
|
+
bb0: {
|
|
254
|
+
let { size: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
|
|
255
|
+
size: t3 === void 0 ? 2 : t3,
|
|
256
|
+
...props
|
|
257
|
+
}, textProps);
|
|
258
|
+
children = t4, style = t5, rest = t6;
|
|
259
|
+
let Component = as || "span";
|
|
260
|
+
if (props.truncate && props.trim) {
|
|
261
|
+
let t7 = clsx(textClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t8 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp", t9;
|
|
262
|
+
$[7] === t8 ? t9 = $[8] : (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9), t2 = /* @__PURE__ */ jsx(Component, {
|
|
263
|
+
className: t7,
|
|
264
|
+
style,
|
|
265
|
+
"data-ui": "Text",
|
|
266
|
+
...rest,
|
|
267
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
268
|
+
className: t9,
|
|
269
|
+
children
|
|
270
|
+
})
|
|
271
|
+
});
|
|
272
|
+
break bb0;
|
|
273
|
+
}
|
|
274
|
+
T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
|
|
275
|
+
}
|
|
276
|
+
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
277
|
+
} else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
|
|
278
|
+
if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
|
|
279
|
+
let t3;
|
|
280
|
+
return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, {
|
|
281
|
+
className: t1,
|
|
282
|
+
style,
|
|
283
|
+
"data-ui": "Text",
|
|
284
|
+
...rest,
|
|
285
|
+
children
|
|
286
|
+
}), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
287
|
+
}
|
|
288
|
+
const badgeProps = {
|
|
289
|
+
as: { type: "string" },
|
|
290
|
+
iconStart: { type: "string" },
|
|
291
|
+
text: { type: "string" },
|
|
292
|
+
...toneProps
|
|
293
|
+
}, badgeClassName = suffixClassName("sui-Badge");
|
|
294
|
+
/** @public */
|
|
295
|
+
function Badge(t0) {
|
|
296
|
+
let $ = c(20), T0, children, t1, t2, t3, t4, t5, text;
|
|
297
|
+
if ($[0] !== t0) {
|
|
298
|
+
let { tone: t6, ...props } = t0, { as, children: t7, className, style, iconStart: IconStart, text: t8, ...rest } = getProps({
|
|
299
|
+
tone: t6 === void 0 ? "neutral" : t6,
|
|
300
|
+
...props
|
|
301
|
+
}, badgeProps);
|
|
302
|
+
children = t7, text = t8;
|
|
303
|
+
let Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
|
|
304
|
+
T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, {
|
|
305
|
+
icon: IconStart,
|
|
306
|
+
marginX: -1,
|
|
307
|
+
marginY: -2,
|
|
308
|
+
size: 0
|
|
309
|
+
})), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
|
|
310
|
+
} else T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
|
|
311
|
+
let t6;
|
|
312
|
+
$[9] === text ? t6 = $[10] : (t6 = text && /* @__PURE__ */ jsx(Text, {
|
|
313
|
+
size: 1,
|
|
314
|
+
trim: !0,
|
|
315
|
+
children: text
|
|
316
|
+
}), $[9] = text, $[10] = t6);
|
|
317
|
+
let t7;
|
|
318
|
+
return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, {
|
|
319
|
+
className: t1,
|
|
320
|
+
style: t2,
|
|
321
|
+
"data-ui": t3,
|
|
322
|
+
...t4,
|
|
323
|
+
children: [
|
|
324
|
+
t5,
|
|
325
|
+
t6,
|
|
326
|
+
children
|
|
327
|
+
]
|
|
328
|
+
}), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
|
|
85
329
|
}
|
|
86
330
|
const borderProps = {
|
|
87
331
|
border: {
|
|
@@ -186,65 +430,6 @@ const borderProps = {
|
|
|
186
430
|
className: "max-height",
|
|
187
431
|
variable: "--max-height"
|
|
188
432
|
}
|
|
189
|
-
}, SPACE = [
|
|
190
|
-
0,
|
|
191
|
-
1,
|
|
192
|
-
2,
|
|
193
|
-
3,
|
|
194
|
-
4,
|
|
195
|
-
5,
|
|
196
|
-
6,
|
|
197
|
-
7,
|
|
198
|
-
8,
|
|
199
|
-
9
|
|
200
|
-
], SPACE_AUTO = [...SPACE, "auto"], SPACE_INHERIT = [...SPACE, "inherit"], SPACE_AUTO_NEGATIVE = [
|
|
201
|
-
-9,
|
|
202
|
-
-8,
|
|
203
|
-
-7,
|
|
204
|
-
-6,
|
|
205
|
-
-5,
|
|
206
|
-
-4,
|
|
207
|
-
-3,
|
|
208
|
-
-2,
|
|
209
|
-
-1,
|
|
210
|
-
...SPACE,
|
|
211
|
-
"auto"
|
|
212
|
-
], marginProps = {
|
|
213
|
-
margin: {
|
|
214
|
-
type: "union",
|
|
215
|
-
className: "m",
|
|
216
|
-
values: SPACE_AUTO_NEGATIVE
|
|
217
|
-
},
|
|
218
|
-
marginX: {
|
|
219
|
-
type: "union",
|
|
220
|
-
className: "mx",
|
|
221
|
-
values: SPACE_AUTO_NEGATIVE
|
|
222
|
-
},
|
|
223
|
-
marginY: {
|
|
224
|
-
type: "union",
|
|
225
|
-
className: "my",
|
|
226
|
-
values: SPACE_AUTO_NEGATIVE
|
|
227
|
-
},
|
|
228
|
-
marginTop: {
|
|
229
|
-
type: "union",
|
|
230
|
-
className: "mt",
|
|
231
|
-
values: SPACE_AUTO_NEGATIVE
|
|
232
|
-
},
|
|
233
|
-
marginRight: {
|
|
234
|
-
type: "union",
|
|
235
|
-
className: "mr",
|
|
236
|
-
values: SPACE_AUTO_NEGATIVE
|
|
237
|
-
},
|
|
238
|
-
marginBottom: {
|
|
239
|
-
type: "union",
|
|
240
|
-
className: "mb",
|
|
241
|
-
values: SPACE_AUTO_NEGATIVE
|
|
242
|
-
},
|
|
243
|
-
marginLeft: {
|
|
244
|
-
type: "union",
|
|
245
|
-
className: "ml",
|
|
246
|
-
values: SPACE_AUTO_NEGATIVE
|
|
247
|
-
}
|
|
248
433
|
}, OVERFLOW = [
|
|
249
434
|
"visible",
|
|
250
435
|
"hidden",
|
|
@@ -351,16 +536,6 @@ const borderProps = {
|
|
|
351
536
|
4,
|
|
352
537
|
5
|
|
353
538
|
]
|
|
354
|
-
} }, toneProps = { tone: {
|
|
355
|
-
type: "union",
|
|
356
|
-
className: "tone",
|
|
357
|
-
values: [
|
|
358
|
-
"neutral",
|
|
359
|
-
"positive",
|
|
360
|
-
"suggest",
|
|
361
|
-
"caution",
|
|
362
|
-
"critical"
|
|
363
|
-
]
|
|
364
539
|
} }, widthProps = {
|
|
365
540
|
width: {
|
|
366
541
|
type: "string",
|
|
@@ -523,88 +698,6 @@ function Flex(t0) {
|
|
|
523
698
|
children
|
|
524
699
|
}), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
|
|
525
700
|
}
|
|
526
|
-
const typographyProps = {
|
|
527
|
-
align: {
|
|
528
|
-
type: "union",
|
|
529
|
-
className: "text",
|
|
530
|
-
values: [
|
|
531
|
-
"left",
|
|
532
|
-
"center",
|
|
533
|
-
"right",
|
|
534
|
-
"justify"
|
|
535
|
-
]
|
|
536
|
-
},
|
|
537
|
-
muted: {
|
|
538
|
-
type: "boolean",
|
|
539
|
-
className: "text-muted",
|
|
540
|
-
inverseClassName: "text-default"
|
|
541
|
-
},
|
|
542
|
-
trim: {
|
|
543
|
-
type: "boolean",
|
|
544
|
-
className: "text-trim",
|
|
545
|
-
inverseClassName: "text-trim-none"
|
|
546
|
-
},
|
|
547
|
-
truncate: {
|
|
548
|
-
type: "conditional",
|
|
549
|
-
resolve: (value) => value === 1 ? {
|
|
550
|
-
type: "number",
|
|
551
|
-
className: "text-overflow"
|
|
552
|
-
} : {
|
|
553
|
-
type: "number",
|
|
554
|
-
className: "line-clamp",
|
|
555
|
-
variable: "--line-clamp"
|
|
556
|
-
}
|
|
557
|
-
},
|
|
558
|
-
weight: {
|
|
559
|
-
type: "union",
|
|
560
|
-
className: "weight",
|
|
561
|
-
values: [
|
|
562
|
-
"regular",
|
|
563
|
-
"medium",
|
|
564
|
-
"semibold",
|
|
565
|
-
"bold"
|
|
566
|
-
]
|
|
567
|
-
},
|
|
568
|
-
...marginProps,
|
|
569
|
-
...toneProps
|
|
570
|
-
}, ICON_SIZE = [
|
|
571
|
-
0,
|
|
572
|
-
1,
|
|
573
|
-
2,
|
|
574
|
-
3,
|
|
575
|
-
4
|
|
576
|
-
], iconProps = {
|
|
577
|
-
icon: { type: "string" },
|
|
578
|
-
size: {
|
|
579
|
-
type: "union",
|
|
580
|
-
className: "icon-body",
|
|
581
|
-
values: ICON_SIZE
|
|
582
|
-
},
|
|
583
|
-
muted: typographyProps.muted,
|
|
584
|
-
...toneProps,
|
|
585
|
-
...marginProps
|
|
586
|
-
}, iconClassName = suffixClassName("sui-Icon");
|
|
587
|
-
/** @public */
|
|
588
|
-
function Icon(t0) {
|
|
589
|
-
let $ = c(12), T0, props, rest, style, t1;
|
|
590
|
-
if ($[0] !== t0) {
|
|
591
|
-
let { size: t2, ...t3 } = t0;
|
|
592
|
-
props = t3;
|
|
593
|
-
let { className, style: t4, icon: Component, ...t5 } = getProps({
|
|
594
|
-
size: t2 === void 0 ? 2 : t2,
|
|
595
|
-
...props
|
|
596
|
-
}, iconProps);
|
|
597
|
-
style = t4, rest = t5, T0 = Component, t1 = clsx(iconClassName, className), $[0] = t0, $[1] = T0, $[2] = props, $[3] = rest, $[4] = style, $[5] = t1;
|
|
598
|
-
} else T0 = $[1], props = $[2], rest = $[3], style = $[4], t1 = $[5];
|
|
599
|
-
let t2 = !props["aria-label"] || void 0, t3;
|
|
600
|
-
return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, {
|
|
601
|
-
className: t1,
|
|
602
|
-
"data-ui": "Icon",
|
|
603
|
-
style,
|
|
604
|
-
"aria-hidden": t2,
|
|
605
|
-
...rest
|
|
606
|
-
}), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
607
|
-
}
|
|
608
701
|
const spinnerProps = { size: {
|
|
609
702
|
type: "union",
|
|
610
703
|
className: "icon-body",
|
|
@@ -631,61 +724,6 @@ function Spinner(t0) {
|
|
|
631
724
|
...rest
|
|
632
725
|
}), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
633
726
|
}
|
|
634
|
-
const textProps = {
|
|
635
|
-
as: { type: "string" },
|
|
636
|
-
size: {
|
|
637
|
-
type: "union",
|
|
638
|
-
className: "text-body",
|
|
639
|
-
values: [
|
|
640
|
-
0,
|
|
641
|
-
1,
|
|
642
|
-
2,
|
|
643
|
-
3,
|
|
644
|
-
4
|
|
645
|
-
]
|
|
646
|
-
},
|
|
647
|
-
...typographyProps
|
|
648
|
-
}, textClassName = suffixClassName("sui-Text");
|
|
649
|
-
/** @public */
|
|
650
|
-
function Text(t0) {
|
|
651
|
-
let $ = c(15), T0, children, rest, style, t1, t2;
|
|
652
|
-
if ($[0] !== t0) {
|
|
653
|
-
t2 = Symbol.for("react.early_return_sentinel");
|
|
654
|
-
bb0: {
|
|
655
|
-
let { size: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
|
|
656
|
-
size: t3 === void 0 ? 2 : t3,
|
|
657
|
-
...props
|
|
658
|
-
}, textProps);
|
|
659
|
-
children = t4, style = t5, rest = t6;
|
|
660
|
-
let Component = as || "span";
|
|
661
|
-
if (props.truncate && props.trim) {
|
|
662
|
-
let t7 = clsx(textClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t8 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp", t9;
|
|
663
|
-
$[7] === t8 ? t9 = $[8] : (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9), t2 = /* @__PURE__ */ jsx(Component, {
|
|
664
|
-
className: t7,
|
|
665
|
-
style,
|
|
666
|
-
"data-ui": "Text",
|
|
667
|
-
...rest,
|
|
668
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
669
|
-
className: t9,
|
|
670
|
-
children
|
|
671
|
-
})
|
|
672
|
-
});
|
|
673
|
-
break bb0;
|
|
674
|
-
}
|
|
675
|
-
T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
|
|
676
|
-
}
|
|
677
|
-
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
678
|
-
} else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
|
|
679
|
-
if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
|
|
680
|
-
let t3;
|
|
681
|
-
return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, {
|
|
682
|
-
className: t1,
|
|
683
|
-
style,
|
|
684
|
-
"data-ui": "Text",
|
|
685
|
-
...rest,
|
|
686
|
-
children
|
|
687
|
-
}), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
688
|
-
}
|
|
689
727
|
const buttonProps = {
|
|
690
728
|
as: { type: "string" },
|
|
691
729
|
density: {
|
|
@@ -1940,36 +1978,35 @@ function Radio(props) {
|
|
|
1940
1978
|
]
|
|
1941
1979
|
}), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
1942
1980
|
}
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
mapping: {
|
|
1960
|
-
regular: 1,
|
|
1961
|
-
loose: 2
|
|
1962
|
-
}
|
|
1981
|
+
const formElementDensityProps = { density: {
|
|
1982
|
+
type: "composite",
|
|
1983
|
+
values: ["regular", "loose"],
|
|
1984
|
+
composition: {
|
|
1985
|
+
paddingX: {
|
|
1986
|
+
propDef: paddingProps.paddingX,
|
|
1987
|
+
mapping: {
|
|
1988
|
+
regular: 2,
|
|
1989
|
+
loose: 3
|
|
1990
|
+
}
|
|
1991
|
+
},
|
|
1992
|
+
paddingY: {
|
|
1993
|
+
propDef: paddingProps.paddingY,
|
|
1994
|
+
mapping: {
|
|
1995
|
+
regular: 1,
|
|
1996
|
+
loose: 2
|
|
1963
1997
|
}
|
|
1964
1998
|
}
|
|
1965
1999
|
}
|
|
2000
|
+
} }, selectProps = {
|
|
2001
|
+
hasError: { type: "boolean" },
|
|
2002
|
+
...formElementDensityProps
|
|
1966
2003
|
}, selectClassName = suffixClassName("sui-Select");
|
|
1967
2004
|
/** @public */
|
|
1968
2005
|
function Select(t0) {
|
|
1969
2006
|
let $ = c(17), { density: t1, hasError: t2, ...props } = t0, density = t1 === void 0 ? "regular" : t1, hasError = t2 !== void 0 && t2, { children, className, style, ...rest } = getProps({
|
|
1970
2007
|
density,
|
|
1971
2008
|
...props
|
|
1972
|
-
}, selectProps), anchorName = `--anchor-${useId()}`, selectClasses = clsx(selectClassName,
|
|
2009
|
+
}, selectProps), anchorName = `--anchor-${useId()}`, selectClasses = clsx(selectClassName, "sui-radius2", "sui-width-full", className), t3;
|
|
1973
2010
|
$[0] !== anchorName || $[1] !== style ? (t3 = {
|
|
1974
2011
|
...style,
|
|
1975
2012
|
anchorName
|
|
@@ -2066,6 +2103,32 @@ function Switch(props) {
|
|
|
2066
2103
|
]
|
|
2067
2104
|
}), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
2068
2105
|
}
|
|
2106
|
+
const textInputProps = {
|
|
2107
|
+
hasError: { type: "boolean" },
|
|
2108
|
+
...formElementDensityProps
|
|
2109
|
+
}, textInputClassName = suffixClassName("sui-TextInput");
|
|
2110
|
+
/** @public */
|
|
2111
|
+
function TextInput(t0) {
|
|
2112
|
+
let $ = c(12), hasError, rest, style, t1, type;
|
|
2113
|
+
if ($[0] !== t0) {
|
|
2114
|
+
let { density: t2, hasError: t3, type: t4, ...props } = t0, density = t2 === void 0 ? "regular" : t2;
|
|
2115
|
+
hasError = t3 !== void 0 && t3, type = t4 === void 0 ? "text" : t4;
|
|
2116
|
+
let { className, style: t5, ...t6 } = getProps({
|
|
2117
|
+
density,
|
|
2118
|
+
...props
|
|
2119
|
+
}, textInputProps);
|
|
2120
|
+
style = t5, rest = t6, t1 = clsx(textInputClassName, "sui-radius2", "sui-width-full", className), $[0] = t0, $[1] = hasError, $[2] = rest, $[3] = style, $[4] = t1, $[5] = type;
|
|
2121
|
+
} else hasError = $[1], rest = $[2], style = $[3], t1 = $[4], type = $[5];
|
|
2122
|
+
let textInputClasses = t1, t2 = hasError || void 0, t3;
|
|
2123
|
+
return $[6] !== rest || $[7] !== style || $[8] !== t2 || $[9] !== textInputClasses || $[10] !== type ? (t3 = /* @__PURE__ */ jsx("input", {
|
|
2124
|
+
type,
|
|
2125
|
+
className: textInputClasses,
|
|
2126
|
+
style,
|
|
2127
|
+
"data-ui": "TextInput",
|
|
2128
|
+
...rest,
|
|
2129
|
+
"aria-invalid": t2
|
|
2130
|
+
}), $[6] = rest, $[7] = style, $[8] = t2, $[9] = textInputClasses, $[10] = type, $[11] = t3) : t3 = $[11], t3;
|
|
2131
|
+
}
|
|
2069
2132
|
const tooltipProps = {
|
|
2070
2133
|
anchorName: { type: "string" },
|
|
2071
2134
|
content: { type: "string" },
|
|
@@ -2148,48 +2211,6 @@ function TooltipGroup(props) {
|
|
|
2148
2211
|
children
|
|
2149
2212
|
}), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
2150
2213
|
}
|
|
2151
|
-
|
|
2152
|
-
as: { type: "string" },
|
|
2153
|
-
iconStart: { type: "string" },
|
|
2154
|
-
text: { type: "string" },
|
|
2155
|
-
...toneProps
|
|
2156
|
-
}, badgeClassName = suffixClassName("sui-Badge");
|
|
2157
|
-
/** @public */
|
|
2158
|
-
function Badge(t0) {
|
|
2159
|
-
let $ = c(20), T0, children, t1, t2, t3, t4, t5, text;
|
|
2160
|
-
if ($[0] !== t0) {
|
|
2161
|
-
let { tone: t6, ...props } = t0, { as, children: t7, className, style, iconStart: IconStart, text: t8, ...rest } = getProps({
|
|
2162
|
-
tone: t6 === void 0 ? "neutral" : t6,
|
|
2163
|
-
...props
|
|
2164
|
-
}, badgeProps);
|
|
2165
|
-
children = t7, text = t8;
|
|
2166
|
-
let Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
|
|
2167
|
-
T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, {
|
|
2168
|
-
icon: IconStart,
|
|
2169
|
-
marginX: -1,
|
|
2170
|
-
marginY: -2,
|
|
2171
|
-
size: 0
|
|
2172
|
-
})), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
|
|
2173
|
-
} else T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
|
|
2174
|
-
let t6;
|
|
2175
|
-
$[9] === text ? t6 = $[10] : (t6 = text && /* @__PURE__ */ jsx(Text, {
|
|
2176
|
-
size: 1,
|
|
2177
|
-
trim: !0,
|
|
2178
|
-
children: text
|
|
2179
|
-
}), $[9] = text, $[10] = t6);
|
|
2180
|
-
let t7;
|
|
2181
|
-
return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, {
|
|
2182
|
-
className: t1,
|
|
2183
|
-
style: t2,
|
|
2184
|
-
"data-ui": t3,
|
|
2185
|
-
...t4,
|
|
2186
|
-
children: [
|
|
2187
|
-
t5,
|
|
2188
|
-
t6,
|
|
2189
|
-
children
|
|
2190
|
-
]
|
|
2191
|
-
}), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
|
|
2192
|
-
}
|
|
2193
|
-
export { Badge, Box, Button, Card, Checkbox, Code, Container, Dialog, Divider, Eyebrow, Flex, Grid, HStack, Heading, Icon, IconButton, Indicator, IndicatorStack, Inline, Label, Link, List, Popover, PressArea, Radio, Select, SkipToContent, Spinner, Switch, Text, Tooltip, TooltipGroup, VStack, VisuallyHidden, useIsClient };
|
|
2214
|
+
export { Badge, Box, Button, Card, Checkbox, Code, Container, Dialog, Divider, Eyebrow, Flex, Grid, HStack, Heading, Icon, IconButton, Indicator, IndicatorStack, Inline, Label, Link, List, Popover, PressArea, Radio, Select, SkipToContent, Spinner, Switch, Text, TextInput, Tooltip, TooltipGroup, VStack, VisuallyHidden, useIsClient };
|
|
2194
2215
|
|
|
2195
2216
|
//# sourceMappingURL=index.js.map
|