@ttoss/ui 5.10.4 → 5.10.6
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 +60 -22
- package/dist/index.d.ts +5 -2
- package/package.json +8 -8
package/dist/esm/index.js
CHANGED
|
@@ -1093,9 +1093,61 @@ var Switch = /* @__PURE__ */__name(props => {
|
|
|
1093
1093
|
|
|
1094
1094
|
// src/components/Tag.tsx
|
|
1095
1095
|
import * as React15 from "react";
|
|
1096
|
+
var tagVariantMap = {
|
|
1097
|
+
positive: {
|
|
1098
|
+
bg: "feedback.background.positive.default",
|
|
1099
|
+
color: "feedback.text.positive.default"
|
|
1100
|
+
},
|
|
1101
|
+
accent: {
|
|
1102
|
+
bg: "action.background.accent.default",
|
|
1103
|
+
color: "action.text.accent.default"
|
|
1104
|
+
},
|
|
1105
|
+
caution: {
|
|
1106
|
+
bg: "feedback.background.caution.default",
|
|
1107
|
+
color: "feedback.text.caution.default"
|
|
1108
|
+
},
|
|
1109
|
+
muted: {
|
|
1110
|
+
bg: "display.background.muted.default",
|
|
1111
|
+
color: "display.text.muted.default"
|
|
1112
|
+
},
|
|
1113
|
+
negative: {
|
|
1114
|
+
bg: "feedback.background.negative.default",
|
|
1115
|
+
color: "feedback.text.negative.default"
|
|
1116
|
+
},
|
|
1117
|
+
primary: {
|
|
1118
|
+
bg: "action.background.primary.default",
|
|
1119
|
+
color: "action.text.primary.default"
|
|
1120
|
+
},
|
|
1121
|
+
secondary: {
|
|
1122
|
+
bg: "action.background.secondary.default",
|
|
1123
|
+
color: "action.text.secondary.default"
|
|
1124
|
+
},
|
|
1125
|
+
default: {
|
|
1126
|
+
bg: "action.background.muted.default",
|
|
1127
|
+
color: "action.text.muted.default"
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1096
1130
|
var Tag = /* @__PURE__ */__name(({
|
|
1097
|
-
children
|
|
1131
|
+
children,
|
|
1132
|
+
variant = "default",
|
|
1133
|
+
sx
|
|
1098
1134
|
}) => {
|
|
1135
|
+
const colors = tagVariantMap[variant];
|
|
1136
|
+
const baseStyles = {
|
|
1137
|
+
ml: 2,
|
|
1138
|
+
px: 2,
|
|
1139
|
+
py: 0,
|
|
1140
|
+
fontSize: "xs",
|
|
1141
|
+
borderRadius: "full",
|
|
1142
|
+
backgroundColor: colors.bg,
|
|
1143
|
+
color: colors.color,
|
|
1144
|
+
border: "1px solid",
|
|
1145
|
+
borderColor: "border.default",
|
|
1146
|
+
fontWeight: "medium",
|
|
1147
|
+
lineHeight: 1.5,
|
|
1148
|
+
display: "inline-flex",
|
|
1149
|
+
alignItems: "center"
|
|
1150
|
+
};
|
|
1099
1151
|
if (Array.isArray(children)) {
|
|
1100
1152
|
return /* @__PURE__ */React15.createElement(Box, {
|
|
1101
1153
|
as: "span",
|
|
@@ -1103,23 +1155,20 @@ var Tag = /* @__PURE__ */__name(({
|
|
|
1103
1155
|
ml: 2,
|
|
1104
1156
|
display: "inline-flex",
|
|
1105
1157
|
alignItems: "center",
|
|
1106
|
-
gap: 1
|
|
1158
|
+
gap: 1,
|
|
1159
|
+
...sx
|
|
1107
1160
|
}
|
|
1108
1161
|
}, children.map((child, i) => {
|
|
1109
1162
|
return /* @__PURE__ */React15.createElement(Box, {
|
|
1110
1163
|
key: i,
|
|
1111
1164
|
as: "span",
|
|
1112
1165
|
sx: {
|
|
1166
|
+
...baseStyles,
|
|
1113
1167
|
px: 2,
|
|
1114
1168
|
py: 0,
|
|
1115
1169
|
fontSize: "xs",
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
color: "text.secondary",
|
|
1119
|
-
border: "1px solid",
|
|
1120
|
-
borderColor: "border.default",
|
|
1121
|
-
fontWeight: "medium",
|
|
1122
|
-
lineHeight: 1.5
|
|
1170
|
+
backgroundColor: colors.bg,
|
|
1171
|
+
color: colors.color
|
|
1123
1172
|
}
|
|
1124
1173
|
}, child);
|
|
1125
1174
|
}));
|
|
@@ -1127,19 +1176,8 @@ var Tag = /* @__PURE__ */__name(({
|
|
|
1127
1176
|
return /* @__PURE__ */React15.createElement(Box, {
|
|
1128
1177
|
as: "span",
|
|
1129
1178
|
sx: {
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
py: 0,
|
|
1133
|
-
fontSize: "xs",
|
|
1134
|
-
borderRadius: "full",
|
|
1135
|
-
backgroundColor: "display.background.secondary.default",
|
|
1136
|
-
color: "text.secondary",
|
|
1137
|
-
border: "1px solid",
|
|
1138
|
-
borderColor: "border.default",
|
|
1139
|
-
fontWeight: "medium",
|
|
1140
|
-
lineHeight: 1.5,
|
|
1141
|
-
display: "inline-flex",
|
|
1142
|
-
alignItems: "center"
|
|
1179
|
+
...baseStyles,
|
|
1180
|
+
...sx
|
|
1143
1181
|
}
|
|
1144
1182
|
}, children);
|
|
1145
1183
|
}, "Tag");
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { IconType } from '@ttoss/react-icons';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as theme_ui from 'theme-ui';
|
|
5
|
-
import { ButtonProps as ButtonProps$1, BadgeProps as BadgeProps$1, CardProps, BoxProps, CheckboxProps as CheckboxProps$1, CloseProps, TextProps, IconButtonProps as IconButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, FlexProps, SxProp, SwitchProps, TextareaProps as TextareaProps$1, Theme } from 'theme-ui';
|
|
5
|
+
import { ButtonProps as ButtonProps$1, BadgeProps as BadgeProps$1, CardProps, BoxProps, CheckboxProps as CheckboxProps$1, CloseProps, TextProps, IconButtonProps as IconButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, FlexProps, SxProp, SwitchProps, ThemeUIStyleObject, TextareaProps as TextareaProps$1, Theme } from 'theme-ui';
|
|
6
6
|
export { BaseStyles, Box, BoxProps, CardProps, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, 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';
|
|
7
7
|
import { Props } from 'react-select';
|
|
8
8
|
import { ITooltip } from 'react-tooltip';
|
|
@@ -159,10 +159,13 @@ declare const Stack: (props: StackProps) => react_jsx_runtime.JSX.Element;
|
|
|
159
159
|
|
|
160
160
|
declare const Switch: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
161
161
|
|
|
162
|
+
type TagVariant = 'accent' | 'positive' | 'caution' | 'muted' | 'negative' | 'primary' | 'secondary' | 'default';
|
|
162
163
|
type TagProps = {
|
|
163
164
|
children: React.ReactNode | React.ReactNode[];
|
|
165
|
+
variant?: TagVariant;
|
|
166
|
+
sx?: ThemeUIStyleObject;
|
|
164
167
|
};
|
|
165
|
-
declare const Tag: ({ children }: TagProps) => react_jsx_runtime.JSX.Element;
|
|
168
|
+
declare const Tag: ({ children, variant, sx }: TagProps) => react_jsx_runtime.JSX.Element;
|
|
166
169
|
|
|
167
170
|
interface TextareaProps extends TextareaProps$1 {
|
|
168
171
|
trailingIcon?: IconType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.6",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -29,24 +29,24 @@
|
|
|
29
29
|
"react-select": "^5.9.0",
|
|
30
30
|
"react-tooltip": "^5.28.0",
|
|
31
31
|
"theme-ui": "^0.17.1",
|
|
32
|
-
"@ttoss/theme": "^2.6.
|
|
32
|
+
"@ttoss/theme": "^2.6.9"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@emotion/react": "^11",
|
|
36
36
|
"react": ">=16.8.0",
|
|
37
|
-
"@ttoss/react-icons": "^0.5.
|
|
37
|
+
"@ttoss/react-icons": "^0.5.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@emotion/react": "^11.14.0",
|
|
41
41
|
"@iconify-icons/mdi-light": "^1.2.5",
|
|
42
42
|
"@types/jest": "^30.0.0",
|
|
43
|
-
"@types/react": "^19.2.
|
|
43
|
+
"@types/react": "^19.2.6",
|
|
44
44
|
"jest": "^30.2.0",
|
|
45
45
|
"react": "^19.2.0",
|
|
46
|
-
"tsup": "^8.5.
|
|
47
|
-
"@ttoss/
|
|
48
|
-
"@ttoss/
|
|
49
|
-
"@ttoss/test-utils": "^3.0.
|
|
46
|
+
"tsup": "^8.5.1",
|
|
47
|
+
"@ttoss/react-icons": "^0.5.1",
|
|
48
|
+
"@ttoss/config": "^1.35.10",
|
|
49
|
+
"@ttoss/test-utils": "^3.0.2"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"React",
|