@ttoss/ui 5.1.0 → 5.1.2

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
@@ -1,9 +1,9 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
 
3
3
  // src/components/Button.tsx
4
+ import { Icon } from "@ttoss/react-icons";
4
5
  import * as React from "react";
5
6
  import { Button as ButtonUi } from "theme-ui";
6
- import { Icon } from "@ttoss/react-icons";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  var Button = React.forwardRef((props, ref) => {
9
9
  const {
@@ -19,12 +19,12 @@ var Button = React.forwardRef((props, ref) => {
19
19
  ref,
20
20
  sx: {
21
21
  cursor: "pointer",
22
- paddingX: "xl",
23
- paddingY: "lg",
22
+ paddingX: "6",
23
+ paddingY: "4",
24
24
  fontFamily: "body",
25
25
  display: "inline-flex",
26
26
  alignItems: "center",
27
- gap: "lg",
27
+ gap: "4",
28
28
  ...restProps.sx
29
29
  },
30
30
  children: [loading && /* @__PURE__ */jsx(Icon, {
@@ -53,9 +53,9 @@ var ActionButton = ({
53
53
  variant: `buttons.actionButton.${variant}`,
54
54
  leftIcon: icon,
55
55
  sx: {
56
- padding: "sm",
57
- gap: "xs",
58
- fontFamily: "caption",
56
+ padding: "2",
57
+ gap: "4",
58
+ fontFamily: "body",
59
59
  borderRadius: "action",
60
60
  outlineColor: "transparent",
61
61
  ":disabled": props.disabled ? {
@@ -72,8 +72,8 @@ var ActionButton = ({
72
72
  };
73
73
 
74
74
  // src/components/Badge.tsx
75
- import { Badge as BadgeUi } from "theme-ui";
76
75
  import { Icon as Icon2 } from "@ttoss/react-icons";
76
+ import { Badge as BadgeUi } from "theme-ui";
77
77
 
78
78
  // src/components/Text.tsx
79
79
  import { Text } from "theme-ui";
@@ -92,14 +92,14 @@ var Badge = ({
92
92
  sx: {
93
93
  display: "flex",
94
94
  alignItems: "center",
95
- fontFamily: "caption",
95
+ fontFamily: "body",
96
96
  fontWeight: "normal",
97
97
  lineHeight: "base",
98
98
  fontSize: "sm",
99
- paddingX: "xs",
99
+ paddingX: "2",
100
100
  borderRadius: "informative",
101
- paddingY: "2xs",
102
- gap: "xs",
101
+ paddingY: "1",
102
+ gap: "2",
103
103
  ...sx
104
104
  },
105
105
  ...props,
@@ -160,8 +160,8 @@ var Checkbox = React2.forwardRef(({
160
160
  Checkbox.displayName = "Checkbox";
161
161
 
162
162
  // src/components/CloseButton.tsx
163
- import * as React3 from "react";
164
163
  import { Icon as Icon3 } from "@ttoss/react-icons";
164
+ import * as React3 from "react";
165
165
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
166
166
  var CloseButton = React3.forwardRef(({
167
167
  label,
@@ -177,18 +177,18 @@ var CloseButton = React3.forwardRef(({
177
177
  type: "button",
178
178
  "aria-label": label,
179
179
  sx: {
180
- fontFamily: "caption",
180
+ fontFamily: "body",
181
181
  fontSize: "xs",
182
182
  display: "inline-flex",
183
183
  alignItems: "center",
184
184
  cursor: "pointer",
185
185
  lineHeight: "normal",
186
- gap: "sm",
187
- padding: "sm",
186
+ gap: "2",
187
+ padding: "2",
188
188
  width: "fit-content",
189
189
  transition: "all 0.2s",
190
190
  "& > iconify-icon": {
191
- fontSize: "base"
191
+ fontSize: "md"
192
192
  },
193
193
  ...sx
194
194
  },
@@ -238,8 +238,8 @@ var HelpText = ({
238
238
  variant,
239
239
  sx: {
240
240
  fontSize: "sm",
241
- fontFamily: "caption",
242
- lineHeight: "base",
241
+ fontFamily: "body",
242
+ lineHeight: "normal",
243
243
  ...sx
244
244
  },
245
245
  "aria-disabled": disabled ? "true" : void 0,
@@ -303,8 +303,8 @@ var InfiniteLinearProgress = () => {
303
303
  };
304
304
 
305
305
  // src/components/Input.tsx
306
- import * as React7 from "react";
307
306
  import { Icon as Icon4 } from "@ttoss/react-icons";
307
+ import * as React7 from "react";
308
308
  import { Input as InputUI } from "theme-ui";
309
309
  import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
310
310
  var Input = React7.forwardRef(({
@@ -342,11 +342,11 @@ var Input = React7.forwardRef(({
342
342
  ref,
343
343
  sx: {
344
344
  fontFamily: "body",
345
- paddingY: "lg",
346
- paddingX: "xl",
345
+ paddingY: "3",
346
+ paddingX: "4",
347
347
  ...sx,
348
- paddingLeft: leadingIcon ? "3xl" : void 0,
349
- paddingRight: trailingIcon ? "3xl" : void 0,
348
+ paddingLeft: leadingIcon ? "10" : void 0,
349
+ paddingRight: trailingIcon ? "10" : void 0,
350
350
  margin: 0
351
351
  },
352
352
  className,
@@ -370,8 +370,8 @@ var Input = React7.forwardRef(({
370
370
  Input.displayName = "Input";
371
371
 
372
372
  // src/components/InputNumber.tsx
373
- import * as React8 from "react";
374
373
  import { Icon as Icon5 } from "@ttoss/react-icons";
374
+ import * as React8 from "react";
375
375
  import { Input as Input2 } from "theme-ui";
376
376
  import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
377
377
  var InputNumber = React8.forwardRef(({
@@ -393,8 +393,8 @@ var InputNumber = React8.forwardRef(({
393
393
  margin: 0
394
394
  },
395
395
  ...sx,
396
- paddingLeft: "3xl",
397
- paddingRight: "2xl",
396
+ paddingLeft: "6",
397
+ paddingRight: "5",
398
398
  margin: 0
399
399
  };
400
400
  }
@@ -406,11 +406,11 @@ var InputNumber = React8.forwardRef(({
406
406
  margin: 0
407
407
  },
408
408
  fontFamily: "body",
409
- paddingY: "lg",
410
- paddingX: "xl",
409
+ paddingY: "2",
410
+ paddingX: "4",
411
411
  ...sx,
412
- paddingLeft: "2xl",
413
- paddingRight: "2xl",
412
+ paddingLeft: "5",
413
+ paddingRight: "5",
414
414
  margin: 0
415
415
  };
416
416
  }, [inputProps, value, sx]);
@@ -558,10 +558,9 @@ var Label = ({
558
558
  }) => {
559
559
  return /* @__PURE__ */jsxs6(LabelUi, {
560
560
  sx: {
561
- fontFamily: "caption",
562
561
  alignItems: "center",
563
562
  fontSize: "sm",
564
- lineHeight: "base",
563
+ lineHeight: "normal",
565
564
  ...sx
566
565
  },
567
566
  ...props,
@@ -604,36 +603,35 @@ import { Paragraph } from "theme-ui";
604
603
  import { Radio } from "theme-ui";
605
604
 
606
605
  // src/components/Select.tsx
607
- import * as React12 from "react";
608
606
  import { Icon as Icon7 } from "@ttoss/react-icons";
607
+ import * as React12 from "react";
609
608
  import ReactSelect, { components } from "react-select";
610
609
  import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
611
610
  var Control = props => {
612
611
  const isDisabled = props.selectProps.isDisabled;
613
612
  const hasError = props.selectProps["aria-invalid"] === "true";
614
- const border = (() => {
613
+ const borderColor = (() => {
615
614
  if (isDisabled) {
616
- return "muted";
615
+ return "display.border.muted.default";
617
616
  }
618
617
  if (hasError) {
619
- return "danger";
618
+ return "display.border.negative.default";
620
619
  }
621
- return "interaction";
620
+ return "";
622
621
  })();
623
622
  const backgroundColor = (() => {
624
623
  if (isDisabled) {
625
- return "muted";
624
+ return "display.background.muted.default";
626
625
  }
627
- return "surface";
626
+ return "display.background.secondary.default";
628
627
  })();
629
628
  return /* @__PURE__ */jsx15(Box, {
630
629
  sx: {
631
630
  ".react-select__control": {
632
- border,
631
+ borderColor,
633
632
  backgroundColor,
634
- paddingX: "xl",
635
- paddingY: "lg",
636
- borderRadius: "action"
633
+ paddingX: "4",
634
+ paddingY: "2"
637
635
  }
638
636
  },
639
637
  children: /* @__PURE__ */jsx15(components.Control, {
@@ -645,13 +643,13 @@ var DropdownIndicator = props => {
645
643
  const isDisabled = props.selectProps.isDisabled;
646
644
  const color = (() => {
647
645
  if (isDisabled) {
648
- return "onMuted";
646
+ return "display.text.muted.default";
649
647
  }
650
648
  return "text";
651
649
  })();
652
650
  return /* @__PURE__ */jsx15(Text, {
653
651
  sx: {
654
- fontSize: "base",
652
+ fontSize: "md",
655
653
  color,
656
654
  alignSelf: "center",
657
655
  display: "flex",
@@ -667,7 +665,7 @@ var IndicatorsContainer = ({
667
665
  }) => {
668
666
  return /* @__PURE__ */jsx15(Box, {
669
667
  sx: {
670
- marginLeft: "lg",
668
+ marginLeft: "4",
671
669
  border: "none"
672
670
  },
673
671
  children
@@ -730,7 +728,7 @@ var ValueContainer = ({
730
728
  })();
731
729
  return /* @__PURE__ */jsxs7(Flex, {
732
730
  sx: {
733
- gap: "lg",
731
+ gap: "4",
734
732
  flex: 1
735
733
  },
736
734
  children: [finalLeadingIcon && /* @__PURE__ */jsx15(Text, {
@@ -738,7 +736,7 @@ var ValueContainer = ({
738
736
  alignSelf: "center",
739
737
  pointerEvents: "none",
740
738
  lineHeight: 0,
741
- fontSize: "base"
739
+ fontSize: "md"
742
740
  },
743
741
  children: /* @__PURE__ */jsx15(Icon7, {
744
742
  icon: finalLeadingIcon
@@ -755,7 +753,7 @@ var ValueContainer = ({
755
753
  alignSelf: "center",
756
754
  pointerEvents: "none",
757
755
  lineHeight: 0,
758
- fontSize: "base",
756
+ fontSize: "md",
759
757
  color: trailingIconColor
760
758
  },
761
759
  children: /* @__PURE__ */jsx15(Icon7, {
@@ -832,7 +830,7 @@ var Switch = props => {
832
830
  role: "switch",
833
831
  "aria-checked": props.checked || false,
834
832
  sx: {
835
- backgroundColor: "input.background.muted.default",
833
+ backgroundColor: "input.background.muted.disabled",
836
834
  "input:checked ~ &": {
837
835
  backgroundColor: "input.background.secondary.default"
838
836
  },
@@ -852,8 +850,8 @@ var Switch = props => {
852
850
  };
853
851
 
854
852
  // src/components/Textarea.tsx
855
- import * as React14 from "react";
856
853
  import { Icon as Icon8 } from "@ttoss/react-icons";
854
+ import * as React14 from "react";
857
855
  import { Textarea as TextareaUI } from "theme-ui";
858
856
  import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
859
857
  var Textarea = React14.forwardRef(({
@@ -874,10 +872,10 @@ var Textarea = React14.forwardRef(({
874
872
  ref,
875
873
  sx: {
876
874
  fontFamily: "body",
877
- paddingY: "lg",
878
- paddingX: "xl",
875
+ paddingY: "4",
876
+ paddingX: "5",
879
877
  ...sx,
880
- paddingRight: trailingIcon ? "3xl" : void 0,
878
+ paddingRight: trailingIcon ? "7" : void 0,
881
879
  margin: 0
882
880
  },
883
881
  className,
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { IconType } from '@ttoss/react-icons';
2
3
  import * as React from 'react';
3
4
  import * as theme_ui from 'theme-ui';
4
5
  import { ButtonProps as ButtonProps$1, BadgeProps as BadgeProps$1, CheckboxProps as CheckboxProps$1, TextProps, IconButtonProps, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, SxProp, FlexProps, SwitchProps, TextareaProps as TextareaProps$1, Theme } from 'theme-ui';
5
6
  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, SwitchProps, SxProp, Text, TextProps, Theme, ThemeUIStyleObject } from 'theme-ui';
6
- import { IconType } from '@ttoss/react-icons';
7
7
  import { Props } from 'react-select';
8
8
  export { Keyframes, keyframes } from '@emotion/react';
9
9
  export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "description": "Primitive layout, typographic, and other components for styling applications.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -27,7 +27,7 @@
27
27
  "@theme-ui/match-media": "^0.17.1",
28
28
  "react-select": "^5.9.0",
29
29
  "theme-ui": "^0.17.1",
30
- "@ttoss/theme": "^1.8.6"
30
+ "@ttoss/theme": "^2.0.2"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@emotion/react": "^11",
@@ -43,8 +43,8 @@
43
43
  "react": "^19.0.0",
44
44
  "tsup": "^8.3.5",
45
45
  "@ttoss/config": "^1.35.2",
46
- "@ttoss/react-icons": "^0.4.9",
47
- "@ttoss/test-utils": "^2.1.22"
46
+ "@ttoss/test-utils": "^2.1.22",
47
+ "@ttoss/react-icons": "^0.4.9"
48
48
  },
49
49
  "keywords": [
50
50
  "React",