@ttoss/ui 1.31.1 → 1.31.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 CHANGED
@@ -14,19 +14,18 @@ var ThemeProvider = ({
14
14
  theme = BruttalTheme,
15
15
  fonts = BruttalFonts
16
16
  }) => {
17
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(ThemeUiProvider, { theme, children: [
18
- /* @__PURE__ */ jsx(
19
- Global,
20
- {
17
+ return /* @__PURE__ */jsx(Fragment, {
18
+ children: /* @__PURE__ */jsxs(ThemeUiProvider, {
19
+ theme,
20
+ children: [/* @__PURE__ */jsx(Global, {
21
21
  styles: css`
22
- ${fonts.map((url) => {
22
+ ${fonts.map(url => {
23
23
  return `@import url('${url}');`;
24
24
  }).join("\n")}
25
25
  `
26
- }
27
- ),
28
- children
29
- ] }) });
26
+ }), children]
27
+ })
28
+ });
30
29
  };
31
30
 
32
31
  // src/theme/useTheme.ts
@@ -41,52 +40,52 @@ import { Box } from "theme-ui";
41
40
 
42
41
  // src/components/Button.tsx
43
42
  import * as React3 from "react";
44
- import {
45
- Button as ButtonUi
46
- } from "theme-ui";
43
+ import { Button as ButtonUi } from "theme-ui";
47
44
 
48
45
  // src/components/Icon.tsx
49
46
  import * as React2 from "react";
50
- import {
51
- Icon as IconifyIcon
52
- } from "@iconify-icon/react";
47
+ import { Icon as IconifyIcon } from "@iconify-icon/react";
53
48
  import { jsx as jsx2 } from "react/jsx-runtime";
54
- var Icon = React2.forwardRef(
55
- (props, ref) => {
56
- return /* @__PURE__ */ jsx2(IconifyIcon, { ref, "data-testid": "iconify-icon", ...props });
57
- }
58
- );
49
+ var Icon = /*#__PURE__*/React2.forwardRef((props, ref) => {
50
+ return /* @__PURE__ */jsx2(IconifyIcon, {
51
+ ref,
52
+ "data-testid": "iconify-icon",
53
+ ...props
54
+ });
55
+ });
59
56
  Icon.displayName = "Icon";
60
57
 
61
58
  // src/components/Button.tsx
62
59
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
63
- var Button = React3.forwardRef(
64
- (props, ref) => {
65
- const { children, leftIcon, rightIcon, ...restProps } = props;
66
- return /* @__PURE__ */ jsxs2(
67
- ButtonUi,
68
- {
69
- ref,
70
- type: "button",
71
- ...restProps,
72
- sx: {
73
- cursor: "pointer",
74
- paddingX: "lg",
75
- paddingY: "md",
76
- display: "inline-flex",
77
- alignItems: "center",
78
- gap: "lg",
79
- ...restProps.sx
80
- },
81
- children: [
82
- leftIcon && /* @__PURE__ */ jsx3(Icon, { inline: true, icon: leftIcon }),
83
- children,
84
- rightIcon && /* @__PURE__ */ jsx3(Icon, { inline: true, icon: rightIcon })
85
- ]
86
- }
87
- );
88
- }
89
- );
60
+ var Button = /*#__PURE__*/React3.forwardRef((props, ref) => {
61
+ const {
62
+ children,
63
+ leftIcon,
64
+ rightIcon,
65
+ ...restProps
66
+ } = props;
67
+ return /* @__PURE__ */jsxs2(ButtonUi, {
68
+ ref,
69
+ type: "button",
70
+ ...restProps,
71
+ sx: {
72
+ cursor: "pointer",
73
+ paddingX: "lg",
74
+ paddingY: "md",
75
+ display: "inline-flex",
76
+ alignItems: "center",
77
+ gap: "lg",
78
+ ...restProps.sx
79
+ },
80
+ children: [leftIcon && /* @__PURE__ */jsx3(Icon, {
81
+ inline: true,
82
+ icon: leftIcon
83
+ }), children, rightIcon && /* @__PURE__ */jsx3(Icon, {
84
+ inline: true,
85
+ icon: rightIcon
86
+ })]
87
+ });
88
+ });
90
89
  Button.displayName = "Button";
