@ttoss/ui 1.36.7 → 1.36.9

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
@@ -90,6 +90,7 @@ var Button = /*#__PURE__*/React2.forwardRef((props, ref) => {
90
90
  children,
91
91
  leftIcon,
92
92
  rightIcon,
93
+ loading,
93
94
  ...restProps
94
95
  } = props;
95
96
  return /* @__PURE__ */jsxs3(ButtonUi, {
@@ -106,7 +107,10 @@ var Button = /*#__PURE__*/React2.forwardRef((props, ref) => {
106
107
  gap: "lg",
107
108
  ...restProps.sx
108
109
  },
109
- children: [leftIcon && /* @__PURE__ */jsx4(Icon, {
110
+ children: [loading && /* @__PURE__ */jsx4(Icon, {
111
+ inline: true,
112
+ icon: "three-dots-loading"
113
+ }), !loading && leftIcon && /* @__PURE__ */jsx4(Icon, {
110
114
  inline: true,
111
115
  icon: leftIcon
112
116
  }), children, rightIcon && /* @__PURE__ */jsx4(Icon, {
@@ -463,9 +467,14 @@ var CloseButton = /*#__PURE__*/React9.forwardRef(({
463
467
  display: "inline-flex",
464
468
  alignItems: "center",
465
469
  cursor: "pointer",
470
+ lineHeight: "normal",
466
471
  gap: "sm",
467
472
  padding: "sm",
468
473
  width: "fit-content",
474
+ transition: "all 0.2s",
475
+ "& > iconify-icon": {
476
+ fontSize: "base"
477
+ },
469
478
  ...sx
470
479
  },
471
480
  ...props,
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputP
3
3
  export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Paragraph, ParagraphProps, Radio, RadioProps, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, SxProp, Text, TextProps, Theme } from 'theme-ui';
4
4
  export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
5
5
  export { Keyframes, keyframes } from '@emotion/react';
6
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import * as React from 'react';
7
8
  import { IconifyIconProps, IconifyIconHTMLElement } from '@iconify-icon/react';
8
9
  import { IconifyIcon } from '@iconify/types';
@@ -15,7 +16,7 @@ type ThemeProviderProps = {
15
16
  */
16
17
  fonts?: string[];
17
18
  };
18
- declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) => JSX.Element;
19
+ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
19
20
 
20
21
  declare const useTheme: () => theme_ui.ThemeUIContextValue;
21
22
 
@@ -26,11 +27,12 @@ declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttribu
26
27
  type BadgeProps = BadgeProps$1 & {
27
28
  icon?: IconType;
28
29
  };
29
- declare const Badge: ({ icon, children, sx, ...props }: BadgeProps) => JSX.Element;
30
+ declare const Badge: ({ icon, children, sx, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
30
31
 
31
32
  type ButtonProps = ButtonProps$1 & {
32
33
  leftIcon?: IconType;
33
34
  rightIcon?: IconType;
35
+ loading?: boolean;
34
36
  };
35
37
  declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
36
38
 
@@ -46,7 +48,7 @@ type LabelProps = LabelProps$1 & {
46
48
  tooltip?: boolean;
47
49
  onTooltipClick?: () => void;
48
50
  };
49
- declare const Label: ({ children, onTooltipClick, tooltip, sx, ...props }: LabelProps) => JSX.Element;
51
+ declare const Label: ({ children, onTooltipClick, tooltip, sx, ...props }: LabelProps) => react_jsx_runtime.JSX.Element;
50
52
 
51
53
  type LinkProps = LinkProps$1 & {
52
54
  quiet?: boolean;
@@ -57,7 +59,7 @@ declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> &
57
59
 
58
60
  declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
59
61
 
60
- declare const InfiniteLinearProgress: () => JSX.Element;
62
+ declare const InfiniteLinearProgress: () => react_jsx_runtime.JSX.Element;
61
63
 
62
64
  interface TextareaProps extends TextareaProps$1 {
63
65
  trailingIcon?: IconType;
@@ -68,7 +70,7 @@ type HelpTextProps = Omit<TextProps, 'variant'> & {
68
70
  disabled?: boolean;
69
71
  negative?: boolean;
70
72
  };
71
- declare const HelpText: ({ sx, disabled, negative, ...props }: HelpTextProps) => JSX.Element;
73
+ declare const HelpText: ({ sx, disabled, negative, ...props }: HelpTextProps) => react_jsx_runtime.JSX.Element;
72
74
 
73
75
  type CloseButtonProps = ButtonProps$1 & {
74
76
  label?: string;
package/dist/index.js CHANGED
@@ -166,6 +166,7 @@ var Button = React2.forwardRef((props, ref) => {
166
166
  children,
167
167
  leftIcon,
168
168
  rightIcon,
169
+ loading,
169
170
  ...restProps
170
171
  } = props;
171
172
  return /* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_theme_ui5.Button, {
@@ -182,7 +183,10 @@ var Button = React2.forwardRef((props, ref) => {
182
183
  gap: "lg",
183
184
  ...restProps.sx
184
185
  },
185
- children: [leftIcon && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
186
+ children: [loading && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
187
+ inline: true,
188
+ icon: "three-dots-loading"
189
+ }), !loading && leftIcon && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
186
190
  inline: true,
187
191
  icon: leftIcon
188
192
  }), children, rightIcon && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
@@ -539,9 +543,14 @@ var CloseButton = React9.forwardRef(({
539
543
  display: "inline-flex",
540
544
  alignItems: "center",
541
545
  cursor: "pointer",
546
+ lineHeight: "normal",
542
547
  gap: "sm",
543
548
  padding: "sm",
544
549
  width: "fit-content",
550
+ transition: "all 0.2s",
551
+ "& > iconify-icon": {
552
+ fontSize: "base"
553
+ },
545
554
  ...sx
546
555
  },
547
556
  ...props,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "1.36.7",
3
+ "version": "1.36.9",
4
4
  "description": "Primitive layout, typographic, and other components for styling applications.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -19,7 +19,7 @@
19
19
  "@iconify-icon/react": "^1.0.7",
20
20
  "@theme-ui/match-media": "^0.15.7",
21
21
  "theme-ui": "^0.15.7",
22
- "@ttoss/theme": "^1.4.34"
22
+ "@ttoss/theme": "^1.4.36"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0"
@@ -28,12 +28,12 @@
28
28
  "@iconify-icons/mdi-light": "^1.2.5",
29
29
  "@iconify/types": "^2.0.0",
30
30
  "@types/jest": "^29.5.1",
31
- "@types/react": "^18.2.5",
31
+ "@types/react": "^18.2.6",
32
32
  "jest": "^29.5.0",
33
33
  "react": "^18.2.0",
34
34
  "tsup": "^6.7.0",
35
35
  "@ttoss/config": "^1.30.0",
36
- "@ttoss/test-utils": "^1.23.0"
36
+ "@ttoss/test-utils": "^1.23.1"
37
37
  },
38
38
  "keywords": [
39
39
  "React",
@@ -8,11 +8,12 @@ import { Icon, IconType } from './Icon';
8
8
  export type ButtonProps = ButtonPropsUi & {
9
9
  leftIcon?: IconType;
10
10
  rightIcon?: IconType;
11
+ loading?: boolean;
11
12
  };
12
13
 
13
14
  export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
14
15
  (props, ref) => {
15
- const { children, leftIcon, rightIcon, ...restProps } = props;
16
+ const { children, leftIcon, rightIcon, loading, ...restProps } = props;
16
17
 
17
18
  return (
18
19
  <ButtonUi
@@ -30,7 +31,8 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
30
31
  ...restProps.sx,
31
32
  }}
32
33
  >
33
- {leftIcon && <Icon inline icon={leftIcon} />}
34
+ {loading && <Icon inline icon="three-dots-loading" />}
35
+ {!loading && leftIcon && <Icon inline icon={leftIcon} />}
34
36
  {children}
35
37
  {rightIcon && <Icon inline icon={rightIcon} />}
36
38
  </ButtonUi>
@@ -26,9 +26,14 @@ export const CloseButton = React.forwardRef<
26
26
  display: 'inline-flex',
27
27
  alignItems: 'center',
28
28
  cursor: 'pointer',
29
+ lineHeight: 'normal',
29
30
  gap: 'sm',
30
31
  padding: 'sm',
31
32
  width: 'fit-content',
33
+ transition: 'all 0.2s',
34
+ '& > iconify-icon': {
35
+ fontSize: 'base',
36
+ },
32
37
  ...sx,
33
38
  }}
34
39
  {...props}