@ttoss/ui 5.0.14 → 5.0.15
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 +524 -522
- package/dist/index.d.ts +63 -63
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -1,47 +1,85 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
// src/components/Button.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Button as ButtonUi } from "theme-ui";
|
|
6
|
+
import { Icon } from "@ttoss/react-icons";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var Button = React.forwardRef((props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
leftIcon,
|
|
12
|
+
rightIcon,
|
|
13
|
+
loading,
|
|
14
|
+
...restProps
|
|
15
|
+
} = props;
|
|
16
|
+
return /* @__PURE__ */jsxs(ButtonUi, {
|
|
17
|
+
type: "button",
|
|
18
|
+
...restProps,
|
|
19
|
+
ref,
|
|
20
|
+
sx: {
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
paddingX: "xl",
|
|
23
|
+
paddingY: "lg",
|
|
24
|
+
fontFamily: "body",
|
|
25
|
+
display: "inline-flex",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
gap: "lg",
|
|
28
|
+
...restProps.sx
|
|
29
|
+
},
|
|
30
|
+
children: [loading && /* @__PURE__ */jsx(Icon, {
|
|
31
|
+
inline: true,
|
|
32
|
+
icon: "three-dots-loading"
|
|
33
|
+
}), !loading && leftIcon && /* @__PURE__ */jsx(Icon, {
|
|
34
|
+
inline: true,
|
|
35
|
+
icon: leftIcon
|
|
36
|
+
}), children, rightIcon && /* @__PURE__ */jsx(Icon, {
|
|
37
|
+
inline: true,
|
|
38
|
+
icon: rightIcon
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
Button.displayName = "Button";
|
|
7
43
|
|
|
8
|
-
// src/
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
theme = BruttalTheme,
|
|
16
|
-
fonts = BruttalFonts
|
|
44
|
+
// src/components/ActionButton.tsx
|
|
45
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
46
|
+
var ActionButton = ({
|
|
47
|
+
icon,
|
|
48
|
+
variant = "default",
|
|
49
|
+
sx,
|
|
50
|
+
...props
|
|
17
51
|
}) => {
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
return /* @__PURE__ */jsx2(Button, {
|
|
53
|
+
variant: `buttons.actionButton.${variant}`,
|
|
54
|
+
leftIcon: icon,
|
|
55
|
+
sx: {
|
|
56
|
+
padding: "sm",
|
|
57
|
+
gap: "xs",
|
|
58
|
+
fontFamily: "caption",
|
|
59
|
+
borderRadius: "action",
|
|
60
|
+
outlineColor: "transparent",
|
|
61
|
+
":disabled": props.disabled ? {
|
|
62
|
+
backgroundColor: "muted",
|
|
63
|
+
color: "onMuted",
|
|
64
|
+
cursor: "not-allowed",
|
|
65
|
+
border: "muted",
|
|
66
|
+
borderColor: "onMuted"
|
|
67
|
+
} : void 0,
|
|
68
|
+
...sx
|
|
69
|
+
},
|
|
70
|
+
...props
|
|
29
71
|
});
|
|
30
72
|
};
|
|
31
73
|
|
|
32
|
-
// src/theme/useTheme.ts
|
|
33
|
-
import { useThemeUI } from "theme-ui";
|
|
34
|
-
var useTheme = useThemeUI;
|
|
35
|
-
|
|
36
74
|
// src/components/Badge.tsx
|
|
37
75
|
import { Badge as BadgeUi } from "theme-ui";
|
|
38
|
-
import { Icon } from "@ttoss/react-icons";
|
|
76
|
+
import { Icon as Icon2 } from "@ttoss/react-icons";
|
|
39
77
|
|
|
40
78
|
// src/components/Text.tsx
|
|
41
79
|
import { Text } from "theme-ui";
|
|
42
80
|
|
|
43
81
|
// src/components/Badge.tsx
|
|
44
|
-
import { jsx as
|
|
82
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
45
83
|
var Badge = ({
|
|
46
84
|
icon,
|
|
47
85
|
children,
|
|
@@ -65,17 +103,17 @@ var Badge = ({
|
|
|
65
103
|
...sx
|
|
66
104
|
},
|
|
67
105
|
...props,
|
|
68
|
-
children: [icon && /* @__PURE__ */
|
|
106
|
+
children: [icon && /* @__PURE__ */jsx3(Icon2, {
|
|
69
107
|
inline: true,
|
|
70
108
|
icon
|
|
71
|
-
}), children, chip && /* @__PURE__ */
|
|
109
|
+
}), children, chip && /* @__PURE__ */jsx3(Text, {
|
|
72
110
|
sx: {
|
|
73
111
|
cursor: "pointer",
|
|
74
112
|
lineHeight: 0,
|
|
75
113
|
color: "currentcolor",
|
|
76
114
|
alignSelf: "center"
|
|
77
115
|
},
|
|
78
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */jsx3(Icon2, {
|
|
79
117
|
onClick: onDelete,
|
|
80
118
|
inline: true,
|
|
81
119
|
icon: "close"
|
|
@@ -87,49 +125,93 @@ var Badge = ({
|
|
|
87
125
|
// src/components/Box.tsx
|
|
88
126
|
import { Box } from "theme-ui";
|
|
89
127
|
|
|
90
|
-
// src/components/
|
|
91
|
-
import
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
// src/components/Card.tsx
|
|
129
|
+
import { Card } from "theme-ui";
|
|
130
|
+
|
|
131
|
+
// src/components/Checkbox.tsx
|
|
132
|
+
import * as React2 from "react";
|
|
133
|
+
import { Checkbox as CheckBoxUi } from "theme-ui";
|
|
134
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
135
|
+
var Checkbox = React2.forwardRef(({
|
|
136
|
+
indeterminate = false,
|
|
137
|
+
...rest
|
|
138
|
+
}, ref) => {
|
|
139
|
+
const innerRef = React2.useRef(null);
|
|
140
|
+
React2.useImperativeHandle(ref, () => {
|
|
141
|
+
return innerRef.current;
|
|
142
|
+
});
|
|
143
|
+
React2.useEffect(() => {
|
|
144
|
+
if (innerRef.current) {
|
|
145
|
+
innerRef.current.indeterminate = indeterminate;
|
|
146
|
+
}
|
|
147
|
+
}, [indeterminate]);
|
|
148
|
+
if (indeterminate) {
|
|
149
|
+
return /* @__PURE__ */jsx4("input", {
|
|
150
|
+
type: "checkbox",
|
|
151
|
+
ref: innerRef,
|
|
152
|
+
...rest
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return /* @__PURE__ */jsx4(CheckBoxUi, {
|
|
156
|
+
ref: innerRef,
|
|
157
|
+
...rest
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
Checkbox.displayName = "Checkbox";
|
|
161
|
+
|
|
162
|
+
// src/components/CloseButton.tsx
|
|
163
|
+
import * as React3 from "react";
|
|
164
|
+
import { Icon as Icon3 } from "@ttoss/react-icons";
|
|
165
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
166
|
+
var CloseButton = React3.forwardRef(({
|
|
167
|
+
label,
|
|
168
|
+
sx,
|
|
169
|
+
onlyText,
|
|
170
|
+
...props
|
|
171
|
+
}, ref) => {
|
|
172
|
+
if (onlyText && !label) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
return /* @__PURE__ */jsxs3(Button, {
|
|
176
|
+
variant: "buttons.closeButton",
|
|
104
177
|
type: "button",
|
|
105
|
-
|
|
106
|
-
ref,
|
|
178
|
+
"aria-label": label,
|
|
107
179
|
sx: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
paddingY: "lg",
|
|
111
|
-
fontFamily: "body",
|
|
180
|
+
fontFamily: "caption",
|
|
181
|
+
fontSize: "xs",
|
|
112
182
|
display: "inline-flex",
|
|
113
183
|
alignItems: "center",
|
|
114
|
-
|
|
115
|
-
|
|
184
|
+
cursor: "pointer",
|
|
185
|
+
lineHeight: "normal",
|
|
186
|
+
gap: "sm",
|
|
187
|
+
padding: "sm",
|
|
188
|
+
width: "fit-content",
|
|
189
|
+
transition: "all 0.2s",
|
|
190
|
+
"& > iconify-icon": {
|
|
191
|
+
fontSize: "base"
|
|
192
|
+
},
|
|
193
|
+
...sx
|
|
116
194
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
inline: true,
|
|
122
|
-
icon: leftIcon
|
|
123
|
-
}), children, rightIcon && /* @__PURE__ */jsx3(Icon2, {
|
|
124
|
-
inline: true,
|
|
125
|
-
icon: rightIcon
|
|
195
|
+
...props,
|
|
196
|
+
ref,
|
|
197
|
+
children: [label, !onlyText && /* @__PURE__ */jsx5(Icon3, {
|
|
198
|
+
icon: "close"
|
|
126
199
|
})]
|
|
127
200
|
});
|
|
128
201
|
});
|
|
129
|
-
|
|
202
|
+
CloseButton.displayName = "CloseButton";
|
|
130
203
|
|
|
131
|
-
// src/components/
|
|
132
|
-
import
|
|
204
|
+
// src/components/Container.tsx
|
|
205
|
+
import * as React4 from "react";
|
|
206
|
+
import { Container as ContainerUi } from "theme-ui";
|
|
207
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
208
|
+
var Container = React4.forwardRef((props, ref) => {
|
|
209
|
+
return /* @__PURE__ */jsx6(ContainerUi, {
|
|
210
|
+
ref,
|
|
211
|
+
...props
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
Container.displayName = "Container";
|
|
133
215
|
|
|
134
216
|
// src/components/Divider.tsx
|
|
135
217
|
import { Divider } from "theme-ui";
|
|
@@ -143,15 +225,89 @@ import { Grid } from "theme-ui";
|
|
|
143
225
|
// src/components/Heading.tsx
|
|
144
226
|
import { Heading } from "theme-ui";
|
|
145
227
|
|
|
228
|
+
// src/components/HelpText.tsx
|
|
229
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
230
|
+
var HelpText = ({
|
|
231
|
+
sx,
|
|
232
|
+
disabled,
|
|
233
|
+
negative,
|
|
234
|
+
...props
|
|
235
|
+
}) => {
|
|
236
|
+
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
237
|
+
return /* @__PURE__ */jsx7(Text, {
|
|
238
|
+
variant,
|
|
239
|
+
sx: {
|
|
240
|
+
fontSize: "sm",
|
|
241
|
+
fontFamily: "caption",
|
|
242
|
+
lineHeight: "base",
|
|
243
|
+
...sx
|
|
244
|
+
},
|
|
245
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
246
|
+
...props
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// src/components/IconButton.tsx
|
|
251
|
+
import * as React5 from "react";
|
|
252
|
+
import { IconButton as IconButtonUi } from "theme-ui";
|
|
253
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
254
|
+
var IconButton = React5.forwardRef((props, ref) => {
|
|
255
|
+
return /* @__PURE__ */jsx8(IconButtonUi, {
|
|
256
|
+
type: "button",
|
|
257
|
+
...props,
|
|
258
|
+
ref
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
IconButton.displayName = "IconButton";
|
|
262
|
+
|
|
146
263
|
// src/components/Image.tsx
|
|
147
264
|
import { Image } from "theme-ui";
|
|
148
265
|
|
|
266
|
+
// src/components/InfiniteLinearProgress.tsx
|
|
267
|
+
import * as React6 from "react";
|
|
268
|
+
|
|
269
|
+
// src/components/LinearProgress.tsx
|
|
270
|
+
import { Progress } from "theme-ui";
|
|
271
|
+
|
|
272
|
+
// src/components/InfiniteLinearProgress.tsx
|
|
273
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
274
|
+
var MAX_PROGRESS = 100;
|
|
275
|
+
var InfiniteLinearProgress = () => {
|
|
276
|
+
const [progress, setProgress] = React6.useState(0);
|
|
277
|
+
React6.useEffect(() => {
|
|
278
|
+
const timer = setInterval(() => {
|
|
279
|
+
setProgress(oldProgress => {
|
|
280
|
+
if (oldProgress === MAX_PROGRESS) {
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
let diff = 0;
|
|
284
|
+
if (oldProgress > 0.97 * MAX_PROGRESS) {
|
|
285
|
+
diff -= 0.75 * MAX_PROGRESS;
|
|
286
|
+
} else if (oldProgress > 0.6 * MAX_PROGRESS) {
|
|
287
|
+
diff = Math.random() * (MAX_PROGRESS - oldProgress) * 0.1;
|
|
288
|
+
} else {
|
|
289
|
+
diff = Math.random() * (MAX_PROGRESS * 0.02);
|
|
290
|
+
}
|
|
291
|
+
return Math.min(oldProgress + diff, MAX_PROGRESS);
|
|
292
|
+
});
|
|
293
|
+
}, 100);
|
|
294
|
+
return () => {
|
|
295
|
+
clearInterval(timer);
|
|
296
|
+
};
|
|
297
|
+
}, []);
|
|
298
|
+
return /* @__PURE__ */jsx9(Progress, {
|
|
299
|
+
max: MAX_PROGRESS,
|
|
300
|
+
value: progress,
|
|
301
|
+
role: "progressbar"
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
|
|
149
305
|
// src/components/Input.tsx
|
|
150
|
-
import * as
|
|
151
|
-
import { Icon as
|
|
306
|
+
import * as React7 from "react";
|
|
307
|
+
import { Icon as Icon4 } from "@ttoss/react-icons";
|
|
152
308
|
import { Input as InputUI } from "theme-ui";
|
|
153
|
-
import { jsx as
|
|
154
|
-
var Input =
|
|
309
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
310
|
+
var Input = React7.forwardRef(({
|
|
155
311
|
leadingIcon,
|
|
156
312
|
trailingIcon: trailingIconProp,
|
|
157
313
|
onLeadingIconClick,
|
|
@@ -169,7 +325,7 @@ var Input = React2.forwardRef(({
|
|
|
169
325
|
padding: 0,
|
|
170
326
|
border: "none"
|
|
171
327
|
},
|
|
172
|
-
children: [leadingIcon && /* @__PURE__ */
|
|
328
|
+
children: [leadingIcon && /* @__PURE__ */jsx10(Text, {
|
|
173
329
|
sx: {
|
|
174
330
|
position: "absolute",
|
|
175
331
|
alignSelf: "center",
|
|
@@ -178,11 +334,11 @@ var Input = React2.forwardRef(({
|
|
|
178
334
|
},
|
|
179
335
|
onClick: onLeadingIconClick,
|
|
180
336
|
variant: "leading-icon",
|
|
181
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */jsx10(Icon4, {
|
|
182
338
|
inline: true,
|
|
183
339
|
icon: leadingIcon
|
|
184
340
|
})
|
|
185
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */jsx10(InputUI, {
|
|
186
342
|
ref,
|
|
187
343
|
sx: {
|
|
188
344
|
fontFamily: "body",
|
|
@@ -195,7 +351,7 @@ var Input = React2.forwardRef(({
|
|
|
195
351
|
},
|
|
196
352
|
className,
|
|
197
353
|
...inputProps
|
|
198
|
-
}), trailingIcon && /* @__PURE__ */
|
|
354
|
+
}), trailingIcon && /* @__PURE__ */jsx10(Text, {
|
|
199
355
|
sx: {
|
|
200
356
|
position: "absolute",
|
|
201
357
|
right: "1rem",
|
|
@@ -204,7 +360,7 @@ var Input = React2.forwardRef(({
|
|
|
204
360
|
},
|
|
205
361
|
variant: "trailing-icon",
|
|
206
362
|
onClick: onTrailingIconClick,
|
|
207
|
-
children: /* @__PURE__ */
|
|
363
|
+
children: /* @__PURE__ */jsx10(Icon4, {
|
|
208
364
|
inline: true,
|
|
209
365
|
icon: trailingIcon
|
|
210
366
|
})
|
|
@@ -213,10 +369,185 @@ var Input = React2.forwardRef(({
|
|
|
213
369
|
});
|
|
214
370
|
Input.displayName = "Input";
|
|
215
371
|
|
|
216
|
-
// src/components/
|
|
217
|
-
import
|
|
218
|
-
import {
|
|
219
|
-
import {
|
|
372
|
+
// src/components/InputNumber.tsx
|
|
373
|
+
import * as React8 from "react";
|
|
374
|
+
import { Icon as Icon5 } from "@ttoss/react-icons";
|
|
375
|
+
import { Input as Input2 } from "theme-ui";
|
|
376
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
377
|
+
var InputNumber = React8.forwardRef(({
|
|
378
|
+
sx,
|
|
379
|
+
value,
|
|
380
|
+
infoIcon,
|
|
381
|
+
onChange,
|
|
382
|
+
onClickInfoIcon,
|
|
383
|
+
...inputProps
|
|
384
|
+
}, ref) => {
|
|
385
|
+
const sxProps = React8.useMemo(() => {
|
|
386
|
+
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
387
|
+
if (inputProps["aria-invalid"] === "true") {
|
|
388
|
+
return {
|
|
389
|
+
width: `calc(139px + ${size > 1 ? size * 10 : 0}px)`,
|
|
390
|
+
textAlign: "left",
|
|
391
|
+
"&[type=number]::-webkit-inner-spin-button, &[type=number]::-webkit-outer-spin-button": {
|
|
392
|
+
WebkitAppearance: "none",
|
|
393
|
+
margin: 0
|
|
394
|
+
},
|
|
395
|
+
...sx,
|
|
396
|
+
paddingLeft: "3xl",
|
|
397
|
+
paddingRight: "2xl",
|
|
398
|
+
margin: 0
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
width: `calc(108px + ${size > 1 ? size * 10 : 0}px)`,
|
|
403
|
+
textAlign: "center",
|
|
404
|
+
"&[type=number]::-webkit-inner-spin-button, &[type=number]::-webkit-outer-spin-button": {
|
|
405
|
+
WebkitAppearance: "none",
|
|
406
|
+
margin: 0
|
|
407
|
+
},
|
|
408
|
+
fontFamily: "body",
|
|
409
|
+
paddingY: "lg",
|
|
410
|
+
paddingX: "xl",
|
|
411
|
+
...sx,
|
|
412
|
+
paddingLeft: "2xl",
|
|
413
|
+
paddingRight: "2xl",
|
|
414
|
+
margin: 0
|
|
415
|
+
};
|
|
416
|
+
}, [inputProps, value, sx]);
|
|
417
|
+
const handleChangeUp = () => {
|
|
418
|
+
if (inputProps.disabled) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if (typeof value !== "number") {
|
|
422
|
+
onChange(-1);
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
onChange(value - 1);
|
|
426
|
+
};
|
|
427
|
+
const handleChangeDown = () => {
|
|
428
|
+
if (inputProps.disabled) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (typeof value !== "number") {
|
|
432
|
+
onChange(1);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
onChange(value + 1);
|
|
436
|
+
};
|
|
437
|
+
return /* @__PURE__ */jsxs5(Flex, {
|
|
438
|
+
sx: {
|
|
439
|
+
width: "fit-content",
|
|
440
|
+
...sx,
|
|
441
|
+
position: "relative",
|
|
442
|
+
padding: 0,
|
|
443
|
+
border: "none"
|
|
444
|
+
},
|
|
445
|
+
ref,
|
|
446
|
+
"aria-invalid": inputProps["aria-invalid"],
|
|
447
|
+
children: [/* @__PURE__ */jsx11(Input2, {
|
|
448
|
+
ref,
|
|
449
|
+
variant: "forms.inputNumber",
|
|
450
|
+
sx: sxProps,
|
|
451
|
+
type: "number",
|
|
452
|
+
onChange: e => {
|
|
453
|
+
onChange(Number(e.target.value));
|
|
454
|
+
},
|
|
455
|
+
value,
|
|
456
|
+
...inputProps
|
|
457
|
+
}), /* @__PURE__ */jsx11(Text, {
|
|
458
|
+
sx: {
|
|
459
|
+
position: "absolute",
|
|
460
|
+
alignSelf: "center",
|
|
461
|
+
left: "1rem",
|
|
462
|
+
zIndex: 1,
|
|
463
|
+
cursor: "pointer"
|
|
464
|
+
},
|
|
465
|
+
onClick: handleChangeUp,
|
|
466
|
+
children: /* @__PURE__ */jsx11(Icon5, {
|
|
467
|
+
icon: "picker-down"
|
|
468
|
+
})
|
|
469
|
+
}), infoIcon && /* @__PURE__ */jsx11(Text, {
|
|
470
|
+
sx: {
|
|
471
|
+
position: "absolute",
|
|
472
|
+
alignSelf: "center",
|
|
473
|
+
right: "2.5rem",
|
|
474
|
+
zIndex: 1,
|
|
475
|
+
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
476
|
+
},
|
|
477
|
+
onClick: onClickInfoIcon,
|
|
478
|
+
children: /* @__PURE__ */jsx11(Icon5, {
|
|
479
|
+
icon: "info"
|
|
480
|
+
})
|
|
481
|
+
}), /* @__PURE__ */jsx11(Text, {
|
|
482
|
+
sx: {
|
|
483
|
+
position: "absolute",
|
|
484
|
+
alignSelf: "center",
|
|
485
|
+
right: "1rem",
|
|
486
|
+
zIndex: 1,
|
|
487
|
+
cursor: "pointer"
|
|
488
|
+
},
|
|
489
|
+
onClick: handleChangeDown,
|
|
490
|
+
children: /* @__PURE__ */jsx11(Icon5, {
|
|
491
|
+
icon: "picker-up"
|
|
492
|
+
})
|
|
493
|
+
})]
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
InputNumber.displayName = "InputNumber";
|
|
497
|
+
|
|
498
|
+
// src/components/InputPassword/InputPassword.tsx
|
|
499
|
+
import * as React10 from "react";
|
|
500
|
+
|
|
501
|
+
// src/components/InputPassword/useHidePassInput.ts
|
|
502
|
+
import * as React9 from "react";
|
|
503
|
+
var useHidePassInput = (defaultValue = true) => {
|
|
504
|
+
const [hidePass, setHidePass] = React9.useState(Boolean(defaultValue));
|
|
505
|
+
const {
|
|
506
|
+
icon,
|
|
507
|
+
inputType
|
|
508
|
+
} = React9.useMemo(() => {
|
|
509
|
+
return {
|
|
510
|
+
icon: hidePass ? "view-off" : "view-on",
|
|
511
|
+
inputType: hidePass ? "password" : "text"
|
|
512
|
+
};
|
|
513
|
+
}, [hidePass]);
|
|
514
|
+
const handleClick = () => {
|
|
515
|
+
setHidePass(prev => {
|
|
516
|
+
return !prev;
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
return {
|
|
520
|
+
handleClick,
|
|
521
|
+
icon,
|
|
522
|
+
inputType
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
// src/components/InputPassword/InputPassword.tsx
|
|
527
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
528
|
+
var InputPassword = React10.forwardRef(({
|
|
529
|
+
showPasswordByDefault,
|
|
530
|
+
...inputPasswordProps
|
|
531
|
+
}, ref) => {
|
|
532
|
+
const {
|
|
533
|
+
handleClick,
|
|
534
|
+
icon,
|
|
535
|
+
inputType
|
|
536
|
+
} = useHidePassInput(!showPasswordByDefault);
|
|
537
|
+
return /* @__PURE__ */jsx12(Input, {
|
|
538
|
+
ref,
|
|
539
|
+
...inputPasswordProps,
|
|
540
|
+
trailingIcon: icon,
|
|
541
|
+
onTrailingIconClick: handleClick,
|
|
542
|
+
type: inputType
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
InputPassword.displayName = "InputPassword";
|
|
546
|
+
|
|
547
|
+
// src/components/Label.tsx
|
|
548
|
+
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
549
|
+
import { Label as LabelUi } from "theme-ui";
|
|
550
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
220
551
|
var TOOLTIP_LABEL = "tooltip";
|
|
221
552
|
var Label = ({
|
|
222
553
|
children,
|
|
@@ -225,7 +556,7 @@ var Label = ({
|
|
|
225
556
|
sx,
|
|
226
557
|
...props
|
|
227
558
|
}) => {
|
|
228
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */jsxs6(LabelUi, {
|
|
229
560
|
sx: {
|
|
230
561
|
fontFamily: "caption",
|
|
231
562
|
alignItems: "center",
|
|
@@ -234,14 +565,14 @@ var Label = ({
|
|
|
234
565
|
...sx
|
|
235
566
|
},
|
|
236
567
|
...props,
|
|
237
|
-
children: [children, tooltip && /* @__PURE__ */
|
|
568
|
+
children: [children, tooltip && /* @__PURE__ */jsx13(Text, {
|
|
238
569
|
sx: {
|
|
239
570
|
color: "currentcolor",
|
|
240
571
|
cursor: onTooltipClick ? "pointer" : void 0
|
|
241
572
|
},
|
|
242
573
|
onClick: onTooltipClick,
|
|
243
574
|
"aria-label": TOOLTIP_LABEL,
|
|
244
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */jsx13(Icon6, {
|
|
245
576
|
inline: true,
|
|
246
577
|
icon: "info"
|
|
247
578
|
})
|
|
@@ -250,15 +581,15 @@ var Label = ({
|
|
|
250
581
|
};
|
|
251
582
|
|
|
252
583
|
// src/components/Link.tsx
|
|
253
|
-
import * as
|
|
584
|
+
import * as React11 from "react";
|
|
254
585
|
import { Link as LinkUi } from "theme-ui";
|
|
255
|
-
import { jsx as
|
|
256
|
-
var Link =
|
|
586
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
587
|
+
var Link = React11.forwardRef(({
|
|
257
588
|
quiet,
|
|
258
589
|
className,
|
|
259
590
|
...props
|
|
260
591
|
}, ref) => {
|
|
261
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */jsx14(LinkUi, {
|
|
262
593
|
className: `${quiet ? "quiet" : ""} ${className ?? ""}`,
|
|
263
594
|
...props,
|
|
264
595
|
ref
|
|
@@ -266,14 +597,17 @@ var Link = React3.forwardRef(({
|
|
|
266
597
|
});
|
|
267
598
|
Link.displayName = "Link";
|
|
268
599
|
|
|
269
|
-
// src/components/
|
|
270
|
-
import {
|
|
600
|
+
// src/components/Paragraph.tsx
|
|
601
|
+
import { Paragraph } from "theme-ui";
|
|
602
|
+
|
|
603
|
+
// src/components/Radio.tsx
|
|
604
|
+
import { Radio } from "theme-ui";
|
|
271
605
|
|
|
272
606
|
// src/components/Select.tsx
|
|
273
|
-
import * as
|
|
274
|
-
import { Icon as
|
|
607
|
+
import * as React12 from "react";
|
|
608
|
+
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
275
609
|
import ReactSelect, { components } from "react-select";
|
|
276
|
-
import { jsx as
|
|
610
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
277
611
|
var Control = props => {
|
|
278
612
|
const isDisabled = props.selectProps.isDisabled;
|
|
279
613
|
const hasError = props.selectProps["aria-invalid"] === "true";
|
|
@@ -292,7 +626,7 @@ var Control = props => {
|
|
|
292
626
|
}
|
|
293
627
|
return "surface";
|
|
294
628
|
})();
|
|
295
|
-
return /* @__PURE__ */
|
|
629
|
+
return /* @__PURE__ */jsx15(Box, {
|
|
296
630
|
sx: {
|
|
297
631
|
".react-select__control": {
|
|
298
632
|
border,
|
|
@@ -302,7 +636,7 @@ var Control = props => {
|
|
|
302
636
|
borderRadius: "action"
|
|
303
637
|
}
|
|
304
638
|
},
|
|
305
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */jsx15(components.Control, {
|
|
306
640
|
...props
|
|
307
641
|
})
|
|
308
642
|
});
|
|
@@ -315,7 +649,7 @@ var DropdownIndicator = props => {
|
|
|
315
649
|
}
|
|
316
650
|
return "text";
|
|
317
651
|
})();
|
|
318
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */jsx15(Text, {
|
|
319
653
|
sx: {
|
|
320
654
|
fontSize: "base",
|
|
321
655
|
color,
|
|
@@ -323,7 +657,7 @@ var DropdownIndicator = props => {
|
|
|
323
657
|
display: "flex",
|
|
324
658
|
alignItems: "center"
|
|
325
659
|
},
|
|
326
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */jsx15(Icon7, {
|
|
327
661
|
icon: "picker-down"
|
|
328
662
|
})
|
|
329
663
|
});
|
|
@@ -331,7 +665,7 @@ var DropdownIndicator = props => {
|
|
|
331
665
|
var IndicatorsContainer = ({
|
|
332
666
|
children
|
|
333
667
|
}) => {
|
|
334
|
-
return /* @__PURE__ */
|
|
668
|
+
return /* @__PURE__ */jsx15(Box, {
|
|
335
669
|
sx: {
|
|
336
670
|
marginLeft: "lg",
|
|
337
671
|
border: "none"
|
|
@@ -342,7 +676,7 @@ var IndicatorsContainer = ({
|
|
|
342
676
|
var Placeholder = ({
|
|
343
677
|
children
|
|
344
678
|
}) => {
|
|
345
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */jsx15(Text, {
|
|
346
680
|
sx: {
|
|
347
681
|
color: "onMuted",
|
|
348
682
|
alignSelf: "center"
|
|
@@ -361,10 +695,10 @@ var SelectContainer = ({
|
|
|
361
695
|
return (
|
|
362
696
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
363
697
|
/* @__PURE__ */
|
|
364
|
-
|
|
698
|
+
jsx15(Box, {
|
|
365
699
|
sx,
|
|
366
700
|
css: css2,
|
|
367
|
-
children: /* @__PURE__ */
|
|
701
|
+
children: /* @__PURE__ */jsx15(components.SelectContainer, {
|
|
368
702
|
...props,
|
|
369
703
|
children
|
|
370
704
|
})
|
|
@@ -394,28 +728,28 @@ var ValueContainer = ({
|
|
|
394
728
|
}
|
|
395
729
|
return leadingIcon || "search";
|
|
396
730
|
})();
|
|
397
|
-
return /* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */jsxs7(Flex, {
|
|
398
732
|
sx: {
|
|
399
733
|
gap: "lg",
|
|
400
734
|
flex: 1
|
|
401
735
|
},
|
|
402
|
-
children: [finalLeadingIcon && /* @__PURE__ */
|
|
736
|
+
children: [finalLeadingIcon && /* @__PURE__ */jsx15(Text, {
|
|
403
737
|
sx: {
|
|
404
738
|
alignSelf: "center",
|
|
405
739
|
pointerEvents: "none",
|
|
406
740
|
lineHeight: 0,
|
|
407
741
|
fontSize: "base"
|
|
408
742
|
},
|
|
409
|
-
children: /* @__PURE__ */
|
|
743
|
+
children: /* @__PURE__ */jsx15(Icon7, {
|
|
410
744
|
icon: finalLeadingIcon
|
|
411
745
|
})
|
|
412
|
-
}), /* @__PURE__ */
|
|
746
|
+
}), /* @__PURE__ */jsx15(Flex, {
|
|
413
747
|
sx: {
|
|
414
748
|
flex: 1,
|
|
415
749
|
alignItems: "center"
|
|
416
750
|
},
|
|
417
751
|
children
|
|
418
|
-
}), (trailingIcon || hasError) && /* @__PURE__ */
|
|
752
|
+
}), (trailingIcon || hasError) && /* @__PURE__ */jsx15(Text, {
|
|
419
753
|
className: hasError ? "error-icon" : "",
|
|
420
754
|
sx: {
|
|
421
755
|
alignSelf: "center",
|
|
@@ -424,13 +758,13 @@ var ValueContainer = ({
|
|
|
424
758
|
fontSize: "base",
|
|
425
759
|
color: trailingIconColor
|
|
426
760
|
},
|
|
427
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */jsx15(Icon7, {
|
|
428
762
|
icon: hasError ? "warning-alt" : trailingIcon
|
|
429
763
|
})
|
|
430
764
|
})]
|
|
431
765
|
});
|
|
432
766
|
};
|
|
433
|
-
var Select =
|
|
767
|
+
var Select = React12.forwardRef(({
|
|
434
768
|
...props
|
|
435
769
|
}, ref) => {
|
|
436
770
|
const value = props.options?.find(option => {
|
|
@@ -439,7 +773,7 @@ var Select = React4.forwardRef(({
|
|
|
439
773
|
}
|
|
440
774
|
return false;
|
|
441
775
|
});
|
|
442
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */jsx15(ReactSelect, {
|
|
443
777
|
ref,
|
|
444
778
|
components: {
|
|
445
779
|
Control,
|
|
@@ -468,435 +802,103 @@ var Select = React4.forwardRef(({
|
|
|
468
802
|
});
|
|
469
803
|
Select.displayName = "Select";
|
|
470
804
|
|
|
805
|
+
// src/components/Slider.tsx
|
|
806
|
+
import { Slider } from "theme-ui";
|
|
807
|
+
|
|
471
808
|
// src/components/Spinner.tsx
|
|
472
809
|
import { Spinner } from "theme-ui";
|
|
473
810
|
|
|
474
|
-
// src/components/
|
|
475
|
-
import
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
481
|
-
var IconButton = React5.forwardRef((props, ref) => {
|
|
482
|
-
return /* @__PURE__ */jsx8(IconButtonUi, {
|
|
483
|
-
type: "button",
|
|
811
|
+
// src/components/Stack.tsx
|
|
812
|
+
import * as React13 from "react";
|
|
813
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
814
|
+
var Stack = React13.forwardRef((props, ref) => {
|
|
815
|
+
return /* @__PURE__ */jsx16(Flex, {
|
|
816
|
+
ref,
|
|
484
817
|
...props,
|
|
485
|
-
|
|
818
|
+
sx: {
|
|
819
|
+
flexDirection: "column",
|
|
820
|
+
...props.sx
|
|
821
|
+
}
|
|
486
822
|
});
|
|
487
823
|
});
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
// src/components/Slider.tsx
|
|
491
|
-
import { Slider } from "theme-ui";
|
|
824
|
+
Stack.displayName = "Stack";
|
|
492
825
|
|
|
493
|
-
// src/components/
|
|
494
|
-
import * as
|
|
495
|
-
import {
|
|
496
|
-
import {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
826
|
+
// src/components/Textarea.tsx
|
|
827
|
+
import * as React14 from "react";
|
|
828
|
+
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
829
|
+
import { Textarea as TextareaUI } from "theme-ui";
|
|
830
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
831
|
+
var Textarea = React14.forwardRef(({
|
|
832
|
+
trailingIcon,
|
|
833
|
+
className,
|
|
834
|
+
sx,
|
|
835
|
+
...textareaProps
|
|
500
836
|
}, ref) => {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
})
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
setProgress(oldProgress => {
|
|
533
|
-
if (oldProgress === MAX_PROGRESS) {
|
|
534
|
-
return 0;
|
|
535
|
-
}
|
|
536
|
-
let diff = 0;
|
|
537
|
-
if (oldProgress > 0.97 * MAX_PROGRESS) {
|
|
538
|
-
diff -= 0.75 * MAX_PROGRESS;
|
|
539
|
-
} else if (oldProgress > 0.6 * MAX_PROGRESS) {
|
|
540
|
-
diff = Math.random() * (MAX_PROGRESS - oldProgress) * 0.1;
|
|
541
|
-
} else {
|
|
542
|
-
diff = Math.random() * (MAX_PROGRESS * 0.02);
|
|
543
|
-
}
|
|
544
|
-
return Math.min(oldProgress + diff, MAX_PROGRESS);
|
|
545
|
-
});
|
|
546
|
-
}, 100);
|
|
547
|
-
return () => {
|
|
548
|
-
clearInterval(timer);
|
|
549
|
-
};
|
|
550
|
-
}, []);
|
|
551
|
-
return /* @__PURE__ */jsx10(Progress, {
|
|
552
|
-
max: MAX_PROGRESS,
|
|
553
|
-
value: progress,
|
|
554
|
-
role: "progressbar"
|
|
555
|
-
});
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
// src/components/Textarea.tsx
|
|
559
|
-
import * as React8 from "react";
|
|
560
|
-
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
561
|
-
import { Textarea as TextareaUI } from "theme-ui";
|
|
562
|
-
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
563
|
-
var Textarea = React8.forwardRef(({
|
|
564
|
-
trailingIcon,
|
|
565
|
-
className,
|
|
566
|
-
sx,
|
|
567
|
-
...textareaProps
|
|
568
|
-
}, ref) => {
|
|
569
|
-
return /* @__PURE__ */jsxs7(Flex, {
|
|
570
|
-
className,
|
|
571
|
-
sx: {
|
|
572
|
-
...sx,
|
|
573
|
-
position: "relative",
|
|
574
|
-
padding: 0,
|
|
575
|
-
border: "none"
|
|
576
|
-
},
|
|
577
|
-
children: [/* @__PURE__ */jsx11(TextareaUI, {
|
|
578
|
-
ref,
|
|
579
|
-
sx: {
|
|
580
|
-
fontFamily: "body",
|
|
581
|
-
paddingY: "lg",
|
|
582
|
-
paddingX: "xl",
|
|
583
|
-
...sx,
|
|
584
|
-
paddingRight: trailingIcon ? "3xl" : void 0,
|
|
585
|
-
margin: 0
|
|
586
|
-
},
|
|
587
|
-
className,
|
|
588
|
-
...textareaProps
|
|
589
|
-
}), trailingIcon && /* @__PURE__ */jsx11(Text, {
|
|
590
|
-
sx: {
|
|
591
|
-
position: "absolute",
|
|
592
|
-
right: "1.25rem",
|
|
593
|
-
top: "0.75rem"
|
|
594
|
-
},
|
|
595
|
-
children: /* @__PURE__ */jsx11(Icon6, {
|
|
596
|
-
inline: true,
|
|
597
|
-
icon: trailingIcon
|
|
598
|
-
})
|
|
599
|
-
})]
|
|
837
|
+
return /* @__PURE__ */jsxs8(Flex, {
|
|
838
|
+
className,
|
|
839
|
+
sx: {
|
|
840
|
+
...sx,
|
|
841
|
+
position: "relative",
|
|
842
|
+
padding: 0,
|
|
843
|
+
border: "none"
|
|
844
|
+
},
|
|
845
|
+
children: [/* @__PURE__ */jsx17(TextareaUI, {
|
|
846
|
+
ref,
|
|
847
|
+
sx: {
|
|
848
|
+
fontFamily: "body",
|
|
849
|
+
paddingY: "lg",
|
|
850
|
+
paddingX: "xl",
|
|
851
|
+
...sx,
|
|
852
|
+
paddingRight: trailingIcon ? "3xl" : void 0,
|
|
853
|
+
margin: 0
|
|
854
|
+
},
|
|
855
|
+
className,
|
|
856
|
+
...textareaProps
|
|
857
|
+
}), trailingIcon && /* @__PURE__ */jsx17(Text, {
|
|
858
|
+
sx: {
|
|
859
|
+
position: "absolute",
|
|
860
|
+
right: "1.25rem",
|
|
861
|
+
top: "0.75rem"
|
|
862
|
+
},
|
|
863
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
864
|
+
inline: true,
|
|
865
|
+
icon: trailingIcon
|
|
866
|
+
})
|
|
867
|
+
})]
|
|
600
868
|
});
|
|
601
869
|
});
|
|
602
870
|
Textarea.displayName = "Textarea";
|
|
603
871
|
|
|
604
|
-
// src/
|
|
605
|
-
import
|
|
606
|
-
import {
|
|
607
|
-
import {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
});
|
|
614
|
-
Container.displayName = "Container";
|
|
615
|
-
|
|
616
|
-
// src/components/HelpText.tsx
|
|
617
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
618
|
-
var HelpText = ({
|
|
619
|
-
sx,
|
|
620
|
-
disabled,
|
|
621
|
-
negative,
|
|
622
|
-
...props
|
|
872
|
+
// src/theme/ThemeProvider.tsx
|
|
873
|
+
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
874
|
+
import { Global, css } from "@emotion/react";
|
|
875
|
+
import { ThemeUIProvider } from "theme-ui";
|
|
876
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
877
|
+
var ThemeProvider = ({
|
|
878
|
+
children,
|
|
879
|
+
theme = BruttalTheme,
|
|
880
|
+
fonts = BruttalFonts
|
|
623
881
|
}) => {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
});
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
// src/components/CloseButton.tsx
|
|
639
|
-
import * as React10 from "react";
|
|
640
|
-
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
641
|
-
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
642
|
-
var CloseButton = React10.forwardRef(({
|
|
643
|
-
label,
|
|
644
|
-
sx,
|
|
645
|
-
onlyText,
|
|
646
|
-
...props
|
|
647
|
-
}, ref) => {
|
|
648
|
-
if (onlyText && !label) {
|
|
649
|
-
return null;
|
|
650
|
-
}
|
|
651
|
-
return /* @__PURE__ */jsxs8(Button, {
|
|
652
|
-
variant: "buttons.closeButton",
|
|
653
|
-
type: "button",
|
|
654
|
-
"aria-label": label,
|
|
655
|
-
sx: {
|
|
656
|
-
fontFamily: "caption",
|
|
657
|
-
fontSize: "xs",
|
|
658
|
-
display: "inline-flex",
|
|
659
|
-
alignItems: "center",
|
|
660
|
-
cursor: "pointer",
|
|
661
|
-
lineHeight: "normal",
|
|
662
|
-
gap: "sm",
|
|
663
|
-
padding: "sm",
|
|
664
|
-
width: "fit-content",
|
|
665
|
-
transition: "all 0.2s",
|
|
666
|
-
"& > iconify-icon": {
|
|
667
|
-
fontSize: "base"
|
|
668
|
-
},
|
|
669
|
-
...sx
|
|
670
|
-
},
|
|
671
|
-
...props,
|
|
672
|
-
ref,
|
|
673
|
-
children: [label, !onlyText && /* @__PURE__ */jsx14(Icon7, {
|
|
674
|
-
icon: "close"
|
|
675
|
-
})]
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
CloseButton.displayName = "CloseButton";
|
|
679
|
-
|
|
680
|
-
// src/components/InputNumber.tsx
|
|
681
|
-
import * as React11 from "react";
|
|
682
|
-
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
683
|
-
import { Input as Input2 } from "theme-ui";
|
|
684
|
-
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
685
|
-
var InputNumber = React11.forwardRef(({
|
|
686
|
-
sx,
|
|
687
|
-
value,
|
|
688
|
-
infoIcon,
|
|
689
|
-
onChange,
|
|
690
|
-
onClickInfoIcon,
|
|
691
|
-
...inputProps
|
|
692
|
-
}, ref) => {
|
|
693
|
-
const sxProps = React11.useMemo(() => {
|
|
694
|
-
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
695
|
-
if (inputProps["aria-invalid"] === "true") {
|
|
696
|
-
return {
|
|
697
|
-
width: `calc(139px + ${size > 1 ? size * 10 : 0}px)`,
|
|
698
|
-
textAlign: "left",
|
|
699
|
-
"&[type=number]::-webkit-inner-spin-button, &[type=number]::-webkit-outer-spin-button": {
|
|
700
|
-
WebkitAppearance: "none",
|
|
701
|
-
margin: 0
|
|
702
|
-
},
|
|
703
|
-
...sx,
|
|
704
|
-
paddingLeft: "3xl",
|
|
705
|
-
paddingRight: "2xl",
|
|
706
|
-
margin: 0
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
return {
|
|
710
|
-
width: `calc(108px + ${size > 1 ? size * 10 : 0}px)`,
|
|
711
|
-
textAlign: "center",
|
|
712
|
-
"&[type=number]::-webkit-inner-spin-button, &[type=number]::-webkit-outer-spin-button": {
|
|
713
|
-
WebkitAppearance: "none",
|
|
714
|
-
margin: 0
|
|
715
|
-
},
|
|
716
|
-
fontFamily: "body",
|
|
717
|
-
paddingY: "lg",
|
|
718
|
-
paddingX: "xl",
|
|
719
|
-
...sx,
|
|
720
|
-
paddingLeft: "2xl",
|
|
721
|
-
paddingRight: "2xl",
|
|
722
|
-
margin: 0
|
|
723
|
-
};
|
|
724
|
-
}, [inputProps, value, sx]);
|
|
725
|
-
const handleChangeUp = () => {
|
|
726
|
-
if (inputProps.disabled) {
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
if (typeof value !== "number") {
|
|
730
|
-
onChange(-1);
|
|
731
|
-
return;
|
|
732
|
-
}
|
|
733
|
-
onChange(value - 1);
|
|
734
|
-
};
|
|
735
|
-
const handleChangeDown = () => {
|
|
736
|
-
if (inputProps.disabled) {
|
|
737
|
-
return;
|
|
738
|
-
}
|
|
739
|
-
if (typeof value !== "number") {
|
|
740
|
-
onChange(1);
|
|
741
|
-
return;
|
|
742
|
-
}
|
|
743
|
-
onChange(value + 1);
|
|
744
|
-
};
|
|
745
|
-
return /* @__PURE__ */jsxs9(Flex, {
|
|
746
|
-
sx: {
|
|
747
|
-
width: "fit-content",
|
|
748
|
-
...sx,
|
|
749
|
-
position: "relative",
|
|
750
|
-
padding: 0,
|
|
751
|
-
border: "none"
|
|
752
|
-
},
|
|
753
|
-
ref,
|
|
754
|
-
"aria-invalid": inputProps["aria-invalid"],
|
|
755
|
-
children: [/* @__PURE__ */jsx15(Input2, {
|
|
756
|
-
ref,
|
|
757
|
-
variant: "forms.inputNumber",
|
|
758
|
-
sx: sxProps,
|
|
759
|
-
type: "number",
|
|
760
|
-
onChange: e => {
|
|
761
|
-
onChange(Number(e.target.value));
|
|
762
|
-
},
|
|
763
|
-
value,
|
|
764
|
-
...inputProps
|
|
765
|
-
}), /* @__PURE__ */jsx15(Text, {
|
|
766
|
-
sx: {
|
|
767
|
-
position: "absolute",
|
|
768
|
-
alignSelf: "center",
|
|
769
|
-
left: "1rem",
|
|
770
|
-
zIndex: 1,
|
|
771
|
-
cursor: "pointer"
|
|
772
|
-
},
|
|
773
|
-
onClick: handleChangeUp,
|
|
774
|
-
children: /* @__PURE__ */jsx15(Icon8, {
|
|
775
|
-
icon: "picker-down"
|
|
776
|
-
})
|
|
777
|
-
}), infoIcon && /* @__PURE__ */jsx15(Text, {
|
|
778
|
-
sx: {
|
|
779
|
-
position: "absolute",
|
|
780
|
-
alignSelf: "center",
|
|
781
|
-
right: "2.5rem",
|
|
782
|
-
zIndex: 1,
|
|
783
|
-
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
784
|
-
},
|
|
785
|
-
onClick: onClickInfoIcon,
|
|
786
|
-
children: /* @__PURE__ */jsx15(Icon8, {
|
|
787
|
-
icon: "info"
|
|
788
|
-
})
|
|
789
|
-
}), /* @__PURE__ */jsx15(Text, {
|
|
790
|
-
sx: {
|
|
791
|
-
position: "absolute",
|
|
792
|
-
alignSelf: "center",
|
|
793
|
-
right: "1rem",
|
|
794
|
-
zIndex: 1,
|
|
795
|
-
cursor: "pointer"
|
|
796
|
-
},
|
|
797
|
-
onClick: handleChangeDown,
|
|
798
|
-
children: /* @__PURE__ */jsx15(Icon8, {
|
|
799
|
-
icon: "picker-up"
|
|
800
|
-
})
|
|
801
|
-
})]
|
|
802
|
-
});
|
|
803
|
-
});
|
|
804
|
-
InputNumber.displayName = "InputNumber";
|
|
805
|
-
|
|
806
|
-
// src/components/Stack.tsx
|
|
807
|
-
import * as React12 from "react";
|
|
808
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
809
|
-
var Stack = React12.forwardRef((props, ref) => {
|
|
810
|
-
return /* @__PURE__ */jsx16(Flex, {
|
|
811
|
-
ref,
|
|
812
|
-
...props,
|
|
813
|
-
sx: {
|
|
814
|
-
flexDirection: "column",
|
|
815
|
-
...props.sx
|
|
816
|
-
}
|
|
882
|
+
return /* @__PURE__ */jsx18(Fragment, {
|
|
883
|
+
children: /* @__PURE__ */jsxs9(ThemeUIProvider, {
|
|
884
|
+
theme,
|
|
885
|
+
children: [/* @__PURE__ */jsx18(Global, {
|
|
886
|
+
styles: css`
|
|
887
|
+
${fonts.map(url => {
|
|
888
|
+
return `@import url('${url}');`;
|
|
889
|
+
}).join("\n")}
|
|
890
|
+
`
|
|
891
|
+
}), children]
|
|
892
|
+
})
|
|
817
893
|
});
|
|
818
|
-
});
|
|
819
|
-
Stack.displayName = "Stack";
|
|
820
|
-
|
|
821
|
-
// src/components/Paragraph.tsx
|
|
822
|
-
import { Paragraph } from "theme-ui";
|
|
823
|
-
|
|
824
|
-
// src/components/InputPassword/InputPassword.tsx
|
|
825
|
-
import * as React14 from "react";
|
|
826
|
-
|
|
827
|
-
// src/components/InputPassword/useHidePassInput.ts
|
|
828
|
-
import * as React13 from "react";
|
|
829
|
-
var useHidePassInput = (defaultValue = true) => {
|
|
830
|
-
const [hidePass, setHidePass] = React13.useState(Boolean(defaultValue));
|
|
831
|
-
const {
|
|
832
|
-
icon,
|
|
833
|
-
inputType
|
|
834
|
-
} = React13.useMemo(() => {
|
|
835
|
-
return {
|
|
836
|
-
icon: hidePass ? "view-off" : "view-on",
|
|
837
|
-
inputType: hidePass ? "password" : "text"
|
|
838
|
-
};
|
|
839
|
-
}, [hidePass]);
|
|
840
|
-
const handleClick = () => {
|
|
841
|
-
setHidePass(prev => {
|
|
842
|
-
return !prev;
|
|
843
|
-
});
|
|
844
|
-
};
|
|
845
|
-
return {
|
|
846
|
-
handleClick,
|
|
847
|
-
icon,
|
|
848
|
-
inputType
|
|
849
|
-
};
|
|
850
894
|
};
|
|
851
895
|
|
|
852
|
-
// src/
|
|
853
|
-
import {
|
|
854
|
-
var
|
|
855
|
-
showPasswordByDefault,
|
|
856
|
-
...inputPasswordProps
|
|
857
|
-
}, ref) => {
|
|
858
|
-
const {
|
|
859
|
-
handleClick,
|
|
860
|
-
icon,
|
|
861
|
-
inputType
|
|
862
|
-
} = useHidePassInput(!showPasswordByDefault);
|
|
863
|
-
return /* @__PURE__ */jsx17(Input, {
|
|
864
|
-
ref,
|
|
865
|
-
...inputPasswordProps,
|
|
866
|
-
trailingIcon: icon,
|
|
867
|
-
onTrailingIconClick: handleClick,
|
|
868
|
-
type: inputType
|
|
869
|
-
});
|
|
870
|
-
});
|
|
871
|
-
InputPassword.displayName = "InputPassword";
|
|
896
|
+
// src/theme/useTheme.ts
|
|
897
|
+
import { useThemeUI } from "theme-ui";
|
|
898
|
+
var useTheme = useThemeUI;
|
|
872
899
|
|
|
873
|
-
// src/
|
|
874
|
-
import {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
variant = "default",
|
|
878
|
-
sx,
|
|
879
|
-
...props
|
|
880
|
-
}) => {
|
|
881
|
-
return /* @__PURE__ */jsx18(Button, {
|
|
882
|
-
variant: `buttons.actionButton.${variant}`,
|
|
883
|
-
leftIcon: icon,
|
|
884
|
-
sx: {
|
|
885
|
-
padding: "sm",
|
|
886
|
-
gap: "xs",
|
|
887
|
-
fontFamily: "caption",
|
|
888
|
-
borderRadius: "action",
|
|
889
|
-
outlineColor: "transparent",
|
|
890
|
-
":disabled": props.disabled ? {
|
|
891
|
-
backgroundColor: "muted",
|
|
892
|
-
color: "onMuted",
|
|
893
|
-
cursor: "not-allowed",
|
|
894
|
-
border: "muted",
|
|
895
|
-
borderColor: "onMuted"
|
|
896
|
-
} : void 0,
|
|
897
|
-
...sx
|
|
898
|
-
},
|
|
899
|
-
...props
|
|
900
|
-
});
|
|
901
|
-
};
|
|
900
|
+
// src/index.ts
|
|
901
|
+
import { keyframes } from "@emotion/react";
|
|
902
|
+
import { useBreakpointIndex, useResponsiveValue } from "@theme-ui/match-media";
|
|
903
|
+
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
902
904
|
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, Select, Slider, Spinner, Stack, Text, Textarea, ThemeProvider, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|