@ttoss/ui 1.32.2 → 1.32.4
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 +59 -45
- package/dist/index.d.ts +8 -3
- package/dist/index.js +63 -49
- package/package.json +5 -5
- package/src/components/Link.tsx +20 -1
package/dist/esm/index.js
CHANGED
|
@@ -212,7 +212,21 @@ var Label = ({
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
// src/components/Link.tsx
|
|
215
|
-
import { Link } from "theme-ui";
|
|
215
|
+
import { Link as LinkUi } from "theme-ui";
|
|
216
|
+
import React5 from "react";
|
|
217
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
218
|
+
var Link = /*#__PURE__*/React5.forwardRef(({
|
|
219
|
+
quiet,
|
|
220
|
+
className,
|
|
221
|
+
...props
|
|
222
|
+
}, ref) => {
|
|
223
|
+
return /* @__PURE__ */jsx7(LinkUi, {
|
|
224
|
+
className: `${quiet ? "quiet" : ""} ${className ?? ""}`,
|
|
225
|
+
...props,
|
|
226
|
+
ref
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
Link.displayName = "Link";
|
|
216
230
|
|
|
217
231
|
// src/components/LinearProgress.tsx
|
|
218
232
|
import { Progress } from "theme-ui";
|
|
@@ -222,15 +236,15 @@ import { Text } from "theme-ui";
|
|
|
222
236
|
|
|
223
237
|
// src/components/Select.tsx
|
|
224
238
|
import { Select as SelectUi } from "theme-ui";
|
|
225
|
-
import
|
|
226
|
-
import { Fragment as Fragment2, jsx as
|
|
227
|
-
var Select = /*#__PURE__*/
|
|
239
|
+
import React6 from "react";
|
|
240
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
241
|
+
var Select = /*#__PURE__*/React6.forwardRef(({
|
|
228
242
|
arrow,
|
|
229
243
|
...props
|
|
230
244
|
}, ref) => {
|
|
231
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */jsx8(SelectUi, {
|
|
232
246
|
arrow: /* @__PURE__ */jsxs6(Fragment2, {
|
|
233
|
-
children: [arrow ?? /* @__PURE__ */
|
|
247
|
+
children: [arrow ?? /* @__PURE__ */jsx8(Text, {
|
|
234
248
|
sx: {
|
|
235
249
|
marginLeft: ({
|
|
236
250
|
space
|
|
@@ -241,10 +255,10 @@ var Select = /*#__PURE__*/React5.forwardRef(({
|
|
|
241
255
|
pointerEvents: "none",
|
|
242
256
|
lineHeight: 0
|
|
243
257
|
},
|
|
244
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */jsx8(Icon, {
|
|
245
259
|
icon: "picker-down"
|
|
246
260
|
})
|
|
247
|
-
}), props["aria-invalid"] === "true" && /* @__PURE__ */
|
|
261
|
+
}), props["aria-invalid"] === "true" && /* @__PURE__ */jsx8(Text, {
|
|
248
262
|
className: "error-icon",
|
|
249
263
|
sx: {
|
|
250
264
|
marginLeft: ({
|
|
@@ -256,7 +270,7 @@ var Select = /*#__PURE__*/React5.forwardRef(({
|
|
|
256
270
|
pointerEvents: "none",
|
|
257
271
|
lineHeight: 0
|
|
258
272
|
},
|
|
259
|
-
children: /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */jsx8(Icon, {
|
|
260
274
|
icon: "error"
|
|
261
275
|
})
|
|
262
276
|
})]
|
|
@@ -274,11 +288,11 @@ import { Spinner } from "theme-ui";
|
|
|
274
288
|
import { Radio } from "theme-ui";
|
|
275
289
|
|
|
276
290
|
// src/components/IconButton.tsx
|
|
277
|
-
import * as
|
|
291
|
+
import * as React7 from "react";
|
|
278
292
|
import { IconButton as IconButtonUi } from "theme-ui";
|
|
279
|
-
import { jsx as
|
|
280
|
-
var IconButton = /*#__PURE__*/
|
|
281
|
-
return /* @__PURE__ */
|
|
293
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
294
|
+
var IconButton = /*#__PURE__*/React7.forwardRef((props, ref) => {
|
|
295
|
+
return /* @__PURE__ */jsx9(IconButtonUi, {
|
|
282
296
|
type: "button",
|
|
283
297
|
...props,
|
|
284
298
|
ref
|
|
@@ -293,12 +307,12 @@ import { Slider } from "theme-ui";
|
|
|
293
307
|
import { Checkbox } from "theme-ui";
|
|
294
308
|
|
|
295
309
|
// src/components/InfiniteLinearProgress.tsx
|
|
296
|
-
import * as
|
|
297
|
-
import { jsx as
|
|
310
|
+
import * as React8 from "react";
|
|
311
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
298
312
|
var MAX_PROGRESS = 100;
|
|
299
313
|
var InfiniteLinearProgress = () => {
|
|
300
|
-
const [progress, setProgress] =
|
|
301
|
-
|
|
314
|
+
const [progress, setProgress] = React8.useState(0);
|
|
315
|
+
React8.useEffect(() => {
|
|
302
316
|
const timer = setInterval(() => {
|
|
303
317
|
setProgress(oldProgress => {
|
|
304
318
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -319,7 +333,7 @@ var InfiniteLinearProgress = () => {
|
|
|
319
333
|
clearInterval(timer);
|
|
320
334
|
};
|
|
321
335
|
}, []);
|
|
322
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */jsx10(Progress, {
|
|
323
337
|
max: MAX_PROGRESS,
|
|
324
338
|
value: progress,
|
|
325
339
|
role: "progressbar"
|
|
@@ -328,9 +342,9 @@ var InfiniteLinearProgress = () => {
|
|
|
328
342
|
|
|
329
343
|
// src/components/Textarea.tsx
|
|
330
344
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
331
|
-
import
|
|
332
|
-
import { jsx as
|
|
333
|
-
var Textarea = /*#__PURE__*/
|
|
345
|
+
import React9 from "react";
|
|
346
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
347
|
+
var Textarea = /*#__PURE__*/React9.forwardRef(({
|
|
334
348
|
trailingIcon,
|
|
335
349
|
className,
|
|
336
350
|
sx,
|
|
@@ -344,7 +358,7 @@ var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
|
344
358
|
padding: 0,
|
|
345
359
|
border: "none"
|
|
346
360
|
},
|
|
347
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */jsx11(TextareaUI, {
|
|
348
362
|
ref,
|
|
349
363
|
sx: {
|
|
350
364
|
...sx,
|
|
@@ -353,13 +367,13 @@ var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
|
353
367
|
},
|
|
354
368
|
className,
|
|
355
369
|
...textareaProps
|
|
356
|
-
}), trailingIcon && /* @__PURE__ */
|
|
370
|
+
}), trailingIcon && /* @__PURE__ */jsx11(Text, {
|
|
357
371
|
sx: {
|
|
358
372
|
position: "absolute",
|
|
359
373
|
right: "1.25rem",
|
|
360
374
|
top: "0.75rem"
|
|
361
375
|
},
|
|
362
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */jsx11(Icon, {
|
|
363
377
|
inline: true,
|
|
364
378
|
icon: trailingIcon
|
|
365
379
|
})
|
|
@@ -372,14 +386,14 @@ Textarea.displayName = "Textarea";
|
|
|
372
386
|
import { Container } from "theme-ui";
|
|
373
387
|
|
|
374
388
|
// src/components/HelpText.tsx
|
|
375
|
-
import { jsx as
|
|
389
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
376
390
|
var HelpText = ({
|
|
377
391
|
disabled,
|
|
378
392
|
negative,
|
|
379
393
|
...props
|
|
380
394
|
}) => {
|
|
381
395
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
382
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */jsx12(Text, {
|
|
383
397
|
variant,
|
|
384
398
|
"aria-disabled": disabled ? "true" : void 0,
|
|
385
399
|
...props
|
|
@@ -388,9 +402,9 @@ var HelpText = ({
|
|
|
388
402
|
|
|
389
403
|
// src/components/CloseButton.tsx
|
|
390
404
|
import { Button as Button2 } from "theme-ui";
|
|
391
|
-
import
|
|
392
|
-
import { jsx as
|
|
393
|
-
var CloseButton = /*#__PURE__*/
|
|
405
|
+
import React10 from "react";
|
|
406
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
407
|
+
var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
394
408
|
label,
|
|
395
409
|
sx,
|
|
396
410
|
...props
|
|
@@ -406,7 +420,7 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
|
|
|
406
420
|
},
|
|
407
421
|
...props,
|
|
408
422
|
ref,
|
|
409
|
-
children: [label, /* @__PURE__ */
|
|
423
|
+
children: [label, /* @__PURE__ */jsx13(Icon, {
|
|
410
424
|
icon: "close"
|
|
411
425
|
})]
|
|
412
426
|
});
|
|
@@ -415,9 +429,9 @@ CloseButton.displayName = "CloseButton";
|
|
|
415
429
|
|
|
416
430
|
// src/components/InputNumber.tsx
|
|
417
431
|
import { Input as Input2 } from "theme-ui";
|
|
418
|
-
import
|
|
419
|
-
import { jsx as
|
|
420
|
-
var InputNumber = /*#__PURE__*/
|
|
432
|
+
import React11 from "react";
|
|
433
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
434
|
+
var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
421
435
|
sx,
|
|
422
436
|
value,
|
|
423
437
|
infoIcon,
|
|
@@ -425,7 +439,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
425
439
|
onClickInfoIcon,
|
|
426
440
|
...inputProps
|
|
427
441
|
}, ref) => {
|
|
428
|
-
const sxProps =
|
|
442
|
+
const sxProps = React11.useMemo(() => {
|
|
429
443
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
430
444
|
if (inputProps["aria-invalid"] === "true") {
|
|
431
445
|
return {
|
|
@@ -484,7 +498,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
484
498
|
},
|
|
485
499
|
ref,
|
|
486
500
|
"aria-invalid": inputProps["aria-invalid"],
|
|
487
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */jsx14(Input2, {
|
|
488
502
|
ref,
|
|
489
503
|
variant: "forms.inputNumber",
|
|
490
504
|
sx: sxProps,
|
|
@@ -494,7 +508,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
494
508
|
},
|
|
495
509
|
value,
|
|
496
510
|
...inputProps
|
|
497
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */jsx14(Text, {
|
|
498
512
|
sx: {
|
|
499
513
|
position: "absolute",
|
|
500
514
|
alignSelf: "center",
|
|
@@ -503,10 +517,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
503
517
|
cursor: "pointer"
|
|
504
518
|
},
|
|
505
519
|
onClick: handleChangeUp,
|
|
506
|
-
children: /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */jsx14(Icon, {
|
|
507
521
|
icon: "picker-down"
|
|
508
522
|
})
|
|
509
|
-
}), infoIcon && /* @__PURE__ */
|
|
523
|
+
}), infoIcon && /* @__PURE__ */jsx14(Text, {
|
|
510
524
|
sx: {
|
|
511
525
|
position: "absolute",
|
|
512
526
|
alignSelf: "center",
|
|
@@ -515,10 +529,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
515
529
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
516
530
|
},
|
|
517
531
|
onClick: onClickInfoIcon,
|
|
518
|
-
children: /* @__PURE__ */
|
|
532
|
+
children: /* @__PURE__ */jsx14(Icon, {
|
|
519
533
|
icon: "info"
|
|
520
534
|
})
|
|
521
|
-
}), /* @__PURE__ */
|
|
535
|
+
}), /* @__PURE__ */jsx14(Text, {
|
|
522
536
|
sx: {
|
|
523
537
|
position: "absolute",
|
|
524
538
|
alignSelf: "center",
|
|
@@ -527,7 +541,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
527
541
|
cursor: "pointer"
|
|
528
542
|
},
|
|
529
543
|
onClick: handleChangeDown,
|
|
530
|
-
children: /* @__PURE__ */
|
|
544
|
+
children: /* @__PURE__ */jsx14(Icon, {
|
|
531
545
|
icon: "picker-up"
|
|
532
546
|
})
|
|
533
547
|
})]
|
|
@@ -536,10 +550,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
536
550
|
InputNumber.displayName = "InputNumber";
|
|
537
551
|
|
|
538
552
|
// src/components/Stack.tsx
|
|
539
|
-
import * as
|
|
540
|
-
import { jsx as
|
|
541
|
-
var Stack = /*#__PURE__*/
|
|
542
|
-
return /* @__PURE__ */
|
|
553
|
+
import * as React12 from "react";
|
|
554
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
555
|
+
var Stack = /*#__PURE__*/React12.forwardRef((props, ref) => {
|
|
556
|
+
return /* @__PURE__ */jsx15(Flex, {
|
|
543
557
|
ref,
|
|
544
558
|
...props,
|
|
545
559
|
sx: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as theme_ui from 'theme-ui';
|
|
2
|
-
import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, SelectProps, IconButtonProps, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
-
export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps,
|
|
2
|
+
import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, SelectProps, IconButtonProps, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
+
export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Radio, RadioProps, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, Text, TextProps, Theme } from 'theme-ui';
|
|
4
4
|
export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default from 'react';
|
|
@@ -46,6 +46,11 @@ type LabelProps = LabelProps$1 & {
|
|
|
46
46
|
};
|
|
47
47
|
declare const Label: ({ children, onTooltipClick, tooltip, ...props }: LabelProps) => JSX.Element;
|
|
48
48
|
|
|
49
|
+
type LinkProps = LinkProps$1 & {
|
|
50
|
+
quiet?: boolean;
|
|
51
|
+
};
|
|
52
|
+
declare const Link: React__default.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React__default.RefAttributes<HTMLAnchorElement>>;
|
|
53
|
+
|
|
49
54
|
declare const Select: React__default.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React__default.RefAttributes<HTMLSelectElement>>;
|
|
50
55
|
|
|
51
56
|
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -82,4 +87,4 @@ type StackProps = FlexProps;
|
|
|
82
87
|
*/
|
|
83
88
|
declare const Stack: React.ForwardRefExoticComponent<theme_ui.BoxProps & React.RefAttributes<HTMLElement>>;
|
|
84
89
|
|
|
85
|
-
export { Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputNumber, InputNumberProps, InputProps, Label, LabelProps, Select, Stack, StackProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
|
|
90
|
+
export { Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputNumber, InputNumberProps, InputProps, Label, LabelProps, Link, LinkProps, Select, Stack, StackProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ __export(src_exports, {
|
|
|
59
59
|
InputNumber: () => InputNumber,
|
|
60
60
|
Label: () => Label,
|
|
61
61
|
LinearProgress: () => import_theme_ui15.Progress,
|
|
62
|
-
Link: () =>
|
|
62
|
+
Link: () => Link,
|
|
63
63
|
Radio: () => import_theme_ui19.Radio,
|
|
64
64
|
Select: () => Select,
|
|
65
65
|
Slider: () => import_theme_ui21.Slider,
|
|
@@ -285,6 +285,20 @@ var Label = ({
|
|
|
285
285
|
|
|
286
286
|
// src/components/Link.tsx
|
|
287
287
|
var import_theme_ui14 = require("theme-ui");
|
|
288
|
+
var import_react4 = __toESM(require("react"));
|
|
289
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
290
|
+
var Link = import_react4.default.forwardRef(({
|
|
291
|
+
quiet,
|
|
292
|
+
className,
|
|
293
|
+
...props
|
|
294
|
+
}, ref) => {
|
|
295
|
+
return /* @__PURE__ */(0, import_jsx_runtime7.jsx)(import_theme_ui14.Link, {
|
|
296
|
+
className: `${quiet ? "quiet" : ""} ${className ?? ""}`,
|
|
297
|
+
...props,
|
|
298
|
+
ref
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
Link.displayName = "Link";
|
|
288
302
|
|
|
289
303
|
// src/components/LinearProgress.tsx
|
|
290
304
|
var import_theme_ui15 = require("theme-ui");
|
|
@@ -294,15 +308,15 @@ var import_theme_ui16 = require("theme-ui");
|
|
|
294
308
|
|
|
295
309
|
// src/components/Select.tsx
|
|
296
310
|
var import_theme_ui17 = require("theme-ui");
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var Select =
|
|
311
|
+
var import_react5 = __toESM(require("react"));
|
|
312
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
313
|
+
var Select = import_react5.default.forwardRef(({
|
|
300
314
|
arrow,
|
|
301
315
|
...props
|
|
302
316
|
}, ref) => {
|
|
303
|
-
return /* @__PURE__ */(0,
|
|
304
|
-
arrow: /* @__PURE__ */(0,
|
|
305
|
-
children: [arrow ?? /* @__PURE__ */(0,
|
|
317
|
+
return /* @__PURE__ */(0, import_jsx_runtime8.jsx)(import_theme_ui17.Select, {
|
|
318
|
+
arrow: /* @__PURE__ */(0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, {
|
|
319
|
+
children: [arrow ?? /* @__PURE__ */(0, import_jsx_runtime8.jsx)(import_theme_ui16.Text, {
|
|
306
320
|
sx: {
|
|
307
321
|
marginLeft: ({
|
|
308
322
|
space
|
|
@@ -313,10 +327,10 @@ var Select = import_react4.default.forwardRef(({
|
|
|
313
327
|
pointerEvents: "none",
|
|
314
328
|
lineHeight: 0
|
|
315
329
|
},
|
|
316
|
-
children: /* @__PURE__ */(0,
|
|
330
|
+
children: /* @__PURE__ */(0, import_jsx_runtime8.jsx)(Icon, {
|
|
317
331
|
icon: "picker-down"
|
|
318
332
|
})
|
|
319
|
-
}), props["aria-invalid"] === "true" && /* @__PURE__ */(0,
|
|
333
|
+
}), props["aria-invalid"] === "true" && /* @__PURE__ */(0, import_jsx_runtime8.jsx)(import_theme_ui16.Text, {
|
|
320
334
|
className: "error-icon",
|
|
321
335
|
sx: {
|
|
322
336
|
marginLeft: ({
|
|
@@ -328,7 +342,7 @@ var Select = import_react4.default.forwardRef(({
|
|
|
328
342
|
pointerEvents: "none",
|
|
329
343
|
lineHeight: 0
|
|
330
344
|
},
|
|
331
|
-
children: /* @__PURE__ */(0,
|
|
345
|
+
children: /* @__PURE__ */(0, import_jsx_runtime8.jsx)(Icon, {
|
|
332
346
|
icon: "error"
|
|
333
347
|
})
|
|
334
348
|
})]
|
|
@@ -346,11 +360,11 @@ var import_theme_ui18 = require("theme-ui");
|
|
|
346
360
|
var import_theme_ui19 = require("theme-ui");
|
|
347
361
|
|
|
348
362
|
// src/components/IconButton.tsx
|
|
349
|
-
var
|
|
363
|
+
var React7 = __toESM(require("react"));
|
|
350
364
|
var import_theme_ui20 = require("theme-ui");
|
|
351
|
-
var
|
|
352
|
-
var IconButton =
|
|
353
|
-
return /* @__PURE__ */(0,
|
|
365
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
366
|
+
var IconButton = React7.forwardRef((props, ref) => {
|
|
367
|
+
return /* @__PURE__ */(0, import_jsx_runtime9.jsx)(import_theme_ui20.IconButton, {
|
|
354
368
|
type: "button",
|
|
355
369
|
...props,
|
|
356
370
|
ref
|
|
@@ -365,12 +379,12 @@ var import_theme_ui21 = require("theme-ui");
|
|
|
365
379
|
var import_theme_ui22 = require("theme-ui");
|
|
366
380
|
|
|
367
381
|
// src/components/InfiniteLinearProgress.tsx
|
|
368
|
-
var
|
|
369
|
-
var
|
|
382
|
+
var React8 = __toESM(require("react"));
|
|
383
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
370
384
|
var MAX_PROGRESS = 100;
|
|
371
385
|
var InfiniteLinearProgress = () => {
|
|
372
|
-
const [progress, setProgress] =
|
|
373
|
-
|
|
386
|
+
const [progress, setProgress] = React8.useState(0);
|
|
387
|
+
React8.useEffect(() => {
|
|
374
388
|
const timer = setInterval(() => {
|
|
375
389
|
setProgress(oldProgress => {
|
|
376
390
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -391,7 +405,7 @@ var InfiniteLinearProgress = () => {
|
|
|
391
405
|
clearInterval(timer);
|
|
392
406
|
};
|
|
393
407
|
}, []);
|
|
394
|
-
return /* @__PURE__ */(0,
|
|
408
|
+
return /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui15.Progress, {
|
|
395
409
|
max: MAX_PROGRESS,
|
|
396
410
|
value: progress,
|
|
397
411
|
role: "progressbar"
|
|
@@ -400,15 +414,15 @@ var InfiniteLinearProgress = () => {
|
|
|
400
414
|
|
|
401
415
|
// src/components/Textarea.tsx
|
|
402
416
|
var import_theme_ui23 = require("theme-ui");
|
|
403
|
-
var
|
|
404
|
-
var
|
|
405
|
-
var Textarea =
|
|
417
|
+
var import_react6 = __toESM(require("react"));
|
|
418
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
419
|
+
var Textarea = import_react6.default.forwardRef(({
|
|
406
420
|
trailingIcon,
|
|
407
421
|
className,
|
|
408
422
|
sx,
|
|
409
423
|
...textareaProps
|
|
410
424
|
}, ref) => {
|
|
411
|
-
return /* @__PURE__ */(0,
|
|
425
|
+
return /* @__PURE__ */(0, import_jsx_runtime11.jsxs)(import_theme_ui8.Flex, {
|
|
412
426
|
className,
|
|
413
427
|
sx: {
|
|
414
428
|
...sx,
|
|
@@ -416,7 +430,7 @@ var Textarea = import_react5.default.forwardRef(({
|
|
|
416
430
|
padding: 0,
|
|
417
431
|
border: "none"
|
|
418
432
|
},
|
|
419
|
-
children: [/* @__PURE__ */(0,
|
|
433
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui23.Textarea, {
|
|
420
434
|
ref,
|
|
421
435
|
sx: {
|
|
422
436
|
...sx,
|
|
@@ -425,13 +439,13 @@ var Textarea = import_react5.default.forwardRef(({
|
|
|
425
439
|
},
|
|
426
440
|
className,
|
|
427
441
|
...textareaProps
|
|
428
|
-
}), trailingIcon && /* @__PURE__ */(0,
|
|
442
|
+
}), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui16.Text, {
|
|
429
443
|
sx: {
|
|
430
444
|
position: "absolute",
|
|
431
445
|
right: "1.25rem",
|
|
432
446
|
top: "0.75rem"
|
|
433
447
|
},
|
|
434
|
-
children: /* @__PURE__ */(0,
|
|
448
|
+
children: /* @__PURE__ */(0, import_jsx_runtime11.jsx)(Icon, {
|
|
435
449
|
inline: true,
|
|
436
450
|
icon: trailingIcon
|
|
437
451
|
})
|
|
@@ -444,14 +458,14 @@ Textarea.displayName = "Textarea";
|
|
|
444
458
|
var import_theme_ui24 = require("theme-ui");
|
|
445
459
|
|
|
446
460
|
// src/components/HelpText.tsx
|
|
447
|
-
var
|
|
461
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
448
462
|
var HelpText = ({
|
|
449
463
|
disabled,
|
|
450
464
|
negative,
|
|
451
465
|
...props
|
|
452
466
|
}) => {
|
|
453
467
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
454
|
-
return /* @__PURE__ */(0,
|
|
468
|
+
return /* @__PURE__ */(0, import_jsx_runtime12.jsx)(import_theme_ui16.Text, {
|
|
455
469
|
variant,
|
|
456
470
|
"aria-disabled": disabled ? "true" : void 0,
|
|
457
471
|
...props
|
|
@@ -460,14 +474,14 @@ var HelpText = ({
|
|
|
460
474
|
|
|
461
475
|
// src/components/CloseButton.tsx
|
|
462
476
|
var import_theme_ui25 = require("theme-ui");
|
|
463
|
-
var
|
|
464
|
-
var
|
|
465
|
-
var CloseButton =
|
|
477
|
+
var import_react7 = __toESM(require("react"));
|
|
478
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
479
|
+
var CloseButton = import_react7.default.forwardRef(({
|
|
466
480
|
label,
|
|
467
481
|
sx,
|
|
468
482
|
...props
|
|
469
483
|
}, ref) => {
|
|
470
|
-
return /* @__PURE__ */(0,
|
|
484
|
+
return /* @__PURE__ */(0, import_jsx_runtime13.jsxs)(import_theme_ui25.Button, {
|
|
471
485
|
variant: "buttons.closeButton",
|
|
472
486
|
type: "button",
|
|
473
487
|
"aria-label": label,
|
|
@@ -478,7 +492,7 @@ var CloseButton = import_react6.default.forwardRef(({
|
|
|
478
492
|
},
|
|
479
493
|
...props,
|
|
480
494
|
ref,
|
|
481
|
-
children: [label, /* @__PURE__ */(0,
|
|
495
|
+
children: [label, /* @__PURE__ */(0, import_jsx_runtime13.jsx)(Icon, {
|
|
482
496
|
icon: "close"
|
|
483
497
|
})]
|
|
484
498
|
});
|
|
@@ -487,9 +501,9 @@ CloseButton.displayName = "CloseButton";
|
|
|
487
501
|
|
|
488
502
|
// src/components/InputNumber.tsx
|
|
489
503
|
var import_theme_ui26 = require("theme-ui");
|
|
490
|
-
var
|
|
491
|
-
var
|
|
492
|
-
var InputNumber =
|
|
504
|
+
var import_react8 = __toESM(require("react"));
|
|
505
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
506
|
+
var InputNumber = import_react8.default.forwardRef(({
|
|
493
507
|
sx,
|
|
494
508
|
value,
|
|
495
509
|
infoIcon,
|
|
@@ -497,7 +511,7 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
497
511
|
onClickInfoIcon,
|
|
498
512
|
...inputProps
|
|
499
513
|
}, ref) => {
|
|
500
|
-
const sxProps =
|
|
514
|
+
const sxProps = import_react8.default.useMemo(() => {
|
|
501
515
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
502
516
|
if (inputProps["aria-invalid"] === "true") {
|
|
503
517
|
return {
|
|
@@ -546,7 +560,7 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
546
560
|
}
|
|
547
561
|
onChange(value + 1);
|
|
548
562
|
};
|
|
549
|
-
return /* @__PURE__ */(0,
|
|
563
|
+
return /* @__PURE__ */(0, import_jsx_runtime14.jsxs)(import_theme_ui8.Flex, {
|
|
550
564
|
sx: {
|
|
551
565
|
width: "fit-content",
|
|
552
566
|
...sx,
|
|
@@ -556,7 +570,7 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
556
570
|
},
|
|
557
571
|
ref,
|
|
558
572
|
"aria-invalid": inputProps["aria-invalid"],
|
|
559
|
-
children: [/* @__PURE__ */(0,
|
|
573
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui26.Input, {
|
|
560
574
|
ref,
|
|
561
575
|
variant: "forms.inputNumber",
|
|
562
576
|
sx: sxProps,
|
|
@@ -566,7 +580,7 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
566
580
|
},
|
|
567
581
|
value,
|
|
568
582
|
...inputProps
|
|
569
|
-
}), /* @__PURE__ */(0,
|
|
583
|
+
}), /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui16.Text, {
|
|
570
584
|
sx: {
|
|
571
585
|
position: "absolute",
|
|
572
586
|
alignSelf: "center",
|
|
@@ -575,10 +589,10 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
575
589
|
cursor: "pointer"
|
|
576
590
|
},
|
|
577
591
|
onClick: handleChangeUp,
|
|
578
|
-
children: /* @__PURE__ */(0,
|
|
592
|
+
children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(Icon, {
|
|
579
593
|
icon: "picker-down"
|
|
580
594
|
})
|
|
581
|
-
}), infoIcon && /* @__PURE__ */(0,
|
|
595
|
+
}), infoIcon && /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui16.Text, {
|
|
582
596
|
sx: {
|
|
583
597
|
position: "absolute",
|
|
584
598
|
alignSelf: "center",
|
|
@@ -587,10 +601,10 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
587
601
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
588
602
|
},
|
|
589
603
|
onClick: onClickInfoIcon,
|
|
590
|
-
children: /* @__PURE__ */(0,
|
|
604
|
+
children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(Icon, {
|
|
591
605
|
icon: "info"
|
|
592
606
|
})
|
|
593
|
-
}), /* @__PURE__ */(0,
|
|
607
|
+
}), /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui16.Text, {
|
|
594
608
|
sx: {
|
|
595
609
|
position: "absolute",
|
|
596
610
|
alignSelf: "center",
|
|
@@ -599,7 +613,7 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
599
613
|
cursor: "pointer"
|
|
600
614
|
},
|
|
601
615
|
onClick: handleChangeDown,
|
|
602
|
-
children: /* @__PURE__ */(0,
|
|
616
|
+
children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(Icon, {
|
|
603
617
|
icon: "picker-up"
|
|
604
618
|
})
|
|
605
619
|
})]
|
|
@@ -608,10 +622,10 @@ var InputNumber = import_react7.default.forwardRef(({
|
|
|
608
622
|
InputNumber.displayName = "InputNumber";
|
|
609
623
|
|
|
610
624
|
// src/components/Stack.tsx
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var Stack =
|
|
614
|
-
return /* @__PURE__ */(0,
|
|
625
|
+
var React12 = __toESM(require("react"));
|
|
626
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
627
|
+
var Stack = React12.forwardRef((props, ref) => {
|
|
628
|
+
return /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui8.Flex, {
|
|
615
629
|
ref,
|
|
616
630
|
...props,
|
|
617
631
|
sx: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.4",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@emotion/react": "^11.10.6",
|
|
24
24
|
"@iconify-icon/react": "^1.0.7",
|
|
25
25
|
"@theme-ui/match-media": "^0.15.7",
|
|
26
|
-
"@ttoss/theme": "^1.4.
|
|
26
|
+
"@ttoss/theme": "^1.4.19",
|
|
27
27
|
"theme-ui": "^0.15.7"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@iconify-icons/mdi-light": "^1.2.5",
|
|
34
34
|
"@iconify/types": "^2.0.0",
|
|
35
35
|
"@ttoss/config": "^1.29.4",
|
|
36
|
-
"@ttoss/test-utils": "^1.21.
|
|
36
|
+
"@ttoss/test-utils": "^1.21.4",
|
|
37
37
|
"@types/jest": "^29.5.0",
|
|
38
|
-
"@types/react": "^18.0.
|
|
38
|
+
"@types/react": "^18.0.37",
|
|
39
39
|
"jest": "^29.5.0",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
41
|
"tsup": "^6.7.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8cf5e69a478866466d1da542af3a9e1ffd1ae35e"
|
|
52
52
|
}
|
package/src/components/Link.tsx
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { type LinkProps as LinkPropsUi, Link as LinkUi } from 'theme-ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export type LinkProps = LinkPropsUi & {
|
|
5
|
+
quiet?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
|
|
9
|
+
({ quiet, className, ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<LinkUi
|
|
12
|
+
className={`${quiet ? 'quiet' : ''} ${className ?? ''}`}
|
|
13
|
+
{...props}
|
|
14
|
+
ref={ref}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
Link.displayName = 'Link';
|