@ttoss/ui 4.1.1 → 4.1.3
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 +82 -56
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +85 -59
- package/package.json +19 -14
- package/src/components/Checkbox.tsx +25 -1
- package/src/components/Select.tsx +2 -3
package/dist/esm/index.js
CHANGED
|
@@ -329,9 +329,7 @@ var DropdownIndicator = props => {
|
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
331
|
var IndicatorsContainer = ({
|
|
332
|
-
children
|
|
333
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
334
|
-
...props
|
|
332
|
+
children
|
|
335
333
|
}) => {
|
|
336
334
|
return /* @__PURE__ */jsx7(Box, {
|
|
337
335
|
sx: {
|
|
@@ -360,14 +358,18 @@ var SelectContainer = ({
|
|
|
360
358
|
sx,
|
|
361
359
|
css: css2
|
|
362
360
|
} = props.selectProps;
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
361
|
+
return (
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
363
|
+
/* @__PURE__ */
|
|
364
|
+
jsx7(Box, {
|
|
365
|
+
sx,
|
|
366
|
+
css: css2,
|
|
367
|
+
children: /* @__PURE__ */jsx7(components.SelectContainer, {
|
|
368
|
+
...props,
|
|
369
|
+
children
|
|
370
|
+
})
|
|
369
371
|
})
|
|
370
|
-
|
|
372
|
+
);
|
|
371
373
|
};
|
|
372
374
|
var ValueContainer = ({
|
|
373
375
|
children,
|
|
@@ -489,15 +491,39 @@ IconButton.displayName = "IconButton";
|
|
|
489
491
|
import { Slider } from "theme-ui";
|
|
490
492
|
|
|
491
493
|
// src/components/Checkbox.tsx
|
|
492
|
-
import { Checkbox } from "theme-ui";
|
|
493
|
-
|
|
494
|
-
// src/components/InfiniteLinearProgress.tsx
|
|
495
494
|
import * as React6 from "react";
|
|
495
|
+
import { Checkbox as CheckBoxUi } from "theme-ui";
|
|
496
496
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
497
|
+
var Checkbox = ({
|
|
498
|
+
indeterminate = false,
|
|
499
|
+
...rest
|
|
500
|
+
}) => {
|
|
501
|
+
const ref = React6.useRef(null);
|
|
502
|
+
React6.useEffect(() => {
|
|
503
|
+
if (ref.current) {
|
|
504
|
+
ref.current.indeterminate = indeterminate;
|
|
505
|
+
}
|
|
506
|
+
}, [indeterminate]);
|
|
507
|
+
if (indeterminate) {
|
|
508
|
+
return /* @__PURE__ */jsx9("input", {
|
|
509
|
+
type: "checkbox",
|
|
510
|
+
ref,
|
|
511
|
+
...rest
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
return /* @__PURE__ */jsx9(CheckBoxUi, {
|
|
515
|
+
ref,
|
|
516
|
+
...rest
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// src/components/InfiniteLinearProgress.tsx
|
|
521
|
+
import * as React7 from "react";
|
|
522
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
497
523
|
var MAX_PROGRESS = 100;
|
|
498
524
|
var InfiniteLinearProgress = () => {
|
|
499
|
-
const [progress, setProgress] =
|
|
500
|
-
|
|
525
|
+
const [progress, setProgress] = React7.useState(0);
|
|
526
|
+
React7.useEffect(() => {
|
|
501
527
|
const timer = setInterval(() => {
|
|
502
528
|
setProgress(oldProgress => {
|
|
503
529
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -518,7 +544,7 @@ var InfiniteLinearProgress = () => {
|
|
|
518
544
|
clearInterval(timer);
|
|
519
545
|
};
|
|
520
546
|
}, []);
|
|
521
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */jsx10(Progress, {
|
|
522
548
|
max: MAX_PROGRESS,
|
|
523
549
|
value: progress,
|
|
524
550
|
role: "progressbar"
|
|
@@ -526,11 +552,11 @@ var InfiniteLinearProgress = () => {
|
|
|
526
552
|
};
|
|
527
553
|
|
|
528
554
|
// src/components/Textarea.tsx
|
|
529
|
-
import * as
|
|
555
|
+
import * as React8 from "react";
|
|
530
556
|
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
531
557
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
532
|
-
import { jsx as
|
|
533
|
-
var Textarea = /*#__PURE__*/
|
|
558
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
559
|
+
var Textarea = /*#__PURE__*/React8.forwardRef(({
|
|
534
560
|
trailingIcon,
|
|
535
561
|
className,
|
|
536
562
|
sx,
|
|
@@ -544,7 +570,7 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
|
|
|
544
570
|
padding: 0,
|
|
545
571
|
border: "none"
|
|
546
572
|
},
|
|
547
|
-
children: [/* @__PURE__ */
|
|
573
|
+
children: [/* @__PURE__ */jsx11(TextareaUI, {
|
|
548
574
|
ref,
|
|
549
575
|
sx: {
|
|
550
576
|
fontFamily: "body",
|
|
@@ -556,13 +582,13 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
|
|
|
556
582
|
},
|
|
557
583
|
className,
|
|
558
584
|
...textareaProps
|
|
559
|
-
}), trailingIcon && /* @__PURE__ */
|
|
585
|
+
}), trailingIcon && /* @__PURE__ */jsx11(Text, {
|
|
560
586
|
sx: {
|
|
561
587
|
position: "absolute",
|
|
562
588
|
right: "1.25rem",
|
|
563
589
|
top: "0.75rem"
|
|
564
590
|
},
|
|
565
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */jsx11(Icon6, {
|
|
566
592
|
inline: true,
|
|
567
593
|
icon: trailingIcon
|
|
568
594
|
})
|
|
@@ -572,11 +598,11 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
|
|
|
572
598
|
Textarea.displayName = "Textarea";
|
|
573
599
|
|
|
574
600
|
// src/components/Container.tsx
|
|
575
|
-
import * as
|
|
601
|
+
import * as React9 from "react";
|
|
576
602
|
import { Container as ContainerUi } from "theme-ui";
|
|
577
|
-
import { jsx as
|
|
578
|
-
var Container = /*#__PURE__*/
|
|
579
|
-
return /* @__PURE__ */
|
|
603
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
604
|
+
var Container = /*#__PURE__*/React9.forwardRef((props, ref) => {
|
|
605
|
+
return /* @__PURE__ */jsx12(ContainerUi, {
|
|
580
606
|
ref,
|
|
581
607
|
...props
|
|
582
608
|
});
|
|
@@ -584,7 +610,7 @@ var Container = /*#__PURE__*/React8.forwardRef((props, ref) => {
|
|
|
584
610
|
Container.displayName = "Container";
|
|
585
611
|
|
|
586
612
|
// src/components/HelpText.tsx
|
|
587
|
-
import { jsx as
|
|
613
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
588
614
|
var HelpText = ({
|
|
589
615
|
sx,
|
|
590
616
|
disabled,
|
|
@@ -592,7 +618,7 @@ var HelpText = ({
|
|
|
592
618
|
...props
|
|
593
619
|
}) => {
|
|
594
620
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
595
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */jsx13(Text, {
|
|
596
622
|
variant,
|
|
597
623
|
sx: {
|
|
598
624
|
fontSize: "sm",
|
|
@@ -606,10 +632,10 @@ var HelpText = ({
|
|
|
606
632
|
};
|
|
607
633
|
|
|
608
634
|
// src/components/CloseButton.tsx
|
|
609
|
-
import * as
|
|
635
|
+
import * as React10 from "react";
|
|
610
636
|
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
611
|
-
import { jsx as
|
|
612
|
-
var CloseButton = /*#__PURE__*/
|
|
637
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
638
|
+
var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
613
639
|
label,
|
|
614
640
|
sx,
|
|
615
641
|
onlyText,
|
|
@@ -640,7 +666,7 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
|
|
|
640
666
|
},
|
|
641
667
|
...props,
|
|
642
668
|
ref,
|
|
643
|
-
children: [label, !onlyText && /* @__PURE__ */
|
|
669
|
+
children: [label, !onlyText && /* @__PURE__ */jsx14(Icon7, {
|
|
644
670
|
icon: "close"
|
|
645
671
|
})]
|
|
646
672
|
});
|
|
@@ -648,11 +674,11 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
|
|
|
648
674
|
CloseButton.displayName = "CloseButton";
|
|
649
675
|
|
|
650
676
|
// src/components/InputNumber.tsx
|
|
651
|
-
import * as
|
|
677
|
+
import * as React11 from "react";
|
|
652
678
|
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
653
679
|
import { Input as Input2 } from "theme-ui";
|
|
654
|
-
import { jsx as
|
|
655
|
-
var InputNumber = /*#__PURE__*/
|
|
680
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
681
|
+
var InputNumber = /*#__PURE__*/React11.forwardRef(({
|
|
656
682
|
sx,
|
|
657
683
|
value,
|
|
658
684
|
infoIcon,
|
|
@@ -660,7 +686,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
660
686
|
onClickInfoIcon,
|
|
661
687
|
...inputProps
|
|
662
688
|
}, ref) => {
|
|
663
|
-
const sxProps =
|
|
689
|
+
const sxProps = React11.useMemo(() => {
|
|
664
690
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
665
691
|
if (inputProps["aria-invalid"] === "true") {
|
|
666
692
|
return {
|
|
@@ -722,7 +748,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
722
748
|
},
|
|
723
749
|
ref,
|
|
724
750
|
"aria-invalid": inputProps["aria-invalid"],
|
|
725
|
-
children: [/* @__PURE__ */
|
|
751
|
+
children: [/* @__PURE__ */jsx15(Input2, {
|
|
726
752
|
ref,
|
|
727
753
|
variant: "forms.inputNumber",
|
|
728
754
|
sx: sxProps,
|
|
@@ -732,7 +758,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
732
758
|
},
|
|
733
759
|
value,
|
|
734
760
|
...inputProps
|
|
735
|
-
}), /* @__PURE__ */
|
|
761
|
+
}), /* @__PURE__ */jsx15(Text, {
|
|
736
762
|
sx: {
|
|
737
763
|
position: "absolute",
|
|
738
764
|
alignSelf: "center",
|
|
@@ -741,10 +767,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
741
767
|
cursor: "pointer"
|
|
742
768
|
},
|
|
743
769
|
onClick: handleChangeUp,
|
|
744
|
-
children: /* @__PURE__ */
|
|
770
|
+
children: /* @__PURE__ */jsx15(Icon8, {
|
|
745
771
|
icon: "picker-down"
|
|
746
772
|
})
|
|
747
|
-
}), infoIcon && /* @__PURE__ */
|
|
773
|
+
}), infoIcon && /* @__PURE__ */jsx15(Text, {
|
|
748
774
|
sx: {
|
|
749
775
|
position: "absolute",
|
|
750
776
|
alignSelf: "center",
|
|
@@ -753,10 +779,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
753
779
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
754
780
|
},
|
|
755
781
|
onClick: onClickInfoIcon,
|
|
756
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */jsx15(Icon8, {
|
|
757
783
|
icon: "info"
|
|
758
784
|
})
|
|
759
|
-
}), /* @__PURE__ */
|
|
785
|
+
}), /* @__PURE__ */jsx15(Text, {
|
|
760
786
|
sx: {
|
|
761
787
|
position: "absolute",
|
|
762
788
|
alignSelf: "center",
|
|
@@ -765,7 +791,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
765
791
|
cursor: "pointer"
|
|
766
792
|
},
|
|
767
793
|
onClick: handleChangeDown,
|
|
768
|
-
children: /* @__PURE__ */
|
|
794
|
+
children: /* @__PURE__ */jsx15(Icon8, {
|
|
769
795
|
icon: "picker-up"
|
|
770
796
|
})
|
|
771
797
|
})]
|
|
@@ -774,10 +800,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
|
|
|
774
800
|
InputNumber.displayName = "InputNumber";
|
|
775
801
|
|
|
776
802
|
// src/components/Stack.tsx
|
|
777
|
-
import * as
|
|
778
|
-
import { jsx as
|
|
779
|
-
var Stack = /*#__PURE__*/
|
|
780
|
-
return /* @__PURE__ */
|
|
803
|
+
import * as React12 from "react";
|
|
804
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
805
|
+
var Stack = /*#__PURE__*/React12.forwardRef((props, ref) => {
|
|
806
|
+
return /* @__PURE__ */jsx16(Flex, {
|
|
781
807
|
ref,
|
|
782
808
|
...props,
|
|
783
809
|
sx: {
|
|
@@ -792,16 +818,16 @@ Stack.displayName = "Stack";
|
|
|
792
818
|
import { Paragraph } from "theme-ui";
|
|
793
819
|
|
|
794
820
|
// src/components/InputPassword/InputPassword.tsx
|
|
795
|
-
import * as
|
|
821
|
+
import * as React14 from "react";
|
|
796
822
|
|
|
797
823
|
// src/components/InputPassword/useHidePassInput.ts
|
|
798
|
-
import * as
|
|
824
|
+
import * as React13 from "react";
|
|
799
825
|
var useHidePassInput = (defaultValue = true) => {
|
|
800
|
-
const [hidePass, setHidePass] =
|
|
826
|
+
const [hidePass, setHidePass] = React13.useState(Boolean(defaultValue));
|
|
801
827
|
const {
|
|
802
828
|
icon,
|
|
803
829
|
inputType
|
|
804
|
-
} =
|
|
830
|
+
} = React13.useMemo(() => {
|
|
805
831
|
return {
|
|
806
832
|
icon: hidePass ? "view-off" : "view-on",
|
|
807
833
|
inputType: hidePass ? "password" : "text"
|
|
@@ -820,8 +846,8 @@ var useHidePassInput = (defaultValue = true) => {
|
|
|
820
846
|
};
|
|
821
847
|
|
|
822
848
|
// src/components/InputPassword/InputPassword.tsx
|
|
823
|
-
import { jsx as
|
|
824
|
-
var InputPassword = /*#__PURE__*/
|
|
849
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
850
|
+
var InputPassword = /*#__PURE__*/React14.forwardRef(({
|
|
825
851
|
showPasswordByDefault,
|
|
826
852
|
...inputPasswordProps
|
|
827
853
|
}, ref) => {
|
|
@@ -830,7 +856,7 @@ var InputPassword = /*#__PURE__*/React13.forwardRef(({
|
|
|
830
856
|
icon,
|
|
831
857
|
inputType
|
|
832
858
|
} = useHidePassInput(!showPasswordByDefault);
|
|
833
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */jsx17(Input, {
|
|
834
860
|
ref,
|
|
835
861
|
...inputPasswordProps,
|
|
836
862
|
trailingIcon: icon,
|
|
@@ -841,14 +867,14 @@ var InputPassword = /*#__PURE__*/React13.forwardRef(({
|
|
|
841
867
|
InputPassword.displayName = "InputPassword";
|
|
842
868
|
|
|
843
869
|
// src/components/ActionButton.tsx
|
|
844
|
-
import { jsx as
|
|
870
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
845
871
|
var ActionButton = ({
|
|
846
872
|
icon,
|
|
847
873
|
variant = "default",
|
|
848
874
|
sx,
|
|
849
875
|
...props
|
|
850
876
|
}) => {
|
|
851
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */jsx18(Button, {
|
|
852
878
|
variant: `buttons.actionButton.${variant}`,
|
|
853
879
|
leftIcon: icon,
|
|
854
880
|
sx: {
|
package/dist/index.d.mts
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, LinkProps as LinkProps$1, SxProp, IconButtonProps, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
-
export { BaseStyles, Box, BoxProps, Card, CardProps,
|
|
2
|
+
import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, SxProp, IconButtonProps, CheckboxProps as CheckboxProps$1, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
+
export { BaseStyles, Box, BoxProps, Card, CardProps, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Paragraph, ParagraphProps, Radio, RadioProps, Slider, SliderProps, Spinner, SpinnerProps, SxProp, Text, TextProps, Theme, ThemeUIStyleObject } from 'theme-ui';
|
|
4
4
|
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';
|
|
@@ -79,7 +79,7 @@ type SelectProps = Omit<Props<SelectOption, IsMulti>, 'styles' | 'value' | 'onCh
|
|
|
79
79
|
/**
|
|
80
80
|
* https://react-select.com/home
|
|
81
81
|
*/
|
|
82
|
-
declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, false>, "
|
|
82
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, false>, "value" | "onChange" | "styles" | "components"> & SxProp & {
|
|
83
83
|
value?: SelectOptionValue | undefined;
|
|
84
84
|
onChange?: ((value: SelectOptionValue | undefined) => void) | undefined;
|
|
85
85
|
disabled?: boolean | undefined;
|
|
@@ -89,6 +89,11 @@ declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, f
|
|
|
89
89
|
|
|
90
90
|
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
91
91
|
|
|
92
|
+
interface CheckboxProps extends CheckboxProps$1 {
|
|
93
|
+
indeterminate?: boolean;
|
|
94
|
+
}
|
|
95
|
+
declare const Checkbox: ({ indeterminate, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
92
97
|
declare const InfiniteLinearProgress: () => react_jsx_runtime.JSX.Element;
|
|
93
98
|
|
|
94
99
|
interface TextareaProps extends TextareaProps$1 {
|
|
@@ -135,4 +140,4 @@ type ActionButtonProps = Omit<ButtonProps, 'rightIcon' | 'leftIcon' | 'variant'>
|
|
|
135
140
|
};
|
|
136
141
|
declare const ActionButton: ({ icon, variant, sx, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
137
142
|
|
|
138
|
-
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, useTheme };
|
|
143
|
+
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, useTheme };
|
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, LinkProps as LinkProps$1, SxProp, IconButtonProps, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
-
export { BaseStyles, Box, BoxProps, Card, CardProps,
|
|
2
|
+
import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, SxProp, IconButtonProps, CheckboxProps as CheckboxProps$1, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
+
export { BaseStyles, Box, BoxProps, Card, CardProps, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Paragraph, ParagraphProps, Radio, RadioProps, Slider, SliderProps, Spinner, SpinnerProps, SxProp, Text, TextProps, Theme, ThemeUIStyleObject } from 'theme-ui';
|
|
4
4
|
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';
|
|
@@ -79,7 +79,7 @@ type SelectProps = Omit<Props<SelectOption, IsMulti>, 'styles' | 'value' | 'onCh
|
|
|
79
79
|
/**
|
|
80
80
|
* https://react-select.com/home
|
|
81
81
|
*/
|
|
82
|
-
declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, false>, "
|
|
82
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, false>, "value" | "onChange" | "styles" | "components"> & SxProp & {
|
|
83
83
|
value?: SelectOptionValue | undefined;
|
|
84
84
|
onChange?: ((value: SelectOptionValue | undefined) => void) | undefined;
|
|
85
85
|
disabled?: boolean | undefined;
|
|
@@ -89,6 +89,11 @@ declare const Select: React.ForwardRefExoticComponent<Omit<Props<SelectOption, f
|
|
|
89
89
|
|
|
90
90
|
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
91
91
|
|
|
92
|
+
interface CheckboxProps extends CheckboxProps$1 {
|
|
93
|
+
indeterminate?: boolean;
|
|
94
|
+
}
|
|
95
|
+
declare const Checkbox: ({ indeterminate, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
92
97
|
declare const InfiniteLinearProgress: () => react_jsx_runtime.JSX.Element;
|
|
93
98
|
|
|
94
99
|
interface TextareaProps extends TextareaProps$1 {
|
|
@@ -135,4 +140,4 @@ type ActionButtonProps = Omit<ButtonProps, 'rightIcon' | 'leftIcon' | 'variant'>
|
|
|
135
140
|
};
|
|
136
141
|
declare const ActionButton: ({ icon, variant, sx, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
137
142
|
|
|
138
|
-
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, useTheme };
|
|
143
|
+
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ __export(src_exports, {
|
|
|
44
44
|
Box: () => import_theme_ui5.Box,
|
|
45
45
|
Button: () => Button,
|
|
46
46
|
Card: () => import_theme_ui7.Card,
|
|
47
|
-
Checkbox: () =>
|
|
47
|
+
Checkbox: () => Checkbox,
|
|
48
48
|
CloseButton: () => CloseButton,
|
|
49
49
|
Container: () => Container,
|
|
50
50
|
Divider: () => import_theme_ui8.Divider,
|
|
@@ -405,9 +405,7 @@ var DropdownIndicator = props => {
|
|
|
405
405
|
});
|
|
406
406
|
};
|
|
407
407
|
var IndicatorsContainer = ({
|
|
408
|
-
children
|
|
409
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
410
|
-
...props
|
|
408
|
+
children
|
|
411
409
|
}) => {
|
|
412
410
|
return /* @__PURE__ */(0, import_jsx_runtime7.jsx)(import_theme_ui5.Box, {
|
|
413
411
|
sx: {
|
|
@@ -436,14 +434,18 @@ var SelectContainer = ({
|
|
|
436
434
|
sx,
|
|
437
435
|
css: css2
|
|
438
436
|
} = props.selectProps;
|
|
439
|
-
return
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
437
|
+
return (
|
|
438
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
439
|
+
/* @__PURE__ */
|
|
440
|
+
(0, import_jsx_runtime7.jsx)(import_theme_ui5.Box, {
|
|
441
|
+
sx,
|
|
442
|
+
css: css2,
|
|
443
|
+
children: /* @__PURE__ */(0, import_jsx_runtime7.jsx)(import_react_select.components.SelectContainer, {
|
|
444
|
+
...props,
|
|
445
|
+
children
|
|
446
|
+
})
|
|
445
447
|
})
|
|
446
|
-
|
|
448
|
+
);
|
|
447
449
|
};
|
|
448
450
|
var ValueContainer = ({
|
|
449
451
|
children,
|
|
@@ -565,15 +567,39 @@ IconButton.displayName = "IconButton";
|
|
|
565
567
|
var import_theme_ui20 = require("theme-ui");
|
|
566
568
|
|
|
567
569
|
// src/components/Checkbox.tsx
|
|
570
|
+
var React6 = __toESM(require("react"));
|
|
568
571
|
var import_theme_ui21 = require("theme-ui");
|
|
572
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
573
|
+
var Checkbox = ({
|
|
574
|
+
indeterminate = false,
|
|
575
|
+
...rest
|
|
576
|
+
}) => {
|
|
577
|
+
const ref = React6.useRef(null);
|
|
578
|
+
React6.useEffect(() => {
|
|
579
|
+
if (ref.current) {
|
|
580
|
+
ref.current.indeterminate = indeterminate;
|
|
581
|
+
}
|
|
582
|
+
}, [indeterminate]);
|
|
583
|
+
if (indeterminate) {
|
|
584
|
+
return /* @__PURE__ */(0, import_jsx_runtime9.jsx)("input", {
|
|
585
|
+
type: "checkbox",
|
|
586
|
+
ref,
|
|
587
|
+
...rest
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
return /* @__PURE__ */(0, import_jsx_runtime9.jsx)(import_theme_ui21.Checkbox, {
|
|
591
|
+
ref,
|
|
592
|
+
...rest
|
|
593
|
+
});
|
|
594
|
+
};
|
|
569
595
|
|
|
570
596
|
// src/components/InfiniteLinearProgress.tsx
|
|
571
|
-
var
|
|
572
|
-
var
|
|
597
|
+
var React7 = __toESM(require("react"));
|
|
598
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
573
599
|
var MAX_PROGRESS = 100;
|
|
574
600
|
var InfiniteLinearProgress = () => {
|
|
575
|
-
const [progress, setProgress] =
|
|
576
|
-
|
|
601
|
+
const [progress, setProgress] = React7.useState(0);
|
|
602
|
+
React7.useEffect(() => {
|
|
577
603
|
const timer = setInterval(() => {
|
|
578
604
|
setProgress(oldProgress => {
|
|
579
605
|
if (oldProgress === MAX_PROGRESS) {
|
|
@@ -594,7 +620,7 @@ var InfiniteLinearProgress = () => {
|
|
|
594
620
|
clearInterval(timer);
|
|
595
621
|
};
|
|
596
622
|
}, []);
|
|
597
|
-
return /* @__PURE__ */(0,
|
|
623
|
+
return /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui16.Progress, {
|
|
598
624
|
max: MAX_PROGRESS,
|
|
599
625
|
value: progress,
|
|
600
626
|
role: "progressbar"
|
|
@@ -602,17 +628,17 @@ var InfiniteLinearProgress = () => {
|
|
|
602
628
|
};
|
|
603
629
|
|
|
604
630
|
// src/components/Textarea.tsx
|
|
605
|
-
var
|
|
631
|
+
var React8 = __toESM(require("react"));
|
|
606
632
|
var import_react_icons6 = require("@ttoss/react-icons");
|
|
607
633
|
var import_theme_ui22 = require("theme-ui");
|
|
608
|
-
var
|
|
609
|
-
var Textarea =
|
|
634
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
635
|
+
var Textarea = React8.forwardRef(({
|
|
610
636
|
trailingIcon,
|
|
611
637
|
className,
|
|
612
638
|
sx,
|
|
613
639
|
...textareaProps
|
|
614
640
|
}, ref) => {
|
|
615
|
-
return /* @__PURE__ */(0,
|
|
641
|
+
return /* @__PURE__ */(0, import_jsx_runtime11.jsxs)(import_theme_ui9.Flex, {
|
|
616
642
|
className,
|
|
617
643
|
sx: {
|
|
618
644
|
...sx,
|
|
@@ -620,7 +646,7 @@ var Textarea = React7.forwardRef(({
|
|
|
620
646
|
padding: 0,
|
|
621
647
|
border: "none"
|
|
622
648
|
},
|
|
623
|
-
children: [/* @__PURE__ */(0,
|
|
649
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui22.Textarea, {
|
|
624
650
|
ref,
|
|
625
651
|
sx: {
|
|
626
652
|
fontFamily: "body",
|
|
@@ -632,13 +658,13 @@ var Textarea = React7.forwardRef(({
|
|
|
632
658
|
},
|
|
633
659
|
className,
|
|
634
660
|
...textareaProps
|
|
635
|
-
}), trailingIcon && /* @__PURE__ */(0,
|
|
661
|
+
}), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui3.Text, {
|
|
636
662
|
sx: {
|
|
637
663
|
position: "absolute",
|
|
638
664
|
right: "1.25rem",
|
|
639
665
|
top: "0.75rem"
|
|
640
666
|
},
|
|
641
|
-
children: /* @__PURE__ */(0,
|
|
667
|
+
children: /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_react_icons6.Icon, {
|
|
642
668
|
inline: true,
|
|
643
669
|
icon: trailingIcon
|
|
644
670
|
})
|
|
@@ -648,11 +674,11 @@ var Textarea = React7.forwardRef(({
|
|
|
648
674
|
Textarea.displayName = "Textarea";
|
|
649
675
|
|
|
650
676
|
// src/components/Container.tsx
|
|
651
|
-
var
|
|
677
|
+
var React9 = __toESM(require("react"));
|
|
652
678
|
var import_theme_ui23 = require("theme-ui");
|
|
653
|
-
var
|
|
654
|
-
var Container =
|
|
655
|
-
return /* @__PURE__ */(0,
|
|
679
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
680
|
+
var Container = React9.forwardRef((props, ref) => {
|
|
681
|
+
return /* @__PURE__ */(0, import_jsx_runtime12.jsx)(import_theme_ui23.Container, {
|
|
656
682
|
ref,
|
|
657
683
|
...props
|
|
658
684
|
});
|
|
@@ -660,7 +686,7 @@ var Container = React8.forwardRef((props, ref) => {
|
|
|
660
686
|
Container.displayName = "Container";
|
|
661
687
|
|
|
662
688
|
// src/components/HelpText.tsx
|
|
663
|
-
var
|
|
689
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
664
690
|
var HelpText = ({
|
|
665
691
|
sx,
|
|
666
692
|
disabled,
|
|
@@ -668,7 +694,7 @@ var HelpText = ({
|
|
|
668
694
|
...props
|
|
669
695
|
}) => {
|
|
670
696
|
const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
|
|
671
|
-
return /* @__PURE__ */(0,
|
|
697
|
+
return /* @__PURE__ */(0, import_jsx_runtime13.jsx)(import_theme_ui3.Text, {
|
|
672
698
|
variant,
|
|
673
699
|
sx: {
|
|
674
700
|
fontSize: "sm",
|
|
@@ -682,10 +708,10 @@ var HelpText = ({
|
|
|
682
708
|
};
|
|
683
709
|
|
|
684
710
|
// src/components/CloseButton.tsx
|
|
685
|
-
var
|
|
711
|
+
var React10 = __toESM(require("react"));
|
|
686
712
|
var import_react_icons7 = require("@ttoss/react-icons");
|
|
687
|
-
var
|
|
688
|
-
var CloseButton =
|
|
713
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
714
|
+
var CloseButton = React10.forwardRef(({
|
|
689
715
|
label,
|
|
690
716
|
sx,
|
|
691
717
|
onlyText,
|
|
@@ -694,7 +720,7 @@ var CloseButton = React9.forwardRef(({
|
|
|
694
720
|
if (onlyText && !label) {
|
|
695
721
|
return null;
|
|
696
722
|
}
|
|
697
|
-
return /* @__PURE__ */(0,
|
|
723
|
+
return /* @__PURE__ */(0, import_jsx_runtime14.jsxs)(Button, {
|
|
698
724
|
variant: "buttons.closeButton",
|
|
699
725
|
type: "button",
|
|
700
726
|
"aria-label": label,
|
|
@@ -716,7 +742,7 @@ var CloseButton = React9.forwardRef(({
|
|
|
716
742
|
},
|
|
717
743
|
...props,
|
|
718
744
|
ref,
|
|
719
|
-
children: [label, !onlyText && /* @__PURE__ */(0,
|
|
745
|
+
children: [label, !onlyText && /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_react_icons7.Icon, {
|
|
720
746
|
icon: "close"
|
|
721
747
|
})]
|
|
722
748
|
});
|
|
@@ -724,11 +750,11 @@ var CloseButton = React9.forwardRef(({
|
|
|
724
750
|
CloseButton.displayName = "CloseButton";
|
|
725
751
|
|
|
726
752
|
// src/components/InputNumber.tsx
|
|
727
|
-
var
|
|
753
|
+
var React11 = __toESM(require("react"));
|
|
728
754
|
var import_react_icons8 = require("@ttoss/react-icons");
|
|
729
755
|
var import_theme_ui24 = require("theme-ui");
|
|
730
|
-
var
|
|
731
|
-
var InputNumber =
|
|
756
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
757
|
+
var InputNumber = React11.forwardRef(({
|
|
732
758
|
sx,
|
|
733
759
|
value,
|
|
734
760
|
infoIcon,
|
|
@@ -736,7 +762,7 @@ var InputNumber = React10.forwardRef(({
|
|
|
736
762
|
onClickInfoIcon,
|
|
737
763
|
...inputProps
|
|
738
764
|
}, ref) => {
|
|
739
|
-
const sxProps =
|
|
765
|
+
const sxProps = React11.useMemo(() => {
|
|
740
766
|
const size = String(typeof value === "undefined" ? 0 : value).length;
|
|
741
767
|
if (inputProps["aria-invalid"] === "true") {
|
|
742
768
|
return {
|
|
@@ -788,7 +814,7 @@ var InputNumber = React10.forwardRef(({
|
|
|
788
814
|
}
|
|
789
815
|
onChange(value + 1);
|
|
790
816
|
};
|
|
791
|
-
return /* @__PURE__ */(0,
|
|
817
|
+
return /* @__PURE__ */(0, import_jsx_runtime15.jsxs)(import_theme_ui9.Flex, {
|
|
792
818
|
sx: {
|
|
793
819
|
width: "fit-content",
|
|
794
820
|
...sx,
|
|
@@ -798,7 +824,7 @@ var InputNumber = React10.forwardRef(({
|
|
|
798
824
|
},
|
|
799
825
|
ref,
|
|
800
826
|
"aria-invalid": inputProps["aria-invalid"],
|
|
801
|
-
children: [/* @__PURE__ */(0,
|
|
827
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui24.Input, {
|
|
802
828
|
ref,
|
|
803
829
|
variant: "forms.inputNumber",
|
|
804
830
|
sx: sxProps,
|
|
@@ -808,7 +834,7 @@ var InputNumber = React10.forwardRef(({
|
|
|
808
834
|
},
|
|
809
835
|
value,
|
|
810
836
|
...inputProps
|
|
811
|
-
}), /* @__PURE__ */(0,
|
|
837
|
+
}), /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
|
|
812
838
|
sx: {
|
|
813
839
|
position: "absolute",
|
|
814
840
|
alignSelf: "center",
|
|
@@ -817,10 +843,10 @@ var InputNumber = React10.forwardRef(({
|
|
|
817
843
|
cursor: "pointer"
|
|
818
844
|
},
|
|
819
845
|
onClick: handleChangeUp,
|
|
820
|
-
children: /* @__PURE__ */(0,
|
|
846
|
+
children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
|
|
821
847
|
icon: "picker-down"
|
|
822
848
|
})
|
|
823
|
-
}), infoIcon && /* @__PURE__ */(0,
|
|
849
|
+
}), infoIcon && /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
|
|
824
850
|
sx: {
|
|
825
851
|
position: "absolute",
|
|
826
852
|
alignSelf: "center",
|
|
@@ -829,10 +855,10 @@ var InputNumber = React10.forwardRef(({
|
|
|
829
855
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
830
856
|
},
|
|
831
857
|
onClick: onClickInfoIcon,
|
|
832
|
-
children: /* @__PURE__ */(0,
|
|
858
|
+
children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
|
|
833
859
|
icon: "info"
|
|
834
860
|
})
|
|
835
|
-
}), /* @__PURE__ */(0,
|
|
861
|
+
}), /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
|
|
836
862
|
sx: {
|
|
837
863
|
position: "absolute",
|
|
838
864
|
alignSelf: "center",
|
|
@@ -841,7 +867,7 @@ var InputNumber = React10.forwardRef(({
|
|
|
841
867
|
cursor: "pointer"
|
|
842
868
|
},
|
|
843
869
|
onClick: handleChangeDown,
|
|
844
|
-
children: /* @__PURE__ */(0,
|
|
870
|
+
children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
|
|
845
871
|
icon: "picker-up"
|
|
846
872
|
})
|
|
847
873
|
})]
|
|
@@ -850,10 +876,10 @@ var InputNumber = React10.forwardRef(({
|
|
|
850
876
|
InputNumber.displayName = "InputNumber";
|
|
851
877
|
|
|
852
878
|
// src/components/Stack.tsx
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
var Stack =
|
|
856
|
-
return /* @__PURE__ */(0,
|
|
879
|
+
var React12 = __toESM(require("react"));
|
|
880
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
881
|
+
var Stack = React12.forwardRef((props, ref) => {
|
|
882
|
+
return /* @__PURE__ */(0, import_jsx_runtime16.jsx)(import_theme_ui9.Flex, {
|
|
857
883
|
ref,
|
|
858
884
|
...props,
|
|
859
885
|
sx: {
|
|
@@ -868,16 +894,16 @@ Stack.displayName = "Stack";
|
|
|
868
894
|
var import_theme_ui25 = require("theme-ui");
|
|
869
895
|
|
|
870
896
|
// src/components/InputPassword/InputPassword.tsx
|
|
871
|
-
var
|
|
897
|
+
var React14 = __toESM(require("react"));
|
|
872
898
|
|
|
873
899
|
// src/components/InputPassword/useHidePassInput.ts
|
|
874
|
-
var
|
|
900
|
+
var React13 = __toESM(require("react"));
|
|
875
901
|
var useHidePassInput = (defaultValue = true) => {
|
|
876
|
-
const [hidePass, setHidePass] =
|
|
902
|
+
const [hidePass, setHidePass] = React13.useState(Boolean(defaultValue));
|
|
877
903
|
const {
|
|
878
904
|
icon,
|
|
879
905
|
inputType
|
|
880
|
-
} =
|
|
906
|
+
} = React13.useMemo(() => {
|
|
881
907
|
return {
|
|
882
908
|
icon: hidePass ? "view-off" : "view-on",
|
|
883
909
|
inputType: hidePass ? "password" : "text"
|
|
@@ -896,8 +922,8 @@ var useHidePassInput = (defaultValue = true) => {
|
|
|
896
922
|
};
|
|
897
923
|
|
|
898
924
|
// src/components/InputPassword/InputPassword.tsx
|
|
899
|
-
var
|
|
900
|
-
var InputPassword =
|
|
925
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
926
|
+
var InputPassword = React14.forwardRef(({
|
|
901
927
|
showPasswordByDefault,
|
|
902
928
|
...inputPasswordProps
|
|
903
929
|
}, ref) => {
|
|
@@ -906,7 +932,7 @@ var InputPassword = React13.forwardRef(({
|
|
|
906
932
|
icon,
|
|
907
933
|
inputType
|
|
908
934
|
} = useHidePassInput(!showPasswordByDefault);
|
|
909
|
-
return /* @__PURE__ */(0,
|
|
935
|
+
return /* @__PURE__ */(0, import_jsx_runtime17.jsx)(Input, {
|
|
910
936
|
ref,
|
|
911
937
|
...inputPasswordProps,
|
|
912
938
|
trailingIcon: icon,
|
|
@@ -917,14 +943,14 @@ var InputPassword = React13.forwardRef(({
|
|
|
917
943
|
InputPassword.displayName = "InputPassword";
|
|
918
944
|
|
|
919
945
|
// src/components/ActionButton.tsx
|
|
920
|
-
var
|
|
946
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
921
947
|
var ActionButton = ({
|
|
922
948
|
icon,
|
|
923
949
|
variant = "default",
|
|
924
950
|
sx,
|
|
925
951
|
...props
|
|
926
952
|
}) => {
|
|
927
|
-
return /* @__PURE__ */(0,
|
|
953
|
+
return /* @__PURE__ */(0, import_jsx_runtime18.jsx)(Button, {
|
|
928
954
|
variant: `buttons.actionButton.${variant}`,
|
|
929
955
|
leftIcon: icon,
|
|
930
956
|
sx: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -11,36 +11,40 @@
|
|
|
11
11
|
"url": "https://github.com/ttoss/ttoss.git",
|
|
12
12
|
"directory": "packages/ui"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/esm/index.js",
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
16
21
|
"files": [
|
|
17
22
|
"dist",
|
|
18
23
|
"src"
|
|
19
24
|
],
|
|
20
25
|
"sideEffects": false,
|
|
21
|
-
"typings": "dist/index.d.ts",
|
|
22
26
|
"dependencies": {
|
|
23
|
-
"@theme-ui/match-media": "^0.16.
|
|
27
|
+
"@theme-ui/match-media": "^0.16.2",
|
|
24
28
|
"react-select": "^5.8.0",
|
|
25
|
-
"theme-ui": "^0.16.
|
|
26
|
-
"@ttoss/theme": "^1.7.
|
|
29
|
+
"theme-ui": "^0.16.2",
|
|
30
|
+
"@ttoss/theme": "^1.7.1"
|
|
27
31
|
},
|
|
28
32
|
"peerDependencies": {
|
|
29
33
|
"@emotion/react": "^11",
|
|
30
34
|
"react": ">=16.8.0",
|
|
31
|
-
"@ttoss/react-icons": "^0.3.
|
|
35
|
+
"@ttoss/react-icons": "^0.3.1"
|
|
32
36
|
},
|
|
33
37
|
"devDependencies": {
|
|
34
38
|
"@emotion/react": "^11.11.3",
|
|
35
39
|
"@iconify-icons/mdi-light": "^1.2.5",
|
|
36
|
-
"@types/jest": "^29.5.
|
|
37
|
-
"@types/react": "^18.2.
|
|
40
|
+
"@types/jest": "^29.5.12",
|
|
41
|
+
"@types/react": "^18.2.58",
|
|
38
42
|
"jest": "^29.7.0",
|
|
39
43
|
"react": "^18.2.0",
|
|
40
|
-
"tsup": "^8.0.
|
|
41
|
-
"@ttoss/
|
|
42
|
-
"@ttoss/
|
|
43
|
-
"@ttoss/
|
|
44
|
+
"tsup": "^8.0.2",
|
|
45
|
+
"@ttoss/config": "^1.31.5",
|
|
46
|
+
"@ttoss/react-icons": "^0.3.1",
|
|
47
|
+
"@ttoss/test-utils": "^2.1.1"
|
|
44
48
|
},
|
|
45
49
|
"keywords": [
|
|
46
50
|
"React",
|
|
@@ -55,6 +59,7 @@
|
|
|
55
59
|
"gitHead": "e2b509ee8717f07f7365191b651dcbb5f080e05a",
|
|
56
60
|
"scripts": {
|
|
57
61
|
"build": "tsup",
|
|
62
|
+
"dev": "pnpm --filter @docs/storybook run dev",
|
|
58
63
|
"test": "jest"
|
|
59
64
|
}
|
|
60
65
|
}
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Checkbox as CheckBoxUi,
|
|
4
|
+
CheckboxProps as CheckboxPropsUi,
|
|
5
|
+
} from 'theme-ui';
|
|
6
|
+
|
|
7
|
+
export interface CheckboxProps extends CheckboxPropsUi {
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Checkbox = ({ indeterminate = false, ...rest }: CheckboxProps) => {
|
|
12
|
+
const ref = React.useRef<HTMLInputElement>(null);
|
|
13
|
+
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (ref.current) {
|
|
16
|
+
ref.current.indeterminate = indeterminate;
|
|
17
|
+
}
|
|
18
|
+
}, [indeterminate]);
|
|
19
|
+
|
|
20
|
+
if (indeterminate) {
|
|
21
|
+
return <input type="checkbox" ref={ref} {...rest} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return <CheckBoxUi ref={ref} {...rest} />;
|
|
25
|
+
};
|
|
@@ -117,8 +117,6 @@ const DropdownIndicator = (
|
|
|
117
117
|
|
|
118
118
|
const IndicatorsContainer = ({
|
|
119
119
|
children,
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
121
|
-
...props
|
|
122
120
|
}: IndicatorsContainerProps<SelectOption, IsMulti>) => {
|
|
123
121
|
return (
|
|
124
122
|
<Box
|
|
@@ -152,7 +150,8 @@ const SelectContainer = ({
|
|
|
152
150
|
const { sx, css } = props.selectProps as unknown as SelectProps;
|
|
153
151
|
|
|
154
152
|
return (
|
|
155
|
-
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
+
<Box sx={sx as any} css={css}>
|
|
156
155
|
<components.SelectContainer {...props}>
|
|
157
156
|
{children}
|
|
158
157
|
</components.SelectContainer>
|