@ttoss/ui 5.9.3 → 5.10.1
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/esm/index.js +437 -493
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
5
|
+
value,
|
|
6
|
+
configurable: true
|
|
7
|
+
});
|
|
2
8
|
|
|
3
9
|
// src/components/Button.tsx
|
|
4
10
|
import { Icon } from "@ttoss/react-icons";
|
|
5
|
-
import * as
|
|
11
|
+
import * as React2 from "react";
|
|
6
12
|
import { Button as ButtonUi } from "theme-ui";
|
|
7
|
-
|
|
8
|
-
var Button = React.forwardRef((props, ref) => {
|
|
13
|
+
var Button = /* @__PURE__ */React2.forwardRef((props, ref) => {
|
|
9
14
|
const {
|
|
10
15
|
children,
|
|
11
16
|
leftIcon,
|
|
@@ -13,7 +18,7 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
13
18
|
loading,
|
|
14
19
|
...restProps
|
|
15
20
|
} = props;
|
|
16
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */React2.createElement(ButtonUi, {
|
|
17
22
|
type: "button",
|
|
18
23
|
...restProps,
|
|
19
24
|
ref,
|
|
@@ -29,24 +34,22 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
29
34
|
cursor: "not-allowed"
|
|
30
35
|
},
|
|
31
36
|
...restProps.sx
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
37
|
+
}
|
|
38
|
+
}, loading && /* @__PURE__ */React2.createElement(Icon, {
|
|
39
|
+
inline: true,
|
|
40
|
+
icon: "three-dots-loading"
|
|
41
|
+
}), !loading && leftIcon && /* @__PURE__ */React2.createElement(Icon, {
|
|
42
|
+
inline: true,
|
|
43
|
+
icon: leftIcon
|
|
44
|
+
}), children, rightIcon && /* @__PURE__ */React2.createElement(Icon, {
|
|
45
|
+
inline: true,
|
|
46
|
+
icon: rightIcon
|
|
47
|
+
}));
|
|
44
48
|
});
|
|
45
49
|
Button.displayName = "Button";
|
|
46
50
|
|
|
47
51
|
// src/components/ActionButton.tsx
|
|
48
|
-
|
|
49
|
-
var ActionButton = ({
|
|
52
|
+
var ActionButton = /* @__PURE__ */__name(({
|
|
50
53
|
icon,
|
|
51
54
|
variant = "default",
|
|
52
55
|
sx,
|
|
@@ -93,7 +96,7 @@ var ActionButton = ({
|
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */React.createElement(Button, {
|
|
97
100
|
leftIcon: icon,
|
|
98
101
|
sx: {
|
|
99
102
|
paddingY: "2",
|
|
@@ -104,7 +107,7 @@ var ActionButton = ({
|
|
|
104
107
|
},
|
|
105
108
|
...props
|
|
106
109
|
});
|
|
107
|
-
};
|
|
110
|
+
}, "ActionButton");
|
|
108
111
|
|
|
109
112
|
// src/components/Badge.tsx
|
|
110
113
|
import { Icon as Icon2 } from "@ttoss/react-icons";
|
|
@@ -114,8 +117,7 @@ import { Badge as BadgeUi } from "theme-ui";
|
|
|
114
117
|
import { Text } from "theme-ui";
|
|
115
118
|
|
|
116
119
|
// src/components/Badge.tsx
|
|
117
|
-
|
|
118
|
-
var Badge = ({
|
|
120
|
+
var Badge = /* @__PURE__ */__name(({
|
|
119
121
|
icon,
|
|
120
122
|
children,
|
|
121
123
|
sx,
|
|
@@ -123,7 +125,7 @@ var Badge = ({
|
|
|
123
125
|
onDelete,
|
|
124
126
|
...props
|
|
125
127
|
}) => {
|
|
126
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */React.createElement(BadgeUi, {
|
|
127
129
|
sx: {
|
|
128
130
|
display: "flex",
|
|
129
131
|
alignItems: "center",
|
|
@@ -137,34 +139,32 @@ var Badge = ({
|
|
|
137
139
|
gap: "2",
|
|
138
140
|
...sx
|
|
139
141
|
},
|
|
140
|
-
...props
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
};
|
|
142
|
+
...props
|
|
143
|
+
}, icon && /* @__PURE__ */React.createElement(Icon2, {
|
|
144
|
+
inline: true,
|
|
145
|
+
icon
|
|
146
|
+
}), children, chip && /* @__PURE__ */React.createElement(Text, {
|
|
147
|
+
sx: {
|
|
148
|
+
cursor: "pointer",
|
|
149
|
+
lineHeight: 0,
|
|
150
|
+
color: "currentcolor",
|
|
151
|
+
alignSelf: "center"
|
|
152
|
+
}
|
|
153
|
+
}, /* @__PURE__ */React.createElement(Icon2, {
|
|
154
|
+
onClick: onDelete,
|
|
155
|
+
inline: true,
|
|
156
|
+
icon: "close"
|
|
157
|
+
})));
|
|
158
|
+
}, "Badge");
|
|
159
159
|
|
|
160
160
|
// src/components/Box.tsx
|
|
161
161
|
import { Box } from "theme-ui";
|
|
162
162
|
|
|
163
163
|
// src/components/Card.tsx
|
|
164
|
+
import * as React3 from "react";
|
|
164
165
|
import { Box as Box2, Card as CardUi } from "theme-ui";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return /* @__PURE__ */jsx4(CardUi, {
|
|
166
|
+
var Card = /* @__PURE__ */__name(props => {
|
|
167
|
+
return /* @__PURE__ */React3.createElement(CardUi, {
|
|
168
168
|
...props,
|
|
169
169
|
sx: {
|
|
170
170
|
backgroundColor: "display.background.secondary.default",
|
|
@@ -179,12 +179,12 @@ var Card = props => {
|
|
|
179
179
|
...props.sx
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
|
-
};
|
|
183
|
-
var CardTitle = ({
|
|
182
|
+
}, "Card");
|
|
183
|
+
var CardTitle = /* @__PURE__ */__name(({
|
|
184
184
|
children,
|
|
185
185
|
...props
|
|
186
186
|
}) => {
|
|
187
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */React3.createElement(Box2, {
|
|
188
188
|
...props,
|
|
189
189
|
sx: {
|
|
190
190
|
paddingY: "4",
|
|
@@ -193,15 +193,14 @@ var CardTitle = ({
|
|
|
193
193
|
borderBottom: "md",
|
|
194
194
|
borderBottomColor: "display.border.muted.default",
|
|
195
195
|
...props.sx
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
var CardBody = ({
|
|
196
|
+
}
|
|
197
|
+
}, children);
|
|
198
|
+
}, "CardTitle");
|
|
199
|
+
var CardBody = /* @__PURE__ */__name(({
|
|
201
200
|
children,
|
|
202
201
|
...props
|
|
203
202
|
}) => {
|
|
204
|
-
return /* @__PURE__ */
|
|
203
|
+
return /* @__PURE__ */React3.createElement(Box2, {
|
|
205
204
|
...props,
|
|
206
205
|
sx: {
|
|
207
206
|
paddingY: "4",
|
|
@@ -209,54 +208,51 @@ var CardBody = ({
|
|
|
209
208
|
width: "full",
|
|
210
209
|
backgroundColor: "display.background.muted.default",
|
|
211
210
|
...props.sx
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
var CardFooter = ({
|
|
211
|
+
}
|
|
212
|
+
}, children);
|
|
213
|
+
}, "CardBody");
|
|
214
|
+
var CardFooter = /* @__PURE__ */__name(({
|
|
217
215
|
children,
|
|
218
216
|
...props
|
|
219
217
|
}) => {
|
|
220
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */React3.createElement(Box2, {
|
|
221
219
|
...props,
|
|
222
220
|
sx: {
|
|
223
221
|
paddingY: "2",
|
|
224
222
|
paddingX: "8",
|
|
225
223
|
width: "full",
|
|
226
224
|
...props.sx
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
};
|
|
225
|
+
}
|
|
226
|
+
}, children);
|
|
227
|
+
}, "CardFooter");
|
|
231
228
|
Card.Title = CardTitle;
|
|
232
229
|
Card.Body = CardBody;
|
|
233
230
|
Card.Footer = CardFooter;
|
|
234
231
|
|
|
235
232
|
// src/components/Checkbox.tsx
|
|
236
|
-
import * as
|
|
233
|
+
import * as React4 from "react";
|
|
237
234
|
import { Checkbox as CheckBoxUi } from "theme-ui";
|
|
238
|
-
|
|
239
|
-
var Checkbox = React2.forwardRef(({
|
|
235
|
+
var Checkbox = /* @__PURE__ */React4.forwardRef(({
|
|
240
236
|
indeterminate = false,
|
|
241
237
|
...rest
|
|
242
238
|
}, ref) => {
|
|
243
|
-
const innerRef =
|
|
244
|
-
|
|
239
|
+
const innerRef = React4.useRef(null);
|
|
240
|
+
React4.useImperativeHandle(ref, () => {
|
|
245
241
|
return innerRef.current;
|
|
246
242
|
});
|
|
247
|
-
|
|
243
|
+
React4.useEffect(() => {
|
|
248
244
|
if (innerRef.current) {
|
|
249
245
|
innerRef.current.indeterminate = indeterminate;
|
|
250
246
|
}
|
|
251
247
|
}, [indeterminate]);
|
|
252
248
|
if (indeterminate) {
|
|
253
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */React4.createElement("input", {
|
|
254
250
|
type: "checkbox",
|
|
255
251
|
ref: innerRef,
|
|
256
252
|
...rest
|
|
257
253
|
});
|
|
258
254
|
}
|
|
259
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */React4.createElement(CheckBoxUi, {
|
|
260
256
|
ref: innerRef,
|
|
261
257
|
...rest
|
|
262
258
|
});
|
|
@@ -265,9 +261,8 @@ Checkbox.displayName = "Checkbox";
|
|
|
265
261
|
|
|
266
262
|
// src/components/CloseButton.tsx
|
|
267
263
|
import { Close as CloseUI } from "theme-ui";
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return /* @__PURE__ */jsx6(CloseUI, {
|
|
264
|
+
var CloseButton = /* @__PURE__ */__name(props => {
|
|
265
|
+
return /* @__PURE__ */React.createElement(CloseUI, {
|
|
271
266
|
type: "button",
|
|
272
267
|
"aria-label": props.ariaLabel,
|
|
273
268
|
sx: {
|
|
@@ -275,14 +270,13 @@ var CloseButton = props => {
|
|
|
275
270
|
},
|
|
276
271
|
...props
|
|
277
272
|
});
|
|
278
|
-
};
|
|
273
|
+
}, "CloseButton");
|
|
279
274
|
|
|
280
275
|
// src/components/Container.tsx
|
|
281
|
-
import * as
|
|
276
|
+
import * as React5 from "react";
|
|
282
277
|
import { Container as ContainerUi } from "theme-ui";
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return /* @__PURE__ */jsx7(ContainerUi, {
|
|
278
|
+
var Container = /* @__PURE__ */React5.forwardRef((props, ref) => {
|
|
279
|
+
return /* @__PURE__ */React5.createElement(ContainerUi, {
|
|
286
280
|
ref,
|
|
287
281
|
...props
|
|
288
282
|
});
|
|
@@ -302,15 +296,14 @@ import { Grid } from "theme-ui";
|
|
|
302
296
|
import { Heading } from "theme-ui";
|
|
303
297
|
|
|
304
298
|
// src/components/HelpText.tsx
|
|
305
|
-
|
|
306
|
-
var HelpText = ({
|
|
299
|
+
var HelpText = /* @__PURE__ */__name(({
|
|
307
300
|
sx,
|
|
308
301
|
disabled,
|
|
309
302
|
negative,
|
|
310
303
|
...props
|
|
311
304
|
}) => {
|
|
312
305
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
313
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */React.createElement(Text, {
|
|
314
307
|
variant,
|
|
315
308
|
sx: {
|
|
316
309
|
fontSize: "sm",
|
|
@@ -321,19 +314,18 @@ var HelpText = ({
|
|
|
321
314
|
"aria-disabled": disabled ? "true" : void 0,
|
|
322
315
|
...props
|
|
323
316
|
});
|
|
324
|
-
};
|
|
317
|
+
}, "HelpText");
|
|
325
318
|
|
|
326
319
|
// src/components/IconButton.tsx
|
|
327
320
|
import { Icon as Icon3 } from "@ttoss/react-icons";
|
|
328
321
|
import { IconButton as IconButtonUi } from "theme-ui";
|
|
329
|
-
|
|
330
|
-
var IconButton = props => {
|
|
322
|
+
var IconButton = /* @__PURE__ */__name(props => {
|
|
331
323
|
const {
|
|
332
324
|
icon,
|
|
333
325
|
children,
|
|
334
326
|
...restProps
|
|
335
327
|
} = props;
|
|
336
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */React.createElement(IconButtonUi, {
|
|
337
329
|
type: "button",
|
|
338
330
|
...restProps,
|
|
339
331
|
sx: {
|
|
@@ -343,29 +335,27 @@ var IconButton = props => {
|
|
|
343
335
|
cursor: "not-allowed"
|
|
344
336
|
},
|
|
345
337
|
...restProps.sx
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
};
|
|
338
|
+
}
|
|
339
|
+
}, icon ? /* @__PURE__ */React.createElement(Icon3, {
|
|
340
|
+
inline: true,
|
|
341
|
+
icon
|
|
342
|
+
}) : children);
|
|
343
|
+
}, "IconButton");
|
|
353
344
|
|
|
354
345
|
// src/components/Image.tsx
|
|
355
346
|
import { Image } from "theme-ui";
|
|
356
347
|
|
|
357
348
|
// src/components/InfiniteLinearProgress.tsx
|
|
358
|
-
import * as
|
|
349
|
+
import * as React6 from "react";
|
|
359
350
|
|
|
360
351
|
// src/components/LinearProgress.tsx
|
|
361
352
|
import { Progress } from "theme-ui";
|
|
362
353
|
|
|
363
354
|
// src/components/InfiniteLinearProgress.tsx
|
|
364
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
365
355
|
var MAX_PROGRESS = 100;
|
|
366
|
-
var InfiniteLinearProgress = () => {
|
|
367
|
-
const [progress, setProgress] =
|
|
368
|
-
|
|
356
|
+
var InfiniteLinearProgress = /* @__PURE__ */__name(() => {
|
|
357
|
+
const [progress, setProgress] = React6.useState(0);
|
|
358
|
+
React6.useEffect(() => {
|
|
369
359
|
const timer = setInterval(() => {
|
|
370
360
|
setProgress(oldProgress => {
|
|
371
361
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -386,19 +376,18 @@ var InfiniteLinearProgress = () => {
|
|
|
386
376
|
clearInterval(timer);
|
|
387
377
|
};
|
|
388
378
|
}, []);
|
|
389
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */React6.createElement(Progress, {
|
|
390
380
|
max: MAX_PROGRESS,
|
|
391
381
|
value: progress,
|
|
392
382
|
role: "progressbar"
|
|
393
383
|
});
|
|
394
|
-
};
|
|
384
|
+
}, "InfiniteLinearProgress");
|
|
395
385
|
|
|
396
386
|
// src/components/Input.tsx
|
|
397
387
|
import { Icon as Icon4 } from "@ttoss/react-icons";
|
|
398
|
-
import * as
|
|
388
|
+
import * as React7 from "react";
|
|
399
389
|
import { Input as InputUI } from "theme-ui";
|
|
400
|
-
|
|
401
|
-
var Input = React5.forwardRef(({
|
|
390
|
+
var Input = /* @__PURE__ */React7.forwardRef(({
|
|
402
391
|
leadingIcon,
|
|
403
392
|
trailingIcon: trailingIconProp,
|
|
404
393
|
onLeadingIconClick,
|
|
@@ -409,66 +398,62 @@ var Input = React5.forwardRef(({
|
|
|
409
398
|
}, ref) => {
|
|
410
399
|
const trailingIcon = inputProps["aria-invalid"] ? "warning-alt" : trailingIconProp;
|
|
411
400
|
const isWarning = !inputProps["aria-invalid"] && trailingIcon === "warning-alt";
|
|
412
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */React7.createElement(Flex, {
|
|
413
402
|
className: `${className} ${isWarning ? "is-warning" : ""}`,
|
|
414
403
|
sx: {
|
|
415
404
|
...sx,
|
|
416
405
|
position: "relative",
|
|
417
406
|
padding: 0,
|
|
418
407
|
border: "none"
|
|
408
|
+
}
|
|
409
|
+
}, leadingIcon && /* @__PURE__ */React7.createElement(Text, {
|
|
410
|
+
sx: {
|
|
411
|
+
position: "absolute",
|
|
412
|
+
alignSelf: "center",
|
|
413
|
+
left: "1rem",
|
|
414
|
+
cursor: onLeadingIconClick ? "pointer" : "default"
|
|
419
415
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
fontSize: "xl"
|
|
454
|
-
},
|
|
455
|
-
variant: "trailing-icon",
|
|
456
|
-
onClick: onTrailingIconClick,
|
|
457
|
-
children: /* @__PURE__ */jsx11(Icon4, {
|
|
458
|
-
inline: true,
|
|
459
|
-
icon: trailingIcon
|
|
460
|
-
})
|
|
461
|
-
})]
|
|
462
|
-
});
|
|
416
|
+
onClick: onLeadingIconClick,
|
|
417
|
+
variant: "leading-icon"
|
|
418
|
+
}, /* @__PURE__ */React7.createElement(Icon4, {
|
|
419
|
+
inline: true,
|
|
420
|
+
icon: leadingIcon
|
|
421
|
+
})), /* @__PURE__ */React7.createElement(InputUI, {
|
|
422
|
+
ref,
|
|
423
|
+
sx: {
|
|
424
|
+
fontFamily: "body",
|
|
425
|
+
paddingY: "3",
|
|
426
|
+
paddingX: "4",
|
|
427
|
+
...sx,
|
|
428
|
+
paddingLeft: leadingIcon ? "10" : void 0,
|
|
429
|
+
paddingRight: trailingIcon ? "10" : void 0,
|
|
430
|
+
margin: 0
|
|
431
|
+
},
|
|
432
|
+
className,
|
|
433
|
+
...inputProps
|
|
434
|
+
}), trailingIcon && /* @__PURE__ */React7.createElement(Text, {
|
|
435
|
+
sx: {
|
|
436
|
+
position: "absolute",
|
|
437
|
+
right: "1rem",
|
|
438
|
+
alignSelf: "center",
|
|
439
|
+
color: isWarning ? "feedback.text.caution.default" : void 0,
|
|
440
|
+
cursor: onTrailingIconClick ? "pointer" : "default",
|
|
441
|
+
fontSize: "xl"
|
|
442
|
+
},
|
|
443
|
+
variant: "trailing-icon",
|
|
444
|
+
onClick: onTrailingIconClick
|
|
445
|
+
}, /* @__PURE__ */React7.createElement(Icon4, {
|
|
446
|
+
inline: true,
|
|
447
|
+
icon: trailingIcon
|
|
448
|
+
})));
|
|
463
449
|
});
|
|
464
450
|
Input.displayName = "Input";
|
|
465
451
|
|
|
466
452
|
// src/components/InputNumber.tsx
|
|
467
453
|
import { Icon as Icon5 } from "@ttoss/react-icons";
|
|
468
|
-
import * as
|
|
454
|
+
import * as React8 from "react";
|
|
469
455
|
import { Input as Input2 } from "theme-ui";
|
|
470
|
-
|
|
471
|
-
var InputNumber = React6.forwardRef(({
|
|
456
|
+
var InputNumber = /* @__PURE__ */React8.forwardRef(({
|
|
472
457
|
sx,
|
|
473
458
|
value,
|
|
474
459
|
infoIcon,
|
|
@@ -476,7 +461,7 @@ var InputNumber = React6.forwardRef(({
|
|
|
476
461
|
onClickInfoIcon,
|
|
477
462
|
...inputProps
|
|
478
463
|
}, ref) => {
|
|
479
|
-
const sxProps =
|
|
464
|
+
const sxProps = React8.useMemo(() => {
|
|
480
465
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
481
466
|
if (inputProps["aria-invalid"] === "true") {
|
|
482
467
|
return {
|
|
@@ -508,7 +493,7 @@ var InputNumber = React6.forwardRef(({
|
|
|
508
493
|
margin: 0
|
|
509
494
|
};
|
|
510
495
|
}, [inputProps, value, sx]);
|
|
511
|
-
const handleChangeUp = () => {
|
|
496
|
+
const handleChangeUp = /* @__PURE__ */__name(() => {
|
|
512
497
|
if (inputProps.disabled) {
|
|
513
498
|
return;
|
|
514
499
|
}
|
|
@@ -517,8 +502,8 @@ var InputNumber = React6.forwardRef(({
|
|
|
517
502
|
return;
|
|
518
503
|
}
|
|
519
504
|
onChange(value - 1);
|
|
520
|
-
};
|
|
521
|
-
const handleChangeDown = () => {
|
|
505
|
+
}, "handleChangeUp");
|
|
506
|
+
const handleChangeDown = /* @__PURE__ */__name(() => {
|
|
522
507
|
if (inputProps.disabled) {
|
|
523
508
|
return;
|
|
524
509
|
}
|
|
@@ -527,8 +512,8 @@ var InputNumber = React6.forwardRef(({
|
|
|
527
512
|
return;
|
|
528
513
|
}
|
|
529
514
|
onChange(value + 1);
|
|
530
|
-
};
|
|
531
|
-
return /* @__PURE__ */
|
|
515
|
+
}, "handleChangeDown");
|
|
516
|
+
return /* @__PURE__ */React8.createElement(Flex, {
|
|
532
517
|
sx: {
|
|
533
518
|
width: "fit-content",
|
|
534
519
|
...sx,
|
|
@@ -537,89 +522,84 @@ var InputNumber = React6.forwardRef(({
|
|
|
537
522
|
border: "none"
|
|
538
523
|
},
|
|
539
524
|
ref,
|
|
540
|
-
"aria-invalid": inputProps["aria-invalid"]
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
icon: "picker-up"
|
|
586
|
-
})
|
|
587
|
-
})]
|
|
588
|
-
});
|
|
525
|
+
"aria-invalid": inputProps["aria-invalid"]
|
|
526
|
+
}, /* @__PURE__ */React8.createElement(Input2, {
|
|
527
|
+
ref,
|
|
528
|
+
variant: "forms.inputNumber",
|
|
529
|
+
sx: sxProps,
|
|
530
|
+
type: "number",
|
|
531
|
+
onChange: /* @__PURE__ */__name(e => {
|
|
532
|
+
onChange(Number(e.target.value));
|
|
533
|
+
}, "onChange"),
|
|
534
|
+
value,
|
|
535
|
+
...inputProps
|
|
536
|
+
}), /* @__PURE__ */React8.createElement(Text, {
|
|
537
|
+
sx: {
|
|
538
|
+
position: "absolute",
|
|
539
|
+
alignSelf: "center",
|
|
540
|
+
left: "1rem",
|
|
541
|
+
zIndex: 1,
|
|
542
|
+
cursor: "pointer"
|
|
543
|
+
},
|
|
544
|
+
onClick: handleChangeUp
|
|
545
|
+
}, /* @__PURE__ */React8.createElement(Icon5, {
|
|
546
|
+
icon: "picker-down"
|
|
547
|
+
})), infoIcon && /* @__PURE__ */React8.createElement(Text, {
|
|
548
|
+
sx: {
|
|
549
|
+
position: "absolute",
|
|
550
|
+
alignSelf: "center",
|
|
551
|
+
right: "2.5rem",
|
|
552
|
+
zIndex: 1,
|
|
553
|
+
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
554
|
+
},
|
|
555
|
+
onClick: onClickInfoIcon
|
|
556
|
+
}, /* @__PURE__ */React8.createElement(Icon5, {
|
|
557
|
+
icon: "info"
|
|
558
|
+
})), /* @__PURE__ */React8.createElement(Text, {
|
|
559
|
+
sx: {
|
|
560
|
+
position: "absolute",
|
|
561
|
+
alignSelf: "center",
|
|
562
|
+
right: "1rem",
|
|
563
|
+
zIndex: 1,
|
|
564
|
+
cursor: "pointer"
|
|
565
|
+
},
|
|
566
|
+
onClick: handleChangeDown
|
|
567
|
+
}, /* @__PURE__ */React8.createElement(Icon5, {
|
|
568
|
+
icon: "picker-up"
|
|
569
|
+
})));
|
|
589
570
|
});
|
|
590
571
|
InputNumber.displayName = "InputNumber";
|
|
591
572
|
|
|
592
573
|
// src/components/InputPassword/InputPassword.tsx
|
|
593
|
-
import * as
|
|
574
|
+
import * as React10 from "react";
|
|
594
575
|
|
|
595
576
|
// src/components/InputPassword/useHidePassInput.ts
|
|
596
|
-
import * as
|
|
597
|
-
var useHidePassInput = (defaultValue = true) => {
|
|
598
|
-
const [hidePass, setHidePass] =
|
|
577
|
+
import * as React9 from "react";
|
|
578
|
+
var useHidePassInput = /* @__PURE__ */__name((defaultValue = true) => {
|
|
579
|
+
const [hidePass, setHidePass] = React9.useState(Boolean(defaultValue));
|
|
599
580
|
const {
|
|
600
581
|
icon,
|
|
601
582
|
inputType
|
|
602
|
-
} =
|
|
583
|
+
} = React9.useMemo(() => {
|
|
603
584
|
return {
|
|
604
585
|
icon: hidePass ? "view-off" : "view-on",
|
|
605
586
|
inputType: hidePass ? "password" : "text"
|
|
606
587
|
};
|
|
607
588
|
}, [hidePass]);
|
|
608
|
-
const handleClick = () => {
|
|
589
|
+
const handleClick = /* @__PURE__ */__name(() => {
|
|
609
590
|
setHidePass(prev => {
|
|
610
591
|
return !prev;
|
|
611
592
|
});
|
|
612
|
-
};
|
|
593
|
+
}, "handleClick");
|
|
613
594
|
return {
|
|
614
595
|
handleClick,
|
|
615
596
|
icon,
|
|
616
597
|
inputType
|
|
617
598
|
};
|
|
618
|
-
};
|
|
599
|
+
}, "useHidePassInput");
|
|
619
600
|
|
|
620
601
|
// src/components/InputPassword/InputPassword.tsx
|
|
621
|
-
|
|
622
|
-
var InputPassword = React8.forwardRef(({
|
|
602
|
+
var InputPassword = /* @__PURE__ */React10.forwardRef(({
|
|
623
603
|
showPasswordByDefault,
|
|
624
604
|
...inputPasswordProps
|
|
625
605
|
}, ref) => {
|
|
@@ -628,7 +608,7 @@ var InputPassword = React8.forwardRef(({
|
|
|
628
608
|
icon,
|
|
629
609
|
inputType
|
|
630
610
|
} = useHidePassInput(!showPasswordByDefault);
|
|
631
|
-
return /* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */React10.createElement(Input, {
|
|
632
612
|
ref,
|
|
633
613
|
...inputPasswordProps,
|
|
634
614
|
trailingIcon: icon,
|
|
@@ -640,19 +620,18 @@ InputPassword.displayName = "InputPassword";
|
|
|
640
620
|
|
|
641
621
|
// src/components/Label.tsx
|
|
642
622
|
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
643
|
-
import * as
|
|
623
|
+
import * as React11 from "react";
|
|
644
624
|
import { Label as LabelUi } from "theme-ui";
|
|
645
|
-
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
646
625
|
var TOOLTIP_LABEL = "tooltip";
|
|
647
|
-
var Label = ({
|
|
626
|
+
var Label = /* @__PURE__ */__name(({
|
|
648
627
|
children,
|
|
649
628
|
tooltip,
|
|
650
629
|
sx,
|
|
651
630
|
...props
|
|
652
631
|
}) => {
|
|
653
|
-
const id =
|
|
632
|
+
const id = React11.useId();
|
|
654
633
|
const tooltipId = `${id}-tooltip`;
|
|
655
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */React11.createElement(LabelUi, {
|
|
656
635
|
"data-tooltip-id": tooltipId,
|
|
657
636
|
sx: {
|
|
658
637
|
alignItems: "center",
|
|
@@ -662,44 +641,40 @@ var Label = ({
|
|
|
662
641
|
color: "input.text.secondary.default",
|
|
663
642
|
...sx
|
|
664
643
|
},
|
|
665
|
-
...props
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
})]
|
|
690
|
-
});
|
|
691
|
-
};
|
|
644
|
+
...props
|
|
645
|
+
}, children, tooltip && /* @__PURE__ */React11.createElement(Text, {
|
|
646
|
+
sx: {
|
|
647
|
+
color: "currentcolor",
|
|
648
|
+
cursor: "pointer"
|
|
649
|
+
},
|
|
650
|
+
"aria-label": TOOLTIP_LABEL
|
|
651
|
+
}, tooltip.icon ? /* @__PURE__ */React11.createElement(Icon6, {
|
|
652
|
+
inline: true,
|
|
653
|
+
icon: tooltip.icon
|
|
654
|
+
}) : /* @__PURE__ */React11.createElement(Icon6, {
|
|
655
|
+
inline: true,
|
|
656
|
+
icon: "fluent:info-24-regular"
|
|
657
|
+
}), /* @__PURE__ */React11.createElement(Tooltip, {
|
|
658
|
+
id: tooltipId,
|
|
659
|
+
openOnClick: tooltip.openOnClick,
|
|
660
|
+
clickable: tooltip.clickable,
|
|
661
|
+
place: tooltip.place,
|
|
662
|
+
hidden: tooltip.hidden,
|
|
663
|
+
variant: tooltip.variant,
|
|
664
|
+
setIsOpen: tooltip.setIsOpen,
|
|
665
|
+
isOpen: tooltip.isOpen
|
|
666
|
+
}, tooltip.render)));
|
|
667
|
+
}, "Label");
|
|
692
668
|
|
|
693
669
|
// src/components/Link.tsx
|
|
694
|
-
import * as
|
|
670
|
+
import * as React12 from "react";
|
|
695
671
|
import { Link as LinkUi } from "theme-ui";
|
|
696
|
-
|
|
697
|
-
var Link = React10.forwardRef(({
|
|
672
|
+
var Link = /* @__PURE__ */React12.forwardRef(({
|
|
698
673
|
quiet,
|
|
699
674
|
className,
|
|
700
675
|
...props
|
|
701
676
|
}, ref) => {
|
|
702
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */React12.createElement(LinkUi, {
|
|
703
678
|
className: `${quiet ? "quiet" : ""} ${className ?? ""}`,
|
|
704
679
|
...props,
|
|
705
680
|
ref
|
|
@@ -714,10 +689,9 @@ import { Paragraph } from "theme-ui";
|
|
|
714
689
|
import { Radio } from "theme-ui";
|
|
715
690
|
|
|
716
691
|
// src/components/SegmentedControl.tsx
|
|
717
|
-
import * as
|
|
692
|
+
import * as React13 from "react";
|
|
718
693
|
import { Box as Box3, Flex as Flex2 } from "theme-ui";
|
|
719
|
-
|
|
720
|
-
var SegmentedControl = ({
|
|
694
|
+
var SegmentedControl = /* @__PURE__ */__name(({
|
|
721
695
|
options,
|
|
722
696
|
value: propValue,
|
|
723
697
|
defaultValue,
|
|
@@ -727,18 +701,18 @@ var SegmentedControl = ({
|
|
|
727
701
|
sx,
|
|
728
702
|
...rest
|
|
729
703
|
}) => {
|
|
730
|
-
const [internalValue, setInternalValue] =
|
|
731
|
-
|
|
704
|
+
const [internalValue, setInternalValue] = React13.useState(propValue || defaultValue);
|
|
705
|
+
React13.useEffect(() => {
|
|
732
706
|
if (propValue !== void 0) {
|
|
733
707
|
setInternalValue(propValue);
|
|
734
708
|
}
|
|
735
709
|
}, [propValue]);
|
|
736
|
-
const handleChange = newValue => {
|
|
710
|
+
const handleChange = /* @__PURE__ */__name(newValue => {
|
|
737
711
|
setInternalValue(newValue);
|
|
738
712
|
if (onChange) {
|
|
739
713
|
onChange(newValue);
|
|
740
714
|
}
|
|
741
|
-
};
|
|
715
|
+
}, "handleChange");
|
|
742
716
|
const normalizedOptions = options.map(option => {
|
|
743
717
|
return typeof option === "string" || typeof option === "number" ? {
|
|
744
718
|
label: option,
|
|
@@ -746,7 +720,7 @@ var SegmentedControl = ({
|
|
|
746
720
|
} : option;
|
|
747
721
|
});
|
|
748
722
|
const currentValue = propValue !== void 0 ? propValue : internalValue;
|
|
749
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */React13.createElement(Flex2, {
|
|
750
724
|
className,
|
|
751
725
|
sx: {
|
|
752
726
|
width: "100%",
|
|
@@ -828,71 +802,65 @@ var SegmentedControl = ({
|
|
|
828
802
|
},
|
|
829
803
|
...sx
|
|
830
804
|
},
|
|
831
|
-
...rest
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
})]
|
|
885
|
-
})
|
|
886
|
-
})
|
|
887
|
-
});
|
|
888
|
-
};
|
|
805
|
+
...rest
|
|
806
|
+
}, /* @__PURE__ */React13.createElement("div", {
|
|
807
|
+
className: "rc-segmented"
|
|
808
|
+
}, /* @__PURE__ */React13.createElement(Flex2, {
|
|
809
|
+
className: "rc-segmented-group custom-segmented-group"
|
|
810
|
+
}, normalizedOptions.map((option, index) => {
|
|
811
|
+
const isSelected = option.value === currentValue;
|
|
812
|
+
const isLastItem = index === normalizedOptions.length - 1;
|
|
813
|
+
const isItemDisabled = disabled || option.disabled;
|
|
814
|
+
const showDivider = !isLastItem && option.value !== currentValue && normalizedOptions[index + 1].value !== currentValue;
|
|
815
|
+
return /* @__PURE__ */React13.createElement(React13.Fragment, {
|
|
816
|
+
key: `${index}-${option.value}`
|
|
817
|
+
}, /* @__PURE__ */React13.createElement(Box3, {
|
|
818
|
+
as: "label",
|
|
819
|
+
className: `rc-segmented-item ${isSelected ? "rc-segmented-item-selected" : ""} ${isItemDisabled ? "rc-segmented-item-disabled" : ""}`,
|
|
820
|
+
onClick: /* @__PURE__ */__name(() => {
|
|
821
|
+
if (!disabled && !option.disabled) {
|
|
822
|
+
handleChange(option.value);
|
|
823
|
+
}
|
|
824
|
+
}, "onClick")
|
|
825
|
+
}, /* @__PURE__ */React13.createElement("input", {
|
|
826
|
+
type: "radio",
|
|
827
|
+
value: option.value,
|
|
828
|
+
checked: isSelected,
|
|
829
|
+
disabled: isItemDisabled,
|
|
830
|
+
onChange: /* @__PURE__ */__name(e => {
|
|
831
|
+
if (!disabled && !option.disabled && e.target.checked) {
|
|
832
|
+
handleChange(option.value);
|
|
833
|
+
}
|
|
834
|
+
}, "onChange")
|
|
835
|
+
}), /* @__PURE__ */React13.createElement("div", {
|
|
836
|
+
className: "rc-segmented-item-label"
|
|
837
|
+
}, option.label)), showDivider && /* @__PURE__ */React13.createElement(Box3, {
|
|
838
|
+
className: "segmented-divider",
|
|
839
|
+
sx: {
|
|
840
|
+
height: "60%",
|
|
841
|
+
width: "1px",
|
|
842
|
+
backgroundColor: "action.text.accent.default",
|
|
843
|
+
opacity: 0.4,
|
|
844
|
+
alignSelf: "center",
|
|
845
|
+
zIndex: 3
|
|
846
|
+
}
|
|
847
|
+
}));
|
|
848
|
+
}), currentValue !== void 0 && /* @__PURE__ */React13.createElement("div", {
|
|
849
|
+
className: "rc-segmented-thumb",
|
|
850
|
+
style: {
|
|
851
|
+
width: `${100 / normalizedOptions.length}%`,
|
|
852
|
+
transform: `translateX(${normalizedOptions.findIndex(option => {
|
|
853
|
+
return option.value === currentValue;
|
|
854
|
+
}) * 100}%)`
|
|
855
|
+
}
|
|
856
|
+
}))));
|
|
857
|
+
}, "SegmentedControl");
|
|
889
858
|
|
|
890
859
|
// src/components/Select.tsx
|
|
891
860
|
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
892
|
-
import * as
|
|
861
|
+
import * as React14 from "react";
|
|
893
862
|
import ReactSelect, { components } from "react-select";
|
|
894
|
-
|
|
895
|
-
var Control = props => {
|
|
863
|
+
var Control = /* @__PURE__ */__name(props => {
|
|
896
864
|
const isDisabled = props.selectProps.isDisabled;
|
|
897
865
|
const hasError = props.selectProps["aria-invalid"] === "true";
|
|
898
866
|
const borderColor = (() => {
|
|
@@ -910,7 +878,7 @@ var Control = props => {
|
|
|
910
878
|
}
|
|
911
879
|
return "display.background.secondary.default";
|
|
912
880
|
})();
|
|
913
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */React14.createElement(Box, {
|
|
914
882
|
sx: {
|
|
915
883
|
".react-select__control": {
|
|
916
884
|
borderColor,
|
|
@@ -918,13 +886,10 @@ var Control = props => {
|
|
|
918
886
|
paddingX: "4",
|
|
919
887
|
paddingY: "3"
|
|
920
888
|
}
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
});
|
|
926
|
-
};
|
|
927
|
-
var DropdownIndicator = props => {
|
|
889
|
+
}
|
|
890
|
+
}, /* @__PURE__ */React14.createElement(components.Control, props));
|
|
891
|
+
}, "Control");
|
|
892
|
+
var DropdownIndicator = /* @__PURE__ */__name(props => {
|
|
928
893
|
const isDisabled = props.selectProps.isDisabled;
|
|
929
894
|
const color = (() => {
|
|
930
895
|
if (isDisabled) {
|
|
@@ -932,42 +897,39 @@ var DropdownIndicator = props => {
|
|
|
932
897
|
}
|
|
933
898
|
return "text";
|
|
934
899
|
})();
|
|
935
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */React14.createElement(Text, {
|
|
936
901
|
sx: {
|
|
937
902
|
fontSize: "md",
|
|
938
903
|
color,
|
|
939
904
|
alignSelf: "center",
|
|
940
905
|
display: "flex",
|
|
941
906
|
alignItems: "center"
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
var IndicatorsContainer = ({
|
|
907
|
+
}
|
|
908
|
+
}, /* @__PURE__ */React14.createElement(Icon7, {
|
|
909
|
+
icon: "picker-down"
|
|
910
|
+
}));
|
|
911
|
+
}, "DropdownIndicator");
|
|
912
|
+
var IndicatorsContainer = /* @__PURE__ */__name(({
|
|
949
913
|
children
|
|
950
914
|
}) => {
|
|
951
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */React14.createElement(Box, {
|
|
952
916
|
sx: {
|
|
953
917
|
marginLeft: "4",
|
|
954
918
|
border: "none"
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
var Placeholder = ({
|
|
919
|
+
}
|
|
920
|
+
}, children);
|
|
921
|
+
}, "IndicatorsContainer");
|
|
922
|
+
var Placeholder = /* @__PURE__ */__name(({
|
|
960
923
|
children
|
|
961
924
|
}) => {
|
|
962
|
-
return /* @__PURE__ */
|
|
925
|
+
return /* @__PURE__ */React14.createElement(Text, {
|
|
963
926
|
sx: {
|
|
964
927
|
color: "onMuted",
|
|
965
928
|
alignSelf: "center"
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
var SelectContainer = ({
|
|
929
|
+
}
|
|
930
|
+
}, children);
|
|
931
|
+
}, "Placeholder");
|
|
932
|
+
var SelectContainer = /* @__PURE__ */__name(({
|
|
971
933
|
children,
|
|
972
934
|
...props
|
|
973
935
|
}) => {
|
|
@@ -978,17 +940,13 @@ var SelectContainer = ({
|
|
|
978
940
|
return (
|
|
979
941
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
980
942
|
/* @__PURE__ */
|
|
981
|
-
|
|
943
|
+
React14.createElement(Box, {
|
|
982
944
|
sx,
|
|
983
|
-
css: css2
|
|
984
|
-
|
|
985
|
-
...props,
|
|
986
|
-
children
|
|
987
|
-
})
|
|
988
|
-
})
|
|
945
|
+
css: css2
|
|
946
|
+
}, /* @__PURE__ */React14.createElement(components.SelectContainer, props, children))
|
|
989
947
|
);
|
|
990
|
-
};
|
|
991
|
-
var ValueContainer = ({
|
|
948
|
+
}, "SelectContainer");
|
|
949
|
+
var ValueContainer = /* @__PURE__ */__name(({
|
|
992
950
|
children,
|
|
993
951
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
994
952
|
...props
|
|
@@ -1011,43 +969,39 @@ var ValueContainer = ({
|
|
|
1011
969
|
}
|
|
1012
970
|
return leadingIcon || "search";
|
|
1013
971
|
})();
|
|
1014
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */React14.createElement(Flex, {
|
|
1015
973
|
sx: {
|
|
1016
974
|
gap: "4",
|
|
1017
975
|
flex: 1
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
})]
|
|
1048
|
-
});
|
|
1049
|
-
};
|
|
1050
|
-
var Select = React12.forwardRef(({
|
|
976
|
+
}
|
|
977
|
+
}, finalLeadingIcon && /* @__PURE__ */React14.createElement(Text, {
|
|
978
|
+
sx: {
|
|
979
|
+
alignSelf: "center",
|
|
980
|
+
pointerEvents: "none",
|
|
981
|
+
lineHeight: 0,
|
|
982
|
+
fontSize: "md"
|
|
983
|
+
}
|
|
984
|
+
}, /* @__PURE__ */React14.createElement(Icon7, {
|
|
985
|
+
icon: finalLeadingIcon
|
|
986
|
+
})), /* @__PURE__ */React14.createElement(Flex, {
|
|
987
|
+
sx: {
|
|
988
|
+
flex: 1,
|
|
989
|
+
alignItems: "center"
|
|
990
|
+
}
|
|
991
|
+
}, children), (trailingIcon || hasError) && /* @__PURE__ */React14.createElement(Text, {
|
|
992
|
+
className: hasError ? "error-icon" : "",
|
|
993
|
+
sx: {
|
|
994
|
+
alignSelf: "center",
|
|
995
|
+
pointerEvents: "none",
|
|
996
|
+
lineHeight: 0,
|
|
997
|
+
fontSize: "md",
|
|
998
|
+
color: trailingIconColor
|
|
999
|
+
}
|
|
1000
|
+
}, /* @__PURE__ */React14.createElement(Icon7, {
|
|
1001
|
+
icon: hasError ? "warning-alt" : trailingIcon
|
|
1002
|
+
})));
|
|
1003
|
+
}, "ValueContainer");
|
|
1004
|
+
var Select = /* @__PURE__ */React14.forwardRef(({
|
|
1051
1005
|
...props
|
|
1052
1006
|
}, ref) => {
|
|
1053
1007
|
const value = props.options?.find(option => {
|
|
@@ -1056,8 +1010,11 @@ var Select = React12.forwardRef(({
|
|
|
1056
1010
|
}
|
|
1057
1011
|
return false;
|
|
1058
1012
|
});
|
|
1059
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */React14.createElement(ReactSelect, {
|
|
1060
1014
|
ref,
|
|
1015
|
+
/**
|
|
1016
|
+
* https://react-select.com/components
|
|
1017
|
+
*/
|
|
1061
1018
|
components: {
|
|
1062
1019
|
Control,
|
|
1063
1020
|
DropdownIndicator,
|
|
@@ -1069,17 +1026,20 @@ var Select = React12.forwardRef(({
|
|
|
1069
1026
|
isDisabled: props.disabled,
|
|
1070
1027
|
...props,
|
|
1071
1028
|
value,
|
|
1072
|
-
onChange: value2 => {
|
|
1029
|
+
onChange: /* @__PURE__ */__name(value2 => {
|
|
1073
1030
|
props.onChange?.(value2?.value);
|
|
1074
|
-
},
|
|
1031
|
+
}, "onChange"),
|
|
1075
1032
|
styles: {
|
|
1076
|
-
input: baseStyles => {
|
|
1033
|
+
input: /* @__PURE__ */__name(baseStyles => {
|
|
1077
1034
|
return {
|
|
1078
1035
|
...baseStyles,
|
|
1079
1036
|
position: "absolute"
|
|
1080
1037
|
};
|
|
1081
|
-
}
|
|
1038
|
+
}, "input")
|
|
1082
1039
|
},
|
|
1040
|
+
/**
|
|
1041
|
+
* https://react-select.com/styles#the-classnameprefix-prop
|
|
1042
|
+
*/
|
|
1083
1043
|
classNamePrefix: "react-select"
|
|
1084
1044
|
});
|
|
1085
1045
|
});
|
|
@@ -1092,9 +1052,8 @@ import { Slider } from "theme-ui";
|
|
|
1092
1052
|
import { Spinner } from "theme-ui";
|
|
1093
1053
|
|
|
1094
1054
|
// src/components/Stack.tsx
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
return /* @__PURE__ */jsx18(Flex, {
|
|
1055
|
+
var Stack = /* @__PURE__ */__name(props => {
|
|
1056
|
+
return /* @__PURE__ */React.createElement(Flex, {
|
|
1098
1057
|
...props,
|
|
1099
1058
|
sx: {
|
|
1100
1059
|
flexDirection: "column",
|
|
@@ -1102,21 +1061,17 @@ var Stack = props => {
|
|
|
1102
1061
|
...props.sx
|
|
1103
1062
|
}
|
|
1104
1063
|
});
|
|
1105
|
-
};
|
|
1064
|
+
}, "Stack");
|
|
1106
1065
|
|
|
1107
1066
|
// src/components/Switch.tsx
|
|
1108
1067
|
import { Switch as SwitchUi } from "theme-ui";
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
return /* @__PURE__ */jsx19(SwitchUi, {
|
|
1068
|
+
var Switch = /* @__PURE__ */__name(props => {
|
|
1069
|
+
return /* @__PURE__ */React.createElement(SwitchUi, {
|
|
1112
1070
|
...props,
|
|
1113
1071
|
role: "switch",
|
|
1114
1072
|
"aria-checked": props.checked || false,
|
|
1115
1073
|
sx: {
|
|
1116
1074
|
backgroundColor: "input.background.muted.disabled",
|
|
1117
|
-
"& > input": {
|
|
1118
|
-
position: "relative"
|
|
1119
|
-
},
|
|
1120
1075
|
"input:checked ~ &": {
|
|
1121
1076
|
backgroundColor: "input.background.accent.default"
|
|
1122
1077
|
},
|
|
@@ -1134,43 +1089,42 @@ var Switch = props => {
|
|
|
1134
1089
|
...props.sx
|
|
1135
1090
|
}
|
|
1136
1091
|
});
|
|
1137
|
-
};
|
|
1092
|
+
}, "Switch");
|
|
1138
1093
|
|
|
1139
1094
|
// src/components/Tag.tsx
|
|
1140
|
-
import
|
|
1141
|
-
var Tag = ({
|
|
1095
|
+
import * as React15 from "react";
|
|
1096
|
+
var Tag = /* @__PURE__ */__name(({
|
|
1142
1097
|
children
|
|
1143
1098
|
}) => {
|
|
1144
1099
|
if (Array.isArray(children)) {
|
|
1145
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */React15.createElement(Box, {
|
|
1146
1101
|
as: "span",
|
|
1147
1102
|
sx: {
|
|
1148
1103
|
ml: 2,
|
|
1149
1104
|
display: "inline-flex",
|
|
1150
1105
|
alignItems: "center",
|
|
1151
1106
|
gap: 1
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
});
|
|
1107
|
+
}
|
|
1108
|
+
}, children.map((child, i) => {
|
|
1109
|
+
return /* @__PURE__ */React15.createElement(Box, {
|
|
1110
|
+
key: i,
|
|
1111
|
+
as: "span",
|
|
1112
|
+
sx: {
|
|
1113
|
+
px: 2,
|
|
1114
|
+
py: 0,
|
|
1115
|
+
fontSize: "xs",
|
|
1116
|
+
borderRadius: "full",
|
|
1117
|
+
backgroundColor: "display.background.secondary.default",
|
|
1118
|
+
color: "text.secondary",
|
|
1119
|
+
border: "1px solid",
|
|
1120
|
+
borderColor: "border.default",
|
|
1121
|
+
fontWeight: "medium",
|
|
1122
|
+
lineHeight: 1.5
|
|
1123
|
+
}
|
|
1124
|
+
}, child);
|
|
1125
|
+
}));
|
|
1172
1126
|
}
|
|
1173
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */React15.createElement(Box, {
|
|
1174
1128
|
as: "span",
|
|
1175
1129
|
sx: {
|
|
1176
1130
|
ml: 2,
|
|
@@ -1186,67 +1140,62 @@ var Tag = ({
|
|
|
1186
1140
|
lineHeight: 1.5,
|
|
1187
1141
|
display: "inline-flex",
|
|
1188
1142
|
alignItems: "center"
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
};
|
|
1143
|
+
}
|
|
1144
|
+
}, children);
|
|
1145
|
+
}, "Tag");
|
|
1193
1146
|
|
|
1194
1147
|
// src/components/Textarea.tsx
|
|
1195
1148
|
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
1196
|
-
import * as
|
|
1149
|
+
import * as React16 from "react";
|
|
1197
1150
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
1198
|
-
|
|
1199
|
-
var Textarea = React13.forwardRef(({
|
|
1151
|
+
var Textarea = /* @__PURE__ */React16.forwardRef(({
|
|
1200
1152
|
trailingIcon,
|
|
1201
1153
|
className,
|
|
1202
1154
|
sx,
|
|
1203
1155
|
...textareaProps
|
|
1204
1156
|
}, ref) => {
|
|
1205
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */React16.createElement(Flex, {
|
|
1206
1158
|
className,
|
|
1207
1159
|
sx: {
|
|
1208
1160
|
...sx,
|
|
1209
1161
|
position: "relative",
|
|
1210
1162
|
padding: 0,
|
|
1211
1163
|
border: "none"
|
|
1164
|
+
}
|
|
1165
|
+
}, /* @__PURE__ */React16.createElement(TextareaUI, {
|
|
1166
|
+
ref,
|
|
1167
|
+
sx: {
|
|
1168
|
+
fontFamily: "body",
|
|
1169
|
+
paddingY: "4",
|
|
1170
|
+
paddingX: "5",
|
|
1171
|
+
...sx,
|
|
1172
|
+
paddingRight: trailingIcon ? "7" : void 0,
|
|
1173
|
+
margin: 0
|
|
1212
1174
|
},
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}), trailingIcon && /* @__PURE__ */jsx21(Text, {
|
|
1226
|
-
sx: {
|
|
1227
|
-
position: "absolute",
|
|
1228
|
-
right: "1.25rem",
|
|
1229
|
-
top: "0.75rem"
|
|
1230
|
-
},
|
|
1231
|
-
children: /* @__PURE__ */jsx21(Icon8, {
|
|
1232
|
-
inline: true,
|
|
1233
|
-
icon: trailingIcon
|
|
1234
|
-
})
|
|
1235
|
-
})]
|
|
1236
|
-
});
|
|
1175
|
+
className,
|
|
1176
|
+
...textareaProps
|
|
1177
|
+
}), trailingIcon && /* @__PURE__ */React16.createElement(Text, {
|
|
1178
|
+
sx: {
|
|
1179
|
+
position: "absolute",
|
|
1180
|
+
right: "1.25rem",
|
|
1181
|
+
top: "0.75rem"
|
|
1182
|
+
}
|
|
1183
|
+
}, /* @__PURE__ */React16.createElement(Icon8, {
|
|
1184
|
+
inline: true,
|
|
1185
|
+
icon: trailingIcon
|
|
1186
|
+
})));
|
|
1237
1187
|
});
|
|
1238
1188
|
Textarea.displayName = "Textarea";
|
|
1239
1189
|
|
|
1240
1190
|
// src/components/Tooltip.tsx
|
|
1241
1191
|
import { Tooltip as TooltipReact } from "react-tooltip";
|
|
1242
|
-
|
|
1243
|
-
var Tooltip = ({
|
|
1192
|
+
var Tooltip = /* @__PURE__ */__name(({
|
|
1244
1193
|
variant = "info",
|
|
1245
1194
|
sx,
|
|
1246
1195
|
...props
|
|
1247
1196
|
}) => {
|
|
1248
1197
|
const className = `tooltip-component tooltip-${variant}`;
|
|
1249
|
-
const getVariantStyles = variantType => {
|
|
1198
|
+
const getVariantStyles = /* @__PURE__ */__name(variantType => {
|
|
1250
1199
|
const variants = {
|
|
1251
1200
|
info: {
|
|
1252
1201
|
backgroundColor: "input.background.secondary.default",
|
|
@@ -1270,9 +1219,9 @@ var Tooltip = ({
|
|
|
1270
1219
|
}
|
|
1271
1220
|
};
|
|
1272
1221
|
return variants[variantType] || variants.info;
|
|
1273
|
-
};
|
|
1274
|
-
return /* @__PURE__ */
|
|
1275
|
-
sx: ({
|
|
1222
|
+
}, "getVariantStyles");
|
|
1223
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
1224
|
+
sx: /* @__PURE__ */__name(({
|
|
1276
1225
|
fonts
|
|
1277
1226
|
}) => {
|
|
1278
1227
|
const variantStyles = getVariantStyles(variant);
|
|
@@ -1301,39 +1250,34 @@ var Tooltip = ({
|
|
|
1301
1250
|
},
|
|
1302
1251
|
[`&.tooltip-${variant}`]: variantStyles
|
|
1303
1252
|
};
|
|
1304
|
-
},
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
});
|
|
1312
|
-
};
|
|
1253
|
+
}, "sx")
|
|
1254
|
+
}, /* @__PURE__ */React.createElement(TooltipReact, {
|
|
1255
|
+
className,
|
|
1256
|
+
...props,
|
|
1257
|
+
classNameArrow: "example-arrow"
|
|
1258
|
+
}, props.children));
|
|
1259
|
+
}, "Tooltip");
|
|
1313
1260
|
|
|
1314
1261
|
// src/theme/ThemeProvider.tsx
|
|
1315
1262
|
import { css, Global } from "@emotion/react";
|
|
1316
1263
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
1264
|
+
import * as React17 from "react";
|
|
1317
1265
|
import { ThemeUIProvider } from "theme-ui";
|
|
1318
|
-
|
|
1319
|
-
var ThemeProvider = ({
|
|
1266
|
+
var ThemeProvider = /* @__PURE__ */__name(({
|
|
1320
1267
|
children,
|
|
1321
1268
|
theme = BruttalTheme,
|
|
1322
1269
|
fonts = BruttalFonts
|
|
1323
1270
|
}) => {
|
|
1324
|
-
return /* @__PURE__ */
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
styles: css`
|
|
1271
|
+
return /* @__PURE__ */React17.createElement(React17.Fragment, null, /* @__PURE__ */React17.createElement(ThemeUIProvider, {
|
|
1272
|
+
theme
|
|
1273
|
+
}, /* @__PURE__ */React17.createElement(Global, {
|
|
1274
|
+
styles: css`
|
|
1329
1275
|
${fonts.map(url => {
|
|
1330
|
-
|
|
1331
|
-
|
|
1276
|
+
return `@import url('${url}');`;
|
|
1277
|
+
}).join("\n")}
|
|
1332
1278
|
`
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
});
|
|
1336
|
-
};
|
|
1279
|
+
}), children));
|
|
1280
|
+
}, "ThemeProvider");
|
|
1337
1281
|
|
|
1338
1282
|
// src/theme/useTheme.ts
|
|
1339
1283
|
import { useThemeUI } from "theme-ui";
|