@ttoss/ui 2.0.5 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -20
- package/dist/esm/index.js +92 -101
- package/dist/index.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +105 -118
- package/package.json +5 -5
- package/src/components/Badge.tsx +1 -2
- package/src/components/Button.tsx +1 -1
- package/src/components/CloseButton.tsx +2 -2
- package/src/components/Input.tsx +2 -1
- package/src/components/InputNumber.tsx +2 -1
- package/src/components/Label.tsx +2 -1
- package/src/components/Select.tsx +4 -1
- package/src/components/Textarea.tsx +2 -1
- package/src/index.ts +0 -2
- package/src/components/Icon.tsx +0 -19
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```shell
|
|
8
|
-
pnpm add @ttoss/ui @emotion/react
|
|
8
|
+
pnpm add @ttoss/ui @ttoss/react-icons @emotion/react
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quickstart
|
|
@@ -93,25 +93,6 @@ export const Provider = (props) => {
|
|
|
93
93
|
};
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
### Icons
|
|
97
|
-
|
|
98
|
-
Our icon module is powered by [Iconify](https://iconify.design/), as this have an awesome open source icon collection.
|
|
99
|
-
To use it, just import `Icon` and start using. The styling is maded the same as Iconify and all his icons are available for using.
|
|
100
|
-
|
|
101
|
-
Please refer to our storybook to see some examples of use.
|
|
102
|
-
|
|
103
|
-
Please, refer to [Iconify docs](https://docs.iconify.design/icon-components/react/) for the parameters and more control over icons
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import { Icon } from '@ttoss/ui';
|
|
107
|
-
|
|
108
|
-
export const IconExample = () => {
|
|
109
|
-
return (
|
|
110
|
-
<Icon icon="mdi-light:alarm-panel" style={{ color: 'red' }} width={100} />
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
```
|
|
114
|
-
|
|
115
96
|
## Misc
|
|
116
97
|
|
|
117
98
|
### keyframes
|
package/dist/esm/index.js
CHANGED
|
@@ -29,31 +29,14 @@ var ThemeProvider = ({
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
// src/index.ts
|
|
33
|
-
import { addIcon } from "@ttoss/theme";
|
|
34
|
-
|
|
35
32
|
// src/theme/useTheme.ts
|
|
36
33
|
import { useThemeUI } from "theme-ui";
|
|
37
34
|
var useTheme = useThemeUI;
|
|
38
35
|
|
|
39
36
|
// src/components/Badge.tsx
|
|
40
37
|
import { Badge as BadgeUi } from "theme-ui";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import * as React from "react";
|
|
44
|
-
import { Icon as IconifyIcon } from "@iconify-icon/react";
|
|
45
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
46
|
-
var Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
47
|
-
return /* @__PURE__ */jsx2(IconifyIcon, {
|
|
48
|
-
ref,
|
|
49
|
-
"data-testid": "iconify-icon",
|
|
50
|
-
...props
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
Icon.displayName = "Icon";
|
|
54
|
-
|
|
55
|
-
// src/components/Badge.tsx
|
|
56
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
38
|
+
import { Icon } from "@ttoss/react-icons";
|
|
39
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
57
40
|
var Badge = ({
|
|
58
41
|
icon,
|
|
59
42
|
children,
|
|
@@ -75,7 +58,7 @@ var Badge = ({
|
|
|
75
58
|
...sx
|
|
76
59
|
},
|
|
77
60
|
...props,
|
|
78
|
-
children: [icon && /* @__PURE__ */
|
|
61
|
+
children: [icon && /* @__PURE__ */jsx2(Icon, {
|
|
79
62
|
inline: true,
|
|
80
63
|
icon
|
|
81
64
|
}), children]
|
|
@@ -86,10 +69,11 @@ var Badge = ({
|
|
|
86
69
|
import { Box } from "theme-ui";
|
|
87
70
|
|
|
88
71
|
// src/components/Button.tsx
|
|
89
|
-
import * as
|
|
72
|
+
import * as React from "react";
|
|
90
73
|
import { Button as ButtonUi } from "theme-ui";
|
|
91
|
-
import {
|
|
92
|
-
|
|
74
|
+
import { Icon as Icon2 } from "@ttoss/react-icons";
|
|
75
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
76
|
+
var Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
93
77
|
const {
|
|
94
78
|
children,
|
|
95
79
|
leftIcon,
|
|
@@ -111,13 +95,13 @@ var Button = /*#__PURE__*/React2.forwardRef((props, ref) => {
|
|
|
111
95
|
gap: "lg",
|
|
112
96
|
...restProps.sx
|
|
113
97
|
},
|
|
114
|
-
children: [loading && /* @__PURE__ */
|
|
98
|
+
children: [loading && /* @__PURE__ */jsx3(Icon2, {
|
|
115
99
|
inline: true,
|
|
116
100
|
icon: "three-dots-loading"
|
|
117
|
-
}), !loading && leftIcon && /* @__PURE__ */
|
|
101
|
+
}), !loading && leftIcon && /* @__PURE__ */jsx3(Icon2, {
|
|
118
102
|
inline: true,
|
|
119
103
|
icon: leftIcon
|
|
120
|
-
}), children, rightIcon && /* @__PURE__ */
|
|
104
|
+
}), children, rightIcon && /* @__PURE__ */jsx3(Icon2, {
|
|
121
105
|
inline: true,
|
|
122
106
|
icon: rightIcon
|
|
123
107
|
})]
|
|
@@ -144,10 +128,11 @@ import { Heading } from "theme-ui";
|
|
|
144
128
|
import { Image } from "theme-ui";
|
|
145
129
|
|
|
146
130
|
// src/components/Input.tsx
|
|
147
|
-
import * as
|
|
131
|
+
import * as React2 from "react";
|
|
132
|
+
import { Icon as Icon3 } from "@ttoss/react-icons";
|
|
148
133
|
import { Input as InputUI } from "theme-ui";
|
|
149
|
-
import { jsx as
|
|
150
|
-
var Input = /*#__PURE__*/
|
|
134
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
135
|
+
var Input = /*#__PURE__*/React2.forwardRef(({
|
|
151
136
|
leadingIcon,
|
|
152
137
|
trailingIcon: trailingIconProp,
|
|
153
138
|
onLeadingIconClick,
|
|
@@ -165,7 +150,7 @@ var Input = /*#__PURE__*/React3.forwardRef(({
|
|
|
165
150
|
padding: 0,
|
|
166
151
|
border: "none"
|
|
167
152
|
},
|
|
168
|
-
children: [leadingIcon && /* @__PURE__ */
|
|
153
|
+
children: [leadingIcon && /* @__PURE__ */jsx4(Text, {
|
|
169
154
|
sx: {
|
|
170
155
|
position: "absolute",
|
|
171
156
|
alignSelf: "center",
|
|
@@ -174,11 +159,11 @@ var Input = /*#__PURE__*/React3.forwardRef(({
|
|
|
174
159
|
},
|
|
175
160
|
onClick: onLeadingIconClick,
|
|
176
161
|
variant: "leading-icon",
|
|
177
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */jsx4(Icon3, {
|
|
178
163
|
inline: true,
|
|
179
164
|
icon: leadingIcon
|
|
180
165
|
})
|
|
181
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */jsx4(InputUI, {
|
|
182
167
|
ref,
|
|
183
168
|
sx: {
|
|
184
169
|
fontFamily: "body",
|
|
@@ -191,7 +176,7 @@ var Input = /*#__PURE__*/React3.forwardRef(({
|
|
|
191
176
|
},
|
|
192
177
|
className,
|
|
193
178
|
...inputProps
|
|
194
|
-
}), trailingIcon && /* @__PURE__ */
|
|
179
|
+
}), trailingIcon && /* @__PURE__ */jsx4(Text, {
|
|
195
180
|
sx: {
|
|
196
181
|
position: "absolute",
|
|
197
182
|
right: "1rem",
|
|
@@ -200,7 +185,7 @@ var Input = /*#__PURE__*/React3.forwardRef(({
|
|
|
200
185
|
},
|
|
201
186
|
variant: "trailing-icon",
|
|
202
187
|
onClick: onTrailingIconClick,
|
|
203
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */jsx4(Icon3, {
|
|
204
189
|
inline: true,
|
|
205
190
|
icon: trailingIcon
|
|
206
191
|
})
|
|
@@ -210,8 +195,9 @@ var Input = /*#__PURE__*/React3.forwardRef(({
|
|
|
210
195
|
Input.displayName = "Input";
|
|
211
196
|
|
|
212
197
|
// src/components/Label.tsx
|
|
198
|
+
import { Icon as Icon4 } from "@ttoss/react-icons";
|
|
213
199
|
import { Label as LabelUi } from "theme-ui";
|
|
214
|
-
import { jsx as
|
|
200
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
215
201
|
var TOOLTIP_LABEL = "tooltip";
|
|
216
202
|
var Label = ({
|
|
217
203
|
children,
|
|
@@ -229,14 +215,14 @@ var Label = ({
|
|
|
229
215
|
...sx
|
|
230
216
|
},
|
|
231
217
|
...props,
|
|
232
|
-
children: [children, tooltip && /* @__PURE__ */
|
|
218
|
+
children: [children, tooltip && /* @__PURE__ */jsx5(Text, {
|
|
233
219
|
sx: {
|
|
234
220
|
color: "currentcolor",
|
|
235
221
|
cursor: onTooltipClick ? "pointer" : void 0
|
|
236
222
|
},
|
|
237
223
|
onClick: onTooltipClick,
|
|
238
224
|
"aria-label": TOOLTIP_LABEL,
|
|
239
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */jsx5(Icon4, {
|
|
240
226
|
inline: true,
|
|
241
227
|
icon: "info"
|
|
242
228
|
})
|
|
@@ -245,15 +231,15 @@ var Label = ({
|
|
|
245
231
|
};
|
|
246
232
|
|
|
247
233
|
// src/components/Link.tsx
|
|
248
|
-
import * as
|
|
234
|
+
import * as React3 from "react";
|
|
249
235
|
import { Link as LinkUi } from "theme-ui";
|
|
250
|
-
import { jsx as
|
|
251
|
-
var Link = /*#__PURE__*/
|
|
236
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
237
|
+
var Link = /*#__PURE__*/React3.forwardRef(({
|
|
252
238
|
quiet,
|
|
253
239
|
className,
|
|
254
240
|
...props
|
|
255
241
|
}, ref) => {
|
|
256
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */jsx6(LinkUi, {
|
|
257
243
|
className: `${quiet ? "quiet" : ""} ${className ?? ""}`,
|
|
258
244
|
...props,
|
|
259
245
|
ref
|
|
@@ -268,18 +254,20 @@ import { Progress } from "theme-ui";
|
|
|
268
254
|
import { Text } from "theme-ui";
|
|
269
255
|
|
|
270
256
|
// src/components/Select.tsx
|
|
271
|
-
import * as
|
|
257
|
+
import * as React4 from "react";
|
|
258
|
+
import { Icon as Icon5 } from "@ttoss/react-icons";
|
|
272
259
|
import { Select as SelectUi } from "theme-ui";
|
|
273
|
-
import { Fragment as Fragment2, jsx as
|
|
274
|
-
var Select = /*#__PURE__*/
|
|
260
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
261
|
+
var Select = /*#__PURE__*/React4.forwardRef(({
|
|
275
262
|
arrow,
|
|
276
263
|
sx,
|
|
277
264
|
...props
|
|
278
265
|
}, ref) => {
|
|
279
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */jsx7(SelectUi, {
|
|
280
267
|
arrow: /* @__PURE__ */jsxs6(Fragment2, {
|
|
281
|
-
children: [arrow ?? /* @__PURE__ */
|
|
268
|
+
children: [arrow ?? /* @__PURE__ */jsx7(Text, {
|
|
282
269
|
sx: {
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
283
271
|
marginLeft: ({
|
|
284
272
|
space
|
|
285
273
|
}) => {
|
|
@@ -290,12 +278,13 @@ var Select = /*#__PURE__*/React5.forwardRef(({
|
|
|
290
278
|
lineHeight: 0,
|
|
291
279
|
fontSize: "base"
|
|
292
280
|
},
|
|
293
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */jsx7(Icon5, {
|
|
294
282
|
icon: "picker-down"
|
|
295
283
|
})
|
|
296
|
-
}), props["aria-invalid"] === "true" && /* @__PURE__ */
|
|
284
|
+
}), props["aria-invalid"] === "true" && /* @__PURE__ */jsx7(Text, {
|
|
297
285
|
className: "error-icon",
|
|
298
286
|
sx: {
|
|
287
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
299
288
|
marginLeft: ({
|
|
300
289
|
space
|
|
301
290
|
}) => {
|
|
@@ -306,7 +295,7 @@ var Select = /*#__PURE__*/React5.forwardRef(({
|
|
|
306
295
|
lineHeight: 0,
|
|
307
296
|
fontSize: "base"
|
|
308
297
|
},
|
|
309
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */jsx7(Icon5, {
|
|
310
299
|
icon: "warning-alt"
|
|
311
300
|
})
|
|
312
301
|
})]
|
|
@@ -331,11 +320,11 @@ import { Spinner } from "theme-ui";
|
|
|
331
320
|
import { Radio } from "theme-ui";
|
|
332
321
|
|
|
333
322
|
// src/components/IconButton.tsx
|
|
334
|
-
import * as
|
|
323
|
+
import * as React5 from "react";
|
|
335
324
|
import { IconButton as IconButtonUi } from "theme-ui";
|
|
336
|
-
import { jsx as
|
|
337
|
-
var IconButton = /*#__PURE__*/
|
|
338
|
-
return /* @__PURE__ */
|
|
325
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
326
|
+
var IconButton = /*#__PURE__*/React5.forwardRef((props, ref) => {
|
|
327
|
+
return /* @__PURE__ */jsx8(IconButtonUi, {
|
|
339
328
|
type: "button",
|
|
340
329
|
...props,
|
|
341
330
|
ref
|
|
@@ -350,12 +339,12 @@ import { Slider } from "theme-ui";
|
|
|
350
339
|
import { Checkbox } from "theme-ui";
|
|
351
340
|
|
|
352
341
|
// src/components/InfiniteLinearProgress.tsx
|
|
353
|
-
import * as
|
|
354
|
-
import { jsx as
|
|
342
|
+
import * as React6 from "react";
|
|
343
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
355
344
|
var MAX_PROGRESS = 100;
|
|
356
345
|
var InfiniteLinearProgress = () => {
|
|
357
|
-
const [progress, setProgress] =
|
|
358
|
-
|
|
346
|
+
const [progress, setProgress] = React6.useState(0);
|
|
347
|
+
React6.useEffect(() => {
|
|
359
348
|
const timer = setInterval(() => {
|
|
360
349
|
setProgress(oldProgress => {
|
|
361
350
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -376,7 +365,7 @@ var InfiniteLinearProgress = () => {
|
|
|
376
365
|
clearInterval(timer);
|
|
377
366
|
};
|
|
378
367
|
}, []);
|
|
379
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */jsx9(Progress, {
|
|
380
369
|
max: MAX_PROGRESS,
|
|
381
370
|
value: progress,
|
|
382
371
|
role: "progressbar"
|
|
@@ -384,10 +373,11 @@ var InfiniteLinearProgress = () => {
|
|
|
384
373
|
};
|
|
385
374
|
|
|
386
375
|
// src/components/Textarea.tsx
|
|
387
|
-
import * as
|
|
376
|
+
import * as React7 from "react";
|
|
377
|
+
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
388
378
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
389
|
-
import { jsx as
|
|
390
|
-
var Textarea = /*#__PURE__*/
|
|
379
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
380
|
+
var Textarea = /*#__PURE__*/React7.forwardRef(({
|
|
391
381
|
trailingIcon,
|
|
392
382
|
className,
|
|
393
383
|
sx,
|
|
@@ -401,7 +391,7 @@ var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
|
401
391
|
padding: 0,
|
|
402
392
|
border: "none"
|
|
403
393
|
},
|
|
404
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */jsx10(TextareaUI, {
|
|
405
395
|
ref,
|
|
406
396
|
sx: {
|
|
407
397
|
fontFamily: "body",
|
|
@@ -413,13 +403,13 @@ var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
|
413
403
|
},
|
|
414
404
|
className,
|
|
415
405
|
...textareaProps
|
|
416
|
-
}), trailingIcon && /* @__PURE__ */
|
|
406
|
+
}), trailingIcon && /* @__PURE__ */jsx10(Text, {
|
|
417
407
|
sx: {
|
|
418
408
|
position: "absolute",
|
|
419
409
|
right: "1.25rem",
|
|
420
410
|
top: "0.75rem"
|
|
421
411
|
},
|
|
422
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */jsx10(Icon6, {
|
|
423
413
|
inline: true,
|
|
424
414
|
icon: trailingIcon
|
|
425
415
|
})
|
|
@@ -429,11 +419,11 @@ var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
|
429
419
|
Textarea.displayName = "Textarea";
|
|
430
420
|
|
|
431
421
|
// src/components/Container.tsx
|
|
432
|
-
import * as
|
|
422
|
+
import * as React8 from "react";
|
|
433
423
|
import { Container as ContainerUi } from "theme-ui";
|
|
434
|
-
import { jsx as
|
|
435
|
-
var Container = /*#__PURE__*/
|
|
436
|
-
return /* @__PURE__ */
|
|
424
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
425
|
+
var Container = /*#__PURE__*/React8.forwardRef((props, ref) => {
|
|
426
|
+
return /* @__PURE__ */jsx11(ContainerUi, {
|
|
437
427
|
ref,
|
|
438
428
|
...props
|
|
439
429
|
});
|
|
@@ -441,7 +431,7 @@ var Container = /*#__PURE__*/React9.forwardRef((props, ref) => {
|
|
|
441
431
|
Container.displayName = "Container";
|
|
442
432
|
|
|
443
433
|
// src/components/HelpText.tsx
|
|
444
|
-
import { jsx as
|
|
434
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
445
435
|
var HelpText = ({
|
|
446
436
|
sx,
|
|
447
437
|
disabled,
|
|
@@ -449,7 +439,7 @@ var HelpText = ({
|
|
|
449
439
|
...props
|
|
450
440
|
}) => {
|
|
451
441
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
452
|
-
return /* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */jsx12(Text, {
|
|
453
443
|
variant,
|
|
454
444
|
sx: {
|
|
455
445
|
fontSize: "sm",
|
|
@@ -463,10 +453,10 @@ var HelpText = ({
|
|
|
463
453
|
};
|
|
464
454
|
|
|
465
455
|
// src/components/CloseButton.tsx
|
|
466
|
-
import * as
|
|
467
|
-
import {
|
|
468
|
-
import { jsx as
|
|
469
|
-
var CloseButton = /*#__PURE__*/
|
|
456
|
+
import * as React9 from "react";
|
|
457
|
+
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
458
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
459
|
+
var CloseButton = /*#__PURE__*/React9.forwardRef(({
|
|
470
460
|
label,
|
|
471
461
|
sx,
|
|
472
462
|
onlyText,
|
|
@@ -475,7 +465,7 @@ var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
|
475
465
|
if (onlyText && !label) {
|
|
476
466
|
return null;
|
|
477
467
|
}
|
|
478
|
-
return /* @__PURE__ */jsxs8(
|
|
468
|
+
return /* @__PURE__ */jsxs8(Button, {
|
|
479
469
|
variant: "buttons.closeButton",
|
|
480
470
|
type: "button",
|
|
481
471
|
"aria-label": label,
|
|
@@ -497,7 +487,7 @@ var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
|
497
487
|
},
|
|
498
488
|
...props,
|
|
499
489
|
ref,
|
|
500
|
-
children: [label, !onlyText && /* @__PURE__ */
|
|
490
|
+
children: [label, !onlyText && /* @__PURE__ */jsx13(Icon7, {
|
|
501
491
|
icon: "close"
|
|
502
492
|
})]
|
|
503
493
|
});
|
|
@@ -505,10 +495,11 @@ var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
|
505
495
|
CloseButton.displayName = "CloseButton";
|
|
506
496
|
|
|
507
497
|
// src/components/InputNumber.tsx
|
|
508
|
-
import * as
|
|
498
|
+
import * as React10 from "react";
|
|
499
|
+
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
509
500
|
import { Input as Input2 } from "theme-ui";
|
|
510
|
-
import { jsx as
|
|
511
|
-
var InputNumber = /*#__PURE__*/
|
|
501
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
502
|
+
var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
512
503
|
sx,
|
|
513
504
|
value,
|
|
514
505
|
infoIcon,
|
|
@@ -516,7 +507,7 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
516
507
|
onClickInfoIcon,
|
|
517
508
|
...inputProps
|
|
518
509
|
}, ref) => {
|
|
519
|
-
const sxProps =
|
|
510
|
+
const sxProps = React10.useMemo(() => {
|
|
520
511
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
521
512
|
if (inputProps["aria-invalid"] === "true") {
|
|
522
513
|
return {
|
|
@@ -578,7 +569,7 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
578
569
|
},
|
|
579
570
|
ref,
|
|
580
571
|
"aria-invalid": inputProps["aria-invalid"],
|
|
581
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */jsx14(Input2, {
|
|
582
573
|
ref,
|
|
583
574
|
variant: "forms.inputNumber",
|
|
584
575
|
sx: sxProps,
|
|
@@ -588,7 +579,7 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
588
579
|
},
|
|
589
580
|
value,
|
|
590
581
|
...inputProps
|
|
591
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */jsx14(Text, {
|
|
592
583
|
sx: {
|
|
593
584
|
position: "absolute",
|
|
594
585
|
alignSelf: "center",
|
|
@@ -597,10 +588,10 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
597
588
|
cursor: "pointer"
|
|
598
589
|
},
|
|
599
590
|
onClick: handleChangeUp,
|
|
600
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */jsx14(Icon8, {
|
|
601
592
|
icon: "picker-down"
|
|
602
593
|
})
|
|
603
|
-
}), infoIcon && /* @__PURE__ */
|
|
594
|
+
}), infoIcon && /* @__PURE__ */jsx14(Text, {
|
|
604
595
|
sx: {
|
|
605
596
|
position: "absolute",
|
|
606
597
|
alignSelf: "center",
|
|
@@ -609,10 +600,10 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
609
600
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
610
601
|
},
|
|
611
602
|
onClick: onClickInfoIcon,
|
|
612
|
-
children: /* @__PURE__ */
|
|
603
|
+
children: /* @__PURE__ */jsx14(Icon8, {
|
|
613
604
|
icon: "info"
|
|
614
605
|
})
|
|
615
|
-
}), /* @__PURE__ */
|
|
606
|
+
}), /* @__PURE__ */jsx14(Text, {
|
|
616
607
|
sx: {
|
|
617
608
|
position: "absolute",
|
|
618
609
|
alignSelf: "center",
|
|
@@ -621,7 +612,7 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
621
612
|
cursor: "pointer"
|
|
622
613
|
},
|
|
623
614
|
onClick: handleChangeDown,
|
|
624
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */jsx14(Icon8, {
|
|
625
616
|
icon: "picker-up"
|
|
626
617
|
})
|
|
627
618
|
})]
|
|
@@ -630,10 +621,10 @@ var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
|
630
621
|
InputNumber.displayName = "InputNumber";
|
|
631
622
|
|
|
632
623
|
// src/components/Stack.tsx
|
|
633
|
-
import * as
|
|
634
|
-
import { jsx as
|
|
635
|
-
var Stack = /*#__PURE__*/
|
|
636
|
-
return /* @__PURE__ */
|
|
624
|
+
import * as React11 from "react";
|
|
625
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
626
|
+
var Stack = /*#__PURE__*/React11.forwardRef((props, ref) => {
|
|
627
|
+
return /* @__PURE__ */jsx15(Flex, {
|
|
637
628
|
ref,
|
|
638
629
|
...props,
|
|
639
630
|
sx: {
|
|
@@ -648,16 +639,16 @@ Stack.displayName = "Stack";
|
|
|
648
639
|
import { Paragraph } from "theme-ui";
|
|
649
640
|
|
|
650
641
|
// src/components/InputPassword/InputPassword.tsx
|
|
651
|
-
import * as
|
|
642
|
+
import * as React13 from "react";
|
|
652
643
|
|
|
653
644
|
// src/components/InputPassword/useHidePassInput.ts
|
|
654
|
-
import * as
|
|
645
|
+
import * as React12 from "react";
|
|
655
646
|
var useHidePassInput = (defaultValue = true) => {
|
|
656
|
-
const [hidePass, setHidePass] =
|
|
647
|
+
const [hidePass, setHidePass] = React12.useState(Boolean(defaultValue));
|
|
657
648
|
const {
|
|
658
649
|
icon,
|
|
659
650
|
inputType
|
|
660
|
-
} =
|
|
651
|
+
} = React12.useMemo(() => {
|
|
661
652
|
return {
|
|
662
653
|
icon: hidePass ? "view-off" : "view-on",
|
|
663
654
|
inputType: hidePass ? "password" : "text"
|
|
@@ -676,8 +667,8 @@ var useHidePassInput = (defaultValue = true) => {
|
|
|
676
667
|
};
|
|
677
668
|
|
|
678
669
|
// src/components/InputPassword/InputPassword.tsx
|
|
679
|
-
import { jsx as
|
|
680
|
-
var InputPassword = /*#__PURE__*/
|
|
670
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
671
|
+
var InputPassword = /*#__PURE__*/React13.forwardRef(({
|
|
681
672
|
showPasswordByDefault,
|
|
682
673
|
...inputPasswordProps
|
|
683
674
|
}, ref) => {
|
|
@@ -686,7 +677,7 @@ var InputPassword = /*#__PURE__*/React14.forwardRef(({
|
|
|
686
677
|
icon,
|
|
687
678
|
inputType
|
|
688
679
|
} = useHidePassInput(!showPasswordByDefault);
|
|
689
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */jsx16(Input, {
|
|
690
681
|
ref,
|
|
691
682
|
...inputPasswordProps,
|
|
692
683
|
trailingIcon: icon,
|
|
@@ -697,14 +688,14 @@ var InputPassword = /*#__PURE__*/React14.forwardRef(({
|
|
|
697
688
|
InputPassword.displayName = "InputPassword";
|
|
698
689
|
|
|
699
690
|
// src/components/ActionButton.tsx
|
|
700
|
-
import { jsx as
|
|
691
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
701
692
|
var ActionButton = ({
|
|
702
693
|
icon,
|
|
703
694
|
variant = "default",
|
|
704
695
|
sx,
|
|
705
696
|
...props
|
|
706
697
|
}) => {
|
|
707
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */jsx17(Button, {
|
|
708
699
|
variant: `buttons.actionButton.${variant}`,
|
|
709
700
|
leftIcon: icon,
|
|
710
701
|
sx: {
|
|
@@ -725,4 +716,4 @@ var ActionButton = ({
|
|
|
725
716
|
...props
|
|
726
717
|
});
|
|
727
718
|
};
|
|
728
|
-
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText,
|
|
719
|
+
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -5,9 +5,7 @@ export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
|
|
|
5
5
|
export { Keyframes, keyframes } from '@emotion/react';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
|
|
9
|
-
import { IconifyIconProps, IconifyIconHTMLElement } from '@iconify-icon/react';
|
|
10
|
-
import { IconifyIcon } from '@iconify/types';
|
|
8
|
+
import { IconType } from '@ttoss/react-icons';
|
|
11
9
|
|
|
12
10
|
type ThemeProviderProps = {
|
|
13
11
|
children?: React.ReactNode;
|
|
@@ -21,10 +19,6 @@ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) =
|
|
|
21
19
|
|
|
22
20
|
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
23
21
|
|
|
24
|
-
type IconType = string | IconifyIcon;
|
|
25
|
-
type IconProps = Omit<IconifyIconProps, 'ref'>;
|
|
26
|
-
declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<IconifyIconHTMLElement | null>>;
|
|
27
|
-
|
|
28
22
|
type BadgeProps = BadgeProps$1 & {
|
|
29
23
|
icon?: IconType;
|
|
30
24
|
};
|
|
@@ -75,7 +69,7 @@ type HelpTextProps = Omit<TextProps, 'variant'> & {
|
|
|
75
69
|
};
|
|
76
70
|
declare const HelpText: ({ sx, disabled, negative, ...props }: HelpTextProps) => react_jsx_runtime.JSX.Element;
|
|
77
71
|
|
|
78
|
-
type CloseButtonProps = ButtonProps
|
|
72
|
+
type CloseButtonProps = ButtonProps & {
|
|
79
73
|
label?: string;
|
|
80
74
|
onlyText?: boolean;
|
|
81
75
|
};
|
|
@@ -106,4 +100,4 @@ type ActionButtonProps = Omit<ButtonProps, 'rightIcon' | 'leftIcon' | 'variant'>
|
|
|
106
100
|
};
|
|
107
101
|
declare const ActionButton: ({ icon, variant, sx, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
108
102
|
|
|
109
|
-
export { ActionButton, ActionButtonProps, Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, Container, HelpText, HelpTextProps,
|
|
103
|
+
export { ActionButton, ActionButtonProps, Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, Container, HelpText, HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, InputNumberProps, InputPassword, InputPasswordProps, InputProps, Label, LabelProps, Link, LinkProps, Select, Stack, StackProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
|
|
|
5
5
|
export { Keyframes, keyframes } from '@emotion/react';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
|
|
9
|
-
import { IconifyIconProps, IconifyIconHTMLElement } from '@iconify-icon/react';
|
|
10
|
-
import { IconifyIcon } from '@iconify/types';
|
|
8
|
+
import { IconType } from '@ttoss/react-icons';
|
|
11
9
|
|
|
12
10
|
type ThemeProviderProps = {
|
|
13
11
|
children?: React.ReactNode;
|
|
@@ -21,10 +19,6 @@ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) =
|
|
|
21
19
|
|
|
22
20
|
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
23
21
|
|
|
24
|
-
type IconType = string | IconifyIcon;
|
|
25
|
-
type IconProps = Omit<IconifyIconProps, 'ref'>;
|
|
26
|
-
declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<IconifyIconHTMLElement | null>>;
|
|
27
|
-
|
|
28
22
|
type BadgeProps = BadgeProps$1 & {
|
|
29
23
|
icon?: IconType;
|
|
30
24
|
};
|
|
@@ -75,7 +69,7 @@ type HelpTextProps = Omit<TextProps, 'variant'> & {
|
|
|
75
69
|
};
|
|
76
70
|
declare const HelpText: ({ sx, disabled, negative, ...props }: HelpTextProps) => react_jsx_runtime.JSX.Element;
|
|
77
71
|
|
|
78
|
-
type CloseButtonProps = ButtonProps
|
|
72
|
+
type CloseButtonProps = ButtonProps & {
|
|
79
73
|
label?: string;
|
|
80
74
|
onlyText?: boolean;
|
|
81
75
|
};
|
|
@@ -106,4 +100,4 @@ type ActionButtonProps = Omit<ButtonProps, 'rightIcon' | 'leftIcon' | 'variant'>
|
|
|
106
100
|
};
|
|
107
101
|
declare const ActionButton: ({ icon, variant, sx, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
108
102
|
|
|
109
|
-
export { ActionButton, ActionButtonProps, Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, Container, HelpText, HelpTextProps,
|
|
103
|
+
export { ActionButton, ActionButtonProps, Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, Container, HelpText, HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, InputNumberProps, InputPassword, InputPasswordProps, InputProps, Label, LabelProps, Link, LinkProps, Select, Stack, StackProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
|