@ttoss/components 1.24.2 → 1.24.4

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
@@ -42,11 +42,9 @@ var Accordion = ({
42
42
  })(theme);
43
43
  return createClassName(styles);
44
44
  }, [theme]);
45
- return /* @__PURE__ */ jsx(Box, {
46
- variant: "accordion",
47
- className,
48
- ...boxProps,
49
- children: /* @__PURE__ */ jsx(ReactAccessibleAccordion, {
45
+ return /* @__PURE__ */ jsx(Box, { variant: "accordion", className, ...boxProps, children: /* @__PURE__ */ jsx(
46
+ ReactAccessibleAccordion,
47
+ {
50
48
  ...{
51
49
  allowMultipleExpanded,
52
50
  allowZeroExpanded,
@@ -54,8 +52,8 @@ var Accordion = ({
54
52
  onChange
55
53
  },
56
54
  children
57
- })
58
- });
55
+ }
56
+ ) });
59
57
  };
60
58
  Accordion.Item = AccordionItem;
61
59
  Accordion.ItemButton = AccordionItemButton;
@@ -69,36 +67,37 @@ import * as React3 from "react";
69
67
  import { Button, Flex, Text } from "@ttoss/ui";
70
68
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
71
69
  var InstallPwaUi = ({ onInstall }) => {
72
- return /* @__PURE__ */ jsx2(Flex, {
73
- sx: {
74
- position: "absolute",
75
- bottom: 4,
76
- width: "100%",
77
- justifyContent: "center"
78
- },
79
- children: /* @__PURE__ */ jsxs(Flex, {
70
+ return /* @__PURE__ */ jsx2(
71
+ Flex,
72
+ {
80
73
  sx: {
81
- backgroundColor: "background",
82
- justifyContent: "center",
83
- alignItems: "center",
84
- gap: 3,
85
- width: "auto",
86
- border: "1px solid",
87
- borderColor: "muted",
88
- borderRadius: 1,
89
- padding: 4
74
+ position: "absolute",
75
+ bottom: 4,
76
+ width: "100%",
77
+ justifyContent: "center"
90
78
  },
91
- children: [
92
- /* @__PURE__ */ jsx2(Text, {
93
- children: "Deseja instalar o nosso aplicativo?"
94
- }),
95
- /* @__PURE__ */ jsx2(Button, {
96
- onClick: onInstall,
97
- children: "Instalar"
98
- })
99
- ]
100
- })
101
- });
79
+ children: /* @__PURE__ */ jsxs(
80
+ Flex,
81
+ {
82
+ sx: {
83
+ backgroundColor: "background",
84
+ justifyContent: "center",
85
+ alignItems: "center",
86
+ gap: 3,
87
+ width: "auto",
88
+ border: "1px solid",
89
+ borderColor: "muted",
90
+ borderRadius: 1,
91
+ padding: 4
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ jsx2(Text, { children: "Deseja instalar o nosso aplicativo?" }),
95
+ /* @__PURE__ */ jsx2(Button, { onClick: onInstall, children: "Instalar" })
96
+ ]
97
+ }
98
+ )
99
+ }
100
+ );
102
101
  };
103
102
 
104
103
  // src/components/InstallPwa/InstallPwa.tsx
@@ -125,9 +124,7 @@ var InstallPwa = () => {
125
124
  if (!supportsPwa) {
126
125
  return null;
127
126
  }
128
- return /* @__PURE__ */ jsx3(InstallPwaUi, {
129
- onInstall
130
- });
127
+ return /* @__PURE__ */ jsx3(InstallPwaUi, { onInstall });
131
128
  };
132
129
 
133
130
  // src/components/Modal/Modal.tsx
@@ -139,12 +136,11 @@ ReactModal.defaultStyles = {
139
136
  content: {}
140
137
  };
141
138
  var Modal = (props) => {
142
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
143
139
  const { theme } = useTheme2();
144
140
  const padding = useResponsiveValue([
145
- (_a = theme.space) == null ? void 0 : _a[2],
146
- (_b = theme.space) == null ? void 0 : _b[3],
147
- (_c = theme.space) == null ? void 0 : _c[4]
141
+ theme.space?.[2],
142
+ theme.space?.[3],
143
+ theme.space?.[4]
148
144
  ]) || 0;
149
145
  const style = {
150
146
  overlay: {
@@ -158,10 +154,10 @@ var Modal = (props) => {
158
154
  justifyContent: "center",
159
155
  alignItems: "center",
160
156
  padding,
161
- ...(_d = props.style) == null ? void 0 : _d.overlay
157
+ ...props.style?.overlay
162
158
  },
163
159
  content: {
164
- backgroundColor: ((_f = (_e = theme.rawColors) == null ? void 0 : _e.background) == null ? void 0 : _f.toString()) || "#fff",
160
+ backgroundColor: theme.rawColors?.background?.toString() || "#fff",
165
161
  padding,
166
162
  WebkitOverflowScrolling: "touch",
167
163
  overflow: "auto",
@@ -171,17 +167,14 @@ var Modal = (props) => {
171
167
  right: "0px",
172
168
  bottom: "0px",
173
169
  border: "2px solid",
174
- borderColor: ((_h = (_g = theme.rawColors) == null ? void 0 : _g.muted) == null ? void 0 : _h.toString()) || "#fff",
170
+ borderColor: theme.rawColors?.muted?.toString() || "#fff",
175
171
  display: "flex",
176
172
  flexDirection: "column",
177
173
  alignItems: "center",
178
- ...(_i = props.style) == null ? void 0 : _i.content
174
+ ...props.style?.content
179
175
  }
180
176
  };
181
- return /* @__PURE__ */ jsx4(ReactModal, {
182
- ...props,
183
- style
184
- });
177
+ return /* @__PURE__ */ jsx4(ReactModal, { ...props, style });
185
178
  };
186
179
  Modal.setAppElement = ReactModal.setAppElement;
187
180
 
@@ -198,21 +191,22 @@ var ToastContainer = (props) => {
198
191
  React4.useEffect(() => {
199
192
  injectStyle();
200
193
  }, []);
201
- return /* @__PURE__ */ jsx5(Box2, {
202
- sx: ({ colors, fonts }) => ({
203
- "--toastify-color-light": "#fff",
204
- "--toastify-color-dark": "#121212",
205
- "--toastify-color-info": (colors == null ? void 0 : colors.info) || "#3498db",
206
- "--toastify-color-success": (colors == null ? void 0 : colors.success) || "#07bc0c",
207
- "--toastify-color-warning": "#f1c40f",
208
- "--toastify-color-error": "#e74c3c",
209
- "--toastify-color-progress-light": `linear-gradient(to right, ${colors == null ? void 0 : colors.primary}, ${colors == null ? void 0 : colors.secondary})`,
210
- "--toastify-font-family": fonts.body
211
- }),
212
- children: /* @__PURE__ */ jsx5(ReactToastifyToastContainer, {
213
- ...props
214
- })
215
- });
194
+ return /* @__PURE__ */ jsx5(
195
+ Box2,
196
+ {
197
+ sx: ({ colors, fonts }) => ({
198
+ "--toastify-color-light": "#fff",
199
+ "--toastify-color-dark": "#121212",
200
+ "--toastify-color-info": colors?.info || "#3498db",
201
+ "--toastify-color-success": colors?.success || "#07bc0c",
202
+ "--toastify-color-warning": "#f1c40f",
203
+ "--toastify-color-error": "#e74c3c",
204
+ "--toastify-color-progress-light": `linear-gradient(to right, ${colors?.primary}, ${colors?.secondary})`,
205
+ "--toastify-font-family": fonts.body
206
+ }),
207
+ children: /* @__PURE__ */ jsx5(ReactToastifyToastContainer, { ...props })
208
+ }
209
+ );
216
210
  };
217
211
  export {
218
212
  Accordion,
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import ReactModal from 'react-modal';
7
7
  import { ToastContainerProps } from 'react-toastify';
8
8
  export { ToastContainerProps, toast } from 'react-toastify';
9
9
 
10
- declare type AccordionProps = BoxProps & {
10
+ type AccordionProps = BoxProps & {
11
11
  allowMultipleExpanded?: boolean;
12
12
  allowZeroExpanded?: boolean;
13
13
  preExpanded?: string[];
@@ -19,7 +19,7 @@ declare type AccordionProps = BoxProps & {
19
19
  declare const Accordion: {
20
20
  ({ children, allowMultipleExpanded, allowZeroExpanded, preExpanded, onChange, ...boxProps }: AccordionProps): JSX.Element;
21
21
  Item: {
22
- ({ uuid, dangerouslySetExpanded, className, activeClassName, ...rest }: react_accessible_accordion_dist_types_helpers_types.DivAttributes & {
22
+ ({ uuid: customUuid, dangerouslySetExpanded, className, activeClassName, ...rest }: react_accessible_accordion_dist_types_helpers_types.DivAttributes & {
23
23
  uuid?: react_accessible_accordion_dist_types_components_ItemContext.ID | undefined;
24
24
  activeClassName?: string | undefined;
25
25
  dangerouslySetExpanded?: boolean | undefined;
@@ -37,12 +37,13 @@ declare const Accordion: {
37
37
  suppressHydrationWarning?: boolean | undefined;
38
38
  accessKey?: string | undefined;
39
39
  className?: string | undefined;
40
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
40
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
41
41
  contextMenu?: string | undefined;
42
42
  dir?: string | undefined;
43
43
  draggable?: (boolean | "true" | "false") | undefined;
44
44
  hidden?: boolean | undefined;
45
45
  lang?: string | undefined;
46
+ nonce?: string | undefined;
46
47
  placeholder?: string | undefined;
47
48
  spellCheck?: (boolean | "true" | "false") | undefined;
48
49
  translate?: "yes" | "no" | undefined;
@@ -71,7 +72,7 @@ declare const Accordion: {
71
72
  is?: string | undefined;
72
73
  'aria-activedescendant'?: string | undefined;
73
74
  'aria-atomic'?: (boolean | "true" | "false") | undefined;
74
- 'aria-autocomplete'?: "list" | "none" | "both" | "inline" | undefined;
75
+ 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
75
76
  'aria-busy'?: (boolean | "true" | "false") | undefined;
76
77
  'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
77
78
  'aria-colcount'?: number | undefined;
@@ -80,11 +81,11 @@ declare const Accordion: {
80
81
  'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
81
82
  'aria-describedby'?: string | undefined;
82
83
  'aria-details'?: string | undefined;
83
- 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
84
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
84
85
  'aria-errormessage'?: string | undefined;
85
86
  'aria-flowto'?: string | undefined;
86
87
  'aria-grabbed'?: (boolean | "true" | "false") | undefined;
87
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
88
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree" | undefined;
88
89
  'aria-hidden'?: (boolean | "true" | "false") | undefined;
89
90
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
90
91
  'aria-keyshortcuts'?: string | undefined;
@@ -185,6 +186,8 @@ declare const Accordion: {
185
186
  onProgressCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
186
187
  onRateChange?: React.ReactEventHandler<HTMLDivElement> | undefined;
187
188
  onRateChangeCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
189
+ onResize?: React.ReactEventHandler<HTMLDivElement> | undefined;
190
+ onResizeCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
188
191
  onSeeked?: React.ReactEventHandler<HTMLDivElement> | undefined;
189
192
  onSeekedCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
190
193
  onSeeking?: React.ReactEventHandler<HTMLDivElement> | undefined;
@@ -287,7 +290,7 @@ declare const Accordion: {
287
290
 
288
291
  declare const InstallPwa: () => JSX.Element | null;
289
292
 
290
- declare type ModalProps = ReactModal.Props;
293
+ type ModalProps = ReactModal.Props;
291
294
  declare const Modal: {
292
295
  (props: ModalProps): JSX.Element;
293
296
  setAppElement: typeof ReactModal.setAppElement;
package/dist/index.js CHANGED
@@ -71,11 +71,9 @@ var Accordion = ({
71
71
  })(theme);
72
72
  return (0, import_css.css)(styles);
73
73
  }, [theme]);
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Box, {
75
- variant: "accordion",
76
- className,
77
- ...boxProps,
78
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_accessible_accordion.Accordion, {
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Box, { variant: "accordion", className, ...boxProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ import_react_accessible_accordion.Accordion,
76
+ {
79
77
  ...{
80
78
  allowMultipleExpanded,
81
79
  allowZeroExpanded,
@@ -83,8 +81,8 @@ var Accordion = ({
83
81
  onChange
84
82
  },
85
83
  children
86
- })
87
- });
84
+ }
85
+ ) });
88
86
  };
89
87
  Accordion.Item = import_react_accessible_accordion.AccordionItem;
90
88
  Accordion.ItemButton = import_react_accessible_accordion.AccordionItemButton;
@@ -98,36 +96,37 @@ var React3 = __toESM(require("react"));
98
96
  var import_ui2 = require("@ttoss/ui");
99
97
  var import_jsx_runtime2 = require("react/jsx-runtime");
100
98
  var InstallPwaUi = ({ onInstall }) => {
101
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
102
- sx: {
103
- position: "absolute",
104
- bottom: 4,
105
- width: "100%",
106
- justifyContent: "center"
107
- },
108
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui2.Flex, {
99
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
100
+ import_ui2.Flex,
101
+ {
109
102
  sx: {
110
- backgroundColor: "background",
111
- justifyContent: "center",
112
- alignItems: "center",
113
- gap: 3,
114
- width: "auto",
115
- border: "1px solid",
116
- borderColor: "muted",
117
- borderRadius: 1,
118
- padding: 4
103
+ position: "absolute",
104
+ bottom: 4,
105
+ width: "100%",
106
+ justifyContent: "center"
119
107
  },
120
- children: [
121
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Text, {
122
- children: "Deseja instalar o nosso aplicativo?"
123
- }),
124
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Button, {
125
- onClick: onInstall,
126
- children: "Instalar"
127
- })
128
- ]
129
- })
130
- });
108
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
109
+ import_ui2.Flex,
110
+ {
111
+ sx: {
112
+ backgroundColor: "background",
113
+ justifyContent: "center",
114
+ alignItems: "center",
115
+ gap: 3,
116
+ width: "auto",
117
+ border: "1px solid",
118
+ borderColor: "muted",
119
+ borderRadius: 1,
120
+ padding: 4
121
+ },
122
+ children: [
123
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Text, { children: "Deseja instalar o nosso aplicativo?" }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Button, { onClick: onInstall, children: "Instalar" })
125
+ ]
126
+ }
127
+ )
128
+ }
129
+ );
131
130
  };
132
131
 
133
132
  // src/components/InstallPwa/InstallPwa.tsx
@@ -154,9 +153,7 @@ var InstallPwa = () => {
154
153
  if (!supportsPwa) {
155
154
  return null;
156
155
  }
157
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InstallPwaUi, {
158
- onInstall
159
- });
156
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InstallPwaUi, { onInstall });
160
157
  };
161
158
 
162
159
  // src/components/Modal/Modal.tsx
@@ -168,12 +165,11 @@ import_react_modal.default.defaultStyles = {
168
165
  content: {}
169
166
  };
170
167
  var Modal = (props) => {
171
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
172
168
  const { theme } = (0, import_ui3.useTheme)();
173
169
  const padding = (0, import_ui3.useResponsiveValue)([
174
- (_a = theme.space) == null ? void 0 : _a[2],
175
- (_b = theme.space) == null ? void 0 : _b[3],
176
- (_c = theme.space) == null ? void 0 : _c[4]
170
+ theme.space?.[2],
171
+ theme.space?.[3],
172
+ theme.space?.[4]
177
173
  ]) || 0;
178
174
  const style = {
179
175
  overlay: {
@@ -187,10 +183,10 @@ var Modal = (props) => {
187
183
  justifyContent: "center",
188
184
  alignItems: "center",
189
185
  padding,
190
- ...(_d = props.style) == null ? void 0 : _d.overlay
186
+ ...props.style?.overlay
191
187
  },
192
188
  content: {
193
- backgroundColor: ((_f = (_e = theme.rawColors) == null ? void 0 : _e.background) == null ? void 0 : _f.toString()) || "#fff",
189
+ backgroundColor: theme.rawColors?.background?.toString() || "#fff",
194
190
  padding,
195
191
  WebkitOverflowScrolling: "touch",
196
192
  overflow: "auto",
@@ -200,17 +196,14 @@ var Modal = (props) => {
200
196
  right: "0px",
201
197
  bottom: "0px",
202
198
  border: "2px solid",
203
- borderColor: ((_h = (_g = theme.rawColors) == null ? void 0 : _g.muted) == null ? void 0 : _h.toString()) || "#fff",
199
+ borderColor: theme.rawColors?.muted?.toString() || "#fff",
204
200
  display: "flex",
205
201
  flexDirection: "column",
206
202
  alignItems: "center",
207
- ...(_i = props.style) == null ? void 0 : _i.content
203
+ ...props.style?.content
208
204
  }
209
205
  };
210
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_modal.default, {
211
- ...props,
212
- style
213
- });
206
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_modal.default, { ...props, style });
214
207
  };
215
208
  Modal.setAppElement = import_react_modal.default.setAppElement;
216
209
 
@@ -224,21 +217,22 @@ var ToastContainer = (props) => {
224
217
  React4.useEffect(() => {
225
218
  (0, import_inject_style.injectStyle)();
226
219
  }, []);
227
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ui4.Box, {
228
- sx: ({ colors, fonts }) => ({
229
- "--toastify-color-light": "#fff",
230
- "--toastify-color-dark": "#121212",
231
- "--toastify-color-info": (colors == null ? void 0 : colors.info) || "#3498db",
232
- "--toastify-color-success": (colors == null ? void 0 : colors.success) || "#07bc0c",
233
- "--toastify-color-warning": "#f1c40f",
234
- "--toastify-color-error": "#e74c3c",
235
- "--toastify-color-progress-light": `linear-gradient(to right, ${colors == null ? void 0 : colors.primary}, ${colors == null ? void 0 : colors.secondary})`,
236
- "--toastify-font-family": fonts.body
237
- }),
238
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_toastify.ToastContainer, {
239
- ...props
240
- })
241
- });
220
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
221
+ import_ui4.Box,
222
+ {
223
+ sx: ({ colors, fonts }) => ({
224
+ "--toastify-color-light": "#fff",
225
+ "--toastify-color-dark": "#121212",
226
+ "--toastify-color-info": colors?.info || "#3498db",
227
+ "--toastify-color-success": colors?.success || "#07bc0c",
228
+ "--toastify-color-warning": "#f1c40f",
229
+ "--toastify-color-error": "#e74c3c",
230
+ "--toastify-color-progress-light": `linear-gradient(to right, ${colors?.primary}, ${colors?.secondary})`,
231
+ "--toastify-font-family": fonts.body
232
+ }),
233
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_toastify.ToastContainer, { ...props })
234
+ }
235
+ );
242
236
  };
243
237
  // Annotate the CommonJS export names for ESM import in node:
244
238
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "1.24.2",
3
+ "version": "1.24.4",
4
4
  "description": "React components.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -32,9 +32,9 @@
32
32
  "react": ">=16.8.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@ttoss/config": "^1.22.0",
36
- "@ttoss/test-utils": "^1.18.2",
37
- "@ttoss/ui": "^1.26.2",
35
+ "@ttoss/config": "^1.25.0",
36
+ "@ttoss/test-utils": "^1.18.3",
37
+ "@ttoss/ui": "^1.27.0",
38
38
  "@types/jest": "^29.2.4",
39
39
  "jest": "^29.3.1"
40
40
  },
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "00ce34857256c353cd910ad1bf8c7f2a5986a88f"
48
+ "gitHead": "9159bd57009f4fee620218bc1a0e7bbac28acccd"
49
49
  }