visits-style 1.4.15 → 2.0.0
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/README.md +59 -26
- package/dist/index.cjs.js +1031 -1358
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.cts +404 -0
- package/dist/index.d.ts +404 -7
- package/dist/index.esm.js +1199 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/lib.css +26 -0
- package/package.json +27 -32
- package/dist/components/Accordion/index.d.ts +0 -12
- package/dist/components/AppBar/index.d.ts +0 -19
- package/dist/components/Modal/index.d.ts +0 -32
- package/dist/components/Popover/index.d.ts +0 -46
- package/dist/components/Portal/index.d.ts +0 -8
- package/dist/components/Spinner/index.d.ts +0 -12
- package/dist/components/Toast/ToastItem.d.ts +0 -2
- package/dist/components/Toast/index.d.ts +0 -2
- package/dist/components/Toast/types.d.ts +0 -44
- package/dist/components/Tooltip/index.d.ts +0 -37
- package/dist/components/index.d.ts +0 -10
- package/dist/elements/Box/index.d.ts +0 -10
- package/dist/elements/Button/ButtonGroup.d.ts +0 -3
- package/dist/elements/Button/TextButton.d.ts +0 -18
- package/dist/elements/Button/index.d.ts +0 -16
- package/dist/elements/Content/index.d.ts +0 -3
- package/dist/elements/Divider/index.d.ts +0 -3
- package/dist/elements/Grid/Col.d.ts +0 -12
- package/dist/elements/Grid/Container.d.ts +0 -7
- package/dist/elements/Grid/Row.d.ts +0 -3
- package/dist/elements/Icons/Approved.d.ts +0 -2
- package/dist/elements/Icons/ArrowDown.d.ts +0 -2
- package/dist/elements/Icons/ChevronLeftRound.d.ts +0 -2
- package/dist/elements/Icons/ChevronRightRound.d.ts +0 -2
- package/dist/elements/Icons/Close.d.ts +0 -2
- package/dist/elements/Icons/FileRound.d.ts +0 -2
- package/dist/elements/Icons/Pencil.d.ts +0 -2
- package/dist/elements/Icons/PencilSimple.d.ts +0 -2
- package/dist/elements/Icons/Plus.d.ts +0 -2
- package/dist/elements/Icons/Refresh.d.ts +0 -2
- package/dist/elements/Icons/User.d.ts +0 -2
- package/dist/elements/Icons/index.d.ts +0 -11
- package/dist/elements/Placeholder/index.d.ts +0 -3
- package/dist/elements/Progress/index.d.ts +0 -18
- package/dist/elements/Table/index.d.ts +0 -12
- package/dist/elements/Tag/index.d.ts +0 -15
- package/dist/elements/index.d.ts +0 -14
- package/dist/forms/Checkbox/index.d.ts +0 -8
- package/dist/forms/Field/index.d.ts +0 -7
- package/dist/forms/HelpMessage.d.ts +0 -8
- package/dist/forms/Radio/index.d.ts +0 -8
- package/dist/forms/Select/index.d.ts +0 -29
- package/dist/forms/Switch/index.d.ts +0 -21
- package/dist/forms/TextInput/index.d.ts +0 -22
- package/dist/forms/Textarea/index.d.ts +0 -11
- package/dist/forms/index.d.ts +0 -7
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
- package/dist/index.es.js +0 -1513
- package/dist/styles/normalize.d.ts +0 -3
- package/dist/theme.d.ts +0 -3
- package/dist/types.d.ts +0 -36
- package/dist/utils/arrow.d.ts +0 -1
- package/dist/utils/boxShadow.d.ts +0 -1
- package/dist/utils/disabledColor.d.ts +0 -2
- package/dist/utils/findColorInvert.d.ts +0 -2
- package/dist/utils/hambuger.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/isClient.d.ts +0 -2
- package/dist/utils/media.d.ts +0 -6
- package/dist/utils/setAlign.d.ts +0 -3
- package/dist/utils/setSize.d.ts +0 -4
- package/dist/utils/stopPropagation.d.ts +0 -2
- package/dist/utils/wrapEvent.d.ts +0 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,528 +1,594 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var clsx8 = require('clsx');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var react$1 = require('@floating-ui/react');
|
|
7
|
+
var reactDom = require('react-dom');
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
const React = require('react');
|
|
8
|
-
const polished = require('polished');
|
|
9
|
-
const react = require('@floating-ui/react');
|
|
10
|
-
const reactDom = require('react-dom');
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
var clsx8__default = /*#__PURE__*/_interopDefault(clsx8);
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
// src/index.ts
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}) => theme.textStrong, ({
|
|
26
|
-
theme
|
|
27
|
-
}) => theme.primary);
|
|
15
|
+
// src/utils/merge.ts
|
|
16
|
+
function merge(a, b) {
|
|
17
|
+
if (!b) return a;
|
|
18
|
+
return a + " " + b;
|
|
19
|
+
}
|
|
20
|
+
function FormLabel({ className, ...rest }) {
|
|
21
|
+
const name = react.useMemo(() => clsx8__default.default("leading-none peer-disabled:opacity-70", className), [className]);
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: name, ...rest });
|
|
23
|
+
}
|
|
28
24
|
function Field({
|
|
29
25
|
label,
|
|
30
26
|
children,
|
|
31
27
|
required,
|
|
28
|
+
htmlFor,
|
|
29
|
+
error,
|
|
30
|
+
help,
|
|
31
|
+
helpBefore,
|
|
32
|
+
className,
|
|
33
|
+
innerClass,
|
|
32
34
|
...rest
|
|
33
35
|
}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const labelName = react.useMemo(() => clsx8__default.default(
|
|
37
|
+
"font-medium",
|
|
38
|
+
required ? 'after:content-["*"] after:text-danger after:text-sm after:pl-0.5' : ""
|
|
39
|
+
), [required]);
|
|
40
|
+
const wrapperName = react.useMemo(() => merge("flex flex-col space-y-2", className), [className]);
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperName, ...rest, children: [
|
|
42
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { className: labelName, htmlFor, children: label }) : null,
|
|
43
|
+
help && helpBefore ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted pb-2", children: help }) : null,
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: innerClass, children: cloneChildren(children, !!error) }),
|
|
45
|
+
help && !helpBefore && !error ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: help }) : null,
|
|
46
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-danger", children: error }) : null
|
|
40
47
|
] });
|
|
41
48
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (!color || polished.getLuminance(color) > 0.55) {
|
|
48
|
-
return black || "#000";
|
|
49
|
-
}
|
|
50
|
-
return white || "#fff";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function hamburger(size) {
|
|
54
|
-
return styledComponents.css(["display:block;position:relative;height:", ";width:", ";cursor:pointer;span{background-color:currentColor;display:block;height:1px;left:calc(50% - 8px);position:absolute;transform-origin:center;transition-duration:100ms;transition-property:background-color,opacity,transform;transition-timing-function:ease-out;width:16px;&:nth-child(1){top:calc(50% - 6px);}&:nth-child(2){top:calc(50% - 1px);}&:nth-child(3){top:calc(50% + 4px);}&:hover{background-color:rgba(black,0.05);}}&.active span{&:nth-child(1){transform:translateY(5px) rotate(45deg);}&:nth-child(2){opacity:0;}&:nth-child(3){transform:translateY(-5px) rotate(-45deg);}}"], size, size);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function boxShadow(size, color, amount) {
|
|
58
|
-
const shadowColor = amount ? polished.transparentize(amount, color) : color;
|
|
59
|
-
return styledComponents.css(["box-shadow:0 0 0 ", " ", ";"], size, shadowColor);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function Arrow(color) {
|
|
63
|
-
return styledComponents.css(["position:absolute;border:3px solid ", ';border-radius:2px;border-right:0;border-top:0;content:" ";display:block;height:0.625em;margin-top:-0.625em;pointer-events:none;top:50%;transform:rotate(-45deg);transform-origin:center;width:0.625em;'], color);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function setSize(name, size) {
|
|
67
|
-
switch (size) {
|
|
68
|
-
case "small":
|
|
69
|
-
return `${name}: 0.75rem;`;
|
|
70
|
-
case "medium":
|
|
71
|
-
return `${name}: 1.25rem;`;
|
|
72
|
-
case "large":
|
|
73
|
-
return `${name}: 1.5rem;`;
|
|
74
|
-
default:
|
|
75
|
-
return `${name}: 1rem;`;
|
|
49
|
+
function cloneChildren(children, error) {
|
|
50
|
+
const len = react.Children.count(children);
|
|
51
|
+
if (!len) return null;
|
|
52
|
+
if (len === 1) {
|
|
53
|
+
return react.cloneElement(children, { error });
|
|
76
54
|
}
|
|
55
|
+
const arr = react.Children.toArray(children);
|
|
56
|
+
arr[0] = react.cloneElement(arr[0], { error });
|
|
57
|
+
return arr;
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
function mediaTablet({
|
|
87
|
-
theme
|
|
88
|
-
}) {
|
|
89
|
-
if (!theme.responsive)
|
|
90
|
-
return "@media (max-width: 0)";
|
|
91
|
-
return `@media screen and (max-width: ${theme.media.tablet})`;
|
|
92
|
-
}
|
|
93
|
-
function mediaDesktop({
|
|
94
|
-
theme
|
|
95
|
-
}) {
|
|
96
|
-
if (!theme.responsive)
|
|
97
|
-
return "@media (max-width: 0)";
|
|
98
|
-
return `@media screen and (max-width: ${theme.media.desktop})`;
|
|
99
|
-
}
|
|
100
|
-
function mediaFullHD({
|
|
101
|
-
theme
|
|
102
|
-
}) {
|
|
103
|
-
if (!theme.responsive)
|
|
104
|
-
return "@media (max-width: 0)";
|
|
105
|
-
return `@media screen and (max-width: ${theme.media.fullhd})`;
|
|
106
|
-
}
|
|
107
|
-
function mediaUntilFullHD({
|
|
108
|
-
theme
|
|
109
|
-
}) {
|
|
110
|
-
if (!theme.responsive)
|
|
111
|
-
return "@media (max-width: 0)";
|
|
112
|
-
return `@media screen and (min-width: ${theme.media.fullhd})`;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function disabledColor(theme) {
|
|
116
|
-
const textColor = polished.transparentize(0.15, theme.textDark || "#000");
|
|
117
|
-
const backColor = polished.transparentize(0.55, theme.border || "#EEE");
|
|
118
|
-
return styledComponents.css(["pointer-events:none;box-shadow:none;color:", ";background-color:", ";"], textColor, backColor);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const Message = /* @__PURE__ */ styledComponents.styled.small.withConfig({
|
|
122
|
-
shouldForwardProp: (name) => name !== "error"
|
|
123
|
-
}).withConfig({
|
|
124
|
-
displayName: "HelpMessage__Message",
|
|
125
|
-
componentId: "sc-14wou17-0"
|
|
126
|
-
})(["font-size:0.8rem;color:", ";"], ({
|
|
127
|
-
error,
|
|
128
|
-
theme
|
|
129
|
-
}) => error ? theme.danger : theme.textLight);
|
|
130
|
-
function HelpMessage({
|
|
131
|
-
help,
|
|
132
|
-
error,
|
|
133
|
-
noErrorMessage
|
|
134
|
-
}) {
|
|
135
|
-
if (error && !noErrorMessage)
|
|
136
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Message, { error: true, children: error });
|
|
137
|
-
if (help)
|
|
138
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Message, { children: help });
|
|
139
|
-
return null;
|
|
59
|
+
function InputField({ error, unstyled, className, ...rest }) {
|
|
60
|
+
const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
|
|
61
|
+
"flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
|
|
62
|
+
"[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",
|
|
63
|
+
error ? "border-danger hover:border-danger-fore" : "border-input"
|
|
64
|
+
), className), [className, error, unstyled]);
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: name, ...rest });
|
|
140
66
|
}
|
|
141
|
-
|
|
142
|
-
const TextInput = React.forwardRef(({
|
|
67
|
+
var Input = react.forwardRef(({
|
|
143
68
|
className,
|
|
144
|
-
|
|
69
|
+
type,
|
|
145
70
|
error,
|
|
146
|
-
|
|
147
|
-
help,
|
|
148
|
-
leftIcon: leftIcon2,
|
|
149
|
-
rightIcon: rightIcon2,
|
|
150
|
-
type = "text",
|
|
151
|
-
maxLength = 255,
|
|
152
|
-
noErrorMessage,
|
|
71
|
+
unstyled,
|
|
153
72
|
...rest
|
|
154
|
-
}, ref) =>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
componentId: "sc-1myda3q-0"
|
|
167
|
-
})(["position:absolute;top:0.375em;bottom:0;z-index:1;color:", ";", " svg,img{height:1em;width:1em;}"], ({
|
|
168
|
-
theme
|
|
169
|
-
}) => theme.border, ({
|
|
170
|
-
$right
|
|
171
|
-
}) => $right ? rightIcon : leftIcon);
|
|
172
|
-
function shouldForwardProp$9(name) {
|
|
173
|
-
return name !== "outline" && name !== "error" && name !== "disabled";
|
|
174
|
-
}
|
|
175
|
-
const Wrapper$5 = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
176
|
-
shouldForwardProp: shouldForwardProp$9
|
|
177
|
-
}).withConfig({
|
|
178
|
-
displayName: "TextInput__Wrapper",
|
|
179
|
-
componentId: "sc-1myda3q-1"
|
|
180
|
-
})(["position:relative;display:block;input{max-width:100%;width:100%;height:100%;position:relative;display:block;outline:none;box-shadow:none;appearance:none;text-align:left;color:inherit;padding:", ";border:1px solid ", ";", " ", " transition-property:box-shadow;transition-duration:150ms;transition-timing-function:ease-in-out;&:focus{border-color:", ";box-shadow:", ";}&:disabled,[disabled]{resize:none;}&::placeholder{color:", ";}}&:hover{input:not(:disabled):not(:focus):not(:active){border-color:", ";}", "{color:", ";}}", ""], ({
|
|
181
|
-
theme
|
|
182
|
-
}) => theme.formPadding, ({
|
|
183
|
-
error,
|
|
184
|
-
theme
|
|
185
|
-
}) => error ? theme.danger : theme.border, ({
|
|
186
|
-
outline,
|
|
187
|
-
theme
|
|
188
|
-
}) => outline ? {
|
|
189
|
-
borderRadius: theme.radius
|
|
190
|
-
} : {
|
|
191
|
-
borderRadius: 0,
|
|
192
|
-
borderWidth: 0,
|
|
193
|
-
borderBottomWidth: "1px"
|
|
194
|
-
}, setSize("font-size"), ({
|
|
195
|
-
error,
|
|
196
|
-
theme
|
|
197
|
-
}) => error ? theme.danger : theme.primary, ({
|
|
198
|
-
theme,
|
|
199
|
-
outline,
|
|
200
|
-
error
|
|
201
|
-
}) => outline ? `0 0 0 0.1em ${error ? theme.danger : theme.primary}` : `0 0.1em ${error ? theme.danger : theme.primary}`, ({
|
|
202
|
-
theme
|
|
203
|
-
}) => theme.placeholder, ({
|
|
204
|
-
theme
|
|
205
|
-
}) => theme.borderHover, Icon, ({
|
|
206
|
-
theme
|
|
207
|
-
}) => theme.borderHover, ({
|
|
208
|
-
disabled,
|
|
209
|
-
theme
|
|
210
|
-
}) => disabled ? styledComponents.css(["input{", " border-style:dashed;}"], disabledColor(theme)) : void 0);
|
|
211
|
-
|
|
212
|
-
const Textarea = React.forwardRef(({
|
|
73
|
+
}, ref) => {
|
|
74
|
+
const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
|
|
75
|
+
"flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted",
|
|
76
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
77
|
+
error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore",
|
|
78
|
+
type === "file" ? "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground" : null
|
|
79
|
+
), className), [className, type, error, unstyled]);
|
|
80
|
+
return /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type, className: name, ...rest });
|
|
81
|
+
});
|
|
82
|
+
Input.displayName = "Input";
|
|
83
|
+
var Input_default = Input;
|
|
84
|
+
var Textarea = react.forwardRef(({
|
|
213
85
|
className,
|
|
214
|
-
help,
|
|
215
86
|
error,
|
|
216
|
-
|
|
217
|
-
noErrorMessage,
|
|
87
|
+
unstyled,
|
|
218
88
|
...rest
|
|
219
|
-
}, ref) =>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
89
|
+
}, ref) => {
|
|
90
|
+
const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
|
|
91
|
+
"flex rounded-md border bg-background px-3 py-2 w-full",
|
|
92
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
93
|
+
error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
|
|
94
|
+
), className), [className, error, unstyled]);
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref, className: name, ...rest });
|
|
96
|
+
});
|
|
223
97
|
Textarea.displayName = "Textarea";
|
|
224
|
-
|
|
225
|
-
function
|
|
226
|
-
return
|
|
98
|
+
var Textarea_default = Textarea;
|
|
99
|
+
function Check(props) {
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z", fill: "currentColor" }) });
|
|
101
|
+
}
|
|
102
|
+
function Indeterminate() {
|
|
103
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "20", height: "3", y: "13.5", x: "4.5", fill: "currentColor", stroke: "none", rx: "2" }) });
|
|
104
|
+
}
|
|
105
|
+
function Checkbox({
|
|
106
|
+
checked,
|
|
107
|
+
indeterminate,
|
|
108
|
+
className,
|
|
109
|
+
id,
|
|
110
|
+
name,
|
|
111
|
+
onChange,
|
|
112
|
+
value,
|
|
113
|
+
...rest
|
|
114
|
+
}) {
|
|
115
|
+
const innerClass = react.useMemo(() => merge(clsx8__default.default(
|
|
116
|
+
"inline-flex justify-center items-center border w-4.5 h-4.5 rounded",
|
|
117
|
+
"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
118
|
+
checked || indeterminate ? "bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input" : "border-input not-disabled:hover:border-input-fore"
|
|
119
|
+
), className), [checked, indeterminate, className]);
|
|
120
|
+
const handleChange = () => {
|
|
121
|
+
if (rest.disabled) return;
|
|
122
|
+
onChange?.(!checked);
|
|
123
|
+
};
|
|
124
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
role: "checkbox",
|
|
129
|
+
id: id || name,
|
|
130
|
+
className: innerClass,
|
|
131
|
+
onClick: handleChange,
|
|
132
|
+
"aria-checked": checked,
|
|
133
|
+
...rest,
|
|
134
|
+
children: [
|
|
135
|
+
checked ? /* @__PURE__ */ jsxRuntime.jsx(Check, {}) : null,
|
|
136
|
+
indeterminate && !checked ? /* @__PURE__ */ jsxRuntime.jsx(Indeterminate, {}) : null,
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
138
|
+
"input",
|
|
139
|
+
{
|
|
140
|
+
type: "checkbox",
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
name,
|
|
143
|
+
checked,
|
|
144
|
+
value,
|
|
145
|
+
onChange: handleChange,
|
|
146
|
+
disabled: rest.disabled,
|
|
147
|
+
style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
227
153
|
}
|
|
228
|
-
const InputWrapper$2 = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
229
|
-
shouldForwardProp: shouldForwardProp$8
|
|
230
|
-
}).withConfig({
|
|
231
|
-
displayName: "Textarea__InputWrapper",
|
|
232
|
-
componentId: "sc-z9p0uf-0"
|
|
233
|
-
})(["display:block;position:relative;textarea{max-width:100%;width:100%;height:100%;padding:0.625em;resize:vertical;appearance:none;overflow:auto;outline:none;text-align:left;color:inherit;border-radius:", ";border:1px solid ", ";transition-property:box-shadow;transition-duration:0.15s;transition-timing-function:ease-in-out;", " &:focus{border-color:", ";", "}&:disabled,[disabled],&:readonly{", "}&:disabled,[disabled]{resize:none;}&::placeholder{color:", ";}}&:hover{textarea:not(:disabled):not(:focus){border-color:", ";}}", ""], ({
|
|
234
|
-
theme
|
|
235
|
-
}) => theme.radius, ({
|
|
236
|
-
theme,
|
|
237
|
-
error
|
|
238
|
-
}) => error ? theme.danger : theme.border, setSize("font-size"), ({
|
|
239
|
-
theme,
|
|
240
|
-
error
|
|
241
|
-
}) => error ? theme.danger : theme.primary, ({
|
|
242
|
-
theme,
|
|
243
|
-
error
|
|
244
|
-
}) => boxShadow("0.1em", error ? theme.danger : theme.primary), ({
|
|
245
|
-
theme
|
|
246
|
-
}) => disabledColor(theme), ({
|
|
247
|
-
theme
|
|
248
|
-
}) => theme.placeholder, ({
|
|
249
|
-
theme
|
|
250
|
-
}) => theme.borderHover, ({
|
|
251
|
-
disabled,
|
|
252
|
-
theme
|
|
253
|
-
}) => disabled ? styledComponents.css(["textarea{", " border-style:dashed;}"], disabledColor(theme)) : void 0);
|
|
254
154
|
|
|
255
|
-
|
|
155
|
+
// src/utils/isClient.ts
|
|
156
|
+
var isClient_default = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
256
157
|
|
|
257
|
-
|
|
158
|
+
// src/hooks/useIsomorphicLayoutEffect.ts
|
|
159
|
+
var useIsomorphicLayoutEffect_default = isClient_default ? react.useLayoutEffect : react.useEffect;
|
|
258
160
|
|
|
259
|
-
|
|
260
|
-
|
|
161
|
+
// src/components/Portal/index.tsx
|
|
162
|
+
function Portal({ children, container, disabled }) {
|
|
163
|
+
const [mountNode, setMountNode] = react.useState(null);
|
|
164
|
+
useIsomorphicLayoutEffect_default(() => {
|
|
165
|
+
if (!container) {
|
|
166
|
+
let dom = document.getElementById("visits-style-portals");
|
|
167
|
+
if (!dom) {
|
|
168
|
+
dom = document.createElement("div");
|
|
169
|
+
dom.id = "visits-style-portals";
|
|
170
|
+
document.body.appendChild(dom);
|
|
171
|
+
}
|
|
172
|
+
return setMountNode(dom);
|
|
173
|
+
}
|
|
174
|
+
setMountNode(container);
|
|
175
|
+
}, [container]);
|
|
176
|
+
if (disabled || !mountNode) return null;
|
|
177
|
+
return reactDom.createPortal(children, mountNode);
|
|
261
178
|
}
|
|
262
|
-
|
|
263
|
-
|
|
179
|
+
|
|
180
|
+
// src/utils/stopPropagation.ts
|
|
181
|
+
function stopPropagation(e) {
|
|
182
|
+
if (!e) return;
|
|
183
|
+
e.stopPropagation();
|
|
184
|
+
e.preventDefault();
|
|
264
185
|
}
|
|
265
|
-
|
|
266
|
-
|
|
186
|
+
var defaultTimeout = { open: 150, close: 75 };
|
|
187
|
+
var Popover = react.forwardRef(({
|
|
188
|
+
position,
|
|
189
|
+
label,
|
|
267
190
|
children,
|
|
268
|
-
|
|
191
|
+
color = "background",
|
|
192
|
+
disabled,
|
|
193
|
+
offset = { x: 0, y: 6 },
|
|
194
|
+
onOpen,
|
|
195
|
+
onClose,
|
|
196
|
+
onManualClose,
|
|
197
|
+
timeout = defaultTimeout,
|
|
198
|
+
unstyled,
|
|
199
|
+
zIndex = 9996,
|
|
200
|
+
role,
|
|
269
201
|
...rest
|
|
270
202
|
}, ref) => {
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
203
|
+
const [open, setOpen] = react.useState(false);
|
|
204
|
+
const nodeId = react$1.useId();
|
|
205
|
+
const openRef = react.useRef(onOpen);
|
|
206
|
+
const closeRef = react.useRef(onClose);
|
|
207
|
+
const { refs, floatingStyles, context } = react$1.useFloating({
|
|
208
|
+
nodeId,
|
|
209
|
+
placement: position,
|
|
210
|
+
middleware: [
|
|
211
|
+
react$1.shift(),
|
|
212
|
+
react$1.flip({ fallbackAxisSideDirection: "end" }),
|
|
213
|
+
react$1.offset({ mainAxis: offset.y, crossAxis: offset.x })
|
|
214
|
+
],
|
|
215
|
+
open,
|
|
216
|
+
onOpenChange: (value) => {
|
|
217
|
+
if (value) {
|
|
218
|
+
openRef.current?.(refs.reference.current, refs.floating.current);
|
|
219
|
+
} else {
|
|
220
|
+
closeRef.current?.(refs.reference.current, refs.floating.current);
|
|
221
|
+
}
|
|
222
|
+
setOpen(value);
|
|
223
|
+
},
|
|
224
|
+
whileElementsMounted: react$1.autoUpdate
|
|
225
|
+
});
|
|
226
|
+
const { isMounted, styles } = react$1.useTransitionStyles(context, {
|
|
227
|
+
duration: timeout,
|
|
228
|
+
initial({ side }) {
|
|
229
|
+
let transform = "";
|
|
230
|
+
if (side === "top") {
|
|
231
|
+
transform = "translateY(5%) scale(0.95)";
|
|
232
|
+
} else if (side === "bottom") {
|
|
233
|
+
transform = "translateY(-5%) scale(0.95)";
|
|
234
|
+
} else if (side === "left") {
|
|
235
|
+
transform = "translateX(5%) scale(0.95)";
|
|
236
|
+
} else {
|
|
237
|
+
transform = "translateX(-5%) scale(0.95)";
|
|
238
|
+
}
|
|
239
|
+
return { opacity: 0, transform };
|
|
285
240
|
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
241
|
+
});
|
|
242
|
+
const handleBlur = react.useCallback((e) => {
|
|
243
|
+
stopPropagation(e);
|
|
244
|
+
if (onManualClose) return onManualClose();
|
|
245
|
+
setOpen(false);
|
|
246
|
+
closeRef.current?.(refs.reference.current, refs.floating.current);
|
|
247
|
+
}, [onManualClose]);
|
|
248
|
+
react.useEffect(() => {
|
|
249
|
+
if (disabled && open) return setOpen(false);
|
|
250
|
+
}, [disabled, open]);
|
|
251
|
+
react.useImperativeHandle(ref, () => ({
|
|
252
|
+
open: () => {
|
|
253
|
+
setOpen(true);
|
|
254
|
+
openRef.current?.(refs.reference.current, refs.floating.current);
|
|
255
|
+
},
|
|
256
|
+
close: () => {
|
|
257
|
+
setOpen(false);
|
|
258
|
+
closeRef.current?.(refs.reference.current, refs.floating.current);
|
|
259
|
+
}
|
|
260
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
261
|
+
}), []);
|
|
262
|
+
const { getFloatingProps, getReferenceProps } = react$1.useInteractions([
|
|
263
|
+
react$1.useClick(context, { enabled: !disabled })
|
|
264
|
+
]);
|
|
265
|
+
openRef.current = onOpen;
|
|
266
|
+
closeRef.current = onClose;
|
|
267
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
268
|
+
react.cloneElement(react.Children.only(label), getReferenceProps({
|
|
269
|
+
ref: refs.setReference,
|
|
270
|
+
tabIndex: 0,
|
|
271
|
+
role: "button",
|
|
272
|
+
"aria-expanded": open,
|
|
273
|
+
disabled,
|
|
274
|
+
onClick: stopPropagation
|
|
275
|
+
})),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: disabled || !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.FloatingOverlay, { "data-testid": "vs-popover-shadow", onClick: handleBlur, style: { zIndex }, autoFocus: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: role || "region", ref: refs.setFloating, style: floatingStyles, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
277
|
+
PopoverContent,
|
|
278
|
+
{
|
|
279
|
+
unstyled,
|
|
280
|
+
styles,
|
|
281
|
+
...getFloatingProps({ ...rest, onClick: stopPropagation }),
|
|
282
|
+
children
|
|
283
|
+
}
|
|
284
|
+
) }) }) })
|
|
293
285
|
] });
|
|
294
286
|
});
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
displayName: "Checkbox__Shape",
|
|
299
|
-
componentId: "sc-1lh5swj-0"
|
|
300
|
-
})(["display:inline-flex;margin:0.5rem;width:1.25em;height:1.25em;background:transparent;border:0.1em solid ", ";border-radius:", ";justify-content:center;align-items:center;will-change:background-color;transition:background-color 150ms ease-out;svg{opacity:0;stroke-width:0.1em;stroke:currentColor;}&.checked{border-color:", ";background-color:", ";color:", ";svg{opacity:1;}&.disabled{color:", ";}}&.disabled{background:", ";border-color:", ";}"], ({
|
|
301
|
-
theme
|
|
302
|
-
}) => theme.border, ({
|
|
303
|
-
theme
|
|
304
|
-
}) => theme.radius, ({
|
|
305
|
-
theme
|
|
306
|
-
}) => theme.primary, ({
|
|
307
|
-
theme
|
|
308
|
-
}) => theme.primary, ({
|
|
309
|
-
theme
|
|
310
|
-
}) => theme.white, ({
|
|
311
|
-
theme
|
|
312
|
-
}) => polished.transparentize(0.15, theme.textDark), ({
|
|
313
|
-
theme
|
|
314
|
-
}) => polished.transparentize(0.55, theme.border), ({
|
|
315
|
-
theme
|
|
316
|
-
}) => theme.border);
|
|
317
|
-
const Wrapper$4 = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
318
|
-
displayName: "Checkbox__Wrapper",
|
|
319
|
-
componentId: "sc-1lh5swj-1"
|
|
320
|
-
})(["display:block;position:relative;width:auto;label{display:flex;align-items:center;cursor:pointer;padding-left:0.625em;max-width:100%;width:100%;line-height:1.25;margin-right:0.625rem;}input{display:none;&:disabled + label{color:", ";}}"], ({
|
|
321
|
-
theme
|
|
322
|
-
}) => polished.transparentize(0.25, theme.textDark));
|
|
323
|
-
|
|
324
|
-
function ChevronDown(props) {
|
|
325
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.6 0L6 4.6 1.4 0 0 1.4l6 6 6-6L10.6 0z", fill: "currentColor" }) });
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const Select = React.forwardRef(({
|
|
329
|
-
options = [],
|
|
330
|
-
placeholder,
|
|
331
|
-
render,
|
|
332
|
-
help,
|
|
333
|
-
error,
|
|
287
|
+
Popover.displayName = "Popover";
|
|
288
|
+
var Popover_default = Popover;
|
|
289
|
+
var PopoverContent = react.forwardRef(({
|
|
334
290
|
className,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
noErrorMessage,
|
|
339
|
-
arrow,
|
|
291
|
+
unstyled,
|
|
292
|
+
styles,
|
|
293
|
+
style = {},
|
|
340
294
|
...rest
|
|
341
295
|
}, ref) => {
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
arrow || /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {}),
|
|
349
|
-
/* @__PURE__ */ jsxRuntime.jsx(HelpMessage, { help, error, noErrorMessage })
|
|
350
|
-
] });
|
|
296
|
+
const popoverName = react.useMemo(() => clsx8__default.default(
|
|
297
|
+
"z-20 w-auto h-auto outline-none transition-transform ease-in-out",
|
|
298
|
+
unstyled ? null : "border border-accent rounded-md shadow-lg p-1 bg-background",
|
|
299
|
+
className
|
|
300
|
+
), [className, unstyled]);
|
|
301
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: popoverName, style: { ...styles, ...style }, ...rest });
|
|
351
302
|
});
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
303
|
+
PopoverContent.displayName = "PopoverContent";
|
|
304
|
+
function ChevronDown(props) {
|
|
305
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.7 14.8 7 9.8a.5.5 0 0 1 0-.7c.2-.2.5-.2.7 0l4.5 5c.2.2.2.6 0 .8-.1.2-.4.2-.6 0Z", fill: "currentColor" }),
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z", fill: "currentColor" })
|
|
308
|
+
] });
|
|
356
309
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
error,
|
|
368
|
-
theme
|
|
369
|
-
}) => error ? theme.danger : theme.border, ({
|
|
370
|
-
outline,
|
|
371
|
-
theme
|
|
372
|
-
}) => outline ? styledComponents.css(["border-radius:", ";"], theme.radius) : styledComponents.css(["border-width:0;border-radius:0;border-bottom-width:1px;"]), ({
|
|
373
|
-
theme
|
|
374
|
-
}) => theme.borderHover, ({
|
|
310
|
+
function Close(props) {
|
|
311
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
|
|
312
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M26 26l-12.5-12.5L26 1" }),
|
|
313
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 26l12.5-12.5L1 1" })
|
|
314
|
+
] }) });
|
|
315
|
+
}
|
|
316
|
+
function Select({
|
|
317
|
+
className,
|
|
318
|
+
placeholder = "",
|
|
319
|
+
options = [],
|
|
375
320
|
error,
|
|
376
|
-
|
|
377
|
-
}) => error ? theme.danger : theme.primary, ({
|
|
378
|
-
theme,
|
|
379
|
-
outline,
|
|
380
|
-
error
|
|
381
|
-
}) => outline ? `0 0 0 0.1em ${error ? theme.danger : theme.primary}` : `0 0.1em ${error ? theme.danger : theme.primary}`, ({
|
|
382
|
-
theme
|
|
383
|
-
}) => theme.placeholder, ({
|
|
384
|
-
theme
|
|
385
|
-
}) => theme.border, ({
|
|
386
|
-
theme
|
|
387
|
-
}) => theme.borderHover, ({
|
|
321
|
+
unstyled,
|
|
388
322
|
disabled,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
children,
|
|
323
|
+
value,
|
|
324
|
+
maxHeight = 408,
|
|
325
|
+
arrow,
|
|
326
|
+
onChange,
|
|
327
|
+
onClear,
|
|
328
|
+
renderItem,
|
|
396
329
|
...rest
|
|
397
|
-
}
|
|
398
|
-
const
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
]
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
330
|
+
}) {
|
|
331
|
+
const ref = react.useRef(null);
|
|
332
|
+
const [width, setWidth] = react.useState(0);
|
|
333
|
+
const btnName = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
|
|
334
|
+
"flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer",
|
|
335
|
+
"disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
|
|
336
|
+
error ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
|
|
337
|
+
), className), [className, error, unstyled]);
|
|
338
|
+
const isMultiple = react.useMemo(() => Array.isArray(value), []);
|
|
339
|
+
const handleChange = react.useCallback((val) => {
|
|
340
|
+
onChange?.(val);
|
|
341
|
+
if (!isMultiple) ref.current?.close();
|
|
342
|
+
}, [onChange, isMultiple]);
|
|
343
|
+
const isSelected = react.useCallback((item) => {
|
|
344
|
+
if (Array.isArray(value)) return value.indexOf(item) > -1;
|
|
345
|
+
return value === item;
|
|
346
|
+
}, [value]);
|
|
347
|
+
const optionMap = react.useMemo(() => {
|
|
348
|
+
const map = {};
|
|
349
|
+
const items = options.filter((item) => typeof item !== "string");
|
|
350
|
+
for (let i = 0, len = items.length; i < len; i += 1) {
|
|
351
|
+
const item = items[i];
|
|
352
|
+
map[`${item.value}`] = item.label;
|
|
353
|
+
}
|
|
354
|
+
return map;
|
|
355
|
+
}, [options]);
|
|
356
|
+
const selectedLabel = react.useMemo(() => {
|
|
357
|
+
if (!value) return placeholder;
|
|
358
|
+
if (Array.isArray(value)) {
|
|
359
|
+
if (!value.length) return placeholder;
|
|
360
|
+
const sorted = [...value].sort();
|
|
361
|
+
const arr = [];
|
|
362
|
+
for (let i = 0, len = sorted.length; i < len; i += 1) {
|
|
363
|
+
arr[i] = optionMap[`${sorted[i]}`] || "";
|
|
364
|
+
}
|
|
365
|
+
return arr.filter(Boolean).join(",") || placeholder;
|
|
366
|
+
}
|
|
367
|
+
return optionMap[`${value}`] || placeholder;
|
|
368
|
+
}, [placeholder, value, optionMap]);
|
|
369
|
+
const isEmpty = selectedLabel === placeholder;
|
|
370
|
+
const btnLabelClass = react.useMemo(() => clsx8__default.default(
|
|
371
|
+
"overflow-hidden overflow-ellipsis whitespace-nowrap",
|
|
372
|
+
isEmpty ? "text-muted" : "text-text"
|
|
373
|
+
), [isEmpty]);
|
|
374
|
+
const Arrow = react.useMemo(() => {
|
|
375
|
+
if (arrow) return arrow;
|
|
376
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { className: "absolute right-0 text-muted size-5" });
|
|
377
|
+
}, [arrow]);
|
|
378
|
+
const handleRender = react.useCallback((item, index) => {
|
|
379
|
+
if (renderItem) {
|
|
380
|
+
if (typeof item === "string") {
|
|
381
|
+
return renderItem(item, { index, selected: false, onChange: () => {
|
|
382
|
+
} });
|
|
383
|
+
}
|
|
384
|
+
return renderItem(item, {
|
|
385
|
+
index,
|
|
386
|
+
selected: isSelected(item.value),
|
|
387
|
+
onChange: () => handleChange(item.value)
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
if (typeof item === "string") {
|
|
391
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "font-medium py-1 px-2 text-muted", children: item }, `optionheader-${index}`);
|
|
392
|
+
}
|
|
393
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
+
SelectItem,
|
|
395
|
+
{
|
|
396
|
+
selected: isSelected(item.value),
|
|
397
|
+
onChange: handleChange,
|
|
398
|
+
...item
|
|
399
|
+
},
|
|
400
|
+
item.label
|
|
401
|
+
);
|
|
402
|
+
}, [renderItem, handleChange, isSelected]);
|
|
403
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
404
|
+
Popover_default,
|
|
405
|
+
{
|
|
406
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: btnName, disabled, ...rest, children: [
|
|
407
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: btnLabelClass, children: selectedLabel }),
|
|
408
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center pl-8 pr-3 space-x-2", children: [
|
|
409
|
+
onClear && !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
tabIndex: -1,
|
|
413
|
+
role: "button",
|
|
414
|
+
className: "size-6 p-1.5 rounded hover:bg-accent",
|
|
415
|
+
"aria-label": "clear selected values",
|
|
416
|
+
onKeyDown: (e) => {
|
|
417
|
+
if (e.key !== "Enter" && e.key !== "Space") return;
|
|
418
|
+
onClear();
|
|
419
|
+
},
|
|
420
|
+
onClick: (e) => {
|
|
421
|
+
e.stopPropagation();
|
|
422
|
+
onClear();
|
|
423
|
+
},
|
|
424
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Close, {})
|
|
425
|
+
}
|
|
426
|
+
) : null,
|
|
427
|
+
Arrow
|
|
428
|
+
] })
|
|
429
|
+
] }),
|
|
430
|
+
ref,
|
|
431
|
+
onOpen: (elem) => setWidth(elem?.getBoundingClientRect().width || 0),
|
|
432
|
+
disabled,
|
|
433
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
434
|
+
"ul",
|
|
435
|
+
{
|
|
436
|
+
className: "overflow-y-auto flex flex-col",
|
|
437
|
+
role: "listbox",
|
|
438
|
+
style: { minWidth: width, maxWidth: "calc(100vw - 3rem)", maxHeight },
|
|
439
|
+
children: options.map(handleRender)
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
function SelectItem({ className, value, label, selected, onChange }) {
|
|
446
|
+
const name = react.useMemo(() => clsx8__default.default(
|
|
447
|
+
"flex items-center w-full hover:bg-accent rounded p-1",
|
|
448
|
+
className
|
|
449
|
+
), [className]);
|
|
450
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
451
|
+
"button",
|
|
452
|
+
{
|
|
453
|
+
type: "button",
|
|
454
|
+
role: "option",
|
|
455
|
+
className: name,
|
|
456
|
+
"aria-selected": selected,
|
|
457
|
+
onClick: () => onChange?.(value),
|
|
458
|
+
children: [
|
|
459
|
+
selected ? /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "w-5 h-5 mr-1" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5 h-1 mr-1" }),
|
|
460
|
+
label
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
function Radio({ checked, className, id, name, onChange, value, ...rest }) {
|
|
466
|
+
const innerClass = react.useMemo(() => clsx8__default.default(
|
|
467
|
+
"relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full",
|
|
468
|
+
"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",
|
|
469
|
+
checked ? "[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input" : "",
|
|
470
|
+
className
|
|
471
|
+
), [className, checked]);
|
|
472
|
+
const handleChange = () => {
|
|
473
|
+
if (rest.disabled) return;
|
|
474
|
+
onChange?.(!checked);
|
|
475
|
+
};
|
|
476
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
477
|
+
"button",
|
|
478
|
+
{
|
|
479
|
+
type: "button",
|
|
480
|
+
role: "radio",
|
|
481
|
+
id: id || name,
|
|
482
|
+
className: innerClass,
|
|
483
|
+
onClick: handleChange,
|
|
484
|
+
"aria-checked": checked,
|
|
485
|
+
...rest,
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
+
"i",
|
|
489
|
+
{
|
|
490
|
+
className: "block w-2.5 h-2.5 rounded-full transition-transform",
|
|
491
|
+
style: { transform: checked ? "" : "scale(0.8)", opacity: checked ? 1 : 0 }
|
|
492
|
+
}
|
|
493
|
+
),
|
|
494
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
495
|
+
"input",
|
|
496
|
+
{
|
|
497
|
+
type: "radio",
|
|
498
|
+
"aria-hidden": "true",
|
|
499
|
+
name,
|
|
500
|
+
checked,
|
|
501
|
+
value,
|
|
502
|
+
onChange: handleChange,
|
|
503
|
+
disabled: rest.disabled,
|
|
504
|
+
style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
var Switch = react.forwardRef(({
|
|
441
512
|
className,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
513
|
+
checked,
|
|
514
|
+
onChange,
|
|
515
|
+
value,
|
|
516
|
+
id,
|
|
517
|
+
name,
|
|
447
518
|
...rest
|
|
448
519
|
}, ref) => {
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
520
|
+
const buttonName = react.useMemo(() => merge(clsx8__default.default(
|
|
521
|
+
"inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
522
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
|
523
|
+
"w-11",
|
|
524
|
+
checked ? "bg-primary" : "bg-input"
|
|
525
|
+
), className), [className, checked]);
|
|
526
|
+
const pointerName = react.useMemo(() => merge(
|
|
527
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
528
|
+
className
|
|
529
|
+
), [className]);
|
|
530
|
+
const handleChange = () => {
|
|
531
|
+
if (rest.disabled) return;
|
|
532
|
+
onChange?.(!checked);
|
|
533
|
+
};
|
|
534
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
535
|
+
"button",
|
|
536
|
+
{
|
|
537
|
+
type: "button",
|
|
538
|
+
role: "switch",
|
|
539
|
+
id: id || name,
|
|
540
|
+
className: buttonName,
|
|
541
|
+
onClick: handleChange,
|
|
542
|
+
"aria-checked": checked,
|
|
543
|
+
...rest,
|
|
544
|
+
children: [
|
|
545
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: pointerName, style: { transform: checked ? "translateX(100%)" : "" } }),
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
547
|
+
"input",
|
|
548
|
+
{
|
|
549
|
+
ref,
|
|
550
|
+
type: "checkbox",
|
|
551
|
+
"aria-hidden": "true",
|
|
552
|
+
name,
|
|
553
|
+
checked,
|
|
554
|
+
value,
|
|
555
|
+
onChange: handleChange,
|
|
556
|
+
disabled: rest.disabled,
|
|
557
|
+
style: { position: "absolute", pointerEvents: "none", top: 0, left: 0, width: 1, height: 1, opacity: 0 }
|
|
558
|
+
}
|
|
559
|
+
)
|
|
560
|
+
]
|
|
561
|
+
}
|
|
562
|
+
);
|
|
454
563
|
});
|
|
455
564
|
Switch.displayName = "Switch";
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}) => onLabel, ({
|
|
464
|
-
theme
|
|
465
|
-
}) => findColorInvert(theme, theme.primary));
|
|
466
|
-
function shouldForwardProp$6(name) {
|
|
467
|
-
return name !== "labelTextOn" && name !== "labelTextOff" && name !== "anchorColor" && name !== "background" && name !== "showLabel";
|
|
468
|
-
}
|
|
469
|
-
const InputWrapper = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
470
|
-
shouldForwardProp: shouldForwardProp$6
|
|
471
|
-
}).withConfig({
|
|
472
|
-
displayName: "Switch__InputWrapper",
|
|
473
|
-
componentId: "sc-1ljdf1-0"
|
|
474
|
-
})(["display:inline-block;cursor:pointer;line-height:1.25;position:relative;input{display:none;}label{position:relative;display:block;height:1.875rem;min-width:5rem;background:transparent;border:1px solid ", ";border-radius:1.25rem;cursor:pointer;will-change:background-color;transition:background-color 300ms ease;box-shadow:inset 0 0.25rem 0.25rem rgba(0,0,0,0.05);&:after{position:absolute;display:block;left:0.375rem;top:0.2rem;width:1.375rem;height:1.375rem;border-radius:100%;background:", ";content:'';text-align:right;border:1px solid ", ";will-change:left;transition:left 300ms ease;box-shadow:0 0 0.375rem rgba(0,0,0,0.1);}}input:checked ~ label{background:", ";box-shadow:inset 0 0.25rem 0.25rem rgba(0,0,0,0.15);&:after{left:calc(100% - 1.75rem);box-shadow:0 0 0.375rem rgba(0,0,0,0.15);}}", " ", ""], ({
|
|
475
|
-
theme
|
|
476
|
-
}) => theme.border, ({
|
|
477
|
-
theme,
|
|
478
|
-
anchorColor
|
|
479
|
-
}) => anchorColor || theme.white, ({
|
|
480
|
-
theme
|
|
481
|
-
}) => theme.border, ({
|
|
482
|
-
theme,
|
|
483
|
-
background
|
|
484
|
-
}) => background || theme.primary, ({
|
|
485
|
-
showLabel
|
|
486
|
-
}) => showLabel ? labelStyle : void 0, ({
|
|
487
|
-
disabled,
|
|
488
|
-
theme
|
|
489
|
-
}) => disabled ? styledComponents.css(["cursor:default;label{", " &:after{background:", ";}}input:checked ~ label{background:", ";}"], disabledColor(theme), theme.disabled, theme.grey) : void 0);
|
|
490
|
-
|
|
491
|
-
function Accordion({
|
|
492
|
-
header,
|
|
493
|
-
show,
|
|
494
|
-
children,
|
|
495
|
-
timeout = 300,
|
|
496
|
-
...rest
|
|
497
|
-
}) {
|
|
498
|
-
const ref = React.useRef(null);
|
|
499
|
-
const prevHeight = React.useRef(0);
|
|
500
|
-
const timeoutRef = React.useRef(0);
|
|
501
|
-
const init = React.useRef(true);
|
|
502
|
-
React.useEffect(() => {
|
|
565
|
+
var Switch_default = Switch;
|
|
566
|
+
function Accordion({ header, show, children, timeout = 300, ...rest }) {
|
|
567
|
+
const ref = react.useRef(null);
|
|
568
|
+
const prevHeight = react.useRef(0);
|
|
569
|
+
const timeoutRef = react.useRef(0);
|
|
570
|
+
const init = react.useRef(true);
|
|
571
|
+
react.useEffect(() => {
|
|
503
572
|
timeoutRef.current = timeout;
|
|
504
573
|
}, [timeout]);
|
|
505
|
-
|
|
506
|
-
if (!ref.current)
|
|
507
|
-
return;
|
|
574
|
+
useIsomorphicLayoutEffect_default(() => {
|
|
575
|
+
if (!ref.current) return;
|
|
508
576
|
ref.current.style.overflow = "hidden";
|
|
509
577
|
ref.current.style.opacity = "1";
|
|
510
578
|
if (init.current) {
|
|
511
579
|
init.current = false;
|
|
512
580
|
ref.current.style.height = show ? "auto" : "0px";
|
|
513
581
|
if (show) {
|
|
514
|
-
requestAnimationFrame(() => {
|
|
515
|
-
if (ref.current)
|
|
516
|
-
|
|
517
|
-
}
|
|
582
|
+
window.requestAnimationFrame(() => {
|
|
583
|
+
if (!ref.current) return;
|
|
584
|
+
prevHeight.current = ref.current.offsetHeight;
|
|
518
585
|
});
|
|
519
586
|
} else {
|
|
520
|
-
requestAnimationFrame(() => {
|
|
521
|
-
if (ref.current)
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}
|
|
587
|
+
window.requestAnimationFrame(() => {
|
|
588
|
+
if (!ref.current) return;
|
|
589
|
+
ref.current.style.height = "auto";
|
|
590
|
+
prevHeight.current = ref.current.offsetHeight;
|
|
591
|
+
ref.current.style.height = "0px";
|
|
526
592
|
});
|
|
527
593
|
ref.current.style.opacity = "0";
|
|
528
594
|
}
|
|
@@ -532,22 +598,21 @@ function Accordion({
|
|
|
532
598
|
ref.current.style.height = `${prevHeight.current}px`;
|
|
533
599
|
}
|
|
534
600
|
const frameIds = [];
|
|
535
|
-
frameIds[0] = requestAnimationFrame(() => {
|
|
536
|
-
frameIds[1] = requestAnimationFrame(() => {
|
|
537
|
-
if (!ref.current)
|
|
538
|
-
return;
|
|
601
|
+
frameIds[0] = window.requestAnimationFrame(() => {
|
|
602
|
+
frameIds[1] = window.requestAnimationFrame(() => {
|
|
603
|
+
if (!ref.current) return;
|
|
539
604
|
ref.current.style.height = `${show ? prevHeight.current : 0}px`;
|
|
540
605
|
ref.current.style.opacity = show ? "1" : "0";
|
|
541
606
|
});
|
|
542
607
|
});
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
608
|
+
let timeoutId;
|
|
609
|
+
const timeoutCallback = () => {
|
|
610
|
+
if (!ref.current) return;
|
|
546
611
|
if (show) {
|
|
547
612
|
ref.current.style.height = "auto";
|
|
548
613
|
ref.current.style.overflow = "";
|
|
549
614
|
ref.current.style.opacity = "";
|
|
550
|
-
requestAnimationFrame(() => {
|
|
615
|
+
window.requestAnimationFrame(() => {
|
|
551
616
|
if (ref.current) {
|
|
552
617
|
prevHeight.current = ref.current.offsetHeight;
|
|
553
618
|
}
|
|
@@ -555,165 +620,65 @@ function Accordion({
|
|
|
555
620
|
} else {
|
|
556
621
|
ref.current.style.height = "0px";
|
|
557
622
|
}
|
|
558
|
-
}
|
|
623
|
+
};
|
|
624
|
+
if (timeoutRef.current === 0) {
|
|
625
|
+
timeoutCallback();
|
|
626
|
+
} else {
|
|
627
|
+
timeoutId = window.setTimeout(timeoutCallback, timeoutRef.current);
|
|
628
|
+
}
|
|
559
629
|
return () => {
|
|
560
|
-
frameIds.forEach(cancelAnimationFrame);
|
|
561
|
-
clearTimeout(timeoutId);
|
|
630
|
+
frameIds.forEach(window.cancelAnimationFrame);
|
|
631
|
+
if (timeoutId) window.clearTimeout(timeoutId);
|
|
562
632
|
};
|
|
563
633
|
}, [show]);
|
|
564
634
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...rest, children: [
|
|
565
635
|
header,
|
|
566
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
567
|
-
|
|
568
|
-
|
|
636
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
className: "transition-all ease-in-out overflow-hidden",
|
|
640
|
+
role: "region",
|
|
641
|
+
"aria-hidden": !show,
|
|
642
|
+
ref,
|
|
643
|
+
style: { transitionDuration: `${timeout}ms` },
|
|
644
|
+
children
|
|
645
|
+
}
|
|
646
|
+
)
|
|
569
647
|
] });
|
|
570
648
|
}
|
|
571
|
-
|
|
572
|
-
displayName: "Accordion__AnimatedContent",
|
|
573
|
-
componentId: "sc-1yjowun-0"
|
|
574
|
-
})(["will-change:opacity,height,transform;transition-property:opacity,height,transform;transition-timing-function:ease-in-out;"]);
|
|
575
|
-
|
|
576
|
-
function setAlign({
|
|
577
|
-
align
|
|
578
|
-
}) {
|
|
579
|
-
switch (align) {
|
|
580
|
-
case "left":
|
|
581
|
-
return "flex-start";
|
|
582
|
-
case "right":
|
|
583
|
-
return "flex-end";
|
|
584
|
-
case "center":
|
|
585
|
-
return "center";
|
|
586
|
-
default:
|
|
587
|
-
return "space-evenly";
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
function AppBar({
|
|
592
|
-
children,
|
|
593
|
-
align,
|
|
594
|
-
brand,
|
|
595
|
-
...rest
|
|
596
|
-
}) {
|
|
597
|
-
const [show, setShow] = React.useState(false);
|
|
598
|
-
const toggleMenu = () => setShow(!show);
|
|
599
|
-
return /* @__PURE__ */ jsxRuntime.jsx(NavBar, { role: "navigation", ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs("nav", { children: [
|
|
600
|
-
brand,
|
|
601
|
-
children && /* @__PURE__ */ jsxRuntime.jsxs(Burger, { className: show ? "active" : void 0, onClick: toggleMenu, children: [
|
|
602
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
603
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
604
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {})
|
|
605
|
-
] }),
|
|
606
|
-
/* @__PURE__ */ jsxRuntime.jsx(NavContent, { className: show ? "active" : void 0, align, children })
|
|
607
|
-
] }) });
|
|
608
|
-
}
|
|
609
|
-
function setColor$1({
|
|
610
|
-
color,
|
|
611
|
-
theme,
|
|
612
|
-
backdrop
|
|
613
|
-
}) {
|
|
614
|
-
const backgroundColor = color ? theme[color] : "transparent";
|
|
615
|
-
const textColor = findColorInvert(theme, backgroundColor === "transparent" ? theme.background : backgroundColor);
|
|
616
|
-
if (backdrop) {
|
|
617
|
-
const backColor = polished.transparentize(0.2, backgroundColor === "transparent" ? theme.white : backgroundColor);
|
|
618
|
-
return styledComponents.css(["background-color:", ";color:", ";"], backColor, textColor);
|
|
619
|
-
}
|
|
620
|
-
return styledComponents.css(["background-color:", ";color:", ";"], backgroundColor, textColor);
|
|
621
|
-
}
|
|
622
|
-
const NavBar = /* @__PURE__ */ styledComponents.styled.header.withConfig({
|
|
623
|
-
displayName: "AppBar__NavBar",
|
|
624
|
-
componentId: "sc-t8gqca-0"
|
|
625
|
-
})(["position:", ";display:flex;top:-1px;min-height:3.25rem;width:100%;z-index:30;padding:", ";& > nav{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;flex:1 0 auto;}", " a{color:inherit;}", "{padding:", ";}"], ({
|
|
626
|
-
fixed,
|
|
627
|
-
sticky
|
|
628
|
-
}) => {
|
|
629
|
-
if (sticky)
|
|
630
|
-
return "sticky";
|
|
631
|
-
if (fixed)
|
|
632
|
-
return "fixed";
|
|
633
|
-
return "relative";
|
|
634
|
-
}, ({
|
|
635
|
-
fluid
|
|
636
|
-
}) => fluid ? "0 0.75rem" : "0 5%", setColor$1, mediaTablet, ({
|
|
637
|
-
fluid
|
|
638
|
-
}) => fluid ? "0 0.5rem" : "0 3%");
|
|
639
|
-
const Burger = /* @__PURE__ */ styledComponents.styled.button.withConfig({
|
|
640
|
-
displayName: "AppBar__Burger",
|
|
641
|
-
componentId: "sc-t8gqca-1"
|
|
642
|
-
})(["", " display:none;margin-left:auto;border:none;background-color:transparent;color:inherit;outline:none;&:hover{background-color:rgba(0,0,0,.05);}", "{display:block;}"], hamburger("3.25rem"), mediaMobile);
|
|
643
|
-
const NavContent = /* @__PURE__ */ styledComponents.styled.div.withConfig({
|
|
644
|
-
displayName: "AppBar__NavContent",
|
|
645
|
-
componentId: "sc-t8gqca-2"
|
|
646
|
-
})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-basis:auto;flex-grow:1;height:100%;& > ul{display:flex;flex-direction:row;list-style:none;flex-grow:1;flex-basis:100%;height:inherit;align-items:center;justify-content:", ";li{padding:0.85rem;}}& > div,& > span,& > form{display:flex;", "}", "{width:100%;flex-direction:column;align-items:flex-start;height:auto;padding-bottom:0.5rem;&:not(.active){display:none;}& > ul{flex-direction:column;align-items:flex-start;width:100%;flex-basis:auto;li{padding:.5rem 0;}}& > div,& > span,& > form{padding:.5rem 0;width:100%;}}"], setAlign, ({
|
|
647
|
-
color
|
|
648
|
-
}) => color ? `color: ${color};` : "", mediaMobile);
|
|
649
|
-
|
|
650
|
-
const Portal = React__default.default.forwardRef(({
|
|
651
|
-
children,
|
|
652
|
-
container,
|
|
653
|
-
disabled
|
|
654
|
-
}, ref) => {
|
|
655
|
-
const [mountNode, setMountNode] = React.useState(null);
|
|
656
|
-
useIsomorphicLayoutEffect(() => {
|
|
657
|
-
if (disabled) {
|
|
658
|
-
setMountNode(null);
|
|
659
|
-
return;
|
|
660
|
-
}
|
|
661
|
-
if (!container) {
|
|
662
|
-
let dom = document.getElementById("visits-style-portals");
|
|
663
|
-
if (!dom) {
|
|
664
|
-
dom = document.createElement("div");
|
|
665
|
-
dom.id = "visits-style-portals";
|
|
666
|
-
document.body.appendChild(dom);
|
|
667
|
-
}
|
|
668
|
-
setMountNode(dom);
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
setMountNode(container);
|
|
672
|
-
}, [container, disabled]);
|
|
673
|
-
return mountNode ? reactDom.createPortal(children, mountNode) : null;
|
|
674
|
-
});
|
|
675
|
-
Portal.displayName = "Portal";
|
|
676
|
-
const Portal$1 = Portal;
|
|
677
|
-
|
|
678
|
-
const Tooltip$1 = React.forwardRef(({
|
|
649
|
+
var Tooltip = react.forwardRef(({
|
|
679
650
|
children,
|
|
680
651
|
position = "bottom",
|
|
681
652
|
label,
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
offset = {
|
|
685
|
-
x: 0,
|
|
686
|
-
y: 6
|
|
687
|
-
},
|
|
653
|
+
className,
|
|
654
|
+
timeout = 150,
|
|
655
|
+
offset = { x: 0, y: 6 },
|
|
688
656
|
clientPoint = false,
|
|
689
657
|
disabled
|
|
690
658
|
}, ref) => {
|
|
691
|
-
const [open, setOpen] =
|
|
692
|
-
const nodeId = react.useId();
|
|
693
|
-
const {
|
|
694
|
-
refs,
|
|
695
|
-
floatingStyles,
|
|
696
|
-
context
|
|
697
|
-
} = react.useFloating({
|
|
659
|
+
const [open, setOpen] = react.useState(false);
|
|
660
|
+
const nodeId = react$1.useId();
|
|
661
|
+
const { refs, floatingStyles, context } = react$1.useFloating({
|
|
698
662
|
nodeId,
|
|
699
663
|
open,
|
|
700
664
|
placement: position,
|
|
701
|
-
middleware: [
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
665
|
+
middleware: [
|
|
666
|
+
react$1.shift(),
|
|
667
|
+
react$1.flip(),
|
|
668
|
+
react$1.offset({ mainAxis: offset.y, crossAxis: offset.x })
|
|
669
|
+
],
|
|
670
|
+
whileElementsMounted: disabled ? undefined : react$1.autoUpdate,
|
|
706
671
|
onOpenChange: setOpen
|
|
707
672
|
});
|
|
708
|
-
const {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
})
|
|
716
|
-
|
|
673
|
+
const { getReferenceProps, getFloatingProps } = react$1.useInteractions([
|
|
674
|
+
react$1.useHover(context, { enabled: !disabled }),
|
|
675
|
+
react$1.useClientPoint(context, { enabled: clientPoint })
|
|
676
|
+
]);
|
|
677
|
+
const { isMounted, styles } = react$1.useTransitionStyles(context, {
|
|
678
|
+
duration: timeout,
|
|
679
|
+
initial: { opacity: 0, transform: "scale(0.8)" }
|
|
680
|
+
});
|
|
681
|
+
react.useImperativeHandle(ref, () => ({
|
|
717
682
|
floating: refs.floating,
|
|
718
683
|
reference: refs.reference,
|
|
719
684
|
open: () => setOpen(true),
|
|
@@ -721,316 +686,328 @@ const Tooltip$1 = React.forwardRef(({
|
|
|
721
686
|
}));
|
|
722
687
|
const child = typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children;
|
|
723
688
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
724
|
-
|
|
689
|
+
react.cloneElement(react.Children.only(child), {
|
|
725
690
|
ref: refs.setReference,
|
|
726
691
|
...getReferenceProps()
|
|
727
692
|
}),
|
|
728
|
-
/* @__PURE__ */ jsxRuntime.jsx(Portal
|
|
693
|
+
/* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: disabled || !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tooltip", className: "z-[9999]", ref: refs.setFloating, ...getFloatingProps({ style: floatingStyles }), children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { className, style: styles, children: label }) }) })
|
|
729
694
|
] });
|
|
730
695
|
});
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
})(["position:relative;box-shadow:0 1px 2px 0 rgba(0,0,0,0.05);z-index:9999;padding:0.375rem 0.625rem;cursor:default;white-space:pre;font-size:0.85rem;z-index:9999;background-color:", ";&:focus{outline:none;}"], ({
|
|
736
|
-
$color,
|
|
737
|
-
theme
|
|
738
|
-
}) => $color ? theme[$color] || theme.background : theme.background);
|
|
739
|
-
|
|
740
|
-
const Box = styledComponents.styled.div.withConfig({
|
|
741
|
-
shouldForwardProp: (name) => name !== "color" && name !== "borderless"
|
|
742
|
-
}).withConfig({
|
|
743
|
-
displayName: "Box",
|
|
744
|
-
componentId: "sc-kc6ybp-0"
|
|
745
|
-
})(["position:relative;display:flex;flex-direction:column;border:", ";border-radius:", ";width:100%;min-width:0;word-wrap:break-word;", ""], ({
|
|
746
|
-
borderless,
|
|
747
|
-
theme
|
|
748
|
-
}) => borderless ? "none" : `1px solid ${theme.border}`, ({
|
|
749
|
-
theme
|
|
750
|
-
}) => theme.radius, ({
|
|
751
|
-
color,
|
|
752
|
-
theme
|
|
753
|
-
}) => {
|
|
754
|
-
if (!color)
|
|
755
|
-
return void 0;
|
|
756
|
-
const target = theme[color] || color;
|
|
757
|
-
const invertColor = findColorInvert(theme, target);
|
|
758
|
-
return {
|
|
759
|
-
backgroundColor: target,
|
|
760
|
-
color: invertColor
|
|
761
|
-
};
|
|
762
|
-
});
|
|
763
|
-
|
|
764
|
-
function stopPropagation$1(e) {
|
|
765
|
-
if (!e)
|
|
766
|
-
return;
|
|
767
|
-
e.stopPropagation();
|
|
768
|
-
e.preventDefault();
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
const Popover = React.forwardRef(({
|
|
772
|
-
position,
|
|
773
|
-
label,
|
|
774
|
-
children,
|
|
775
|
-
color = "background",
|
|
776
|
-
onOpen,
|
|
777
|
-
onClose,
|
|
778
|
-
disabled,
|
|
779
|
-
offset = {
|
|
780
|
-
x: 0,
|
|
781
|
-
y: 6
|
|
782
|
-
},
|
|
783
|
-
onManualClose,
|
|
784
|
-
zIndex = 9996,
|
|
696
|
+
var Tooltip_default = Tooltip;
|
|
697
|
+
var TooltipContent = react.forwardRef(({
|
|
698
|
+
className,
|
|
699
|
+
custom,
|
|
785
700
|
...rest
|
|
786
701
|
}, ref) => {
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
openRef.current?.(refs.reference.current, refs.floating.current);
|
|
808
|
-
} else {
|
|
809
|
-
closeRef.current?.(refs.reference.current, refs.floating.current);
|
|
810
|
-
}
|
|
811
|
-
setOpen(value);
|
|
812
|
-
},
|
|
813
|
-
whileElementsMounted: react.autoUpdate
|
|
814
|
-
});
|
|
815
|
-
const handleBlur = React.useCallback((e) => {
|
|
816
|
-
stopPropagation$1(e);
|
|
817
|
-
if (onManualClose)
|
|
818
|
-
return onManualClose();
|
|
819
|
-
setOpen(false);
|
|
820
|
-
closeRef.current?.(refs.reference.current, refs.floating.current);
|
|
821
|
-
}, [onManualClose]);
|
|
822
|
-
React.useEffect(() => {
|
|
823
|
-
if (disabled && open) {
|
|
824
|
-
setOpen(false);
|
|
825
|
-
}
|
|
826
|
-
}, [disabled, open]);
|
|
827
|
-
React.useImperativeHandle(ref, () => ({
|
|
828
|
-
open: () => {
|
|
829
|
-
setOpen(true);
|
|
830
|
-
openRef.current?.(refs.reference.current, refs.floating.current);
|
|
702
|
+
const tooltipName = react.useMemo(() => clsx8__default.default(
|
|
703
|
+
"relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",
|
|
704
|
+
custom ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background",
|
|
705
|
+
className
|
|
706
|
+
), [className, custom]);
|
|
707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: tooltipName, ...rest });
|
|
708
|
+
});
|
|
709
|
+
function varientButton({ variant, size }) {
|
|
710
|
+
return clsx8__default.default(
|
|
711
|
+
"inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer",
|
|
712
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
713
|
+
"disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",
|
|
714
|
+
{
|
|
715
|
+
"bg-primary text-inverted hover:bg-primary-fore": !variant || variant === "primary",
|
|
716
|
+
"bg-info text-inverted hover:bg-info-fore": variant === "info",
|
|
717
|
+
"bg-warn text-inverted hover:bg-warn-fore": variant === "warn",
|
|
718
|
+
"bg-danger text-inverted hover:bg-danger-fore": variant === "danger",
|
|
719
|
+
"hover:bg-accent": variant === "ghost",
|
|
720
|
+
"hover:underline": variant === "link",
|
|
721
|
+
"border border-input hover:bg-accent": variant === "outline"
|
|
831
722
|
},
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
723
|
+
{
|
|
724
|
+
"px-2 py-1": !size,
|
|
725
|
+
"p-1.5": size === "icon"
|
|
835
726
|
}
|
|
836
|
-
|
|
837
|
-
}), []);
|
|
838
|
-
const {
|
|
839
|
-
getFloatingProps,
|
|
840
|
-
getReferenceProps
|
|
841
|
-
} = react.useInteractions([react.useClick(context, {
|
|
842
|
-
enabled: !disabled
|
|
843
|
-
})]);
|
|
844
|
-
openRef.current = onOpen;
|
|
845
|
-
closeRef.current = onClose;
|
|
846
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
847
|
-
React.cloneElement(React.Children.only(label), getReferenceProps({
|
|
848
|
-
ref: refs.setReference,
|
|
849
|
-
tabIndex: 0,
|
|
850
|
-
role: "button",
|
|
851
|
-
disabled,
|
|
852
|
-
onClick: stopPropagation$1
|
|
853
|
-
})),
|
|
854
|
-
/* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: open && !disabled ? /* @__PURE__ */ jsxRuntime.jsx(react.FloatingOverlay, { "data-testid": "visits-style-shadow", onClick: handleBlur, style: {
|
|
855
|
-
zIndex
|
|
856
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { role: "tooltip", ref: refs.setFloating, color, style: floatingStyles, ...getFloatingProps({
|
|
857
|
-
...rest,
|
|
858
|
-
onClick: stopPropagation$1
|
|
859
|
-
}), children }) }) : null })
|
|
860
|
-
] });
|
|
861
|
-
});
|
|
862
|
-
Popover.displayName = "Popover";
|
|
863
|
-
const Popover$1 = Popover;
|
|
864
|
-
const Tooltip = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
|
|
865
|
-
displayName: "Popover__Tooltip",
|
|
866
|
-
componentId: "sc-1huajr8-0"
|
|
867
|
-
})(["display:flex;box-shadow:0 1px 2px 0 rgba(0,0,0,0.05);padding:0.5rem 0;width:auto;height:auto;cursor:auto;z-index:20;"]);
|
|
868
|
-
|
|
869
|
-
function stopPropagation(e) {
|
|
870
|
-
if (!e)
|
|
871
|
-
return;
|
|
872
|
-
e.stopPropagation();
|
|
727
|
+
);
|
|
873
728
|
}
|
|
874
|
-
function
|
|
875
|
-
|
|
729
|
+
function Button({ size, variant, className, ...rest }) {
|
|
730
|
+
const buttonClass = react.useMemo(() => clsx8__default.default(varientButton({ size, variant }), className), [size, variant, className]);
|
|
731
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { className: buttonClass, type: "button", ...rest });
|
|
732
|
+
}
|
|
733
|
+
function Dialog({
|
|
734
|
+
open,
|
|
876
735
|
children,
|
|
877
|
-
timeout =
|
|
736
|
+
timeout = 150,
|
|
878
737
|
padding = "0.85rem",
|
|
879
738
|
verticalAlign = "center",
|
|
880
|
-
closeModal,
|
|
881
739
|
closeOnOverlay,
|
|
882
740
|
closeOnEsc,
|
|
883
741
|
onExited,
|
|
742
|
+
className,
|
|
743
|
+
onOpenChange,
|
|
744
|
+
size,
|
|
884
745
|
...rest
|
|
885
746
|
}) {
|
|
886
|
-
const exitRef =
|
|
887
|
-
const isTransMountedRef =
|
|
888
|
-
const
|
|
889
|
-
const {
|
|
890
|
-
|
|
891
|
-
context
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
const {
|
|
898
|
-
getFloatingProps
|
|
899
|
-
} = react.useInteractions([react.useDismiss(context, {
|
|
900
|
-
enabled: closeOnEsc,
|
|
901
|
-
outsidePress: false,
|
|
902
|
-
escapeKey: closeOnEsc
|
|
903
|
-
})]);
|
|
904
|
-
const {
|
|
905
|
-
isMounted,
|
|
906
|
-
styles
|
|
907
|
-
} = react.useTransitionStyles(context, {
|
|
747
|
+
const exitRef = react.useRef(onExited);
|
|
748
|
+
const isTransMountedRef = react.useRef(false);
|
|
749
|
+
const nodeId = react$1.useId();
|
|
750
|
+
const { refs, context } = react$1.useFloating({ open, onOpenChange, nodeId });
|
|
751
|
+
const { getFloatingProps } = react$1.useInteractions([
|
|
752
|
+
react$1.useDismiss(context, {
|
|
753
|
+
enabled: closeOnEsc,
|
|
754
|
+
escapeKey: closeOnEsc,
|
|
755
|
+
outsidePress: false
|
|
756
|
+
})
|
|
757
|
+
]);
|
|
758
|
+
const { isMounted, styles } = react$1.useTransitionStyles(context, {
|
|
908
759
|
duration: timeout,
|
|
909
|
-
initial: {
|
|
910
|
-
opacity: 0,
|
|
911
|
-
transform: "scale(0.8)"
|
|
912
|
-
}
|
|
760
|
+
initial: { opacity: 0, transform: "scale(0.8)" }
|
|
913
761
|
});
|
|
914
|
-
|
|
915
|
-
if (isTransMountedRef.current === isMounted)
|
|
916
|
-
return;
|
|
762
|
+
react.useEffect(() => {
|
|
763
|
+
if (isTransMountedRef.current === isMounted) return;
|
|
917
764
|
isTransMountedRef.current = isMounted;
|
|
918
|
-
if (isMounted)
|
|
919
|
-
return;
|
|
765
|
+
if (isMounted) return;
|
|
920
766
|
exitRef.current?.();
|
|
921
767
|
}, [isMounted]);
|
|
922
|
-
const handleOverlayClose = (
|
|
923
|
-
if (!closeOnOverlay)
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
};
|
|
768
|
+
const handleOverlayClose = react.useCallback(() => {
|
|
769
|
+
if (!closeOnOverlay) return;
|
|
770
|
+
onOpenChange?.(false);
|
|
771
|
+
}, [onOpenChange, closeOnOverlay]);
|
|
927
772
|
exitRef.current = onExited;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
773
|
+
const overlayClass = react.useMemo(() => clsx8__default.default("grid bg-backdrop z-40 justify-items-center", {
|
|
774
|
+
"place-items-start items-start": verticalAlign === "start",
|
|
775
|
+
"place-items-end": verticalAlign === "end",
|
|
776
|
+
"place-items-center": verticalAlign === "center" || !verticalAlign
|
|
777
|
+
}), [verticalAlign]);
|
|
778
|
+
const dialogClass = react.useMemo(() => merge("transition ease-in-out", className), [className]);
|
|
779
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal, { disabled: !isMounted, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
780
|
+
react$1.FloatingOverlay,
|
|
781
|
+
{
|
|
782
|
+
className: overlayClass,
|
|
783
|
+
"data-testid": "vs-dialog-overlay",
|
|
784
|
+
onClick: handleOverlayClose,
|
|
785
|
+
style: { padding, opacity: styles.opacity },
|
|
786
|
+
lockScroll: true,
|
|
787
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
788
|
+
DialogContent,
|
|
789
|
+
{
|
|
790
|
+
ref: refs.setFloating,
|
|
791
|
+
className: dialogClass,
|
|
792
|
+
role: "dialog",
|
|
793
|
+
size,
|
|
794
|
+
...getFloatingProps({ ...rest, style: styles, onClick: stopPropagation }),
|
|
795
|
+
children
|
|
796
|
+
}
|
|
797
|
+
)
|
|
798
|
+
}
|
|
799
|
+
) });
|
|
935
800
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
componentId: "sc-pb7lhx-0"
|
|
939
|
-
})([" display:flex;display:grid;place-items:", ";align-items:", ";justify-content:center;background:", ";z-index:9997;"], ({
|
|
940
|
-
$verticalAlign
|
|
941
|
-
}) => {
|
|
942
|
-
if ($verticalAlign === "start")
|
|
943
|
-
return "flex-start";
|
|
944
|
-
if ($verticalAlign === "end")
|
|
945
|
-
return "flex-end";
|
|
946
|
-
return "center";
|
|
947
|
-
}, ({
|
|
948
|
-
$verticalAlign
|
|
949
|
-
}) => {
|
|
950
|
-
if ($verticalAlign === "start")
|
|
951
|
-
return "flex-start";
|
|
952
|
-
if ($verticalAlign === "end")
|
|
953
|
-
return "flex-end";
|
|
954
|
-
return "center";
|
|
955
|
-
}, ({
|
|
956
|
-
theme
|
|
957
|
-
}) => theme.backdrop);
|
|
958
|
-
const Wrapper$2 = /* @__PURE__ */ styledComponents.styled.div.withConfig({
|
|
959
|
-
displayName: "Modal__Wrapper",
|
|
960
|
-
componentId: "sc-pb7lhx-1"
|
|
961
|
-
})(["will-change:transform,opacity;transform-origin:center top;transition-timing-function:cubic-bezier(0.645,0.045,0.355,1);z-index:9999;"]);
|
|
962
|
-
|
|
963
|
-
function ToastItem({
|
|
801
|
+
var DialogContent = react.forwardRef(({
|
|
802
|
+
size,
|
|
964
803
|
className,
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
804
|
+
...rest
|
|
805
|
+
}, ref) => {
|
|
806
|
+
const dialogClass = react.useMemo(() => clsx8__default.default(
|
|
807
|
+
size ? "flex flex-col bg-background shadow-lg p-5 rounded" : null,
|
|
808
|
+
{
|
|
809
|
+
"w-full max-w-sm": size === "small",
|
|
810
|
+
"w-full max-w-lg": size === "medium",
|
|
811
|
+
"w-full max-w-2xl": size === "large"
|
|
812
|
+
},
|
|
813
|
+
className
|
|
814
|
+
), [size, className]);
|
|
815
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: dialogClass, ...rest });
|
|
816
|
+
});
|
|
817
|
+
DialogContent.displayName = "DialogContent";
|
|
818
|
+
var defaultTimeout2 = { open: 300, close: 150 };
|
|
819
|
+
function Sheet({ open, timeout = defaultTimeout2, onOpenChange, position = "right", overlay, ...rest }) {
|
|
820
|
+
const nodeId = react$1.useId();
|
|
821
|
+
const { refs, context } = react$1.useFloating({ open, onOpenChange, nodeId });
|
|
822
|
+
const { isMounted, styles } = react$1.useTransitionStyles(context, {
|
|
823
|
+
duration: timeout,
|
|
824
|
+
initial() {
|
|
825
|
+
let transform = "translateX(75%)";
|
|
826
|
+
if (position === "left") {
|
|
827
|
+
transform = "translateX(-75%)";
|
|
828
|
+
} else if (position === "top") {
|
|
829
|
+
transform = "translateY(-75%)";
|
|
830
|
+
} else if (position === "bottom") {
|
|
831
|
+
transform = "translateY(75%)";
|
|
832
|
+
}
|
|
833
|
+
return { opacity: 0, transform };
|
|
834
|
+
}
|
|
981
835
|
});
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
transform: "scale(0.8)"
|
|
836
|
+
const name = react.useMemo(() => clsx8__default.default(
|
|
837
|
+
"fixed transition-transform z-30",
|
|
838
|
+
{
|
|
839
|
+
"top-0 right-0 h-full max-h-screen": position === "right",
|
|
840
|
+
"top-0 left-0 h-full max-h-screen": position === "left",
|
|
841
|
+
"top-0 left-0 right-0 w-full max-w-screen": position === "top",
|
|
842
|
+
"bottom-0 left-0 right-0 w-full max-w-screen": position === "bottom"
|
|
990
843
|
}
|
|
844
|
+
), [position]);
|
|
845
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Portal, { disabled: !isMounted, children: [
|
|
846
|
+
overlay ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
847
|
+
react$1.FloatingOverlay,
|
|
848
|
+
{
|
|
849
|
+
className: "bg-backdrop",
|
|
850
|
+
style: { opacity: styles.opacity },
|
|
851
|
+
onClick: () => onOpenChange?.(false)
|
|
852
|
+
}
|
|
853
|
+
) : null,
|
|
854
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
ref: refs.setFloating,
|
|
858
|
+
className: name,
|
|
859
|
+
role: "dialog",
|
|
860
|
+
style: styles,
|
|
861
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SheetContent, { ...rest })
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
] });
|
|
865
|
+
}
|
|
866
|
+
function SheetContent({ className, unstyled, ...rest }) {
|
|
867
|
+
const name = react.useMemo(() => unstyled ? className : merge(clsx8__default.default(
|
|
868
|
+
"relative bg-background min-w-full min-h-full border border-input shadow-lg"
|
|
869
|
+
), className), [unstyled, className]);
|
|
870
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: name, ...rest });
|
|
871
|
+
}
|
|
872
|
+
function Approved(props) {
|
|
873
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
|
|
874
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z", fill: "none" }),
|
|
875
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z", fill: "currentColor" }),
|
|
876
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11.5 18.5-3.9-4L6 16l5.6 5.6L23.2 10l-1.7-1.6z", fill: "currentColor" })
|
|
877
|
+
] });
|
|
878
|
+
}
|
|
879
|
+
function Alert(props) {
|
|
880
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 32 32", ...props, children: [
|
|
881
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 0C7.16 0 0 7.16 0 16C0 24.84 7.16 32 16 32C24.84 32 32 24.84 32 16C32 7.16 24.84 0 16 0ZM16 31C7.73 31 1 24.27 1 16C1 7.73 7.73 1 16 1C24.27 1 31 7.73 31 16C31 24.27 24.27 31 16 31Z", fill: "currentColor" }),
|
|
882
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.5 19.55V8.54999C15.5 8.26999 15.72 8.04999 16 8.04999C16.28 8.04999 16.5 8.26999 16.5 8.54999V19.55C16.5 19.83 16.28 20.05 16 20.05C15.72 20.05 15.5 19.83 15.5 19.55Z", fill: "currentColor" }),
|
|
883
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z", fill: "currentColor" })
|
|
884
|
+
] });
|
|
885
|
+
}
|
|
886
|
+
function Caution(props) {
|
|
887
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 52 45", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z", fill: "currentColor" }) });
|
|
888
|
+
}
|
|
889
|
+
function Spinner({ size = 20, label = "Loading...", ...rest }) {
|
|
890
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", ...rest, children: [
|
|
891
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { "aria-hidden": "true", className: "text-accent animate-spin fill-primary", width: size, height: size, viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
892
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z", fill: "currentColor" }),
|
|
893
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z", fill: "currentFill" })
|
|
894
|
+
] }),
|
|
895
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label })
|
|
896
|
+
] });
|
|
897
|
+
}
|
|
898
|
+
function ToastItem({ type, label, message }) {
|
|
899
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2", children: [
|
|
900
|
+
type ? /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "mr-2", children: [
|
|
901
|
+
type === "success" ? /* @__PURE__ */ jsxRuntime.jsx(Approved, { className: "text-primary size-5" }) : null,
|
|
902
|
+
type === "info" ? /* @__PURE__ */ jsxRuntime.jsx(Alert, { className: "text-info size-5" }) : null,
|
|
903
|
+
type === "error" ? /* @__PURE__ */ jsxRuntime.jsx(Alert, { className: "text-danger size-5" }) : null,
|
|
904
|
+
type === "warn" ? /* @__PURE__ */ jsxRuntime.jsx(Caution, { className: "text-warn size-5" }) : null,
|
|
905
|
+
type === "loading" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 20 }) : null
|
|
906
|
+
] }) : null,
|
|
907
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
908
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium leading-none", children: label }),
|
|
909
|
+
message ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: message }) : null
|
|
910
|
+
] })
|
|
911
|
+
] });
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// src/components/Toast/observer.ts
|
|
915
|
+
function noop() {
|
|
916
|
+
}
|
|
917
|
+
var ToastObserver = class {
|
|
918
|
+
/** システムで1つしか存在しない前提とする */
|
|
919
|
+
notify = noop;
|
|
920
|
+
lastId = 0;
|
|
921
|
+
/** internal use only */
|
|
922
|
+
subscribe = (callback) => {
|
|
923
|
+
this.notify = callback;
|
|
924
|
+
return () => {
|
|
925
|
+
this.notify = noop;
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
add = (label, config = {}) => {
|
|
929
|
+
this.lastId += 1;
|
|
930
|
+
const id = `${this.lastId}`;
|
|
931
|
+
this.notify({ id, type: "add", config: { id, label, ...config } });
|
|
932
|
+
return id;
|
|
933
|
+
};
|
|
934
|
+
/** 表示中のtoastを修正します。promiseのロード状態を表示することなどに使います */
|
|
935
|
+
update = (id, config) => {
|
|
936
|
+
this.notify({ id, type: "update", config });
|
|
937
|
+
};
|
|
938
|
+
remove = (id) => {
|
|
939
|
+
this.notify({ id, type: "remove" });
|
|
940
|
+
};
|
|
941
|
+
clear = () => {
|
|
942
|
+
this.lastId = 0;
|
|
943
|
+
};
|
|
944
|
+
};
|
|
945
|
+
var observer = new ToastObserver();
|
|
946
|
+
var observer_default = observer;
|
|
947
|
+
function ToastContainer({
|
|
948
|
+
id,
|
|
949
|
+
type,
|
|
950
|
+
index,
|
|
951
|
+
duration,
|
|
952
|
+
className,
|
|
953
|
+
children,
|
|
954
|
+
inverted,
|
|
955
|
+
timeout = 250,
|
|
956
|
+
max = 3
|
|
957
|
+
}) {
|
|
958
|
+
const isPrevMountedRef = react.useRef(false);
|
|
959
|
+
const [open, setOpen] = react.useState(false);
|
|
960
|
+
const { context, refs } = react$1.useFloating({ open, onOpenChange: setOpen, nodeId: id });
|
|
961
|
+
const { isMounted, styles } = react$1.useTransitionStyles(context, {
|
|
962
|
+
duration: timeout,
|
|
963
|
+
initial: { opacity: 0, transform: `translateY(${inverted ? "" : "-"}50%)` }
|
|
991
964
|
});
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
965
|
+
react.useLayoutEffect(() => {
|
|
966
|
+
setOpen(index <= max);
|
|
967
|
+
}, [index, max]);
|
|
968
|
+
react.useEffect(() => {
|
|
969
|
+
if (isPrevMountedRef.current === isMounted) return;
|
|
996
970
|
if (!isMounted) {
|
|
997
|
-
|
|
971
|
+
observer_default.remove(id);
|
|
998
972
|
}
|
|
999
973
|
isPrevMountedRef.current = isMounted;
|
|
1000
974
|
}, [isMounted, id]);
|
|
1001
|
-
|
|
1002
|
-
if (!duration)
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
if (!clearOnClick)
|
|
1009
|
-
return;
|
|
975
|
+
react.useEffect(() => {
|
|
976
|
+
if (!duration) return;
|
|
977
|
+
const tId = window.setTimeout(() => setOpen(false), duration);
|
|
978
|
+
return () => window.clearTimeout(tId);
|
|
979
|
+
}, [duration, id]);
|
|
980
|
+
const handleClose = react.useCallback(() => {
|
|
981
|
+
if (type === "loading") return;
|
|
1010
982
|
setOpen(false);
|
|
1011
|
-
}, [
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
983
|
+
}, [type]);
|
|
984
|
+
const name = react.useMemo(() => clsx8__default.default(
|
|
985
|
+
"relative flex w-fit transition-transform ease-in-out cursor-pointer",
|
|
986
|
+
className
|
|
987
|
+
), [className]);
|
|
988
|
+
if (!isMounted) return null;
|
|
989
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
990
|
+
"li",
|
|
991
|
+
{
|
|
992
|
+
role: "log",
|
|
993
|
+
tabIndex: -1,
|
|
994
|
+
ref: refs.setFloating,
|
|
995
|
+
className: name,
|
|
996
|
+
style: styles,
|
|
997
|
+
onClick: handleClose,
|
|
998
|
+
children
|
|
999
|
+
}
|
|
1000
|
+
);
|
|
1016
1001
|
}
|
|
1017
|
-
const Item = /* @__PURE__ */ styledComponents.styled.li.withConfig({
|
|
1018
|
-
displayName: "ToastItem__Item",
|
|
1019
|
-
componentId: "sc-193rp7r-0"
|
|
1020
|
-
})(["position:relative;display:flex;width:fit-content;padding:0.375em 0.75em;max-width:100%;transition-timing-function:cubic-bezier(0.645,0.045,0.355,1);"]);
|
|
1021
|
-
|
|
1022
1002
|
function Toast({
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
fixed,
|
|
1026
|
-
margin = "16px",
|
|
1003
|
+
className,
|
|
1004
|
+
margin = 16,
|
|
1027
1005
|
position = "top-left",
|
|
1028
|
-
|
|
1006
|
+
max,
|
|
1007
|
+
ListItem = ToastItem
|
|
1029
1008
|
}) {
|
|
1030
|
-
const style =
|
|
1031
|
-
const base = {
|
|
1032
|
-
position: fixed ? "fixed" : "absolute"
|
|
1033
|
-
};
|
|
1009
|
+
const style = react.useMemo(() => {
|
|
1010
|
+
const base = { position: "fixed" };
|
|
1034
1011
|
if (position.indexOf("top") > -1) {
|
|
1035
1012
|
base.top = margin;
|
|
1036
1013
|
} else if (position.indexOf("bottom") > -1) {
|
|
@@ -1048,524 +1025,220 @@ function Toast({
|
|
|
1048
1025
|
base.transform = "translateX(-50%)";
|
|
1049
1026
|
}
|
|
1050
1027
|
return base;
|
|
1051
|
-
}, [
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
})
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
})
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
})
|
|
1101
|
-
theme
|
|
1102
|
-
}) => setGap(theme.media.desktop, theme.gutter), mediaTablet, ({
|
|
1103
|
-
theme
|
|
1104
|
-
}) => setGap(theme.media.tablet, theme.smallGutter), mediaMobile, ({
|
|
1105
|
-
theme
|
|
1106
|
-
}) => setGap(theme.media.mobile, theme.smallGutter));
|
|
1107
|
-
}
|
|
1108
|
-
const Container = styledComponents.styled.div.withConfig({
|
|
1109
|
-
shouldForwardProp: (name) => name !== "fluid"
|
|
1110
|
-
}).withConfig({
|
|
1111
|
-
displayName: "Container",
|
|
1112
|
-
componentId: "sc-1308ay5-0"
|
|
1113
|
-
})(["position:relative;width:100%;", ""], setResponsive);
|
|
1114
|
-
|
|
1115
|
-
const Row = styledComponents.styled.div.withConfig({
|
|
1116
|
-
displayName: "Row",
|
|
1117
|
-
componentId: "sc-1qqbtdw-0"
|
|
1118
|
-
})(["display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;margin:-", "px;padding:", "px;", "{margin:-", "px;padding:", "px;}"], ({
|
|
1119
|
-
theme
|
|
1120
|
-
}) => theme.gutter / 2, ({
|
|
1121
|
-
theme
|
|
1122
|
-
}) => theme.gutter / 2, mediaTablet, ({
|
|
1123
|
-
theme
|
|
1124
|
-
}) => theme.smallGutter / 2, ({
|
|
1125
|
-
theme
|
|
1126
|
-
}) => theme.smallGutter / 2);
|
|
1127
|
-
|
|
1128
|
-
const sizes = ["auto", "8.3333333%", "16.666667%", "25%", "33.333333%", "41.666667%", "50%", "58.333333%", "66.666667%", "75%", "83.333333%", "91.666667%", "100%"];
|
|
1129
|
-
function setAutoSize({
|
|
1130
|
-
size,
|
|
1131
|
-
auto
|
|
1132
|
-
}) {
|
|
1133
|
-
if (!auto || !size)
|
|
1134
|
-
return void 0;
|
|
1135
|
-
const mobileSize = size >= 4 ? sizes[12] : sizes[Math.round(size * 3)];
|
|
1136
|
-
const desktopSize = size >= 8 ? sizes[12] : sizes[Math.round(size * 1.5)];
|
|
1137
|
-
return styledComponents.css(["", "{flex-basis:", ";max-width:", ";}", "{flex-basis:", ";max-width:", ";}"], mediaDesktop, desktopSize, desktopSize, mediaMobile, mobileSize, mobileSize);
|
|
1138
|
-
}
|
|
1139
|
-
function shouldForwardProp$4(name) {
|
|
1140
|
-
return name !== "size" && name !== "offset" && name !== "auto";
|
|
1141
|
-
}
|
|
1142
|
-
const Col = /* @__PURE__ */ styledComponents.styled.div.withConfig({
|
|
1143
|
-
shouldForwardProp: shouldForwardProp$4
|
|
1144
|
-
}).withConfig({
|
|
1145
|
-
displayName: "Col",
|
|
1146
|
-
componentId: "sc-16i9d04-0"
|
|
1147
|
-
})(["display:flex;flex:0 0 auto;flex-direction:row;flex-wrap:wrap;padding:", "px;", " ", " ", "{padding:", "px;}", ""], ({
|
|
1148
|
-
theme
|
|
1149
|
-
}) => theme.gutter / 2, ({
|
|
1150
|
-
size
|
|
1151
|
-
}) => size ? {
|
|
1152
|
-
flexBasis: sizes[size],
|
|
1153
|
-
maxWidth: sizes[size]
|
|
1154
|
-
} : {
|
|
1155
|
-
flexGrow: 1,
|
|
1156
|
-
flexBasis: 0,
|
|
1157
|
-
maxWidth: "100%"
|
|
1158
|
-
}, ({
|
|
1159
|
-
offset
|
|
1160
|
-
}) => offset ? {
|
|
1161
|
-
marginLeft: sizes[offset]
|
|
1162
|
-
} : void 0, mediaTablet, ({
|
|
1163
|
-
theme
|
|
1164
|
-
}) => theme.smallGutter / 2, setAutoSize);
|
|
1165
|
-
Col.defaultProps = {
|
|
1166
|
-
size: 0,
|
|
1167
|
-
offset: 0
|
|
1168
|
-
};
|
|
1169
|
-
const Col$1 = Col;
|
|
1170
|
-
|
|
1171
|
-
const index$3 = styledComponents.styled.div.withConfig({
|
|
1172
|
-
displayName: "Content",
|
|
1173
|
-
componentId: "sc-180oh4h-0"
|
|
1174
|
-
})(["color:", ";line-height:1.5;li + li{margin-top:0.25em;}p,dl,ol,ul,blockquote,pre,table{&:not(:last-child){margin-bottom:1em;}}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.125;}h1{font-size:2rem;margin-bottom:0.5em;}h2{font-size:1.75em;margin-bottom:0.5714em;&:not(:first-child){margin-top:1.1428em;}}h3{font-size:1.5em;margin-bottom:0.6666em;&:not(:first-child){margin-top:1.3333em;}}h4{font-size:1.25em;margin-bottom:0.8em;}h5{font-size:1.125em;margin-bottom:0.8888em;}h6{font-size:1em;margin-bottom:1em;}ol{list-style:decimal outside;margin-left:2em;margin-top:1em;}ul{list-style:disc outside;margin-left:2em;margin-top:1em;ul{list-style-type:circle;margin-top:0.5em;ul{list-style-type:square;}}}dd{margin-left:2em;}table{width:100%;td,th{border:1px solid ", ";border-width:0 0 1px;padding:0.5em 0.75em;vertical-align:top;}th{color:", ";text-align:left;}thead{td,th{border-width:0 0 2px;color:", ";}}tfoot{td,th{border-width:2px 0 0;color:", ";}}tbody > tr:last-child{td,th{border-bottom-width:0;}}}"], ({
|
|
1175
|
-
theme
|
|
1176
|
-
}) => theme.text, ({
|
|
1177
|
-
theme
|
|
1178
|
-
}) => theme.border, ({
|
|
1179
|
-
theme
|
|
1180
|
-
}) => theme.text, ({
|
|
1181
|
-
theme
|
|
1182
|
-
}) => theme.text, ({
|
|
1183
|
-
theme
|
|
1184
|
-
}) => theme.text);
|
|
1185
|
-
|
|
1186
|
-
const setAnimation = ({
|
|
1187
|
-
theme
|
|
1188
|
-
}) => styledComponents.keyframes(["0%{background-color:", ";}50%{background-color:", ";}100%{background-color:", ";}"], theme.greyLighter, theme.grey, theme.greyLighter);
|
|
1189
|
-
const index$2 = styledComponents.styled.span.withConfig({
|
|
1190
|
-
displayName: "Placeholder",
|
|
1191
|
-
componentId: "sc-1091c0n-0"
|
|
1192
|
-
})(["display:inline-block;height:1rem;width:100%;animation:", " 3.5s ease infinite;border-radius:", ";opacity:0.125;"], setAnimation, ({
|
|
1193
|
-
theme
|
|
1194
|
-
}) => theme.radius);
|
|
1195
|
-
|
|
1196
|
-
function setColor({
|
|
1197
|
-
theme,
|
|
1198
|
-
color,
|
|
1199
|
-
outline,
|
|
1200
|
-
disabled
|
|
1201
|
-
}) {
|
|
1202
|
-
if (disabled) {
|
|
1203
|
-
return disabledColor(theme);
|
|
1204
|
-
}
|
|
1205
|
-
if (!color) {
|
|
1206
|
-
return styledComponents.css(["border-color:", ";color:", ";&:hover{border-color:", ";}&:active{border-color:", ";}"], theme.border, theme.text, theme.borderHover, theme.borderActive);
|
|
1207
|
-
}
|
|
1208
|
-
const target = theme[color] || color;
|
|
1209
|
-
const invertColor = findColorInvert(theme, target);
|
|
1210
|
-
if (outline) {
|
|
1211
|
-
return styledComponents.css(["background-color:transparent;border-color:", ";color:", ";&:hover{background-color:", ";color:", ";}&:active{background-color:", ";}&:focus:not(:active){", "}"], target, target, target, invertColor, polished.darken(0.1, target), boxShadow("0.1rem", target, 0.5));
|
|
1212
|
-
}
|
|
1213
|
-
return styledComponents.css(["background-color:", ";border-color:transparent;color:", ";box-shadow:none;&:hover{color:", ";background-color:", ";}&:active{background-color:", ";}&:focus:not(:active){", "}"], target, invertColor, invertColor, polished.darken(0.05, target), polished.darken(0.1, target), boxShadow("0.1rem", target, 0.5));
|
|
1214
|
-
}
|
|
1215
|
-
function shouldForwardProp$3(name) {
|
|
1216
|
-
return name !== "color" && name !== "size" && name !== "outline" && name !== "round" && name !== "icon";
|
|
1217
|
-
}
|
|
1218
|
-
const Button = styledComponents.styled.button.withConfig({
|
|
1219
|
-
shouldForwardProp: shouldForwardProp$3
|
|
1220
|
-
}).withConfig({
|
|
1221
|
-
displayName: "Button",
|
|
1222
|
-
componentId: "sc-f6cc58-0"
|
|
1223
|
-
})(["position:relative;outline:none;appearance:none;box-sizing:border-box;display:inline-block;text-align:center;white-space:nowrap;cursor:pointer;justify-content:center;vertical-align:middle;user-select:none;background:transparent;border:1px solid transparent;border-radius:", ";padding:", ";line-height:", ";", " ", ""], ({
|
|
1224
|
-
round,
|
|
1225
|
-
theme
|
|
1226
|
-
}) => round ? "2456189px" : theme.radius, ({
|
|
1227
|
-
icon
|
|
1228
|
-
}) => icon ? "0.375em" : "0.375em 0.75em", ({
|
|
1229
|
-
icon
|
|
1230
|
-
}) => icon ? 1 : 1.5, setColor, ({
|
|
1231
|
-
size
|
|
1232
|
-
}) => setSize("font-size", size));
|
|
1233
|
-
|
|
1234
|
-
function shouldForwardProp$2(name) {
|
|
1235
|
-
return name !== "color" && name !== "size" && name !== "pure" && name !== "underline" && name !== "round" && name !== "icon";
|
|
1236
|
-
}
|
|
1237
|
-
const TextButton = styledComponents.styled.button.withConfig({
|
|
1238
|
-
shouldForwardProp: shouldForwardProp$2
|
|
1239
|
-
}).withConfig({
|
|
1240
|
-
displayName: "TextButton",
|
|
1241
|
-
componentId: "sc-14wzat7-0"
|
|
1242
|
-
})(["background-color:transparent;border:none;cursor:pointer;display:inline;margin:0;border-radius:", ";padding:", ";line-height:", ";color:", ";", " &:hover,&:focus{", " ", "}&:focus,&:active{outline:none;}&:active{", "}", ""], ({
|
|
1243
|
-
round,
|
|
1244
|
-
theme
|
|
1245
|
-
}) => round ? "2456189px" : theme.radius, ({
|
|
1246
|
-
pure,
|
|
1247
|
-
icon
|
|
1248
|
-
}) => {
|
|
1249
|
-
if (pure)
|
|
1250
|
-
return "0";
|
|
1251
|
-
if (icon)
|
|
1252
|
-
return "0.375em";
|
|
1253
|
-
return "0.375em 0.75em";
|
|
1254
|
-
}, ({
|
|
1255
|
-
icon
|
|
1256
|
-
}) => icon ? 1 : 1.5, ({
|
|
1257
|
-
color,
|
|
1258
|
-
theme
|
|
1259
|
-
}) => color ? theme[color] : theme.text, ({
|
|
1260
|
-
size
|
|
1261
|
-
}) => setSize("font-size", size), ({
|
|
1262
|
-
underline
|
|
1263
|
-
}) => underline ? {
|
|
1264
|
-
textDecoration: "underline"
|
|
1265
|
-
} : void 0, ({
|
|
1266
|
-
pure,
|
|
1267
|
-
theme,
|
|
1268
|
-
color
|
|
1269
|
-
}) => pure ? void 0 : {
|
|
1270
|
-
background: polished.transparentize(0.9, color ? theme[color] || theme.text : theme.text)
|
|
1271
|
-
}, ({
|
|
1272
|
-
pure,
|
|
1273
|
-
theme,
|
|
1274
|
-
color
|
|
1275
|
-
}) => pure ? void 0 : {
|
|
1276
|
-
background: polished.transparentize(0.8, color ? theme[color] || theme.text : theme.text)
|
|
1277
|
-
}, ({
|
|
1278
|
-
disabled,
|
|
1279
|
-
theme
|
|
1280
|
-
}) => disabled ? styledComponents.css(["color:", ";cursor:default;&:hover{background:transparent;text-decoration:none;}"], polished.transparentize(0.75, theme.textDark)) : void 0);
|
|
1281
|
-
|
|
1282
|
-
const ButtonGroup = styledComponents.styled.div.withConfig({
|
|
1283
|
-
displayName: "ButtonGroup",
|
|
1284
|
-
componentId: "sc-b4d11t-0"
|
|
1285
|
-
})(["display:inline-block;&:not(:last-child){margin-right:0.5rem;}", "{margin:0;border-radius:0;&:hover{z-index:1;}&:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px;}&:not(:first-child){margin-left:-1px;}&:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;}}"], Button);
|
|
1286
|
-
|
|
1287
|
-
const stripedStyle = /* @__PURE__ */ styledComponents.css(["tbody > tr:nth-child(odd){background-color:rgba(0,0,0,0.02);}"]);
|
|
1288
|
-
const hoverStyle = /* @__PURE__ */ styledComponents.css(["tbody > tr:hover{background-color:rgba(0,0,0,0.04);}"]);
|
|
1289
|
-
function shouldForwardProp$1(name) {
|
|
1290
|
-
return name !== "size" && name !== "full" && name !== "headerStyle" && name !== "bordered" && name !== "striped" && name !== "hover";
|
|
1291
|
-
}
|
|
1292
|
-
const index$1 = styledComponents.styled.table.withConfig({
|
|
1293
|
-
shouldForwardProp: shouldForwardProp$1
|
|
1294
|
-
}).withConfig({
|
|
1295
|
-
displayName: "Table",
|
|
1296
|
-
componentId: "sc-1x2nuaf-0"
|
|
1297
|
-
})(["", " max-width:100%;margin-bottom:1rem;background-color:transparent;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;td,th{vertical-align:top;padding:0.75rem;", " border-width:0 0 1px;}th{white-space:nowrap;}", " ", " ", ""], ({
|
|
1298
|
-
full
|
|
1299
|
-
}) => full ? styledComponents.css(["width:100%;"]) : void 0, ({
|
|
1300
|
-
theme,
|
|
1301
|
-
bordered
|
|
1302
|
-
}) => bordered ? styledComponents.css(["border:1px solid ", ";"], theme.border) : void 0, ({
|
|
1303
|
-
striped
|
|
1304
|
-
}) => striped ? stripedStyle : void 0, ({
|
|
1305
|
-
hover
|
|
1306
|
-
}) => hover ? hoverStyle : void 0, ({
|
|
1307
|
-
headerStyle
|
|
1308
|
-
}) => headerStyle ? styledComponents.css(["th{", "}"], headerStyle) : void 0);
|
|
1309
|
-
|
|
1310
|
-
function Progress({
|
|
1311
|
-
value,
|
|
1312
|
-
max,
|
|
1313
|
-
color = "primary",
|
|
1314
|
-
height,
|
|
1315
|
-
size,
|
|
1316
|
-
...rest
|
|
1317
|
-
}) {
|
|
1318
|
-
const percent = React.useMemo(() => value ? Math.round(value / max * 100) : 0, [value, max]);
|
|
1319
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { $color: color, $height: height, $size: size, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: "progressbar", "aria-label": "progress", className: value !== max ? "in-progress" : void 0, style: {
|
|
1320
|
-
width: `${percent > 100 ? 100 : percent}%`
|
|
1321
|
-
} }) });
|
|
1028
|
+
}, [margin, position]);
|
|
1029
|
+
const name = react.useMemo(() => clsx8__default.default(
|
|
1030
|
+
"flex flex-col z-40 overflow-hidden",
|
|
1031
|
+
className
|
|
1032
|
+
), [className]);
|
|
1033
|
+
const isInvertedOrder = react.useMemo(() => position?.startsWith("bottom") || false, [position]);
|
|
1034
|
+
const data = react.useRef(/* @__PURE__ */ new Map());
|
|
1035
|
+
const [order, setOrder] = react.useState([]);
|
|
1036
|
+
const update = react.useState(0)[1];
|
|
1037
|
+
useIsomorphicLayoutEffect_default(() => observer_default.subscribe((payload) => {
|
|
1038
|
+
react.startTransition(() => {
|
|
1039
|
+
if (payload.type === "add") {
|
|
1040
|
+
data.current.set(payload.id, payload.config);
|
|
1041
|
+
setOrder((prev) => [...prev, payload.id]);
|
|
1042
|
+
} else if (payload.type === "remove") {
|
|
1043
|
+
const isDeleted = data.current.delete(payload.id);
|
|
1044
|
+
if (!isDeleted) return;
|
|
1045
|
+
setOrder((prev) => {
|
|
1046
|
+
const next = new Set(prev);
|
|
1047
|
+
if (!next.has(payload.id)) return prev;
|
|
1048
|
+
next.delete(payload.id);
|
|
1049
|
+
return Array.from(next);
|
|
1050
|
+
});
|
|
1051
|
+
} else if (payload.type === "update") {
|
|
1052
|
+
const d = data.current.get(payload.id);
|
|
1053
|
+
if (!d) return;
|
|
1054
|
+
data.current.set(payload.id, { ...d, ...payload.config });
|
|
1055
|
+
update((prev) => prev + 1);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
}), []);
|
|
1059
|
+
const size = order.length;
|
|
1060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: name, style, "aria-live": "polite", children: order.map((id, i) => {
|
|
1061
|
+
const item = data.current.get(id);
|
|
1062
|
+
if (!item) return null;
|
|
1063
|
+
const { className: innerClass, duration, ...props } = item;
|
|
1064
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
|
+
ToastContainer,
|
|
1066
|
+
{
|
|
1067
|
+
id,
|
|
1068
|
+
index: size - i,
|
|
1069
|
+
className: innerClass,
|
|
1070
|
+
duration,
|
|
1071
|
+
inverted: isInvertedOrder,
|
|
1072
|
+
max,
|
|
1073
|
+
children: react.createElement(ListItem, props)
|
|
1074
|
+
},
|
|
1075
|
+
id
|
|
1076
|
+
);
|
|
1077
|
+
}) }) });
|
|
1322
1078
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
theme
|
|
1330
|
-
}) => theme.background, ({
|
|
1331
|
-
$size,
|
|
1332
|
-
$height
|
|
1333
|
-
}) => $height || setSize("height", $size), ({
|
|
1334
|
-
theme
|
|
1335
|
-
}) => theme.radius, ({
|
|
1336
|
-
$color,
|
|
1337
|
-
theme
|
|
1338
|
-
}) => theme[$color] || $color);
|
|
1339
|
-
|
|
1340
|
-
const index = styledComponents.styled.hr.withConfig({
|
|
1341
|
-
displayName: "Divider",
|
|
1342
|
-
componentId: "sc-13lwfus-0"
|
|
1343
|
-
})(["border:none;height:1px;margin:0;flex-shrink:0;background-color:", ";"], ({
|
|
1344
|
-
theme
|
|
1345
|
-
}) => theme.border);
|
|
1346
|
-
|
|
1347
|
-
function Close(props) {
|
|
1348
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
|
|
1349
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M25.999 26l-12.5-12.5L25.999 1" }),
|
|
1350
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 26l12.5-12.5L1 1" })
|
|
1351
|
-
] }) });
|
|
1079
|
+
function Skeleton({ className, ...props }) {
|
|
1080
|
+
const name = react.useMemo(() => merge(
|
|
1081
|
+
"inline-block animate-pulse rounded-md bg-accent",
|
|
1082
|
+
className
|
|
1083
|
+
), [className]);
|
|
1084
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: name, ...props });
|
|
1352
1085
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1086
|
+
function ButtonGroup({ className, ...rest }) {
|
|
1087
|
+
const name = react.useMemo(() => clsx8__default.default(
|
|
1088
|
+
"flex items-center justify-center",
|
|
1089
|
+
"[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr",
|
|
1090
|
+
"[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",
|
|
1091
|
+
className
|
|
1092
|
+
), [className]);
|
|
1093
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", className: name, ...rest });
|
|
1356
1094
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1095
|
+
function Progress({ value, max, className, ...rest }) {
|
|
1096
|
+
const percent = react.useMemo(() => value ? Math.round(value / max * 100) : 0, [value, max]);
|
|
1097
|
+
const name = react.useMemo(() => merge("relative overflow-hidden rounded-full bg-primary", className), [className]);
|
|
1098
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "progressbar", className: name, "aria-valuemax": max, "aria-valuemin": 0, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1099
|
+
"div",
|
|
1100
|
+
{
|
|
1101
|
+
className: "h-full w-full flex-1 bg-input transition-all origin-right",
|
|
1102
|
+
style: { transform: `translateX(${percent > 100 ? 100 : percent}%)` }
|
|
1103
|
+
}
|
|
1104
|
+
) });
|
|
1360
1105
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
theme,
|
|
1368
|
-
round
|
|
1369
|
-
}) => round ? "50rem" : theme.radius, ({
|
|
1370
|
-
color,
|
|
1371
|
-
theme
|
|
1372
|
-
}) => {
|
|
1373
|
-
const target = getColor(theme, color);
|
|
1374
|
-
const invertColor = findColorInvert(theme, target);
|
|
1375
|
-
return styledComponents.css(["color:", ";background-color:", ";a,span{color:", ";}"], invertColor, target, invertColor);
|
|
1376
|
-
}, TextButton, ({
|
|
1377
|
-
theme,
|
|
1378
|
-
round
|
|
1379
|
-
}) => round ? "50rem" : theme.radius, ({
|
|
1380
|
-
theme,
|
|
1381
|
-
round
|
|
1382
|
-
}) => round ? "50rem" : theme.radius, ({
|
|
1383
|
-
close
|
|
1384
|
-
}) => close ? closeCss : void 0);
|
|
1385
|
-
function Tag({
|
|
1386
|
-
children,
|
|
1387
|
-
onClose,
|
|
1388
|
-
...rest
|
|
1389
|
-
}) {
|
|
1390
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper, { close: !!onClose, ...rest, children: [
|
|
1391
|
-
children,
|
|
1392
|
-
onClose && /* @__PURE__ */ jsxRuntime.jsx(TextButton, { onClick: onClose, pure: true, children: /* @__PURE__ */ jsxRuntime.jsx(Close, {}) })
|
|
1393
|
-
] });
|
|
1106
|
+
function Divider({ className, orientation = "horizontal", ...props }) {
|
|
1107
|
+
const name = react.useMemo(() => merge(clsx8__default.default(
|
|
1108
|
+
"border-0 p-0 shrink-0 bg-input",
|
|
1109
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "w-[1px] h-full"
|
|
1110
|
+
), className), [className, orientation]);
|
|
1111
|
+
return /* @__PURE__ */ jsxRuntime.jsx("hr", { className: name, role: "none", ...props });
|
|
1394
1112
|
}
|
|
1395
|
-
|
|
1396
|
-
function Approved(props) {
|
|
1113
|
+
function IconChevronRound(props) {
|
|
1397
1114
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
|
|
1398
1115
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
|
|
1399
1116
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
|
|
1400
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1117
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1118
|
+
"path",
|
|
1119
|
+
{
|
|
1120
|
+
d: "M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",
|
|
1121
|
+
fill: "currentColor"
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1401
1124
|
] }),
|
|
1402
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
] }),
|
|
1412
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.066 8.5l-7.567 6.731 7.567 6.2", fill: "none", stroke: "currentColor", strokeWidth: "2" })
|
|
1413
|
-
] });
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
function ChevronRightRound(props) {
|
|
1417
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
|
|
1418
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
|
|
1419
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1z" }),
|
|
1420
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28m0 2C6.716 30 0 23.284 0 15 0 6.716 6.716 0 15 0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15z", fill: "currentColor" })
|
|
1421
|
-
] }),
|
|
1422
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.934 21.5l7.567-6.731-7.567-6.2", fill: "none", stroke: "currentColor", strokeWidth: "2" })
|
|
1125
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1126
|
+
"path",
|
|
1127
|
+
{
|
|
1128
|
+
d: "M18.066 8.5l-7.567 6.731 7.567 6.2",
|
|
1129
|
+
fill: "none",
|
|
1130
|
+
stroke: "currentColor",
|
|
1131
|
+
strokeWidth: "2"
|
|
1132
|
+
}
|
|
1133
|
+
)
|
|
1423
1134
|
] });
|
|
1424
1135
|
}
|
|
1425
|
-
|
|
1426
1136
|
function FileRound(props) {
|
|
1427
1137
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
|
|
1428
1138
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", children: [
|
|
1429
1139
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
|
|
1430
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1140
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1141
|
+
"path",
|
|
1142
|
+
{
|
|
1143
|
+
d: "M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",
|
|
1144
|
+
fill: "currentColor"
|
|
1145
|
+
}
|
|
1146
|
+
)
|
|
1431
1147
|
] }),
|
|
1432
1148
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(9 7)", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1433
1149
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "12", height: "16", rx: "1", stroke: "none" }),
|
|
1434
1150
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1h10v14H1z" })
|
|
1435
1151
|
] }),
|
|
1436
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1152
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1153
|
+
"path",
|
|
1154
|
+
{
|
|
1155
|
+
fill: "currentColor",
|
|
1156
|
+
d: "M13 11h4v1.3h-4zM13 14h4v1.3h-4zM13 17h4v1.3h-4z"
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1437
1159
|
] });
|
|
1438
1160
|
}
|
|
1439
|
-
|
|
1440
1161
|
function Pencil(props) {
|
|
1441
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17.796", height: "17.908", viewBox: "0 0 17.796 17.908", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1162
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17.796", height: "17.908", viewBox: "0 0 17.796 17.908", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1163
|
+
"path",
|
|
1164
|
+
{
|
|
1165
|
+
d: "M1.254 12.674L.5 17.408l4.726-.8L17.3 4.472 13.281.5zM1.375 12.766l3.851 3.838M10.949 2.959l3.836 3.801",
|
|
1166
|
+
fill: "none",
|
|
1167
|
+
stroke: "currentColor"
|
|
1168
|
+
}
|
|
1169
|
+
) });
|
|
1446
1170
|
}
|
|
1447
|
-
|
|
1448
1171
|
function User(props) {
|
|
1449
1172
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: [
|
|
1450
1173
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1451
1174
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "15", r: "15", stroke: "none" }),
|
|
1452
1175
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "15", r: "14" })
|
|
1453
1176
|
] }),
|
|
1454
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1178
|
+
"path",
|
|
1179
|
+
{
|
|
1180
|
+
d: "M8 23a6.018 6.018 0 016-6h2a6.018 6.018 0 016 6zm2.6-2h8.9a4.033 4.033 0 00-3.5-2h-1.9a4.035 4.035 0 00-3.5 2zm.4-9v-1a4.012 4.012 0 014-4 4.012 4.012 0 014 4v1a4.012 4.012 0 01-4 4 4.012 4.012 0 01-4-4zm2-1v1a2.006 2.006 0 002 2 2.006 2.006 0 002-2v-1a2.006 2.006 0 00-2-2 2.006 2.006 0 00-2 2z",
|
|
1181
|
+
fill: "currentColor"
|
|
1182
|
+
}
|
|
1183
|
+
)
|
|
1455
1184
|
] });
|
|
1456
1185
|
}
|
|
1457
|
-
|
|
1458
1186
|
function Refresh(props) {
|
|
1459
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1187
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1188
|
+
"path",
|
|
1189
|
+
{
|
|
1190
|
+
d: "M15.065 0A15.069 15.069 0 00.142 13.105a1.256 1.256 0 102.478.406c0-.027.008-.055.01-.082a12.52 12.52 0 0121.3-7.226l-2.584 2.584 7.532 1.255-1.255-7.532-1.92 1.92A15 15 0 0015.065 0zm13.7 15.589A1.255 1.255 0 0027.5 16.7a12.512 12.512 0 01-21.893 6.569l1.927-1.927L0 20.086l1.255 7.532 2.572-2.572a15.02 15.02 0 0026.16-8.023 1.256 1.256 0 00-1.064-1.423 1.273 1.273 0 00-.16-.011z",
|
|
1191
|
+
fill: "currentColor"
|
|
1192
|
+
}
|
|
1193
|
+
) });
|
|
1460
1194
|
}
|
|
1461
|
-
|
|
1462
1195
|
function Plus(props) {
|
|
1463
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1196
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "30", height: "30", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "16.5", y: "9", width: "14", height: "1", rx: ".5", transform: "rotate(90 16.5 9)", fill: "currentColor" }),
|
|
1198
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "15.5", width: "14", height: "1", rx: ".5", fill: "currentColor" })
|
|
1199
|
+
] });
|
|
1464
1200
|
}
|
|
1465
1201
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
smallGutter: 16,
|
|
1471
|
-
media: {
|
|
1472
|
-
mobile: "576px",
|
|
1473
|
-
tablet: "769px",
|
|
1474
|
-
desktop: "960px",
|
|
1475
|
-
fullhd: "1344px"
|
|
1476
|
-
},
|
|
1477
|
-
radius: "4px",
|
|
1478
|
-
timeout: 250,
|
|
1479
|
-
formPadding: "0.75rem 0.625rem",
|
|
1480
|
-
primary: "#37B151",
|
|
1481
|
-
link: "#578ba9",
|
|
1482
|
-
info: "#209cee",
|
|
1483
|
-
success: "#0fa886",
|
|
1484
|
-
warning: "#f2b541",
|
|
1485
|
-
danger: "#f3575a",
|
|
1486
|
-
dark: "#363636",
|
|
1487
|
-
light: "#9b9b9b",
|
|
1488
|
-
black: "#0a0a0a",
|
|
1489
|
-
blackBis: "#121212",
|
|
1490
|
-
blackTer: "#242424",
|
|
1491
|
-
white: "#ffffff",
|
|
1492
|
-
whiteBis: "#fafafa",
|
|
1493
|
-
whiteTer: "#f5f5f5",
|
|
1494
|
-
grey: "#7a7a7a",
|
|
1495
|
-
greyLight: "#9b9b9b",
|
|
1496
|
-
greyLighter: "#dbdbdb",
|
|
1497
|
-
text: "#4a4a4a",
|
|
1498
|
-
textDark: "#4a4a4a",
|
|
1499
|
-
textLight: "#7a7a7a",
|
|
1500
|
-
textStrong: "#4a4a4a",
|
|
1501
|
-
background: "#f5f5f5",
|
|
1502
|
-
border: "#dbdbdb",
|
|
1503
|
-
borderHover: "#9b9b9b",
|
|
1504
|
-
borderActive: "#4a4a4a",
|
|
1505
|
-
placeholder: "#7a7a7a",
|
|
1506
|
-
backdrop: "rgba(10,10,10,0.25)",
|
|
1507
|
-
responsive: true
|
|
1508
|
-
};
|
|
1509
|
-
const theme$1 = theme;
|
|
1510
|
-
|
|
1511
|
-
/*! based on normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
|
|
1512
|
-
const normalized = /* @__PURE__ */ styledComponents.css(["*,::after,::before{box-sizing:border-box;}html{line-height:1.15;-webkit-text-size-adjust:100%;-ms-overflow-style:scrollbar;}body{margin:0;font-family:", ";font-size:", ";text-align:left;}h1{font-size:2em;margin:.67em 0;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace,monospace;font-size:1em;}a{background-color:transparent;color:", ';}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder;}code,kbd,samp{font-family:monospace,monospace;font-size:1em;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sub{bottom:-.25em;}sup{top:-.5em;}img{border-style:none;}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible;}button,select{text-transform:none;}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0;}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText;}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox;}fieldset{padding:.35em .75em .625em;}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline;resize:vertical;}textarea{overflow:auto;}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto;}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none;}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block;}summary{display:list-item;}template{display:none;}[hidden]{display:none;}blockquote,body,dd,dl,dt,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,html,iframe,legend,li,ol,p,pre,textarea,ul{margin:0;padding:0;}button{font-size:inherit;}article,aside,figure,footer,header,hgroup,section{display:block;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}a{cursor:pointer;text-decoration:none;color:#3273dc;&:hover{color:currentColor;}}img{vertical-align:middle;border-style:none;}svg{overflow:hidden;vertical-align:middle;}small{font-size:.875em;}span{font-style:inherit;font-weight:inherit;}strong{color:#363636;font-weight:700;}table{border-collapse:collapse;border-spacing:0;}th{text-align:inherit;}ul{list-style-type:none;}'], ({
|
|
1513
|
-
theme
|
|
1514
|
-
}) => theme ? theme.fontFamily : "sans-serif", ({
|
|
1515
|
-
theme
|
|
1516
|
-
}) => theme ? theme.fontSize : "16px", ({
|
|
1517
|
-
theme
|
|
1518
|
-
}) => theme.link);
|
|
1519
|
-
const normalized$1 = normalized;
|
|
1520
|
-
|
|
1202
|
+
Object.defineProperty(exports, "clsx", {
|
|
1203
|
+
enumerable: true,
|
|
1204
|
+
get: function () { return clsx8__default.default; }
|
|
1205
|
+
});
|
|
1521
1206
|
exports.Accordion = Accordion;
|
|
1522
|
-
exports.AppBar = AppBar;
|
|
1523
|
-
exports.Box = Box;
|
|
1524
1207
|
exports.Button = Button;
|
|
1525
1208
|
exports.ButtonGroup = ButtonGroup;
|
|
1526
|
-
exports.Checkbox = Checkbox
|
|
1527
|
-
exports.
|
|
1528
|
-
exports.
|
|
1529
|
-
exports.
|
|
1530
|
-
exports.
|
|
1531
|
-
exports.
|
|
1209
|
+
exports.Checkbox = Checkbox;
|
|
1210
|
+
exports.Dialog = Dialog;
|
|
1211
|
+
exports.Divider = Divider;
|
|
1212
|
+
exports.FormField = Field;
|
|
1213
|
+
exports.FormLabel = FormLabel;
|
|
1214
|
+
exports.IconAlert = Alert;
|
|
1532
1215
|
exports.IconApproved = Approved;
|
|
1533
1216
|
exports.IconArrowDown = ChevronDown;
|
|
1534
|
-
exports.
|
|
1535
|
-
exports.
|
|
1217
|
+
exports.IconCaution = Caution;
|
|
1218
|
+
exports.IconCheck = Check;
|
|
1219
|
+
exports.IconChevronRound = IconChevronRound;
|
|
1536
1220
|
exports.IconClose = Close;
|
|
1537
1221
|
exports.IconFileRound = FileRound;
|
|
1538
1222
|
exports.IconPencil = Pencil;
|
|
1539
|
-
exports.IconPencilSimple = PencilSimple;
|
|
1540
1223
|
exports.IconPlus = Plus;
|
|
1541
1224
|
exports.IconRefresh = Refresh;
|
|
1542
1225
|
exports.IconUser = User;
|
|
1543
|
-
exports.
|
|
1544
|
-
exports.
|
|
1545
|
-
exports.
|
|
1546
|
-
exports.
|
|
1226
|
+
exports.Input = Input_default;
|
|
1227
|
+
exports.InputField = InputField;
|
|
1228
|
+
exports.Placeholder = Skeleton;
|
|
1229
|
+
exports.Popover = Popover_default;
|
|
1230
|
+
exports.Portal = Portal;
|
|
1547
1231
|
exports.Progress = Progress;
|
|
1548
|
-
exports.Radio = Radio
|
|
1549
|
-
exports.
|
|
1550
|
-
exports.
|
|
1551
|
-
exports.Spinner = Spinner
|
|
1552
|
-
exports.Switch =
|
|
1553
|
-
exports.
|
|
1554
|
-
exports.Tag = Tag;
|
|
1555
|
-
exports.TextButton = TextButton;
|
|
1556
|
-
exports.TextInput = TextInput$1;
|
|
1557
|
-
exports.Textarea = Textarea$1;
|
|
1232
|
+
exports.Radio = Radio;
|
|
1233
|
+
exports.Select = Select;
|
|
1234
|
+
exports.Sheet = Sheet;
|
|
1235
|
+
exports.Spinner = Spinner;
|
|
1236
|
+
exports.Switch = Switch_default;
|
|
1237
|
+
exports.Textarea = Textarea_default;
|
|
1558
1238
|
exports.Toast = Toast;
|
|
1559
|
-
exports.
|
|
1560
|
-
exports.
|
|
1561
|
-
exports.
|
|
1562
|
-
exports.
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
exports.mediaDesktop = mediaDesktop;
|
|
1566
|
-
exports.mediaFullHD = mediaFullHD;
|
|
1567
|
-
exports.mediaMobile = mediaMobile;
|
|
1568
|
-
exports.mediaTablet = mediaTablet;
|
|
1569
|
-
exports.mediaUntilFullHD = mediaUntilFullHD;
|
|
1570
|
-
exports.normalizeStyle = normalized$1;
|
|
1571
|
-
exports.setSize = setSize;
|
|
1239
|
+
exports.ToastItem = ToastItem;
|
|
1240
|
+
exports.Tooltip = Tooltip_default;
|
|
1241
|
+
exports.merge = merge;
|
|
1242
|
+
exports.toast = observer_default;
|
|
1243
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
1244
|
+
//# sourceMappingURL=index.cjs.js.map
|