@ttoss/ui 4.1.2 → 4.1.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 CHANGED
@@ -491,15 +491,39 @@ IconButton.displayName = "IconButton";
491
491
  import { Slider } from "theme-ui";
492
492
 
493
493
  // src/components/Checkbox.tsx
494
- import { Checkbox } from "theme-ui";
495
-
496
- // src/components/InfiniteLinearProgress.tsx
497
494
  import * as React6 from "react";
495
+ import { Checkbox as CheckBoxUi } from "theme-ui";
498
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";
499
523
  var MAX_PROGRESS = 100;
500
524
  var InfiniteLinearProgress = () => {
501
- const [progress, setProgress] = React6.useState(0);
502
- React6.useEffect(() => {
525
+ const [progress, setProgress] = React7.useState(0);
526
+ React7.useEffect(() => {
503
527
  const timer = setInterval(() => {
504
528
  setProgress(oldProgress => {
505
529
  if (oldProgress === MAX_PROGRESS) {
@@ -520,7 +544,7 @@ var InfiniteLinearProgress = () => {
520
544
  clearInterval(timer);
521
545
  };
522
546
  }, []);
523
- return /* @__PURE__ */jsx9(Progress, {
547
+ return /* @__PURE__ */jsx10(Progress, {
524
548
  max: MAX_PROGRESS,
525
549
  value: progress,
526
550
  role: "progressbar"
@@ -528,11 +552,11 @@ var InfiniteLinearProgress = () => {
528
552
  };
529
553
 
530
554
  // src/components/Textarea.tsx
531
- import * as React7 from "react";
555
+ import * as React8 from "react";
532
556
  import { Icon as Icon6 } from "@ttoss/react-icons";
533
557
  import { Textarea as TextareaUI } from "theme-ui";
534
- import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
535
- var Textarea = /*#__PURE__*/React7.forwardRef(({
558
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
559
+ var Textarea = /*#__PURE__*/React8.forwardRef(({
536
560
  trailingIcon,
537
561
  className,
538
562
  sx,
@@ -546,7 +570,7 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
546
570
  padding: 0,
547
571
  border: "none"
548
572
  },
549
- children: [/* @__PURE__ */jsx10(TextareaUI, {
573
+ children: [/* @__PURE__ */jsx11(TextareaUI, {
550
574
  ref,
551
575
  sx: {
552
576
  fontFamily: "body",
@@ -558,13 +582,13 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
558
582
  },
559
583
  className,
560
584
  ...textareaProps
561
- }), trailingIcon && /* @__PURE__ */jsx10(Text, {
585
+ }), trailingIcon && /* @__PURE__ */jsx11(Text, {
562
586
  sx: {
563
587
  position: "absolute",
564
588
  right: "1.25rem",
565
589
  top: "0.75rem"
566
590
  },
567
- children: /* @__PURE__ */jsx10(Icon6, {
591
+ children: /* @__PURE__ */jsx11(Icon6, {
568
592
  inline: true,
569
593
  icon: trailingIcon
570
594
  })
@@ -574,11 +598,11 @@ var Textarea = /*#__PURE__*/React7.forwardRef(({
574
598
  Textarea.displayName = "Textarea";
575
599
 
576
600
  // src/components/Container.tsx
577
- import * as React8 from "react";
601
+ import * as React9 from "react";
578
602
  import { Container as ContainerUi } from "theme-ui";
579
- import { jsx as jsx11 } from "react/jsx-runtime";
580
- var Container = /*#__PURE__*/React8.forwardRef((props, ref) => {
581
- return /* @__PURE__ */jsx11(ContainerUi, {
603
+ import { jsx as jsx12 } from "react/jsx-runtime";
604
+ var Container = /*#__PURE__*/React9.forwardRef((props, ref) => {
605
+ return /* @__PURE__ */jsx12(ContainerUi, {
582
606
  ref,
583
607
  ...props
584
608
  });
@@ -586,7 +610,7 @@ var Container = /*#__PURE__*/React8.forwardRef((props, ref) => {
586
610
  Container.displayName = "Container";
587
611
 
588
612
  // src/components/HelpText.tsx
589
- import { jsx as jsx12 } from "react/jsx-runtime";
613
+ import { jsx as jsx13 } from "react/jsx-runtime";
590
614
  var HelpText = ({
591
615
  sx,
592
616
  disabled,
@@ -594,7 +618,7 @@ var HelpText = ({
594
618
  ...props
595
619
  }) => {
596
620
  const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
597
- return /* @__PURE__ */jsx12(Text, {
621
+ return /* @__PURE__ */jsx13(Text, {
598
622
  variant,
599
623
  sx: {
600
624
  fontSize: "sm",
@@ -608,10 +632,10 @@ var HelpText = ({
608
632
  };
609
633
 
610
634
  // src/components/CloseButton.tsx
611
- import * as React9 from "react";
635
+ import * as React10 from "react";
612
636
  import { Icon as Icon7 } from "@ttoss/react-icons";
613
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
614
- var CloseButton = /*#__PURE__*/React9.forwardRef(({
637
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
638
+ var CloseButton = /*#__PURE__*/React10.forwardRef(({
615
639
  label,
616
640
  sx,
617
641
  onlyText,
@@ -642,7 +666,7 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
642
666
  },
643
667
  ...props,
644
668
  ref,
645
- children: [label, !onlyText && /* @__PURE__ */jsx13(Icon7, {
669
+ children: [label, !onlyText && /* @__PURE__ */jsx14(Icon7, {
646
670
  icon: "close"
647
671
  })]
648
672
  });
@@ -650,11 +674,11 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
650
674
  CloseButton.displayName = "CloseButton";
651
675
 
652
676
  // src/components/InputNumber.tsx
653
- import * as React10 from "react";
677
+ import * as React11 from "react";
654
678
  import { Icon as Icon8 } from "@ttoss/react-icons";
655
679
  import { Input as Input2 } from "theme-ui";
656
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
657
- var InputNumber = /*#__PURE__*/React10.forwardRef(({
680
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
681
+ var InputNumber = /*#__PURE__*/React11.forwardRef(({
658
682
  sx,
659
683
  value,
660
684
  infoIcon,
@@ -662,7 +686,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
662
686
  onClickInfoIcon,
663
687
  ...inputProps
664
688
  }, ref) => {
665
- const sxProps = React10.useMemo(() => {
689
+ const sxProps = React11.useMemo(() => {
666
690
  const size = String(typeof value === "undefined" ? 0 : value).length;
667
691
  if (inputProps["aria-invalid"] === "true") {
668
692
  return {
@@ -724,7 +748,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
724
748
  },
725
749
  ref,
726
750
  "aria-invalid": inputProps["aria-invalid"],
727
- children: [/* @__PURE__ */jsx14(Input2, {
751
+ children: [/* @__PURE__ */jsx15(Input2, {
728
752
  ref,
729
753
  variant: "forms.inputNumber",
730
754
  sx: sxProps,
@@ -734,7 +758,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
734
758
  },
735
759
  value,
736
760
  ...inputProps
737
- }), /* @__PURE__ */jsx14(Text, {
761
+ }), /* @__PURE__ */jsx15(Text, {
738
762
  sx: {
739
763
  position: "absolute",
740
764
  alignSelf: "center",
@@ -743,10 +767,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
743
767
  cursor: "pointer"
744
768
  },
745
769
  onClick: handleChangeUp,
746
- children: /* @__PURE__ */jsx14(Icon8, {
770
+ children: /* @__PURE__ */jsx15(Icon8, {
747
771
  icon: "picker-down"
748
772
  })
749
- }), infoIcon && /* @__PURE__ */jsx14(Text, {
773
+ }), infoIcon && /* @__PURE__ */jsx15(Text, {
750
774
  sx: {
751
775
  position: "absolute",
752
776
  alignSelf: "center",
@@ -755,10 +779,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
755
779
  cursor: onClickInfoIcon ? "pointer" : "default"
756
780
  },
757
781
  onClick: onClickInfoIcon,
758
- children: /* @__PURE__ */jsx14(Icon8, {
782
+ children: /* @__PURE__ */jsx15(Icon8, {
759
783
  icon: "info"
760
784
  })
761
- }), /* @__PURE__ */jsx14(Text, {
785
+ }), /* @__PURE__ */jsx15(Text, {
762
786
  sx: {
763
787
  position: "absolute",
764
788
  alignSelf: "center",
@@ -767,7 +791,7 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
767
791
  cursor: "pointer"
768
792
  },
769
793
  onClick: handleChangeDown,
770
- children: /* @__PURE__ */jsx14(Icon8, {
794
+ children: /* @__PURE__ */jsx15(Icon8, {
771
795
  icon: "picker-up"
772
796
  })
773
797
  })]
@@ -776,10 +800,10 @@ var InputNumber = /*#__PURE__*/React10.forwardRef(({
776
800
  InputNumber.displayName = "InputNumber";
777
801
 
778
802
  // src/components/Stack.tsx
779
- import * as React11 from "react";
780
- import { jsx as jsx15 } from "react/jsx-runtime";
781
- var Stack = /*#__PURE__*/React11.forwardRef((props, ref) => {
782
- return /* @__PURE__ */jsx15(Flex, {
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, {
783
807
  ref,
784
808
  ...props,
785
809
  sx: {
@@ -794,16 +818,16 @@ Stack.displayName = "Stack";
794
818
  import { Paragraph } from "theme-ui";
795
819
 
796
820
  // src/components/InputPassword/InputPassword.tsx
797
- import * as React13 from "react";
821
+ import * as React14 from "react";
798
822
 
799
823
  // src/components/InputPassword/useHidePassInput.ts
800
- import * as React12 from "react";
824
+ import * as React13 from "react";
801
825
  var useHidePassInput = (defaultValue = true) => {
802
- const [hidePass, setHidePass] = React12.useState(Boolean(defaultValue));
826
+ const [hidePass, setHidePass] = React13.useState(Boolean(defaultValue));
803
827
  const {
804
828
  icon,
805
829
  inputType
806
- } = React12.useMemo(() => {
830
+ } = React13.useMemo(() => {
807
831
  return {
808
832
  icon: hidePass ? "view-off" : "view-on",
809
833
  inputType: hidePass ? "password" : "text"
@@ -822,8 +846,8 @@ var useHidePassInput = (defaultValue = true) => {
822
846
  };
823
847
 
824
848
  // src/components/InputPassword/InputPassword.tsx
825
- import { jsx as jsx16 } from "react/jsx-runtime";
826
- var InputPassword = /*#__PURE__*/React13.forwardRef(({
849
+ import { jsx as jsx17 } from "react/jsx-runtime";
850
+ var InputPassword = /*#__PURE__*/React14.forwardRef(({
827
851
  showPasswordByDefault,
828
852
  ...inputPasswordProps
829
853
  }, ref) => {
@@ -832,7 +856,7 @@ var InputPassword = /*#__PURE__*/React13.forwardRef(({
832
856
  icon,
833
857
  inputType
834
858
  } = useHidePassInput(!showPasswordByDefault);
835
- return /* @__PURE__ */jsx16(Input, {
859
+ return /* @__PURE__ */jsx17(Input, {
836
860
  ref,
837
861
  ...inputPasswordProps,
838
862
  trailingIcon: icon,
@@ -843,14 +867,14 @@ var InputPassword = /*#__PURE__*/React13.forwardRef(({
843
867
  InputPassword.displayName = "InputPassword";
844
868
 
845
869
  // src/components/ActionButton.tsx
846
- import { jsx as jsx17 } from "react/jsx-runtime";
870
+ import { jsx as jsx18 } from "react/jsx-runtime";
847
871
  var ActionButton = ({
848
872
  icon,
849
873
  variant = "default",
850
874
  sx,
851
875
  ...props
852
876
  }) => {
853
- return /* @__PURE__ */jsx17(Button, {
877
+ return /* @__PURE__ */jsx18(Button, {
854
878
  variant: `buttons.actionButton.${variant}`,
855
879
  leftIcon: icon,
856
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, Checkbox, CheckboxProps, 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';
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';
@@ -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, Checkbox, CheckboxProps, 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';
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';
@@ -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: () => import_theme_ui21.Checkbox,
47
+ Checkbox: () => Checkbox,
48
48
  CloseButton: () => CloseButton,
49
49
  Container: () => Container,
50
50
  Divider: () => import_theme_ui8.Divider,
@@ -567,15 +567,39 @@ IconButton.displayName = "IconButton";
567
567
  var import_theme_ui20 = require("theme-ui");
568
568
 
569
569
  // src/components/Checkbox.tsx
570
+ var React6 = __toESM(require("react"));
570
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
+ };
571
595
 
572
596
  // src/components/InfiniteLinearProgress.tsx
573
- var React6 = __toESM(require("react"));
574
- var import_jsx_runtime9 = require("react/jsx-runtime");
597
+ var React7 = __toESM(require("react"));
598
+ var import_jsx_runtime10 = require("react/jsx-runtime");
575
599
  var MAX_PROGRESS = 100;
576
600
  var InfiniteLinearProgress = () => {
577
- const [progress, setProgress] = React6.useState(0);
578
- React6.useEffect(() => {
601
+ const [progress, setProgress] = React7.useState(0);
602
+ React7.useEffect(() => {
579
603
  const timer = setInterval(() => {
580
604
  setProgress(oldProgress => {
581
605
  if (oldProgress === MAX_PROGRESS) {
@@ -596,7 +620,7 @@ var InfiniteLinearProgress = () => {
596
620
  clearInterval(timer);
597
621
  };
598
622
  }, []);
599
- return /* @__PURE__ */(0, import_jsx_runtime9.jsx)(import_theme_ui16.Progress, {
623
+ return /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui16.Progress, {
600
624
  max: MAX_PROGRESS,
601
625
  value: progress,
602
626
  role: "progressbar"
@@ -604,17 +628,17 @@ var InfiniteLinearProgress = () => {
604
628
  };
605
629
 
606
630
  // src/components/Textarea.tsx
607
- var React7 = __toESM(require("react"));
631
+ var React8 = __toESM(require("react"));
608
632
  var import_react_icons6 = require("@ttoss/react-icons");
609
633
  var import_theme_ui22 = require("theme-ui");
610
- var import_jsx_runtime10 = require("react/jsx-runtime");
611
- var Textarea = React7.forwardRef(({
634
+ var import_jsx_runtime11 = require("react/jsx-runtime");
635
+ var Textarea = React8.forwardRef(({
612
636
  trailingIcon,
613
637
  className,
614
638
  sx,
615
639
  ...textareaProps
616
640
  }, ref) => {
617
- return /* @__PURE__ */(0, import_jsx_runtime10.jsxs)(import_theme_ui9.Flex, {
641
+ return /* @__PURE__ */(0, import_jsx_runtime11.jsxs)(import_theme_ui9.Flex, {
618
642
  className,
619
643
  sx: {
620
644
  ...sx,
@@ -622,7 +646,7 @@ var Textarea = React7.forwardRef(({
622
646
  padding: 0,
623
647
  border: "none"
624
648
  },
625
- children: [/* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui22.Textarea, {
649
+ children: [/* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui22.Textarea, {
626
650
  ref,
627
651
  sx: {
628
652
  fontFamily: "body",
@@ -634,13 +658,13 @@ var Textarea = React7.forwardRef(({
634
658
  },
635
659
  className,
636
660
  ...textareaProps
637
- }), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui3.Text, {
661
+ }), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui3.Text, {
638
662
  sx: {
639
663
  position: "absolute",
640
664
  right: "1.25rem",
641
665
  top: "0.75rem"
642
666
  },
643
- children: /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_react_icons6.Icon, {
667
+ children: /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_react_icons6.Icon, {
644
668
  inline: true,
645
669
  icon: trailingIcon
646
670
  })
@@ -650,11 +674,11 @@ var Textarea = React7.forwardRef(({
650
674
  Textarea.displayName = "Textarea";
651
675
 
652
676
  // src/components/Container.tsx
653
- var React8 = __toESM(require("react"));
677
+ var React9 = __toESM(require("react"));
654
678
  var import_theme_ui23 = require("theme-ui");
655
- var import_jsx_runtime11 = require("react/jsx-runtime");
656
- var Container = React8.forwardRef((props, ref) => {
657
- return /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui23.Container, {
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, {
658
682
  ref,
659
683
  ...props
660
684
  });
@@ -662,7 +686,7 @@ var Container = React8.forwardRef((props, ref) => {
662
686
  Container.displayName = "Container";
663
687
 
664
688
  // src/components/HelpText.tsx
665
- var import_jsx_runtime12 = require("react/jsx-runtime");
689
+ var import_jsx_runtime13 = require("react/jsx-runtime");
666
690
  var HelpText = ({
667
691
  sx,
668
692
  disabled,
@@ -670,7 +694,7 @@ var HelpText = ({
670
694
  ...props
671
695
  }) => {
672
696
  const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
673
- return /* @__PURE__ */(0, import_jsx_runtime12.jsx)(import_theme_ui3.Text, {
697
+ return /* @__PURE__ */(0, import_jsx_runtime13.jsx)(import_theme_ui3.Text, {
674
698
  variant,
675
699
  sx: {
676
700
  fontSize: "sm",
@@ -684,10 +708,10 @@ var HelpText = ({
684
708
  };
685
709
 
686
710
  // src/components/CloseButton.tsx
687
- var React9 = __toESM(require("react"));
711
+ var React10 = __toESM(require("react"));
688
712
  var import_react_icons7 = require("@ttoss/react-icons");
689
- var import_jsx_runtime13 = require("react/jsx-runtime");
690
- var CloseButton = React9.forwardRef(({
713
+ var import_jsx_runtime14 = require("react/jsx-runtime");
714
+ var CloseButton = React10.forwardRef(({
691
715
  label,
692
716
  sx,
693
717
  onlyText,
@@ -696,7 +720,7 @@ var CloseButton = React9.forwardRef(({
696
720
  if (onlyText && !label) {
697
721
  return null;
698
722
  }
699
- return /* @__PURE__ */(0, import_jsx_runtime13.jsxs)(Button, {
723
+ return /* @__PURE__ */(0, import_jsx_runtime14.jsxs)(Button, {
700
724
  variant: "buttons.closeButton",
701
725
  type: "button",
702
726
  "aria-label": label,
@@ -718,7 +742,7 @@ var CloseButton = React9.forwardRef(({
718
742
  },
719
743
  ...props,
720
744
  ref,
721
- children: [label, !onlyText && /* @__PURE__ */(0, import_jsx_runtime13.jsx)(import_react_icons7.Icon, {
745
+ children: [label, !onlyText && /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_react_icons7.Icon, {
722
746
  icon: "close"
723
747
  })]
724
748
  });
@@ -726,11 +750,11 @@ var CloseButton = React9.forwardRef(({
726
750
  CloseButton.displayName = "CloseButton";
727
751
 
728
752
  // src/components/InputNumber.tsx
729
- var React10 = __toESM(require("react"));
753
+ var React11 = __toESM(require("react"));
730
754
  var import_react_icons8 = require("@ttoss/react-icons");
731
755
  var import_theme_ui24 = require("theme-ui");
732
- var import_jsx_runtime14 = require("react/jsx-runtime");
733
- var InputNumber = React10.forwardRef(({
756
+ var import_jsx_runtime15 = require("react/jsx-runtime");
757
+ var InputNumber = React11.forwardRef(({
734
758
  sx,
735
759
  value,
736
760
  infoIcon,
@@ -738,7 +762,7 @@ var InputNumber = React10.forwardRef(({
738
762
  onClickInfoIcon,
739
763
  ...inputProps
740
764
  }, ref) => {
741
- const sxProps = React10.useMemo(() => {
765
+ const sxProps = React11.useMemo(() => {
742
766
  const size = String(typeof value === "undefined" ? 0 : value).length;
743
767
  if (inputProps["aria-invalid"] === "true") {
744
768
  return {
@@ -790,7 +814,7 @@ var InputNumber = React10.forwardRef(({
790
814
  }
791
815
  onChange(value + 1);
792
816
  };
793
- return /* @__PURE__ */(0, import_jsx_runtime14.jsxs)(import_theme_ui9.Flex, {
817
+ return /* @__PURE__ */(0, import_jsx_runtime15.jsxs)(import_theme_ui9.Flex, {
794
818
  sx: {
795
819
  width: "fit-content",
796
820
  ...sx,
@@ -800,7 +824,7 @@ var InputNumber = React10.forwardRef(({
800
824
  },
801
825
  ref,
802
826
  "aria-invalid": inputProps["aria-invalid"],
803
- children: [/* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui24.Input, {
827
+ children: [/* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui24.Input, {
804
828
  ref,
805
829
  variant: "forms.inputNumber",
806
830
  sx: sxProps,
@@ -810,7 +834,7 @@ var InputNumber = React10.forwardRef(({
810
834
  },
811
835
  value,
812
836
  ...inputProps
813
- }), /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui3.Text, {
837
+ }), /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
814
838
  sx: {
815
839
  position: "absolute",
816
840
  alignSelf: "center",
@@ -819,10 +843,10 @@ var InputNumber = React10.forwardRef(({
819
843
  cursor: "pointer"
820
844
  },
821
845
  onClick: handleChangeUp,
822
- children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_react_icons8.Icon, {
846
+ children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
823
847
  icon: "picker-down"
824
848
  })
825
- }), infoIcon && /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui3.Text, {
849
+ }), infoIcon && /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
826
850
  sx: {
827
851
  position: "absolute",
828
852
  alignSelf: "center",
@@ -831,10 +855,10 @@ var InputNumber = React10.forwardRef(({
831
855
  cursor: onClickInfoIcon ? "pointer" : "default"
832
856
  },
833
857
  onClick: onClickInfoIcon,
834
- children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_react_icons8.Icon, {
858
+ children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
835
859
  icon: "info"
836
860
  })
837
- }), /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_theme_ui3.Text, {
861
+ }), /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui3.Text, {
838
862
  sx: {
839
863
  position: "absolute",
840
864
  alignSelf: "center",
@@ -843,7 +867,7 @@ var InputNumber = React10.forwardRef(({
843
867
  cursor: "pointer"
844
868
  },
845
869
  onClick: handleChangeDown,
846
- children: /* @__PURE__ */(0, import_jsx_runtime14.jsx)(import_react_icons8.Icon, {
870
+ children: /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_react_icons8.Icon, {
847
871
  icon: "picker-up"
848
872
  })
849
873
  })]
@@ -852,10 +876,10 @@ var InputNumber = React10.forwardRef(({
852
876
  InputNumber.displayName = "InputNumber";
853
877
 
854
878
  // src/components/Stack.tsx
855
- var React11 = __toESM(require("react"));
856
- var import_jsx_runtime15 = require("react/jsx-runtime");
857
- var Stack = React11.forwardRef((props, ref) => {
858
- return /* @__PURE__ */(0, import_jsx_runtime15.jsx)(import_theme_ui9.Flex, {
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, {
859
883
  ref,
860
884
  ...props,
861
885
  sx: {
@@ -870,16 +894,16 @@ Stack.displayName = "Stack";
870
894
  var import_theme_ui25 = require("theme-ui");
871
895
 
872
896
  // src/components/InputPassword/InputPassword.tsx
873
- var React13 = __toESM(require("react"));
897
+ var React14 = __toESM(require("react"));
874
898
 
875
899
  // src/components/InputPassword/useHidePassInput.ts
876
- var React12 = __toESM(require("react"));
900
+ var React13 = __toESM(require("react"));
877
901
  var useHidePassInput = (defaultValue = true) => {
878
- const [hidePass, setHidePass] = React12.useState(Boolean(defaultValue));
902
+ const [hidePass, setHidePass] = React13.useState(Boolean(defaultValue));
879
903
  const {
880
904
  icon,
881
905
  inputType
882
- } = React12.useMemo(() => {
906
+ } = React13.useMemo(() => {
883
907
  return {
884
908
  icon: hidePass ? "view-off" : "view-on",
885
909
  inputType: hidePass ? "password" : "text"
@@ -898,8 +922,8 @@ var useHidePassInput = (defaultValue = true) => {
898
922
  };
899
923
 
900
924
  // src/components/InputPassword/InputPassword.tsx
901
- var import_jsx_runtime16 = require("react/jsx-runtime");
902
- var InputPassword = React13.forwardRef(({
925
+ var import_jsx_runtime17 = require("react/jsx-runtime");
926
+ var InputPassword = React14.forwardRef(({
903
927
  showPasswordByDefault,
904
928
  ...inputPasswordProps
905
929
  }, ref) => {
@@ -908,7 +932,7 @@ var InputPassword = React13.forwardRef(({
908
932
  icon,
909
933
  inputType
910
934
  } = useHidePassInput(!showPasswordByDefault);
911
- return /* @__PURE__ */(0, import_jsx_runtime16.jsx)(Input, {
935
+ return /* @__PURE__ */(0, import_jsx_runtime17.jsx)(Input, {
912
936
  ref,
913
937
  ...inputPasswordProps,
914
938
  trailingIcon: icon,
@@ -919,14 +943,14 @@ var InputPassword = React13.forwardRef(({
919
943
  InputPassword.displayName = "InputPassword";
920
944
 
921
945
  // src/components/ActionButton.tsx
922
- var import_jsx_runtime17 = require("react/jsx-runtime");
946
+ var import_jsx_runtime18 = require("react/jsx-runtime");
923
947
  var ActionButton = ({
924
948
  icon,
925
949
  variant = "default",
926
950
  sx,
927
951
  ...props
928
952
  }) => {
929
- return /* @__PURE__ */(0, import_jsx_runtime17.jsx)(Button, {
953
+ return /* @__PURE__ */(0, import_jsx_runtime18.jsx)(Button, {
930
954
  variant: `buttons.actionButton.${variant}`,
931
955
  leftIcon: icon,
932
956
  sx: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Primitive layout, typographic, and other components for styling applications.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -27,7 +27,7 @@
27
27
  "@theme-ui/match-media": "^0.16.2",
28
28
  "react-select": "^5.8.0",
29
29
  "theme-ui": "^0.16.2",
30
- "@ttoss/theme": "^1.7.1"
30
+ "@ttoss/theme": "^1.7.2"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@emotion/react": "^11",
@@ -42,9 +42,9 @@
42
42
  "jest": "^29.7.0",
43
43
  "react": "^18.2.0",
44
44
  "tsup": "^8.0.2",
45
- "@ttoss/config": "^1.31.5",
46
45
  "@ttoss/react-icons": "^0.3.1",
47
- "@ttoss/test-utils": "^2.1.1"
46
+ "@ttoss/test-utils": "^2.1.1",
47
+ "@ttoss/config": "^1.31.5"
48
48
  },
49
49
  "keywords": [
50
50
  "React",
@@ -1 +1,25 @@
1
- export { type CheckboxProps, Checkbox } from 'theme-ui';
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
+ };