91
90
 
92
91
  // src/components/Card.tsx
@@ -111,52 +110,51 @@ import { Image } from "theme-ui";
111
110
  import React4 from "react";
112
111
  import { Input as InputUI } from "theme-ui";
113
112
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
114
- var Input = React4.forwardRef(
115
- ({ leadingIcon, trailingIcon, sx, ...inputProps }, ref) => {
116
- return /* @__PURE__ */ jsxs3(Flex, { sx: { position: "relative" }, children: [
117
- leadingIcon && /* @__PURE__ */ jsx4(
118
- Text,
119
- {
120
- sx: {
121
- position: "absolute",
122
- alignSelf: "center",
123
- fontSize: "lg",
124
- left: "1rem",
125
- lineHeight: 0
126
- },
127
- variant: "leading-icon",
128
- children: /* @__PURE__ */ jsx4(Icon, { icon: leadingIcon })
129
- }
130
- ),
131
- /* @__PURE__ */ jsx4(
132
- InputUI,
133
- {
134
- ref,
135
- sx: {
136
- paddingLeft: leadingIcon ? "3xl" : void 0,
137
- paddingRight: trailingIcon ? "3xl" : void 0,
138
- ...sx
139
- },
140
- ...inputProps
141
- }
142
- ),
143
- trailingIcon && /* @__PURE__ */ jsx4(
144
- Text,
145
- {
146
- sx: {
147
- position: "absolute",
148
- right: "1rem",
149
- alignSelf: "center",
150
- fontSize: "lg",
151
- lineHeight: 0
152
- },
153
- variant: "trailing-icon",
154
- children: /* @__PURE__ */ jsx4(Icon, { icon: trailingIcon })
155
- }
156
- )
157
- ] });
158
- }
159
- );
113
+ var Input = /*#__PURE__*/React4.forwardRef(({
114
+ leadingIcon,
115
+ trailingIcon,
116
+ sx,
117
+ ...inputProps
118
+ }, ref) => {
119
+ return /* @__PURE__ */jsxs3(Flex, {
120
+ sx: {
121
+ position: "relative"
122
+ },
123
+ children: [leadingIcon && /* @__PURE__ */jsx4(Text, {
124
+ sx: {
125
+ position: "absolute",
126
+ alignSelf: "center",
127
+ fontSize: "lg",
128
+ left: "1rem",
129
+ lineHeight: 0
130
+ },
131
+ variant: "leading-icon",
132
+ children: /* @__PURE__ */jsx4(Icon, {
133
+ icon: leadingIcon
134
+ })
135
+ }), /* @__PURE__ */jsx4(InputUI, {
136
+ ref,
137
+ sx: {
138
+ paddingLeft: leadingIcon ? "3xl" : void 0,
139
+ paddingRight: trailingIcon ? "3xl" : void 0,
140
+ ...sx
141
+ },
142
+ ...inputProps
143
+ }), trailingIcon && /* @__PURE__ */jsx4(Text, {
144
+ sx: {
145
+ position: "absolute",
146
+ right: "1rem",
147
+ alignSelf: "center",
148
+ fontSize: "lg",
149
+ lineHeight: 0
150
+ },
151
+ variant: "trailing-icon",
152
+ children: /* @__PURE__ */jsx4(Icon, {
153
+ icon: trailingIcon
154
+ })
155
+ })]
156
+ });
157
+ });
160
158
  Input.displayName = "Input";
161
159
 
162
160
  // src/components/Label.tsx
@@ -166,9 +164,7 @@ import { Label } from "theme-ui";
166
164
  import { Link } from "theme-ui";
167
165
 
168
166
  // src/components/LinearProgress.tsx
169
- import {
170
- Progress
171
- } from "theme-ui";
167
+ import { Progress } from "theme-ui";
172
168
 
173
169
  // src/components/Text.tsx
