@stamcat/craftsman 0.0.23-alpha.25 → 0.0.23-alpha.28
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 +123 -2
- package/Components.esm.js +12 -6
- package/Styles.esm.js +8 -8
- package/package.json +16 -3
- package/src/components/Button.esm.js +20 -14
- package/src/components/Checkbox.d.ts +7 -0
- package/src/components/Checkbox.esm.js +10 -0
- package/src/components/Input.d.ts +11 -1
- package/src/components/Input.esm.js +84 -3
- package/src/components/InputPassword.d.ts +6 -0
- package/src/components/InputPassword.esm.js +33 -0
- package/src/components/Modal.esm.js +60 -58
- package/src/components/RadioButton.d.ts +7 -0
- package/src/components/RadioButton.esm.js +10 -0
- package/src/components/index.d.ts +3 -0
- package/src/styles/components/NextJSProvider.esm.js +7 -7
- package/src/styles/global/components/button.d.ts +1 -0
- package/src/styles/global/components/button.esm.js +41 -32
- package/src/styles/global/components/checkbox.d.ts +1 -0
- package/src/styles/global/components/checkbox.esm.js +78 -0
- package/src/styles/global/components/code.esm.js +14 -12
- package/src/styles/global/components/input.d.ts +5 -0
- package/src/styles/global/components/input.esm.js +121 -0
- package/src/styles/global/components/loaders.d.ts +1 -1
- package/src/styles/global/components/radioButton.d.ts +1 -0
- package/src/styles/global/components/radioButton.esm.js +39 -0
- package/src/styles/global/components/typography.esm.js +31 -27
- package/src/styles/global/globalStyles.esm.js +21 -6
- package/src/styles/theme/components.esm.js +5 -5
- package/src/styles/utilities/color.d.ts +23 -23
- package/src/styles/utilities/color.esm.js +1 -1
- package/src/styles/utilities/constants.d.ts +23 -23
- package/src/styles/utilities/constants.esm.js +44 -44
- package/src/styles/utilities/layout.esm.js +3 -3
- package/src/styles/utilities/types.d.ts +39 -0
- package/src/styles/utilities/types.esm.js +30 -1
package/AGENTS.md
CHANGED
|
@@ -10,9 +10,12 @@ Use these imports:
|
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { Button } from "@stamcat/craftsman/Button";
|
|
13
|
+
import { Checkbox } from "@stamcat/craftsman/Checkbox";
|
|
13
14
|
import { Input } from "@stamcat/craftsman/Input";
|
|
15
|
+
import { InputPassword } from "@stamcat/craftsman/InputPassword";
|
|
14
16
|
import { Loader } from "@stamcat/craftsman/Loader";
|
|
15
17
|
import { Modal } from "@stamcat/craftsman/Modal";
|
|
18
|
+
import { RadioButton } from "@stamcat/craftsman/RadioButton";
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
Do not assume a root export like `@stamcat/craftsman` unless that export is explicitly added to package `exports`.
|
|
@@ -101,7 +104,19 @@ import { Input } from "@stamcat/craftsman/Input";
|
|
|
101
104
|
|
|
102
105
|
Props:
|
|
103
106
|
|
|
104
|
-
-
|
|
107
|
+
- Inherits native `<input>` props.
|
|
108
|
+
- `label?: string | ReactNode`
|
|
109
|
+
- `labelPosition?: "top" | "left" | "bottom" | "right" | "inside" | "hidden"` (default: `"top"`)
|
|
110
|
+
- `error?: string | boolean | ReactNode`
|
|
111
|
+
- `required?: boolean`
|
|
112
|
+
- `styles?: SerializedStyles` (wrapper override)
|
|
113
|
+
- `type?: TextInputType` (checkbox/radio excluded)
|
|
114
|
+
|
|
115
|
+
Behavior notes:
|
|
116
|
+
|
|
117
|
+
- `id` is preserved; if omitted, a stable React `useId` value is used.
|
|
118
|
+
- Floating-label behavior is supported when `labelPosition="inside"`.
|
|
119
|
+
- `endAdornment` exists as an internal extension point used by `InputPassword`; consumer apps should prefer `InputPassword` rather than wiring password toggles on `Input`.
|
|
105
120
|
|
|
106
121
|
Example:
|
|
107
122
|
|
|
@@ -109,6 +124,112 @@ Example:
|
|
|
109
124
|
<Input type="email" placeholder="you@company.com" required />
|
|
110
125
|
```
|
|
111
126
|
|
|
127
|
+
### InputPassword
|
|
128
|
+
|
|
129
|
+
Import:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import { InputPassword } from "@stamcat/craftsman/InputPassword";
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Props:
|
|
136
|
+
|
|
137
|
+
- Extends `Input` props, with `type` constrained to password mode.
|
|
138
|
+
- Includes all label, error, required, and wrapper style props from `Input`.
|
|
139
|
+
|
|
140
|
+
Behavior notes:
|
|
141
|
+
|
|
142
|
+
- Built on top of `Input` and adds an internal password visibility state.
|
|
143
|
+
- Renders an in-field show/hide toggle button.
|
|
144
|
+
- Toggle is accessible: real button element, keyboard operable, and updates `aria-label` + `aria-pressed`.
|
|
145
|
+
- Use this component for password fields instead of `Input type="password"`.
|
|
146
|
+
|
|
147
|
+
Example:
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<InputPassword
|
|
151
|
+
label="Password"
|
|
152
|
+
placeholder="Enter your password"
|
|
153
|
+
autoComplete="current-password"
|
|
154
|
+
/>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Checkbox
|
|
158
|
+
|
|
159
|
+
Import:
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
import { Checkbox } from "@stamcat/craftsman/Checkbox";
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Props:
|
|
166
|
+
|
|
167
|
+
- Extends `Input` props.
|
|
168
|
+
- `type?: "checkbox"` (default: `"checkbox"`)
|
|
169
|
+
- `labelPosition?: "left" | "right" | "top" | "bottom"` (default: `"right"`)
|
|
170
|
+
|
|
171
|
+
Behavior notes:
|
|
172
|
+
|
|
173
|
+
- `Checkbox` is a thin wrapper around `Input` with checkbox-specific guardrails.
|
|
174
|
+
- The wrapper enforces checkbox type by default and narrows label position options to common checkbox layouts.
|
|
175
|
+
- Controlled and uncontrolled patterns are both supported (`checked` + `onChange`, or `defaultChecked`).
|
|
176
|
+
|
|
177
|
+
Example:
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<Checkbox
|
|
181
|
+
id="accept-terms"
|
|
182
|
+
name="terms"
|
|
183
|
+
value="accepted"
|
|
184
|
+
label="Accept terms"
|
|
185
|
+
checked={accepted}
|
|
186
|
+
onChange={(event) => setAccepted(event.currentTarget.checked)}
|
|
187
|
+
/>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### RadioButton
|
|
191
|
+
|
|
192
|
+
Import:
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { RadioButton } from "@stamcat/craftsman/RadioButton";
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Props:
|
|
199
|
+
|
|
200
|
+
- Extends `Input` props.
|
|
201
|
+
- `type?: "radio"` (default: `"radio"`)
|
|
202
|
+
- `labelPosition?: "left" | "right"` (default: `"right"`)
|
|
203
|
+
|
|
204
|
+
Behavior notes:
|
|
205
|
+
|
|
206
|
+
- `RadioButton` is a thin wrapper around `Input` with radio-specific guardrails.
|
|
207
|
+
- Group behavior is native HTML radio behavior: use a shared `name` across options.
|
|
208
|
+
- Controlled and uncontrolled patterns are both supported (`checked` + `onChange`, or `defaultChecked`).
|
|
209
|
+
|
|
210
|
+
Example:
|
|
211
|
+
|
|
212
|
+
```tsx
|
|
213
|
+
<>
|
|
214
|
+
<RadioButton
|
|
215
|
+
id="captain-kirk"
|
|
216
|
+
name="favorite-captain"
|
|
217
|
+
value="Kirk"
|
|
218
|
+
label="James T. Kirk"
|
|
219
|
+
checked={selected === "Kirk"}
|
|
220
|
+
onChange={(event) => setSelected(event.currentTarget.value)}
|
|
221
|
+
/>
|
|
222
|
+
<RadioButton
|
|
223
|
+
id="captain-picard"
|
|
224
|
+
name="favorite-captain"
|
|
225
|
+
value="Picard"
|
|
226
|
+
label="Jean-Luc Picard"
|
|
227
|
+
checked={selected === "Picard"}
|
|
228
|
+
onChange={(event) => setSelected(event.currentTarget.value)}
|
|
229
|
+
/>
|
|
230
|
+
</>
|
|
231
|
+
```
|
|
232
|
+
|
|
112
233
|
### Modal
|
|
113
234
|
|
|
114
235
|
Import:
|
|
@@ -246,6 +367,6 @@ if (arr.length === 0) { ... }
|
|
|
246
367
|
|
|
247
368
|
If uncertain about available exports:
|
|
248
369
|
|
|
249
|
-
1. Use only `Button`, `Input`, `Loader`, and `
|
|
370
|
+
1. Use only `Button`, `Checkbox`, `Input`, `InputPassword`, `Loader`, `Modal`, and `RadioButton` from their component entry points.
|
|
250
371
|
2. Do not invent package APIs.
|
|
251
372
|
3. Prefer native HTML elements for anything not explicitly exported.
|
package/Components.esm.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { __exportAll as e } from "./_virtual/_rolldown/runtime.esm.js";
|
|
2
2
|
import { Button as t } from "./src/components/Button.esm.js";
|
|
3
3
|
import { Input as n } from "./src/components/Input.esm.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { InputPassword as r } from "./src/components/InputPassword.esm.js";
|
|
5
|
+
import { Loader as i } from "./src/components/Loader.esm.js";
|
|
6
|
+
import { RadioButton as a } from "./src/components/RadioButton.esm.js";
|
|
7
|
+
import { Checkbox as o } from "./src/components/Checkbox.esm.js";
|
|
8
|
+
import { Modal as s } from "./src/components/Modal.esm.js";
|
|
6
9
|
//#region src/components/index.ts
|
|
7
|
-
var
|
|
10
|
+
var c = /* @__PURE__ */ e({
|
|
8
11
|
Button: () => t,
|
|
12
|
+
Checkbox: () => o,
|
|
9
13
|
Input: () => n,
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
InputPassword: () => r,
|
|
15
|
+
Loader: () => i,
|
|
16
|
+
Modal: () => s,
|
|
17
|
+
RadioButton: () => a
|
|
12
18
|
});
|
|
13
19
|
//#endregion
|
|
14
|
-
export { t as Button, n as Input, r as
|
|
20
|
+
export { t as Button, o as Checkbox, n as Input, r as InputPassword, i as Loader, s as Modal, a as RadioButton, c as components_exports };
|
package/Styles.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { CraftsmanThemeProvider as
|
|
6
|
-
import { globalStyles as
|
|
7
|
-
import { ClientProvider as
|
|
8
|
-
export {
|
|
1
|
+
import { defaultColors as e, defaultWidths as t } from "./src/styles/utilities/constants.esm.js";
|
|
2
|
+
import { color as n, colors as r, hexToRgba as i } from "./src/styles/utilities/color.esm.js";
|
|
3
|
+
import { BaseWidthSchema as a, BreakpointSchema as o, LayoutWidthsSchema as s, MaxScreenWidthSchema as c, ScreenWidthSchema as l, zLabelPosition as u, zTextInputExclusions as d, zTextInputType as f, zTextInputTypes as p } from "./src/styles/utilities/types.esm.js";
|
|
4
|
+
import { breakpoint as m, media as h, width as g, widths as _ } from "./src/styles/utilities/layout.esm.js";
|
|
5
|
+
import { CraftsmanThemeProvider as v, themeBuilder as y } from "./src/styles/theme/theme.esm.js";
|
|
6
|
+
import { globalStyles as b } from "./src/styles/global/globalStyles.esm.js";
|
|
7
|
+
import { ClientProvider as x } from "./src/styles/components/ClientProvider.esm.js";
|
|
8
|
+
export { a as BaseWidthSchema, o as BreakpointSchema, x as ClientProvider, v as CraftsmanThemeProvider, s as LayoutWidthsSchema, c as MaxScreenWidthSchema, l as ScreenWidthSchema, m as breakpoint, n as color, r as colors, e as defaultColors, t as defaultWidths, b as globalStyles, i as hexToRgba, h as media, y as themeBuilder, g as width, _ as widths, u as zLabelPosition, d as zTextInputExclusions, f as zTextInputType, p as zTextInputTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamcat/craftsman",
|
|
3
|
-
"version": "0.0.23-alpha.
|
|
3
|
+
"version": "0.0.23-alpha.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A powerful, lightweight framework for design systems",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@emotion/react": "11.14.0",
|
|
27
27
|
"@emotion/styled": "11.14.1",
|
|
28
|
-
"dompurify": "3.4.
|
|
28
|
+
"dompurify": "3.4.12",
|
|
29
29
|
"emotion": "11.0.0",
|
|
30
30
|
"react": "19.2.7",
|
|
31
31
|
"react-date-picker": "12.0.2",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {},
|
|
41
41
|
"overrides": {
|
|
42
|
-
"postcss": "8.5.20"
|
|
42
|
+
"postcss": "8.5.20",
|
|
43
|
+
"sharp": "0.35.3"
|
|
43
44
|
},
|
|
44
45
|
"exports": {
|
|
45
46
|
".": {
|
|
@@ -66,10 +67,22 @@
|
|
|
66
67
|
"types": "./src/components/Input.d.ts",
|
|
67
68
|
"default": "./src/components/Input.esm.js"
|
|
68
69
|
},
|
|
70
|
+
"./InputPassword": {
|
|
71
|
+
"types": "./src/components/InputPassword.d.ts",
|
|
72
|
+
"default": "./src/components/InputPassword.esm.js"
|
|
73
|
+
},
|
|
69
74
|
"./Loader": {
|
|
70
75
|
"types": "./src/components/Loader.d.ts",
|
|
71
76
|
"default": "./src/components/Loader.esm.js"
|
|
72
77
|
},
|
|
78
|
+
"./RadioButton": {
|
|
79
|
+
"types": "./src/components/RadioButton.d.ts",
|
|
80
|
+
"default": "./src/components/RadioButton.esm.js"
|
|
81
|
+
},
|
|
82
|
+
"./Checkbox": {
|
|
83
|
+
"types": "./src/components/Checkbox.d.ts",
|
|
84
|
+
"default": "./src/components/Checkbox.esm.js"
|
|
85
|
+
},
|
|
73
86
|
"./Modal": {
|
|
74
87
|
"types": "./src/components/Modal.d.ts",
|
|
75
88
|
"default": "./src/components/Modal.esm.js"
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { isEmpty as e } from "../utilities/validations.esm.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { width as t } from "../styles/utilities/layout.esm.js";
|
|
3
|
+
import "../../Styles.esm.js";
|
|
4
|
+
import { css as n } from "@emotion/react";
|
|
5
|
+
import r from "@emotion/styled";
|
|
6
|
+
import { Fragment as i, jsx as a } from "react/jsx-runtime";
|
|
5
7
|
//#region src/components/Button.tsx
|
|
6
|
-
var
|
|
7
|
-
${(e) => e.
|
|
8
|
-
${((e) => e.size && t`
|
|
8
|
+
var o = r.button`
|
|
9
|
+
${((e) => e.size && n`
|
|
9
10
|
border-radius: calc(var(--btn-border-radius) * ${e.size});
|
|
10
11
|
padding: calc(var(--btn-pad-y) * ${e.size}) calc(var(--btn-pad-x) * ${e.size});
|
|
11
|
-
font-size: max(10px, calc(
|
|
12
|
+
font-size: max(10px, calc(${t("text")} * ${e.size}));
|
|
12
13
|
`)}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
${(e) => e.styles && n`
|
|
15
|
+
&& {
|
|
16
|
+
${e.styles}
|
|
17
|
+
}
|
|
18
|
+
`}
|
|
19
|
+
`, s = (t) => {
|
|
20
|
+
let { type: n = "button", variant: r = "default", size: s, ...c } = t, l = typeof s == "number" ? Math.min(10, Math.max(.1, s)) : void 0;
|
|
21
|
+
return e(t.children) ? /* @__PURE__ */ a(i, {}) : /* @__PURE__ */ a(o, {
|
|
16
22
|
type: n,
|
|
17
|
-
size:
|
|
18
|
-
|
|
19
|
-
...
|
|
23
|
+
size: l,
|
|
24
|
+
"data-variant": r,
|
|
25
|
+
...c
|
|
20
26
|
});
|
|
21
27
|
};
|
|
22
28
|
//#endregion
|
|
23
|
-
export {
|
|
29
|
+
export { s as Button };
|
|
@@ -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/Checkbox.tsx
|
|
4
|
+
var n = ({ type: n = "checkbox", labelPosition: r = "right", ...i }) => /* @__PURE__ */ t(e, {
|
|
5
|
+
type: n,
|
|
6
|
+
labelPosition: r,
|
|
7
|
+
...i
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as Checkbox };
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { LabelPosition, TextInputType } from '../styles/utilities/types';
|
|
3
|
+
export type InputProps = React.ComponentProps<"input"> & {
|
|
4
|
+
label?: string | React.ReactNode;
|
|
5
|
+
labelPosition?: LabelPosition;
|
|
6
|
+
error?: string | boolean | React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
styles?: SerializedStyles;
|
|
9
|
+
endAdornment?: React.ReactNode;
|
|
10
|
+
type?: TextInputType;
|
|
11
|
+
};
|
|
2
12
|
export declare const Input: React.FC<InputProps>;
|
|
@@ -1,5 +1,86 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isEmpty as e } from "../utilities/validations.esm.js";
|
|
2
|
+
import { color as t } from "../styles/utilities/color.esm.js";
|
|
3
|
+
import { width as n } from "../styles/utilities/layout.esm.js";
|
|
4
|
+
import { inputErrorStyles as r, inputFieldAdornmentStyles as i, insideLabelStyles as a } from "../styles/global/components/input.esm.js";
|
|
5
|
+
import { css as o } from "@emotion/react";
|
|
6
|
+
import s from "@emotion/styled";
|
|
7
|
+
import { useId as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
2
9
|
//#region src/components/Input.tsx
|
|
3
|
-
var
|
|
10
|
+
var d = (e, r) => o`
|
|
11
|
+
label {
|
|
12
|
+
.input-label {
|
|
13
|
+
margin-bottom: ${n("gutter", .25)};
|
|
14
|
+
${r && o`
|
|
15
|
+
::after {
|
|
16
|
+
content: "*";
|
|
17
|
+
color: ${t("red700")};
|
|
18
|
+
}
|
|
19
|
+
`}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-label-position="left"] label {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
.input-label {
|
|
27
|
+
width: fit-content;
|
|
28
|
+
margin-right: ${n("gutter", .75)};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&[data-label-position="bottom"] label {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
flex-direction: column-reverse;
|
|
35
|
+
align-items: flex-start;
|
|
36
|
+
.input-label {
|
|
37
|
+
margin-bottom: 0;
|
|
38
|
+
margin-top: ${n("gutter", .25)};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[data-label-position="right"] label {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
flex-direction: row-reverse;
|
|
45
|
+
align-items: center;
|
|
46
|
+
.input-label {
|
|
47
|
+
margin-left: ${n("gutter", .75)};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-label-position="inside"] {
|
|
52
|
+
${a(e)}
|
|
53
|
+
}
|
|
54
|
+
`, f = s.div`
|
|
55
|
+
${(e) => d(e.hasInput, e.required)}
|
|
56
|
+
${(e) => e.hasEndAdornment && i}
|
|
57
|
+
${(e) => e.styles}
|
|
58
|
+
`, p = s.div`
|
|
59
|
+
${r}
|
|
60
|
+
`, m = ({ label: t, id: n, labelPosition: r = "top", required: i = !1, type: a = "text", error: o, styles: s, endAdornment: d, ...m }) => {
|
|
61
|
+
let h = c(), g = n || h, _ = !e(m.value) || !e(m.defaultValue), v = /* @__PURE__ */ u("span", {
|
|
62
|
+
className: "input-field",
|
|
63
|
+
"data-has-end-adornment": !e(d),
|
|
64
|
+
children: [/* @__PURE__ */ l("input", {
|
|
65
|
+
id: g,
|
|
66
|
+
type: a,
|
|
67
|
+
...m
|
|
68
|
+
}), !e(d) && /* @__PURE__ */ l("span", {
|
|
69
|
+
className: "input-adornment",
|
|
70
|
+
children: d
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ u(f, {
|
|
74
|
+
"data-label-position": r,
|
|
75
|
+
hasEndAdornment: !e(d),
|
|
76
|
+
required: i,
|
|
77
|
+
hasInput: _,
|
|
78
|
+
styles: s,
|
|
79
|
+
children: [e(t) ? v : /* @__PURE__ */ u("label", { children: [r !== "hidden" && /* @__PURE__ */ l("div", {
|
|
80
|
+
className: "input-label",
|
|
81
|
+
children: t
|
|
82
|
+
}), v] }), !e(o) && /* @__PURE__ */ l(p, { children: o })]
|
|
83
|
+
});
|
|
84
|
+
};
|
|
4
85
|
//#endregion
|
|
5
|
-
export {
|
|
86
|
+
export { m as Input };
|
|
@@ -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,33 @@
|
|
|
1
|
+
import { Button as e } from "./Button.esm.js";
|
|
2
|
+
import { Input as t } from "./Input.esm.js";
|
|
3
|
+
import { css as n } from "@emotion/react";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { ImEye as a, ImEyeBlocked as o } from "react-icons/im";
|
|
7
|
+
//#region src/components/InputPassword.tsx
|
|
8
|
+
var s = n`
|
|
9
|
+
padding: 0;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
line-height: 1;
|
|
13
|
+
`, c = ({ visible: t, onToggle: n }) => /* @__PURE__ */ i(e, {
|
|
14
|
+
type: "button",
|
|
15
|
+
variant: "text",
|
|
16
|
+
onClick: n,
|
|
17
|
+
"aria-label": t ? "Hide password" : "Show password",
|
|
18
|
+
"aria-pressed": t,
|
|
19
|
+
styles: s,
|
|
20
|
+
children: i(t ? a : o, { size: 16 })
|
|
21
|
+
}), l = ({ type: e = "password", ...n }) => {
|
|
22
|
+
let [a, o] = r(!1), s = a ? "text" : e;
|
|
23
|
+
return /* @__PURE__ */ i(t, {
|
|
24
|
+
...n,
|
|
25
|
+
type: s,
|
|
26
|
+
endAdornment: /* @__PURE__ */ i(c, {
|
|
27
|
+
visible: a,
|
|
28
|
+
onToggle: () => o((e) => !e)
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { l as InputPassword };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { breakpoint as t } from "../styles/utilities/layout.esm.js";
|
|
3
|
-
import {
|
|
4
|
-
import { css as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import l from "react";
|
|
8
|
-
import { LuX as
|
|
1
|
+
import { color as e } from "../styles/utilities/color.esm.js";
|
|
2
|
+
import { breakpoint as t, width as n } from "../styles/utilities/layout.esm.js";
|
|
3
|
+
import { Button as r } from "./Button.esm.js";
|
|
4
|
+
import { css as i, keyframes as a } from "@emotion/react";
|
|
5
|
+
import o from "@emotion/styled";
|
|
6
|
+
import s from "react";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { LuX as d } from "react-icons/lu";
|
|
9
9
|
//#region src/components/Modal.tsx
|
|
10
|
-
var
|
|
10
|
+
var f = a`
|
|
11
11
|
from {
|
|
12
12
|
opacity: 0;
|
|
13
13
|
}
|
|
14
14
|
to {
|
|
15
15
|
opacity: 1;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`, p = a`
|
|
18
18
|
from {
|
|
19
19
|
opacity: 1;
|
|
20
20
|
}
|
|
21
21
|
to {
|
|
22
22
|
opacity: 0;
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`, m = a`
|
|
25
25
|
from {
|
|
26
26
|
transform: translateY(100%);
|
|
27
27
|
}
|
|
28
28
|
to {
|
|
29
29
|
transform: translateY(0);
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`, h = a`
|
|
32
32
|
from {
|
|
33
33
|
transform: translateY(0);
|
|
34
34
|
}
|
|
35
35
|
to {
|
|
36
36
|
transform: translateY(100%);
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`, g = o.div`
|
|
39
39
|
position: fixed;
|
|
40
40
|
width: 100%;
|
|
41
41
|
height: 100%;
|
|
@@ -48,9 +48,9 @@ var d = i`
|
|
|
48
48
|
justify-content: center;
|
|
49
49
|
align-items: center;
|
|
50
50
|
${(e) => e.styles}
|
|
51
|
-
`,
|
|
51
|
+
`, _ = o.div`
|
|
52
52
|
background-color: rgba(0, 0, 0, 0.5);
|
|
53
|
-
animation: ${(e) => e.isClosing ?
|
|
53
|
+
animation: ${(e) => e.isClosing ? p : f} 0.3s ease-in-out;
|
|
54
54
|
animation-fill-mode: forwards;
|
|
55
55
|
position: fixed;
|
|
56
56
|
width: 100%;
|
|
@@ -60,60 +60,63 @@ var d = i`
|
|
|
60
60
|
right: 0;
|
|
61
61
|
bottom: 0;
|
|
62
62
|
z-index: 1001;
|
|
63
|
-
`,
|
|
63
|
+
`, v = i`
|
|
64
64
|
width: 100%;
|
|
65
65
|
height: 100%;
|
|
66
|
-
`,
|
|
67
|
-
width:
|
|
68
|
-
`,
|
|
69
|
-
width:
|
|
70
|
-
${t("tablet",
|
|
71
|
-
width:
|
|
66
|
+
`, y = i`
|
|
67
|
+
width: ${n("column", 4)};
|
|
68
|
+
`, b = i`
|
|
69
|
+
width: ${n("column", 4)};
|
|
70
|
+
${t("tablet", i`
|
|
71
|
+
width: ${n("column", 6)};
|
|
72
72
|
`)}
|
|
73
|
-
${t("desktop",
|
|
74
|
-
width:
|
|
73
|
+
${t("desktop", i`
|
|
74
|
+
width: ${n("column", 8)};
|
|
75
75
|
`)}
|
|
76
|
-
`,
|
|
76
|
+
`, x = i`
|
|
77
77
|
position: fixed;
|
|
78
78
|
top: 0;
|
|
79
79
|
right: 0;
|
|
80
80
|
height: 100%;
|
|
81
|
-
${t("mobileOnly",
|
|
82
|
-
${t("tablet", v)}
|
|
83
|
-
`, x = r`
|
|
84
|
-
border-radius: 8px;
|
|
85
|
-
${t("mobileOnly", _)}
|
|
81
|
+
${t("mobileOnly", v)}
|
|
86
82
|
${t("tablet", y)}
|
|
87
|
-
`, S =
|
|
88
|
-
|
|
83
|
+
`, S = i`
|
|
84
|
+
border-radius: 8px;
|
|
85
|
+
${t("mobileOnly", v)}
|
|
86
|
+
${t("tablet", b)}
|
|
87
|
+
`, C = o.div`
|
|
88
|
+
padding: ${n("gutter")};
|
|
89
89
|
z-index: 1002;
|
|
90
|
-
background-color:
|
|
90
|
+
background-color: ${e("white")};
|
|
91
91
|
max-height: 80vh;
|
|
92
92
|
overflow-y: auto;
|
|
93
93
|
-webkit-overflow-scrolling: touch;
|
|
94
94
|
touch-action: pan-y;
|
|
95
|
-
animation: ${(e) => e.isClosing ?
|
|
95
|
+
animation: ${(e) => e.isClosing ? h : m} 0.3s ease-in-out;
|
|
96
96
|
animation-fill-mode: forwards;
|
|
97
|
-
${(e) => e.type === "panel" &&
|
|
98
|
-
${(e) => e.type === "dialog" &&
|
|
97
|
+
${(e) => e.type === "panel" && x}
|
|
98
|
+
${(e) => e.type === "dialog" && S}
|
|
99
99
|
header {
|
|
100
100
|
display: inline-flex;
|
|
101
101
|
width: 100%;
|
|
102
102
|
justify-content: space-between;
|
|
103
|
-
margin-bottom:
|
|
103
|
+
margin-bottom: ${n("gutter", .5)};
|
|
104
104
|
}
|
|
105
|
-
`,
|
|
105
|
+
`, w = i`
|
|
106
106
|
text-decoration: none;
|
|
107
|
-
height:
|
|
108
|
-
width:
|
|
107
|
+
height: 30px;
|
|
108
|
+
width: 30px;
|
|
109
109
|
border-radius: 50%;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
padding: 0;
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
`, T = o.footer`
|
|
114
|
+
margin-top: ${n("gutter", 2)};
|
|
115
|
+
background-color: ${e("white")};
|
|
113
116
|
height: fit-content;
|
|
114
117
|
display: flex;
|
|
115
|
-
gap:
|
|
116
|
-
`,
|
|
118
|
+
gap: ${n("gutter")};
|
|
119
|
+
`, E = class extends s.PureComponent {
|
|
117
120
|
state = { isClosing: !1 };
|
|
118
121
|
onDismiss = () => {
|
|
119
122
|
this.props.onDismiss && (this.setState({ isClosing: !0 }), setTimeout(() => {
|
|
@@ -124,31 +127,30 @@ var d = i`
|
|
|
124
127
|
(this.props.backgroundDismiss || !0) === !0 && this.onDismiss();
|
|
125
128
|
};
|
|
126
129
|
render() {
|
|
127
|
-
return this.props.visible ? /* @__PURE__ */
|
|
130
|
+
return this.props.visible ? /* @__PURE__ */ u(g, {
|
|
128
131
|
styles: this.props.styles,
|
|
129
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ u(C, {
|
|
130
133
|
type: this.props.type || "dialog",
|
|
131
134
|
isClosing: this.state.isClosing,
|
|
132
135
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ u("header", { children: [this.props.header && /* @__PURE__ */ l(c, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ l(r, {
|
|
134
137
|
variant: "primary",
|
|
135
|
-
styles:
|
|
138
|
+
styles: w,
|
|
136
139
|
onClick: this.onDismiss,
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
fill:
|
|
139
|
-
|
|
140
|
-
size: 24
|
|
140
|
+
children: /* @__PURE__ */ l(d, {
|
|
141
|
+
fill: e("white"),
|
|
142
|
+
size: 18
|
|
141
143
|
})
|
|
142
144
|
})] }),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
this.props.footer && /* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ l("section", { children: this.props.children }),
|
|
146
|
+
this.props.footer && /* @__PURE__ */ l(T, { children: this.props.footer })
|
|
145
147
|
]
|
|
146
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ l(_, {
|
|
147
149
|
isClosing: this.state.isClosing,
|
|
148
150
|
onClick: this.onClickBackground
|
|
149
151
|
})]
|
|
150
|
-
}) : /* @__PURE__ */
|
|
152
|
+
}) : /* @__PURE__ */ l(c, {});
|
|
151
153
|
}
|
|
152
154
|
};
|
|
153
155
|
//#endregion
|
|
154
|
-
export {
|
|
156
|
+
export { E as Modal };
|