@ttoss/ui 5.7.0 → 5.8.1
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 +69 -12
- package/dist/index.d.ts +7 -2
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1132,11 +1132,66 @@ var Switch = props => {
|
|
|
1132
1132
|
});
|
|
1133
1133
|
};
|
|
1134
1134
|
|
|
1135
|
+
// src/components/Tag.tsx
|
|
1136
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1137
|
+
var Tag = ({
|
|
1138
|
+
children
|
|
1139
|
+
}) => {
|
|
1140
|
+
if (Array.isArray(children)) {
|
|
1141
|
+
return /* @__PURE__ */jsx20(Box, {
|
|
1142
|
+
as: "span",
|
|
1143
|
+
sx: {
|
|
1144
|
+
ml: 2,
|
|
1145
|
+
display: "inline-flex",
|
|
1146
|
+
alignItems: "center",
|
|
1147
|
+
gap: 1
|
|
1148
|
+
},
|
|
1149
|
+
children: children.map((child, i) => {
|
|
1150
|
+
return /* @__PURE__ */jsx20(Box, {
|
|
1151
|
+
as: "span",
|
|
1152
|
+
sx: {
|
|
1153
|
+
px: 2,
|
|
1154
|
+
py: 0,
|
|
1155
|
+
fontSize: "xs",
|
|
1156
|
+
borderRadius: "full",
|
|
1157
|
+
backgroundColor: "display.background.secondary.default",
|
|
1158
|
+
color: "text.secondary",
|
|
1159
|
+
border: "1px solid",
|
|
1160
|
+
borderColor: "border.default",
|
|
1161
|
+
fontWeight: "medium",
|
|
1162
|
+
lineHeight: 1.5
|
|
1163
|
+
},
|
|
1164
|
+
children: child
|
|
1165
|
+
}, i);
|
|
1166
|
+
})
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
return /* @__PURE__ */jsx20(Box, {
|
|
1170
|
+
as: "span",
|
|
1171
|
+
sx: {
|
|
1172
|
+
ml: 2,
|
|
1173
|
+
px: 2,
|
|
1174
|
+
py: 0,
|
|
1175
|
+
fontSize: "xs",
|
|
1176
|
+
borderRadius: "full",
|
|
1177
|
+
backgroundColor: "display.background.secondary.default",
|
|
1178
|
+
color: "text.secondary",
|
|
1179
|
+
border: "1px solid",
|
|
1180
|
+
borderColor: "border.default",
|
|
1181
|
+
fontWeight: "medium",
|
|
1182
|
+
lineHeight: 1.5,
|
|
1183
|
+
display: "inline-flex",
|
|
1184
|
+
alignItems: "center"
|
|
1185
|
+
},
|
|
1186
|
+
children
|
|
1187
|
+
});
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1135
1190
|
// src/components/Textarea.tsx
|
|
1136
1191
|
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
1137
1192
|
import * as React13 from "react";
|
|
1138
1193
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
1139
|
-
import { jsx as
|
|
1194
|
+
import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1140
1195
|
var Textarea = React13.forwardRef(({
|
|
1141
1196
|
trailingIcon,
|
|
1142
1197
|
className,
|
|
@@ -1151,7 +1206,7 @@ var Textarea = React13.forwardRef(({
|
|
|
1151
1206
|
padding: 0,
|
|
1152
1207
|
border: "none"
|
|
1153
1208
|
},
|
|
1154
|
-
children: [/* @__PURE__ */
|
|
1209
|
+
children: [/* @__PURE__ */jsx21(TextareaUI, {
|
|
1155
1210
|
ref,
|
|
1156
1211
|
sx: {
|
|
1157
1212
|
fontFamily: "body",
|
|
@@ -1163,13 +1218,13 @@ var Textarea = React13.forwardRef(({
|
|
|
1163
1218
|
},
|
|
1164
1219
|
className,
|
|
1165
1220
|
...textareaProps
|
|
1166
|
-
}), trailingIcon && /* @__PURE__ */
|
|
1221
|
+
}), trailingIcon && /* @__PURE__ */jsx21(Text, {
|
|
1167
1222
|
sx: {
|
|
1168
1223
|
position: "absolute",
|
|
1169
1224
|
right: "1.25rem",
|
|
1170
1225
|
top: "0.75rem"
|
|
1171
1226
|
},
|
|
1172
|
-
children: /* @__PURE__ */
|
|
1227
|
+
children: /* @__PURE__ */jsx21(Icon8, {
|
|
1173
1228
|
inline: true,
|
|
1174
1229
|
icon: trailingIcon
|
|
1175
1230
|
})
|
|
@@ -1180,9 +1235,10 @@ Textarea.displayName = "Textarea";
|
|
|
1180
1235
|
|
|
1181
1236
|
// src/components/Tooltip.tsx
|
|
1182
1237
|
import { Tooltip as TooltipReact } from "react-tooltip";
|
|
1183
|
-
import { jsx as
|
|
1238
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1184
1239
|
var Tooltip = ({
|
|
1185
1240
|
variant = "info",
|
|
1241
|
+
sx,
|
|
1186
1242
|
...props
|
|
1187
1243
|
}) => {
|
|
1188
1244
|
const className = `tooltip-component tooltip-${variant}`;
|
|
@@ -1211,7 +1267,7 @@ var Tooltip = ({
|
|
|
1211
1267
|
};
|
|
1212
1268
|
return variants[variantType] || variants.info;
|
|
1213
1269
|
};
|
|
1214
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */jsx22(Box, {
|
|
1215
1271
|
sx: ({
|
|
1216
1272
|
fonts
|
|
1217
1273
|
}) => {
|
|
@@ -1236,12 +1292,13 @@ var Tooltip = ({
|
|
|
1236
1292
|
textDecorationLine: "underline",
|
|
1237
1293
|
lineHeight: "normal"
|
|
1238
1294
|
},
|
|
1239
|
-
...variantStyles
|
|
1295
|
+
...variantStyles,
|
|
1296
|
+
...sx
|
|
1240
1297
|
},
|
|
1241
1298
|
[`&.tooltip-${variant}`]: variantStyles
|
|
1242
1299
|
};
|
|
1243
1300
|
},
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1301
|
+
children: /* @__PURE__ */jsx22(TooltipReact, {
|
|
1245
1302
|
className,
|
|
1246
1303
|
...props,
|
|
1247
1304
|
classNameArrow: "example-arrow",
|
|
@@ -1254,16 +1311,16 @@ var Tooltip = ({
|
|
|
1254
1311
|
import { css, Global } from "@emotion/react";
|
|
1255
1312
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
1256
1313
|
import { ThemeUIProvider } from "theme-ui";
|
|
1257
|
-
import { Fragment as Fragment2, jsx as
|
|
1314
|
+
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1258
1315
|
var ThemeProvider = ({
|
|
1259
1316
|
children,
|
|
1260
1317
|
theme = BruttalTheme,
|
|
1261
1318
|
fonts = BruttalFonts
|
|
1262
1319
|
}) => {
|
|
1263
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */jsx23(Fragment2, {
|
|
1264
1321
|
children: /* @__PURE__ */jsxs9(ThemeUIProvider, {
|
|
1265
1322
|
theme,
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1323
|
+
children: [/* @__PURE__ */jsx23(Global, {
|
|
1267
1324
|
styles: css`
|
|
1268
1325
|
${fonts.map(url => {
|
|
1269
1326
|
return `@import url('${url}');`;
|
|
@@ -1282,4 +1339,4 @@ var useTheme = useThemeUI;
|
|
|
1282
1339
|
import { keyframes } from "@emotion/react";
|
|
1283
1340
|
import { useBreakpointIndex, useResponsiveValue } from "@theme-ui/match-media";
|
|
1284
1341
|
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
1285
|
-
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, SegmentedControl, Select, Slider, Spinner, Stack, Switch, Text, Textarea, ThemeProvider, Tooltip, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
|
1342
|
+
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, SegmentedControl, Select, Slider, Spinner, Stack, Switch, Tag, Text, Textarea, ThemeProvider, Tooltip, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -159,12 +159,17 @@ 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 TagProps = {
|
|
163
|
+
children: React.ReactNode | React.ReactNode[];
|
|
164
|
+
};
|
|
165
|
+
declare const Tag: ({ children }: TagProps) => react_jsx_runtime.JSX.Element;
|
|
166
|
+
|
|
162
167
|
interface TextareaProps extends TextareaProps$1 {
|
|
163
168
|
trailingIcon?: IconType;
|
|
164
169
|
}
|
|
165
170
|
declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
166
171
|
|
|
167
|
-
declare const Tooltip: ({ variant, ...props }: ITooltip) => react_jsx_runtime.JSX.Element;
|
|
172
|
+
declare const Tooltip: ({ variant, sx, ...props }: ITooltip & SxProp) => react_jsx_runtime.JSX.Element;
|
|
168
173
|
|
|
169
174
|
type ThemeProviderProps = {
|
|
170
175
|
children?: React.ReactNode;
|
|
@@ -178,4 +183,4 @@ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) =
|
|
|
178
183
|
|
|
179
184
|
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
180
185
|
|
|
181
|
-
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, SegmentedControl, type SegmentedControlProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, useTheme };
|
|
186
|
+
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, SegmentedControl, type SegmentedControlProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Tag, type TagProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, useTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
45
|
"react": "^19.0.0",
|
|
46
46
|
"tsup": "^8.3.5",
|
|
47
|
-
"@ttoss/react-icons": "^0.4.11",
|
|
48
47
|
"@ttoss/config": "^1.35.3",
|
|
48
|
+
"@ttoss/react-icons": "^0.4.11",
|
|
49
49
|
"@ttoss/test-utils": "^2.1.23"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|