@ttoss/components 1.21.4 → 1.21.5
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 +49 -35
- package/dist/index.js +53 -34
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
// tsup.inject.js
|
|
4
2
|
import * as React from "react";
|
|
5
3
|
|
|
@@ -15,6 +13,7 @@ import {
|
|
|
15
13
|
import { Box, useTheme } from "@ttoss/ui";
|
|
16
14
|
import { css as createClassName } from "@emotion/css";
|
|
17
15
|
import { css as transformStyleObject } from "@theme-ui/css";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
17
|
var Accordion = ({
|
|
19
18
|
children,
|
|
20
19
|
allowMultipleExpanded,
|
|
@@ -41,18 +40,20 @@ var Accordion = ({
|
|
|
41
40
|
})(theme);
|
|
42
41
|
return createClassName(styles);
|
|
43
42
|
}, [theme]);
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
45
44
|
variant: "accordion",
|
|
46
45
|
className,
|
|
47
|
-
...boxProps
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
...boxProps,
|
|
47
|
+
children: /* @__PURE__ */ jsx(ReactAccessibleAccordion, {
|
|
48
|
+
...{
|
|
49
|
+
allowMultipleExpanded,
|
|
50
|
+
allowZeroExpanded,
|
|
51
|
+
preExpanded,
|
|
52
|
+
onChange
|
|
53
|
+
},
|
|
54
|
+
children
|
|
55
|
+
})
|
|
56
|
+
});
|
|
56
57
|
};
|
|
57
58
|
Accordion.Item = AccordionItem;
|
|
58
59
|
Accordion.ItemButton = AccordionItemButton;
|
|
@@ -64,32 +65,42 @@ import * as React3 from "react";
|
|
|
64
65
|
|
|
65
66
|
// src/components/InstallPwa/InstallPwaUi.tsx
|
|
66
67
|
import { Button, Flex, Text } from "@ttoss/ui";
|
|
68
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
67
69
|
var InstallPwaUi = ({ onInstall }) => {
|
|
68
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ jsx2(Flex, {
|
|
69
71
|
sx: {
|
|
70
72
|
position: "absolute",
|
|
71
73
|
bottom: 4,
|
|
72
74
|
width: "100%",
|
|
73
75
|
justifyContent: "center"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
},
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
78
|
+
sx: {
|
|
79
|
+
backgroundColor: "background",
|
|
80
|
+
justifyContent: "center",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: 3,
|
|
83
|
+
width: "auto",
|
|
84
|
+
border: "1px solid",
|
|
85
|
+
borderColor: "muted",
|
|
86
|
+
borderRadius: 1,
|
|
87
|
+
padding: 4
|
|
88
|
+
},
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx2(Text, {
|
|
91
|
+
children: "Deseja instalar o nosso aplicativo?"
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ jsx2(Button, {
|
|
94
|
+
onClick: onInstall,
|
|
95
|
+
children: "Instalar"
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
});
|
|
90
100
|
};
|
|
91
101
|
|
|
92
102
|
// src/components/InstallPwa/InstallPwa.tsx
|
|
103
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
93
104
|
var InstallPwa = () => {
|
|
94
105
|
const [supportsPwa, setSupportsPwa] = React3.useState(false);
|
|
95
106
|
const [promptInstall, setPromptInstall] = React3.useState(null);
|
|
@@ -112,7 +123,7 @@ var InstallPwa = () => {
|
|
|
112
123
|
if (!supportsPwa) {
|
|
113
124
|
return null;
|
|
114
125
|
}
|
|
115
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsx3(InstallPwaUi, {
|
|
116
127
|
onInstall
|
|
117
128
|
});
|
|
118
129
|
};
|
|
@@ -120,6 +131,7 @@ var InstallPwa = () => {
|
|
|
120
131
|
// src/components/Modal/Modal.tsx
|
|
121
132
|
import { useResponsiveValue, useTheme as useTheme2 } from "@ttoss/ui";
|
|
122
133
|
import ReactModal from "react-modal";
|
|
134
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
123
135
|
ReactModal.defaultStyles = {
|
|
124
136
|
overlay: {},
|
|
125
137
|
content: {}
|
|
@@ -164,7 +176,7 @@ var Modal = (props) => {
|
|
|
164
176
|
...(_i = props.style) == null ? void 0 : _i.content
|
|
165
177
|
}
|
|
166
178
|
};
|
|
167
|
-
return /* @__PURE__ */
|
|
179
|
+
return /* @__PURE__ */ jsx4(ReactModal, {
|
|
168
180
|
...props,
|
|
169
181
|
style
|
|
170
182
|
});
|
|
@@ -180,11 +192,12 @@ import {
|
|
|
180
192
|
toast
|
|
181
193
|
} from "react-toastify";
|
|
182
194
|
import { injectStyle } from "react-toastify/dist/inject-style";
|
|
195
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
183
196
|
var ToastContainer = (props) => {
|
|
184
197
|
React4.useEffect(() => {
|
|
185
198
|
injectStyle();
|
|
186
199
|
}, []);
|
|
187
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ jsx5(Box2, {
|
|
188
201
|
sx: ({ colors, fonts }) => ({
|
|
189
202
|
"--toastify-color-light": "#fff",
|
|
190
203
|
"--toastify-color-dark": "#121212",
|
|
@@ -194,10 +207,11 @@ var ToastContainer = (props) => {
|
|
|
194
207
|
"--toastify-color-error": "#e74c3c",
|
|
195
208
|
"--toastify-color-progress-light": `linear-gradient(to right, ${colors == null ? void 0 : colors.primary}, ${colors == null ? void 0 : colors.secondary})`,
|
|
196
209
|
"--toastify-font-family": fonts.body
|
|
210
|
+
}),
|
|
211
|
+
children: /* @__PURE__ */ jsx5(ReactToastifyToastContainer, {
|
|
212
|
+
...props
|
|
197
213
|
})
|
|
198
|
-
}
|
|
199
|
-
...props
|
|
200
|
-
}));
|
|
214
|
+
});
|
|
201
215
|
};
|
|
202
216
|
export {
|
|
203
217
|
Accordion,
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
|
|
23
26
|
// src/index.ts
|
|
@@ -41,6 +44,7 @@ var import_react_accessible_accordion = require("react-accessible-accordion");
|
|
|
41
44
|
var import_ui = require("@ttoss/ui");
|
|
42
45
|
var import_css = require("@emotion/css");
|
|
43
46
|
var import_css2 = require("@theme-ui/css");
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
48
|
var Accordion = ({
|
|
45
49
|
children,
|
|
46
50
|
allowMultipleExpanded,
|
|
@@ -67,18 +71,20 @@ var Accordion = ({
|
|
|
67
71
|
})(theme);
|
|
68
72
|
return (0, import_css.css)(styles);
|
|
69
73
|
}, [theme]);
|
|
70
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Box, {
|
|
71
75
|
variant: "accordion",
|
|
72
76
|
className,
|
|
73
|
-
...boxProps
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
...boxProps,
|
|
78
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_accessible_accordion.Accordion, {
|
|
79
|
+
...{
|
|
80
|
+
allowMultipleExpanded,
|
|
81
|
+
allowZeroExpanded,
|
|
82
|
+
preExpanded,
|
|
83
|
+
onChange
|
|
84
|
+
},
|
|
85
|
+
children
|
|
86
|
+
})
|
|
87
|
+
});
|
|
82
88
|
};
|
|
83
89
|
Accordion.Item = import_react_accessible_accordion.AccordionItem;
|
|
84
90
|
Accordion.ItemButton = import_react_accessible_accordion.AccordionItemButton;
|
|
@@ -90,32 +96,42 @@ var React3 = __toESM(require("react"));
|
|
|
90
96
|
|
|
91
97
|
// src/components/InstallPwa/InstallPwaUi.tsx
|
|
92
98
|
var import_ui2 = require("@ttoss/ui");
|
|
99
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
93
100
|
var InstallPwaUi = ({ onInstall }) => {
|
|
94
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Flex, {
|
|
95
102
|
sx: {
|
|
96
103
|
position: "absolute",
|
|
97
104
|
bottom: 4,
|
|
98
105
|
width: "100%",
|
|
99
106
|
justifyContent: "center"
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
},
|
|
108
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui2.Flex, {
|
|
109
|
+
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
|
|
119
|
+
},
|
|
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
|
+
});
|
|
116
131
|
};
|
|
117
132
|
|
|
118
133
|
// src/components/InstallPwa/InstallPwa.tsx
|
|
134
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
119
135
|
var InstallPwa = () => {
|
|
120
136
|
const [supportsPwa, setSupportsPwa] = React3.useState(false);
|
|
121
137
|
const [promptInstall, setPromptInstall] = React3.useState(null);
|
|
@@ -138,7 +154,7 @@ var InstallPwa = () => {
|
|
|
138
154
|
if (!supportsPwa) {
|
|
139
155
|
return null;
|
|
140
156
|
}
|
|
141
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InstallPwaUi, {
|
|
142
158
|
onInstall
|
|
143
159
|
});
|
|
144
160
|
};
|
|
@@ -146,6 +162,7 @@ var InstallPwa = () => {
|
|
|
146
162
|
// src/components/Modal/Modal.tsx
|
|
147
163
|
var import_ui3 = require("@ttoss/ui");
|
|
148
164
|
var import_react_modal = __toESM(require("react-modal"));
|
|
165
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
149
166
|
import_react_modal.default.defaultStyles = {
|
|
150
167
|
overlay: {},
|
|
151
168
|
content: {}
|
|
@@ -190,7 +207,7 @@ var Modal = (props) => {
|
|
|
190
207
|
...(_i = props.style) == null ? void 0 : _i.content
|
|
191
208
|
}
|
|
192
209
|
};
|
|
193
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_modal.default, {
|
|
194
211
|
...props,
|
|
195
212
|
style
|
|
196
213
|
});
|
|
@@ -202,11 +219,12 @@ var React4 = __toESM(require("react"));
|
|
|
202
219
|
var import_ui4 = require("@ttoss/ui");
|
|
203
220
|
var import_react_toastify = require("react-toastify");
|
|
204
221
|
var import_inject_style = require("react-toastify/dist/inject-style");
|
|
222
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
205
223
|
var ToastContainer = (props) => {
|
|
206
224
|
React4.useEffect(() => {
|
|
207
225
|
(0, import_inject_style.injectStyle)();
|
|
208
226
|
}, []);
|
|
209
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ui4.Box, {
|
|
210
228
|
sx: ({ colors, fonts }) => ({
|
|
211
229
|
"--toastify-color-light": "#fff",
|
|
212
230
|
"--toastify-color-dark": "#121212",
|
|
@@ -216,10 +234,11 @@ var ToastContainer = (props) => {
|
|
|
216
234
|
"--toastify-color-error": "#e74c3c",
|
|
217
235
|
"--toastify-color-progress-light": `linear-gradient(to right, ${colors == null ? void 0 : colors.primary}, ${colors == null ? void 0 : colors.secondary})`,
|
|
218
236
|
"--toastify-font-family": fonts.body
|
|
237
|
+
}),
|
|
238
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_toastify.ToastContainer, {
|
|
239
|
+
...props
|
|
219
240
|
})
|
|
220
|
-
}
|
|
221
|
-
...props
|
|
222
|
-
}));
|
|
241
|
+
});
|
|
223
242
|
};
|
|
224
243
|
// Annotate the CommonJS export names for ESM import in node:
|
|
225
244
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/components",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.5",
|
|
4
4
|
"description": "React components.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@ttoss/config": "^1.18.1",
|
|
36
36
|
"@ttoss/test-utils": "^1.16.8",
|
|
37
|
-
"@ttoss/ui": "^1.20.
|
|
37
|
+
"@ttoss/ui": "^1.20.2",
|
|
38
38
|
"@types/jest": "^28.1.5",
|
|
39
39
|
"jest": "^28.1.3"
|
|
40
40
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "0759c1ec512f6cb0a613c209beba1fcf6af7e232"
|
|
49
49
|
}
|