174
170
  import { Text } from "theme-ui";
@@ -199,7 +195,7 @@ var InfiniteLinearProgress = () => {
199
195
  const [progress, setProgress] = React5.useState(0);
200
196
  React5.useEffect(() => {
201
197
  const timer = setInterval(() => {
202
- setProgress((oldProgress) => {
198
+ setProgress(oldProgress => {
203
199
  if (oldProgress === MAX_PROGRESS) {
204
200
  return 0;
205
201
  }
@@ -218,7 +214,11 @@ var InfiniteLinearProgress = () => {
218
214
  clearInterval(timer);
219
215
  };
220
216
  }, []);
221
- return /* @__PURE__ */ jsx5(Progress, { max: MAX_PROGRESS, value: progress, role: "progressbar" });
217
+ return /* @__PURE__ */jsx5(Progress, {
218
+ max: MAX_PROGRESS,
219
+ value: progress,
220
+ role: "progressbar"
221
+ });
222
222
  };
223
223
 
224
224
  // src/components/Textarea.tsx
@@ -226,34 +226,4 @@ import { Textarea } from "theme-ui";
226
226
 
227
227
  // src/components/Container.tsx
228
228
  import { Container } from "theme-ui";
229
- export {
230
- Badge,
231
- BaseStyles,
232
- Box,
233
- Button,
234
- Card,
235
- Checkbox,
236
- Container,
237
- Divider,
238
- Flex,
239
- Grid,
240
- Heading,
241
- Icon,
242
- IconButton,
243
- Image,
244
- InfiniteLinearProgress,
245
- Input,
246
- Label,
247
- Progress as LinearProgress,
248
- Link,
249
- Radio,
250
- Select,
251
- Slider,
252
- Spinner,
253
- Text,
254
- Textarea,
255
- ThemeProvider,
256
- useBreakpointIndex,
257
- useResponsiveValue,
258
- useTheme
259
- };
229
+ export { Badge, BaseStyles, Box, Button, Card, Checkbox, Container, Divider, Flex, Grid, Heading, Icon, IconButton, Image, InfiniteLinearProgress, Input, Label, Progress as LinearProgress, Link, Radio, Select, Slider, Spinner, Text, Textarea, ThemeProvider, useBreakpointIndex, useResponsiveValue, useTheme };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  "use strict";
3
+
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7,26 +8,32 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
8
  var __getProtoOf = Object.getPrototypeOf;
8
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
10
  var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
12
15
  };
13
16
  var __copyProps = (to, from, except, desc) => {
14
17
  if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
18
22
  }
19
23
  return to;
20
24
  };
21
25
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
31
+ value: mod,
32
+ enumerable: true
33
+ }) : target, mod));
34
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
35
+ value: true
36
+ }), mod);
30
37
 
31
38
  // src/index.ts
32
39
  var src_exports = {};
@@ -75,19 +82,18 @@ var ThemeProvider = ({
75
82
  theme = import_Bruttal.BruttalTheme,
76
83
  fonts = import_Bruttal.BruttalFonts
77
84
  }) => {
78
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_theme_ui.ThemeProvider, { theme, children: [
79
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
- import_react.Global,
81
- {
85
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
86
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_theme_ui.ThemeProvider, {
87
+ theme,
88
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.Global, {
82
89
  styles: import_react.css`
83
- ${fonts.map((url) => {
90
+ ${fonts.map(url => {
84
91
  return `@import url('${url}');`;
85
92
  }).join("\n")}
86
93
  `
87
- }
88
- ),
89
- children
90
- ] }) });
94
+ }), children]
95
+ })
96
+ });
91
97
  };
92
98
 
93
99
  // src/theme/useTheme.ts
@@ -108,42 +114,46 @@ var import_theme_ui5 = require("theme-ui");
108
114
  var React2 = __toESM(require("react"));
109
115
  var import_react2 = require("@iconify-icon/react");
110
116
  var import_jsx_runtime2 = require("react/jsx-runtime");
