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