@ttoss/ui 2.0.1 → 2.0.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 +2 -2
- package/dist/index.d.mts +108 -0
- package/dist/index.js +2 -2
- package/package.json +7 -7
- package/src/components/Input.tsx +4 -1
- package/src/components/Select.tsx +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -147,12 +147,12 @@ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
|
147
147
|
var Input = /*#__PURE__*/React3.forwardRef(({
|
|
148
148
|
leadingIcon,
|
|
149
149
|
onLeadingIconClick,
|
|
150
|
-
trailingIcon,
|
|
151
150
|
onTrailingIconClick,
|
|
152
151
|
className,
|
|
153
152
|
sx,
|
|
154
153
|
...inputProps
|
|
155
154
|
}, ref) => {
|
|
155
|
+
const trailingIcon = inputProps["aria-invalid"] ? "warning-alt" : inputProps.trailingIcon;
|
|
156
156
|
return /* @__PURE__ */jsxs4(Flex, {
|
|
157
157
|
className,
|
|
158
158
|
sx: {
|
|
@@ -303,7 +303,7 @@ var Select = /*#__PURE__*/React5.forwardRef(({
|
|
|
303
303
|
fontSize: "base"
|
|
304
304
|
},
|
|
305
305
|
children: /* @__PURE__ */jsx8(Icon, {
|
|
306
|
-
icon: "
|
|
306
|
+
icon: "warning-alt"
|
|
307
307
|
})
|
|
308
308
|
})]
|
|
309
309
|
}),
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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, SelectProps, 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, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, SxProp, Text, TextProps, Theme } from 'theme-ui';
|
|
4
|
+
export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
|
|
5
|
+
export { Keyframes, keyframes } from '@emotion/react';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { IconifyIconProps, IconifyIconHTMLElement } from '@iconify-icon/react';
|
|
9
|
+
import { IconifyIcon } from '@iconify/types';
|
|
10
|
+
|
|
11
|
+
type ThemeProviderProps = {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
theme?: Theme;
|
|
14
|
+
/**
|
|
15
|
+
* Fonts URLs.
|
|
16
|
+
*/
|
|
17
|
+
fonts?: string[];
|
|
18
|
+
};
|
|
19
|
+
declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
22
|
+
|
|
23
|
+
type IconType = string | IconifyIcon;
|
|
24
|
+
type IconProps = Omit<IconifyIconProps, 'ref'>;
|
|
25
|
+
declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<IconifyIconHTMLElement | null>>;
|
|
26
|
+
|
|
27
|
+
type BadgeProps = BadgeProps$1 & {
|
|
28
|
+
icon?: IconType;
|
|
29
|
+
};
|
|
30
|
+
declare const Badge: ({ icon, children, sx, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
type ButtonProps = ButtonProps$1 & {
|
|
33
|
+
leftIcon?: IconType;
|
|
34
|
+
rightIcon?: IconType;
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
};
|
|
37
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
|
|
39
|
+
interface InputProps extends InputProps$1 {
|
|
40
|
+
leadingIcon?: IconType;
|
|
41
|
+
onLeadingIconClick?: () => void;
|
|
42
|
+
trailingIcon?: IconType;
|
|
43
|
+
onTrailingIconClick?: () => void;
|
|
44
|
+
}
|
|
45
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
46
|
+
|
|
47
|
+
type LabelProps = LabelProps$1 & {
|
|
48
|
+
tooltip?: boolean;
|
|
49
|
+
onTooltipClick?: () => void;
|
|
50
|
+
};
|
|
51
|
+
declare const Label: ({ children, onTooltipClick, tooltip, sx, ...props }: LabelProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
type LinkProps = LinkProps$1 & {
|
|
54
|
+
quiet?: boolean;
|
|
55
|
+
};
|
|
56
|
+
declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
57
|
+
|
|
58
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
59
|
+
|
|
60
|
+
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
61
|
+
|
|
62
|
+
declare const InfiniteLinearProgress: () => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
interface TextareaProps extends TextareaProps$1 {
|
|
65
|
+
trailingIcon?: IconType;
|
|
66
|
+
}
|
|
67
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
68
|
+
|
|
69
|
+
declare const Container: React.ForwardRefExoticComponent<theme_ui.BoxProps & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
|
|
71
|
+
type HelpTextProps = Omit<TextProps, 'variant'> & {
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
negative?: boolean;
|
|
74
|
+
};
|
|
75
|
+
declare const HelpText: ({ sx, disabled, negative, ...props }: HelpTextProps) => react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
type CloseButtonProps = ButtonProps$1 & {
|
|
78
|
+
label?: string;
|
|
79
|
+
onlyText?: boolean;
|
|
80
|
+
};
|
|
81
|
+
declare const CloseButton: React.ForwardRefExoticComponent<Omit<CloseButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
82
|
+
|
|
83
|
+
type InputNumberProps = Omit<InputProps$1, 'type' | 'variant' | 'onChange'> & {
|
|
84
|
+
onChange: (value: number) => void;
|
|
85
|
+
value?: number;
|
|
86
|
+
infoIcon?: boolean;
|
|
87
|
+
onClickInfoIcon?: () => void;
|
|
88
|
+
};
|
|
89
|
+
declare const InputNumber: React.ForwardRefExoticComponent<Omit<InputNumberProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
90
|
+
|
|
91
|
+
type StackProps = FlexProps;
|
|
92
|
+
/**
|
|
93
|
+
* A component that renders its children in a column.
|
|
94
|
+
*/
|
|
95
|
+
declare const Stack: React.ForwardRefExoticComponent<theme_ui.BoxProps & React.RefAttributes<HTMLElement>>;
|
|
96
|
+
|
|
97
|
+
type InputPasswordProps = Omit<InputProps, 'trailingIcon' | 'onTrailingIconClick' | 'type'> & {
|
|
98
|
+
showPasswordByDefault?: boolean;
|
|
99
|
+
};
|
|
100
|
+
declare const InputPassword: React.ForwardRefExoticComponent<Omit<InputPasswordProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
101
|
+
|
|
102
|
+
type ActionButtonProps = Omit<ButtonProps, 'rightIcon' | 'leftIcon' | 'variant'> & {
|
|
103
|
+
icon: ButtonProps['leftIcon'];
|
|
104
|
+
variant?: 'default' | 'accent' | 'quiet';
|
|
105
|
+
};
|
|
106
|
+
declare const ActionButton: ({ icon, variant, sx, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
export { ActionButton, ActionButtonProps, Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, Container, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputNumber, InputNumberProps, InputPassword, InputPasswordProps, InputProps, Label, LabelProps, Link, LinkProps, Select, Stack, StackProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -224,12 +224,12 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
224
224
|
var Input = React3.forwardRef(({
|
|
225
225
|
leadingIcon,
|
|
226
226
|
onLeadingIconClick,
|
|
227
|
-
trailingIcon,
|
|
228
227
|
onTrailingIconClick,
|
|
229
228
|
className,
|
|
230
229
|
sx,
|
|
231
230
|
...inputProps
|
|
232
231
|
}, ref) => {
|
|
232
|
+
const trailingIcon = inputProps["aria-invalid"] ? "warning-alt" : inputProps.trailingIcon;
|
|
233
233
|
return /* @__PURE__ */(0, import_jsx_runtime5.jsxs)(import_theme_ui8.Flex, {
|
|
234
234
|
className,
|
|
235
235
|
sx: {
|
|
@@ -380,7 +380,7 @@ var Select = React5.forwardRef(({
|
|
|
380
380
|
fontSize: "base"
|
|
381
381
|
},
|
|
382
382
|
children: /* @__PURE__ */(0, import_jsx_runtime8.jsx)(Icon, {
|
|
383
|
-
icon: "
|
|
383
|
+
icon: "warning-alt"
|
|
384
384
|
})
|
|
385
385
|
})]
|
|
386
386
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@iconify-icon/react": "^1.0.7",
|
|
24
24
|
"@theme-ui/match-media": "^0.16.0",
|
|
25
25
|
"theme-ui": "^0.16.0",
|
|
26
|
-
"@ttoss/theme": "^1.5.
|
|
26
|
+
"@ttoss/theme": "^1.5.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@emotion/react": "^11",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@emotion/react": "^11.11.1",
|
|
34
34
|
"@iconify-icons/mdi-light": "^1.2.5",
|
|
35
35
|
"@iconify/types": "^2.0.0",
|
|
36
|
-
"@types/jest": "^29.5.
|
|
36
|
+
"@types/jest": "^29.5.3",
|
|
37
37
|
"@types/react": "^18.2.12",
|
|
38
|
-
"jest": "^29.
|
|
38
|
+
"jest": "^29.6.1",
|
|
39
39
|
"react": "^18.2.0",
|
|
40
|
-
"tsup": "^7.
|
|
41
|
-
"@ttoss/config": "^1.30.
|
|
42
|
-
"@ttoss/test-utils": "^1.23.
|
|
40
|
+
"tsup": "^7.1.0",
|
|
41
|
+
"@ttoss/config": "^1.30.5",
|
|
42
|
+
"@ttoss/test-utils": "^1.23.6"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"React",
|
package/src/components/Input.tsx
CHANGED
|
@@ -14,7 +14,6 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
14
14
|
{
|
|
15
15
|
leadingIcon,
|
|
16
16
|
onLeadingIconClick,
|
|
17
|
-
trailingIcon,
|
|
18
17
|
onTrailingIconClick,
|
|
19
18
|
className,
|
|
20
19
|
sx,
|
|
@@ -22,6 +21,10 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
22
21
|
},
|
|
23
22
|
ref
|
|
24
23
|
) => {
|
|
24
|
+
const trailingIcon = inputProps['aria-invalid']
|
|
25
|
+
? 'warning-alt'
|
|
26
|
+
: inputProps.trailingIcon;
|
|
27
|
+
|
|
25
28
|
return (
|
|
26
29
|
<Flex
|
|
27
30
|
className={className}
|