111
- var Icon = React2.forwardRef(
112
- (props, ref) => {
113
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Icon, { ref, "data-testid": "iconify-icon", ...props });
114
- }
115
- );
117
+ var Icon = React2.forwardRef((props, ref) => {
118
+ return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react2.Icon, {
119
+ ref,
120
+ "data-testid": "iconify-icon",
121
+ ...props
122
+ });
123
+ });
116
124
  Icon.displayName = "Icon";
117
125
 
118
126
  // src/components/Button.tsx
119
127
  var import_jsx_runtime3 = require("react/jsx-runtime");
120
- var Button = React3.forwardRef(
121
- (props, ref) => {
122
- const { children, leftIcon, rightIcon, ...restProps } = props;
123
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
124
- import_theme_ui5.Button,
125
- {
126
- ref,
127
- type: "button",
128
- ...restProps,
129
- sx: {
130
- cursor: "pointer",
131
- paddingX: "lg",
132
- paddingY: "md",
133
- display: "inline-flex",
134
- alignItems: "center",
135
- gap: "lg",
136
- ...restProps.sx
137
- },
138
- children: [
139
- leftIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { inline: true, icon: leftIcon }),
140
- children,
141
- rightIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { inline: true, icon: rightIcon })
142
- ]
143
- }
144
- );
145
- }
146
- );
128
+ var Button = React3.forwardRef((props, ref) => {
129
+ const {
130
+ children,
131
+ leftIcon,
132
+ rightIcon,
133
+ ...restProps
134
+ } = props;
135
+ return /* @__PURE__ */(0, import_jsx_runtime3.jsxs)(import_theme_ui5.Button, {
136
+ ref,
137
+ type: "button",
138
+ ...restProps,
139
+ sx: {
140
+ cursor: "pointer",
141
+ paddingX: "lg",
142
+ paddingY: "md",
143
+ display: "inline-flex",
144
+ alignItems: "center",
145
+ gap: "lg",
146
+ ...restProps.sx
147
+ },
148
+ children: [leftIcon && /* @__PURE__ */(0, import_jsx_runtime3.jsx)(Icon, {
149
+ inline: true,
150
+ icon: leftIcon
151
+ }), children, rightIcon && /* @__PURE__ */(0, import_jsx_runtime3.jsx)(Icon, {
152
+ inline: true,
153
+ icon: rightIcon
154
+ })]
155
+ });
156
+ });
147
157
  Button.displayName = "Button";
148
158
 
149
159
  // src/components/Card.tsx
@@ -168,52 +178,51 @@ var import_theme_ui11 = require("theme-ui");
168
178
  var import_react3 = __toESM(require("react"));
169
179
  var import_theme_ui12 = require("theme-ui");
170
180
  var import_jsx_runtime4 = require("react/jsx-runtime");
