@stamcat/craftsman 0.0.23-alpha.9 → 0.0.24
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/AGENTS.md +216 -6
- package/Components.d.ts +2 -0
- package/Components.esm.js +20 -5
- package/Styles.d.ts +2 -0
- package/Styles.esm.js +8 -0
- package/Utilities.d.ts +2 -0
- package/Utilities.esm.js +2 -0
- package/_virtual/_rolldown/runtime.esm.js +11 -0
- package/package.json +42 -15
- package/{components → src/components}/Button.d.ts +2 -2
- package/src/components/Button.esm.js +23 -16
- package/src/components/Button.module.css +1 -0
- package/src/components/Button.module.esm.js +9 -0
- package/src/components/Button.module.scss +5 -0
- package/src/components/Checkbox.d.ts +7 -0
- package/src/components/Checkbox.esm.js +10 -0
- package/src/components/Input.d.ts +11 -0
- package/src/components/Input.esm.js +38 -3
- package/src/components/Input.module.css +1 -0
- package/src/components/Input.module.esm.js +11 -0
- package/src/components/Input.module.scss +141 -0
- package/src/components/InputPassword.d.ts +6 -0
- package/src/components/InputPassword.esm.js +32 -0
- package/{components → src/components}/Loader.d.ts +1 -2
- package/src/components/Loader.esm.js +15 -14
- package/{components → src/components}/Modal.d.ts +2 -3
- package/src/components/Modal.esm.js +40 -135
- package/src/components/Modal.module.css +1 -0
- package/src/components/Modal.module.esm.js +13 -0
- package/src/components/Modal.module.scss +133 -0
- package/src/components/RadioButton.d.ts +7 -0
- package/src/components/RadioButton.esm.js +10 -0
- package/{components → src/components}/index.d.ts +3 -0
- package/src/styles/components/ThemeProvider.d.ts +7 -0
- package/src/styles/components/ThemeProvider.esm.js +8 -0
- package/src/styles/global/components/_button.scss +64 -0
- package/src/styles/global/components/_checkbox.scss +78 -0
- package/src/styles/global/components/_code.scss +19 -0
- package/src/styles/global/components/_input.scss +46 -0
- package/src/styles/global/components/_mixins.scss +2 -0
- package/src/styles/global/components/_modal.scss +9 -0
- package/src/styles/global/components/_radioButton.scss +33 -0
- package/src/styles/global/components/_typography.scss +7 -0
- package/{styles → src/styles}/global/components/button.d.ts +1 -2
- package/{styles → src/styles}/global/components/loaders.d.ts +3 -5
- package/src/styles/global/components/loaders.esm.js +44 -55
- package/src/styles/global/components/loaders.module.css +1 -1
- package/src/styles/global/components/loaders.module.esm.js +15 -19
- package/src/styles/global/components/loaders.module.scss +73 -67
- package/src/styles/global/globalStyles.d.ts +1 -0
- package/src/styles/global/globalStyles.esm.js +4 -0
- package/src/styles/global/globalStyles.module.scss +129 -0
- package/src/styles/global/variables.esm.js +11 -0
- package/src/styles/index.d.ts +7 -0
- package/src/styles/theme/components.esm.js +12 -0
- package/src/styles/theme/constants.esm.js +4 -0
- package/src/styles/theme/theme.d.ts +2 -0
- package/src/styles/theme/theme.esm.js +56 -0
- package/{styles → src/styles}/theme/types.d.ts +10 -3
- package/src/styles/theme/utilities.d.ts +3 -0
- package/src/styles/theme/utilities.esm.js +48 -0
- package/src/styles/utilities/color.d.ts +174 -0
- package/src/styles/utilities/color.esm.js +4 -8
- package/src/styles/utilities/constants.d.ts +172 -0
- package/src/styles/utilities/constants.esm.js +175 -71
- package/{styles → src/styles}/utilities/layout.d.ts +6 -4
- package/src/styles/utilities/layout.esm.js +28 -29
- package/src/styles/utilities/types.d.ts +85 -0
- package/src/styles/utilities/types.esm.js +54 -0
- package/src/utilities/index.d.ts +1 -0
- package/src/utilities/validations.esm.js +9 -0
- package/components/Input.d.ts +0 -2
- package/src/styles/utilities/config.esm.js +0 -25
- package/stories/Button.stories.d.ts +0 -15
- package/stories/Colors.stories.d.ts +0 -5
- package/stories/Icons.stories.d.ts +0 -36
- package/stories/Loaders.stories.d.ts +0 -6
- package/stories/Modal.stories.d.ts +0 -8
- package/stories/Toastify.stories.d.ts +0 -7
- package/stories/Typography.stories.d.ts +0 -6
- package/styles/global/components/code.d.ts +0 -1
- package/styles/global/components/typography.d.ts +0 -11
- package/styles/global/globalStyles.d.ts +0 -1
- package/styles/theme/theme.d.ts +0 -8
- package/styles/theme/utilities.d.ts +0 -2
- package/styles/utilities/color.d.ts +0 -5
- package/styles/utilities/config.d.ts +0 -7
- package/styles/utilities/constants.d.ts +0 -77
- package/styles/utilities/types.d.ts +0 -17
- /package/{components → src/components}/Progress.d.ts +0 -0
- /package/{main.d.ts → src/main.d.ts} +0 -0
- /package/{styles → src/styles}/global/variables.d.ts +0 -0
- /package/{styles → src/styles}/theme/components.d.ts +0 -0
- /package/{styles → src/styles}/theme/constants.d.ts +0 -0
- /package/{utilities → src/utilities}/validations.d.ts +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@use "../styles/global/components/input";
|
|
2
|
+
|
|
3
|
+
.wrapper {
|
|
4
|
+
label {
|
|
5
|
+
.inputLabel {
|
|
6
|
+
margin-bottom: calc(var(--w-gutter, 16px) * 0.25);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&[data-required="true"] {
|
|
11
|
+
label {
|
|
12
|
+
.inputLabel {
|
|
13
|
+
&::after {
|
|
14
|
+
content: "*";
|
|
15
|
+
color: var(--red700);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-label-position="left"] {
|
|
22
|
+
label {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
|
|
26
|
+
.inputLabel {
|
|
27
|
+
width: fit-content;
|
|
28
|
+
margin-right: calc(var(--w-gutter, 16px) * 0.75);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[data-label-position="bottom"] {
|
|
34
|
+
label {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
flex-direction: column-reverse;
|
|
37
|
+
align-items: flex-start;
|
|
38
|
+
|
|
39
|
+
.inputLabel {
|
|
40
|
+
margin-bottom: 0;
|
|
41
|
+
margin-top: calc(var(--w-gutter, 16px) * 0.25);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&[data-label-position="right"] {
|
|
47
|
+
label {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
flex-direction: row-reverse;
|
|
50
|
+
align-items: baseline;
|
|
51
|
+
|
|
52
|
+
.inputLabel {
|
|
53
|
+
margin-left: calc(var(--w-gutter, 16px) * 0.25);
|
|
54
|
+
margin-bottom: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&[data-label-position="inside"] {
|
|
60
|
+
@extend %inside-input-label-base;
|
|
61
|
+
|
|
62
|
+
.inputLabel {
|
|
63
|
+
position: absolute;
|
|
64
|
+
background-color: var(--white);
|
|
65
|
+
z-index: 1;
|
|
66
|
+
width: fit-content;
|
|
67
|
+
padding: 0 5px;
|
|
68
|
+
top: calc(var(--w-gutter, 16px) * 0.25);
|
|
69
|
+
left: calc(var(--w-gutter, 16px) * 0.25);
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
transition: top 150ms ease, left 150ms ease, font-size 150ms ease, color 150ms ease;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
> label > .inputField > .input,
|
|
75
|
+
> .input {
|
|
76
|
+
transition: border-color 200ms ease;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:focus-within {
|
|
80
|
+
.inputLabel {
|
|
81
|
+
@extend %inside-input-label-floating;
|
|
82
|
+
color: var(--blue500);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.input {
|
|
86
|
+
border-color: var(--blue500);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.input::placeholder {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:has(.input:not(:placeholder-shown)),
|
|
95
|
+
&:has(.input:-webkit-autofill),
|
|
96
|
+
&[data-has-input="true"] {
|
|
97
|
+
.inputLabel {
|
|
98
|
+
@extend %inside-input-label-floating;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.input[type="tel"] {
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.input::placeholder {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
transition: opacity 200ms ease;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.inputField {
|
|
114
|
+
position: relative;
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
|
|
118
|
+
&[data-has-end-adornment="true"] {
|
|
119
|
+
> .input {
|
|
120
|
+
width: 100%;
|
|
121
|
+
padding-right: calc(calc(var(--w-gutter, 16px) * 0.5) + 24px + calc(var(--w-gutter, 16px) * 0.5));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.inputAdornment {
|
|
127
|
+
position: absolute;
|
|
128
|
+
right: calc(var(--w-gutter, 16px) * 0.5);
|
|
129
|
+
top: 50%;
|
|
130
|
+
transform: translateY(-50%);
|
|
131
|
+
margin-top: 0;
|
|
132
|
+
z-index: 1;
|
|
133
|
+
display: inline-flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.error {
|
|
138
|
+
margin-top: calc(var(--w-gutter, 16px) * 0.25);
|
|
139
|
+
font-size: calc(var(--w-text, 14px) * 0.75);
|
|
140
|
+
color: var(--red600);
|
|
141
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TextInputType } from '../styles/utilities/types';
|
|
2
|
+
import { InputProps } from './Input';
|
|
3
|
+
export type InputPasswordProps = React.ComponentProps<"input"> & {} & Omit<InputProps, "type" | "endAdornment"> & {
|
|
4
|
+
type?: Extract<TextInputType, "password">;
|
|
5
|
+
};
|
|
6
|
+
export declare const InputPassword: React.FC<InputPasswordProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button as e } from "./Button.esm.js";
|
|
2
|
+
import { Input as t } from "./Input.esm.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { ImEye as i, ImEyeBlocked as a } from "react-icons/im";
|
|
6
|
+
//#region src/components/InputPassword.tsx
|
|
7
|
+
var o = {
|
|
8
|
+
padding: 0,
|
|
9
|
+
display: "inline-flex",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
lineHeight: 1
|
|
12
|
+
}, s = ({ visible: t, onToggle: r }) => /* @__PURE__ */ n(e, {
|
|
13
|
+
type: "button",
|
|
14
|
+
variant: "text",
|
|
15
|
+
onClick: r,
|
|
16
|
+
"aria-label": t ? "Hide password" : "Show password",
|
|
17
|
+
"aria-pressed": t,
|
|
18
|
+
styles: o,
|
|
19
|
+
children: n(t ? i : a, { size: 16 })
|
|
20
|
+
}), c = ({ type: e = "password", ...i }) => {
|
|
21
|
+
let [a, o] = r(!1), c = a ? "text" : e;
|
|
22
|
+
return /* @__PURE__ */ n(t, {
|
|
23
|
+
...i,
|
|
24
|
+
type: c,
|
|
25
|
+
endAdornment: /* @__PURE__ */ n(s, {
|
|
26
|
+
visible: a,
|
|
27
|
+
onToggle: () => o((e) => !e)
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { c as InputPassword };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { LoaderStyle } from '../styles/global/components/loaders';
|
|
2
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
2
|
export type LoaderProps = React.ComponentProps<"div"> & {
|
|
4
3
|
type: LoaderStyle;
|
|
5
4
|
color?: string;
|
|
6
5
|
width?: number;
|
|
7
|
-
styles?:
|
|
6
|
+
styles?: React.CSSProperties;
|
|
8
7
|
};
|
|
9
8
|
export declare const Loader: React.FC<LoaderProps>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import t from "../styles/global/components/loaders.
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
1
|
+
import { isEmpty as e } from "../utilities/validations.esm.js";
|
|
2
|
+
import { loaders as t } from "../styles/global/components/loaders.esm.js";
|
|
3
|
+
import n from "../styles/global/components/loaders.module.esm.js";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/Loader.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
...
|
|
7
|
+
var a = (a) => {
|
|
8
|
+
let { type: o, color: s = "black", width: c, styles: l, className: u, style: d, ...f } = a, p = e(l) ? void 0 : l, m = t[o](s, c);
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: r(n[o], u),
|
|
11
|
+
style: {
|
|
12
|
+
...m,
|
|
13
|
+
...p,
|
|
14
|
+
...d
|
|
15
|
+
},
|
|
16
|
+
...f
|
|
16
17
|
});
|
|
17
18
|
};
|
|
18
19
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
2
|
export type ModalType = "dialog" | "panel";
|
|
4
3
|
export interface ModalProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
5
4
|
visible?: boolean;
|
|
@@ -9,7 +8,7 @@ export interface ModalProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
|
9
8
|
backgroundDismiss?: boolean;
|
|
10
9
|
hideDismissIcon?: boolean;
|
|
11
10
|
footer?: React.ReactNode;
|
|
12
|
-
styles?:
|
|
11
|
+
styles?: React.CSSProperties;
|
|
13
12
|
}
|
|
14
13
|
type ModalState = {
|
|
15
14
|
isClosing: boolean;
|
|
@@ -18,6 +17,6 @@ export declare class Modal extends React.PureComponent<ModalProps, ModalState> {
|
|
|
18
17
|
readonly state: ModalState;
|
|
19
18
|
onDismiss: () => void;
|
|
20
19
|
onClickBackground: () => void;
|
|
21
|
-
render(): React.JSX.Element
|
|
20
|
+
render(): React.JSX.Element;
|
|
22
21
|
}
|
|
23
22
|
export {};
|
|
@@ -1,120 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import u from "react";
|
|
1
|
+
import { isEmpty as e } from "../utilities/validations.esm.js";
|
|
2
|
+
import { color as t } from "../styles/utilities/color.esm.js";
|
|
3
|
+
import { Button as n } from "./Button.esm.js";
|
|
4
|
+
import r from "./Modal.module.esm.js";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import s from "react";
|
|
7
|
+
import { LuX as c } from "react-icons/lu";
|
|
9
8
|
//#region src/components/Modal.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
to {
|
|
22
|
-
opacity: 0;
|
|
23
|
-
}
|
|
24
|
-
`, p = a`
|
|
25
|
-
from {
|
|
26
|
-
transform: translateY(100%);
|
|
27
|
-
}
|
|
28
|
-
to {
|
|
29
|
-
transform: translateY(0);
|
|
30
|
-
}
|
|
31
|
-
`, m = a`
|
|
32
|
-
from {
|
|
33
|
-
transform: translateY(0);
|
|
34
|
-
}
|
|
35
|
-
to {
|
|
36
|
-
transform: translateY(100%);
|
|
37
|
-
}
|
|
38
|
-
`, h = o.div`
|
|
39
|
-
position: fixed;
|
|
40
|
-
width: 100%;
|
|
41
|
-
height: 100%;
|
|
42
|
-
left: 0;
|
|
43
|
-
top: 0;
|
|
44
|
-
right: 0;
|
|
45
|
-
bottom: 0;
|
|
46
|
-
z-index: 1000;
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
align-items: center;
|
|
50
|
-
${(e) => e.styles}
|
|
51
|
-
`, g = o.div`
|
|
52
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
53
|
-
animation: ${(e) => e.isClosing ? f : d} 0.3s ease-in-out;
|
|
54
|
-
animation-fill-mode: forwards;
|
|
55
|
-
position: fixed;
|
|
56
|
-
width: 100%;
|
|
57
|
-
height: 100%;
|
|
58
|
-
left: 0;
|
|
59
|
-
top: 0;
|
|
60
|
-
right: 0;
|
|
61
|
-
bottom: 0;
|
|
62
|
-
z-index: 1001;
|
|
63
|
-
`, _ = i`
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: 100%;
|
|
66
|
-
`, v = i`
|
|
67
|
-
width: calc(var(--w-column) * 4);
|
|
68
|
-
`, y = i`
|
|
69
|
-
width: calc(var(--w-column) * 4);
|
|
70
|
-
${t("tablet", i`
|
|
71
|
-
width: calc(var(--w-column) * 6);
|
|
72
|
-
`)}
|
|
73
|
-
${t("desktop", i`
|
|
74
|
-
width: calc(var(--w-column) * 8);
|
|
75
|
-
`)}
|
|
76
|
-
`, b = i`
|
|
77
|
-
position: fixed;
|
|
78
|
-
top: 0;
|
|
79
|
-
right: 0;
|
|
80
|
-
height: 100%;
|
|
81
|
-
${t("mobileOnly", _)}
|
|
82
|
-
${t("tablet", v)}
|
|
83
|
-
`, x = i`
|
|
84
|
-
border-radius: 8px;
|
|
85
|
-
${t("mobileOnly", _)}
|
|
86
|
-
${t("tablet", y)}
|
|
87
|
-
`, S = o.div`
|
|
88
|
-
padding: calc(var(--w-gutter));
|
|
89
|
-
z-index: 1002;
|
|
90
|
-
background-color: var(--white);
|
|
91
|
-
max-height: 80vh;
|
|
92
|
-
overflow-y: auto;
|
|
93
|
-
-webkit-overflow-scrolling: touch;
|
|
94
|
-
touch-action: pan-y;
|
|
95
|
-
animation: ${(e) => e.isClosing ? m : p} 0.3s ease-in-out;
|
|
96
|
-
animation-fill-mode: forwards;
|
|
97
|
-
${(e) => e.type === "panel" && b}
|
|
98
|
-
${(e) => e.type === "dialog" && x}
|
|
99
|
-
header {
|
|
100
|
-
display: inline-flex;
|
|
101
|
-
width: 100%;
|
|
102
|
-
justify-content: space-between;
|
|
103
|
-
margin-bottom: calc(var(--w-gutter) * 0.5);
|
|
104
|
-
}
|
|
105
|
-
`, C = i`
|
|
106
|
-
text-decoration: none;
|
|
107
|
-
// padding: 0 calc(var(--w-gutter) * 0.25) 0 var(--w-gutter);
|
|
108
|
-
height: 36px;
|
|
109
|
-
width: 36px;
|
|
110
|
-
border-radius: 50%;
|
|
111
|
-
`, w = o.footer`
|
|
112
|
-
margin-top: calc(var(--w-gutter) * 2);
|
|
113
|
-
background-color:var(--white);
|
|
114
|
-
height: fit-content;
|
|
115
|
-
display: flex;
|
|
116
|
-
gap: var(--w-gutter);
|
|
117
|
-
`, T = class extends u.PureComponent {
|
|
9
|
+
var l = {
|
|
10
|
+
textDecoration: "none",
|
|
11
|
+
height: 30,
|
|
12
|
+
width: 30,
|
|
13
|
+
borderRadius: "50%",
|
|
14
|
+
padding: 0,
|
|
15
|
+
display: "inline-flex",
|
|
16
|
+
justifyContent: "center"
|
|
17
|
+
}, u = class extends s.PureComponent {
|
|
118
18
|
state = { isClosing: !1 };
|
|
119
19
|
onDismiss = () => {
|
|
120
20
|
this.props.onDismiss && (this.setState({ isClosing: !0 }), setTimeout(() => {
|
|
@@ -122,35 +22,40 @@ var d = a`
|
|
|
122
22
|
}, 280));
|
|
123
23
|
};
|
|
124
24
|
onClickBackground = () => {
|
|
125
|
-
|
|
126
|
-
(e === !0 || e === void 0) && this.onDismiss();
|
|
25
|
+
(this.props.backgroundDismiss || !0) === !0 && this.onDismiss();
|
|
127
26
|
};
|
|
128
27
|
render() {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
28
|
+
let s = e(this.props.styles) ? void 0 : this.props.styles;
|
|
29
|
+
return this.props.visible ? /* @__PURE__ */ o("div", {
|
|
30
|
+
className: r.wrapper,
|
|
31
|
+
style: s,
|
|
32
|
+
children: [/* @__PURE__ */ o("div", {
|
|
33
|
+
className: r.content,
|
|
34
|
+
"data-type": this.props.type || "dialog",
|
|
35
|
+
"data-is-closing": this.state.isClosing,
|
|
134
36
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ o("header", { children: [this.props.header && /* @__PURE__ */ a(i, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ a(n, {
|
|
136
38
|
variant: "primary",
|
|
137
|
-
styles:
|
|
39
|
+
styles: l,
|
|
138
40
|
onClick: this.onDismiss,
|
|
139
|
-
children: /* @__PURE__ */ c
|
|
140
|
-
fill:
|
|
141
|
-
|
|
142
|
-
size: 24
|
|
41
|
+
children: /* @__PURE__ */ a(c, {
|
|
42
|
+
fill: t("white"),
|
|
43
|
+
size: 18
|
|
143
44
|
})
|
|
144
45
|
})] }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
this.props.footer && /* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ a("section", { children: this.props.children }),
|
|
47
|
+
this.props.footer && /* @__PURE__ */ a("footer", {
|
|
48
|
+
className: r.actionContainer,
|
|
49
|
+
children: this.props.footer
|
|
50
|
+
})
|
|
147
51
|
]
|
|
148
|
-
}), /* @__PURE__ */
|
|
149
|
-
|
|
52
|
+
}), /* @__PURE__ */ a("div", {
|
|
53
|
+
className: r.background,
|
|
54
|
+
"data-is-closing": this.state.isClosing,
|
|
150
55
|
onClick: this.onClickBackground
|
|
151
56
|
})]
|
|
152
|
-
}) :
|
|
57
|
+
}) : /* @__PURE__ */ a(i, {});
|
|
153
58
|
}
|
|
154
59
|
};
|
|
155
60
|
//#endregion
|
|
156
|
-
export {
|
|
61
|
+
export { u as Modal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._wrapper_16mh3_1,._background_16mh3_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_16mh3_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_16mh3_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_16mh3_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_16mh3_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_16mh3_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_16mh3_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_16mh3_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_16mh3_1}._background_16mh3_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_16mh3_1}._content_16mh3_62{padding:var(--w-gutter,16px);z-index:1002;background-color:var(--white);-webkit-overflow-scrolling:touch;touch-action:pan-y;max-height:80vh;animation-fill-mode:forwards;overflow-y:auto}._content_16mh3_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_16mh3_1}._content_16mh3_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_16mh3_1}._content_16mh3_62[data-type=panel]{height:100%;position:fixed;top:0;right:0}._content_16mh3_62[data-type=dialog]{border-radius:8px}._content_16mh3_62>header{width:100%;margin-bottom:calc(var(--w-gutter,16px) * .5);justify-content:space-between;display:inline-flex}._actionContainer_16mh3_94{margin-top:calc(var(--w-gutter,16px) * 2);background-color:var(--white);gap:var(--w-gutter,16px);height:fit-content;display:flex}@media (width>=0) and (width<=660px){._content_16mh3_62[data-type=panel],._content_16mh3_62[data-type=dialog]{width:100%;height:100%}}@media (width>=660px){._content_16mh3_62[data-type=panel]{width:calc(var(--w-column,60px) * 4 + var(--w-gutter,16px) * 3)}._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 6 + var(--w-gutter,16px) * 5)}}@media (width>=1040px){._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 8 + var(--w-gutter,16px) * 7)}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './Modal.module.css';//#region src/components/Modal.module.scss
|
|
2
|
+
var e = "_wrapper_16mh3_1", t = "_background_16mh3_1", n = "_fadeOut_16mh3_1", r = "_fadeIn_16mh3_1", i = "_content_16mh3_62", a = "_slideOut_16mh3_1", o = "_slideIn_16mh3_1", s = "_actionContainer_16mh3_94", c = {
|
|
3
|
+
wrapper: e,
|
|
4
|
+
background: t,
|
|
5
|
+
fadeOut: n,
|
|
6
|
+
fadeIn: r,
|
|
7
|
+
content: i,
|
|
8
|
+
slideOut: a,
|
|
9
|
+
slideIn: o,
|
|
10
|
+
actionContainer: s
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { s as actionContainer, t as background, i as content, c as default, r as fadeIn, n as fadeOut, o as slideIn, a as slideOut, e as wrapper };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
@use "../styles/global/components/modal";
|
|
2
|
+
|
|
3
|
+
@keyframes fadeIn {
|
|
4
|
+
from {
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
to {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes fadeOut {
|
|
14
|
+
from {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
to {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes slideIn {
|
|
24
|
+
from {
|
|
25
|
+
transform: translateY(100%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
to {
|
|
29
|
+
transform: translateY(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes slideOut {
|
|
34
|
+
from {
|
|
35
|
+
transform: translateY(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
to {
|
|
39
|
+
transform: translateY(100%);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.wrapper {
|
|
44
|
+
@extend %modal-overlay;
|
|
45
|
+
z-index: 1000;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.background {
|
|
52
|
+
@extend %modal-overlay;
|
|
53
|
+
z-index: 1001;
|
|
54
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
55
|
+
animation-fill-mode: forwards;
|
|
56
|
+
|
|
57
|
+
&[data-is-closing="true"] {
|
|
58
|
+
animation: fadeOut 0.3s ease-in-out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&[data-is-closing="false"] {
|
|
62
|
+
animation: fadeIn 0.3s ease-in-out;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.content {
|
|
67
|
+
padding: var(--w-gutter, 16px);
|
|
68
|
+
z-index: 1002;
|
|
69
|
+
background-color: var(--white);
|
|
70
|
+
max-height: 80vh;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
-webkit-overflow-scrolling: touch;
|
|
73
|
+
touch-action: pan-y;
|
|
74
|
+
animation-fill-mode: forwards;
|
|
75
|
+
|
|
76
|
+
&[data-is-closing="true"] {
|
|
77
|
+
animation: slideOut 0.3s ease-in-out;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&[data-is-closing="false"] {
|
|
81
|
+
animation: slideIn 0.3s ease-in-out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[data-type="panel"] {
|
|
85
|
+
position: fixed;
|
|
86
|
+
top: 0;
|
|
87
|
+
right: 0;
|
|
88
|
+
height: 100%;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&[data-type="dialog"] {
|
|
92
|
+
border-radius: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
> header {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
width: 100%;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
margin-bottom: calc(var(--w-gutter, 16px) * 0.5);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.actionContainer {
|
|
104
|
+
margin-top: calc(var(--w-gutter, 16px) * 2);
|
|
105
|
+
background-color: var(--white);
|
|
106
|
+
height: fit-content;
|
|
107
|
+
display: flex;
|
|
108
|
+
gap: var(--w-gutter, 16px);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (min-width: 0px) and (max-width: 659.99999px) {
|
|
112
|
+
.content[data-type="panel"],
|
|
113
|
+
.content[data-type="dialog"] {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (min-width: 660px) {
|
|
120
|
+
.content[data-type="panel"] {
|
|
121
|
+
width: calc((var(--w-column, 60px) * 4) + (var(--w-gutter, 16px) * 3));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.content[data-type="dialog"] {
|
|
125
|
+
width: calc((var(--w-column, 60px) * 6) + (var(--w-gutter, 16px) * 5));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media (min-width: 1040px) {
|
|
130
|
+
.content[data-type="dialog"] {
|
|
131
|
+
width: calc((var(--w-column, 60px) * 8) + (var(--w-gutter, 16px) * 7));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Input as e } from "./Input.esm.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/RadioButton.tsx
|
|
4
|
+
var n = ({ type: n = "radio", labelPosition: r = "right", ...i }) => /* @__PURE__ */ t(e, {
|
|
5
|
+
type: n,
|
|
6
|
+
labelPosition: r,
|
|
7
|
+
...i
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as RadioButton };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { Button } from './Button';
|
|
2
2
|
export { Input } from './Input';
|
|
3
|
+
export { InputPassword } from './InputPassword';
|
|
3
4
|
export { Loader } from './Loader';
|
|
5
|
+
export { RadioButton } from './RadioButton';
|
|
6
|
+
export { Checkbox } from './Checkbox';
|
|
4
7
|
export { Modal } from './Modal';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { themeBuilder as e } from "../theme/theme.esm.js";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
//#region src/styles/components/ThemeProvider.tsx
|
|
4
|
+
function i({ theme: i, children: a }) {
|
|
5
|
+
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("style", { dangerouslySetInnerHTML: { __html: e(i || {}) } }), a] });
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { i as ThemeProvider };
|