171
- var Input = import_react3.default.forwardRef(
172
- ({ leadingIcon, trailingIcon, sx, ...inputProps }, ref) => {
173
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_theme_ui8.Flex, { sx: { position: "relative" }, children: [
174
- leadingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
175
- import_theme_ui16.Text,
176
- {
177
- sx: {
178
- position: "absolute",
179
- alignSelf: "center",
180
- fontSize: "lg",
181
- left: "1rem",
182
- lineHeight: 0
183
- },
184
- variant: "leading-icon",
185
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { icon: leadingIcon })
186
- }
187
- ),
188
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
189
- import_theme_ui12.Input,
190
- {
191
- ref,
192
- sx: {
193
- paddingLeft: leadingIcon ? "3xl" : void 0,
194
- paddingRight: trailingIcon ? "3xl" : void 0,
195
- ...sx
196
- },
197
- ...inputProps
198
- }
199
- ),
200
- trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
201
- import_theme_ui16.Text,
202
- {
203
- sx: {
204
- position: "absolute",
205
- right: "1rem",
206
- alignSelf: "center",
207
- fontSize: "lg",
208
- lineHeight: 0
209
- },
210
- variant: "trailing-icon",
211
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { icon: trailingIcon })
212
- }
213
- )
214
- ] });
215
- }
216
- );
181
+ var Input = import_react3.default.forwardRef(({
182
+ leadingIcon,
183
+ trailingIcon,
184
+ sx,
185
+ ...inputProps
186
+ }, ref) => {
187
+ return /* @__PURE__ */(0, import_jsx_runtime4.jsxs)(import_theme_ui8.Flex, {
188
+ sx: {
189
+ position: "relative"
190
+ },
191
+ children: [leadingIcon && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_theme_ui16.Text, {
192
+ sx: {
193
+ position: "absolute",
194
+ alignSelf: "center",
195
+ fontSize: "lg",
196
+ left: "1rem",
197
+ lineHeight: 0
198
+ },
199
+ variant: "leading-icon",
200
+ children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
201
+ icon: leadingIcon
202
+ })
203
+ }), /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_theme_ui12.Input, {
204
+ ref,
205
+ sx: {
206
+ paddingLeft: leadingIcon ? "3xl" : void 0,
207
+ paddingRight: trailingIcon ? "3xl" : void 0,
208
+ ...sx
209
+ },
210
+ ...inputProps
211
+ }), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime4.jsx)(import_theme_ui16.Text, {
212
+ sx: {
213
+ position: "absolute",
214
+ right: "1rem",
215
+ alignSelf: "center",
216
+ fontSize: "lg",
217
+ lineHeight: 0
218
+ },
219
+ variant: "trailing-icon",
220
+ children: /* @__PURE__ */(0, import_jsx_runtime4.jsx)(Icon, {
221
+ icon: trailingIcon
222
+ })
223
+ })]
224
+ });
225
+ });
217
226
  Input.displayName = "Input";
218
227
 
219
228
  // src/components/Label.tsx
@@ -254,7 +263,7 @@ var InfiniteLinearProgress = () => {
254
263
  const [progress, setProgress] = React5.useState(0);
255
264
  React5.useEffect(() => {
256
265
  const timer = setInterval(() => {
257
- setProgress((oldProgress) => {
266
+ setProgress(oldProgress => {
258
267
  if (oldProgress === MAX_PROGRESS) {
259
268
  return 0;
260
269
  }
@@ -273,7 +282,11 @@ var InfiniteLinearProgress = () => {
273
282
  clearInterval(timer);
274
283
  };
275
284
  }, []);
276
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_theme_ui15.Progress, { max: MAX_PROGRESS, value: progress, role: "progressbar" });
285
+ return /* @__PURE__ */(0, import_jsx_runtime5.jsx)(import_theme_ui15.Progress, {
286
+ max: MAX_PROGRESS,
287
+ value: progress,
288
+ role: "progressbar"
289
+ });
277
290
  };
278
291
 
279
292
  // src/components/Textarea.tsx
@@ -312,4 +325,4 @@ var import_theme_ui24 = require("theme-ui");
312
325
  useBreakpointIndex,
313
326
  useResponsiveValue,
314
327
  useTheme
315
- });
328
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "1.31.1",
3
+ "version": "1.31.3",
4
4
  "description": "Primitive layout, typographic, and other components for styling applications.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -24,15 +24,15 @@
24
24
  "@emotion/react": "^11.10.6",
25
25
  "@iconify-icon/react": "^1.0.7",
26
26
  "@theme-ui/match-media": "^0.15.5",
27
- "@ttoss/theme": "^1.4.1",
27
+ "@ttoss/theme": "^1.4.3",
28
28
  "theme-ui": "^0.15.5"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=16.8.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@ttoss/config": "^1.29.1",
35
- "@ttoss/test-utils": "^1.20.8",
34
+ "@ttoss/config": "^1.29.2",
35
+ "@ttoss/test-utils": "^1.20.9",
36
36
  "@types/jest": "^29.5.0",
37
37
  "jest": "^29.5.0",
38
38
  "react": "^18.2.0",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "ee0c2e51d38f37f997c020d4303cf90be720ecb0"
49
+ "gitHead": "792b02e52847725c19fdceffb606c201840d5910"
50
50
  }