@stamcat/craftsman 0.0.23-alpha.7 → 0.0.23-alpha.9
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 +162 -0
- package/Components.esm.js +5 -3
- package/components/Button.d.ts +6 -1
- package/components/Loader.d.ts +9 -0
- package/components/Modal.d.ts +23 -0
- package/components/Progress.d.ts +1 -0
- package/components/index.d.ts +2 -0
- package/package.json +12 -1
- package/src/components/Button.esm.js +20 -0
- package/src/components/Loader.esm.js +19 -0
- package/src/components/Modal.esm.js +156 -0
- package/src/styles/global/components/loaders.esm.js +65 -0
- package/src/styles/global/components/loaders.module.css +1 -0
- package/src/styles/global/components/loaders.module.esm.js +25 -0
- package/src/styles/global/components/loaders.module.scss +240 -0
- package/src/styles/utilities/color.esm.js +19 -0
- package/src/styles/utilities/config.esm.js +25 -0
- package/src/styles/utilities/constants.esm.js +79 -0
- package/src/styles/utilities/layout.esm.js +48 -0
- package/stories/Button.stories.d.ts +7 -0
- package/stories/Colors.stories.d.ts +5 -0
- package/stories/Icons.stories.d.ts +36 -0
- package/stories/Loaders.stories.d.ts +6 -0
- package/stories/Modal.stories.d.ts +8 -0
- package/stories/Toastify.stories.d.ts +7 -0
- package/stories/Typography.stories.d.ts +6 -0
- package/styles/global/components/button.d.ts +7 -0
- package/styles/global/components/code.d.ts +1 -0
- package/styles/global/components/loaders.d.ts +17 -0
- package/styles/global/components/typography.d.ts +11 -0
- package/styles/global/variables.d.ts +2 -0
- package/styles/theme/components.d.ts +1 -1
- package/styles/theme/constants.d.ts +1 -2
- package/styles/theme/types.d.ts +1 -1
- package/styles/theme/utilities.d.ts +2 -0
- package/styles/utilities/color.d.ts +2 -66
- package/styles/utilities/config.d.ts +7 -0
- package/styles/utilities/constants.d.ts +77 -0
- package/styles/utilities/layout.d.ts +15 -0
- package/styles/utilities/types.d.ts +17 -0
- package/Button.esm.js +0 -5
- package/icons/IconCalendar.d.ts +0 -3
- package/icons/IconChevronRight.d.ts +0 -2
- package/icons/IconCircleAlert.d.ts +0 -2
- package/icons/IconCircleCheck.d.ts +0 -2
- package/icons/IconCircleHelp.d.ts +0 -2
- package/icons/IconCircleInfo.d.ts +0 -2
- package/icons/IconEye.d.ts +0 -2
- package/icons/IconEyeClosed.d.ts +0 -2
- package/icons/IconX.d.ts +0 -2
- package/styles/global/colors.d.ts +0 -1
- package/styles/theme/components/button.d.ts +0 -1
- /package/{Input.esm.js → src/components/Input.esm.js} +0 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# AI Agent Integration Guide for @stamcat/craftsman
|
|
2
|
+
|
|
3
|
+
This document explains how code-generation agents should use this library safely and correctly.
|
|
4
|
+
|
|
5
|
+
## What This Package Currently Exports
|
|
6
|
+
|
|
7
|
+
The package is currently built with component-level entry points only.
|
|
8
|
+
|
|
9
|
+
Use these imports:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Button } from "@stamcat/craftsman/Button";
|
|
13
|
+
import { Input } from "@stamcat/craftsman/Input";
|
|
14
|
+
import { Loader } from "@stamcat/craftsman/Loader";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Do not assume a root export like `@stamcat/craftsman` unless that export is explicitly added to package `exports`.
|
|
18
|
+
|
|
19
|
+
## Hard Rules for Agents
|
|
20
|
+
|
|
21
|
+
1. Never deep-import from package internals (for example `@stamcat/craftsman/src/...`).
|
|
22
|
+
2. Only use documented component entry points.
|
|
23
|
+
3. Do not import storybook files or internal style utilities from consuming applications.
|
|
24
|
+
4. Prefer standard React props first; use custom props only when required.
|
|
25
|
+
|
|
26
|
+
## Component Contracts
|
|
27
|
+
|
|
28
|
+
### Button
|
|
29
|
+
|
|
30
|
+
Import:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Button } from "@stamcat/craftsman/Button";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Props:
|
|
37
|
+
|
|
38
|
+
- Inherits all native `<button>` props.
|
|
39
|
+
- `variant?: "primary" | "default" | "text"` (default: `"default"`)
|
|
40
|
+
- `styles?: SerializedStyles` (Emotion override)
|
|
41
|
+
|
|
42
|
+
Behavior notes:
|
|
43
|
+
|
|
44
|
+
- `type` defaults to `"button"`.
|
|
45
|
+
- For `variant !== "default"`, variant is appended to `className` (for example `"primary"`).
|
|
46
|
+
|
|
47
|
+
Example:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
<Button variant="primary" onClick={onSave}>Save</Button>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Input
|
|
54
|
+
|
|
55
|
+
Import:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Input } from "@stamcat/craftsman/Input";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Props:
|
|
62
|
+
|
|
63
|
+
- Pure passthrough of native `<input>` props.
|
|
64
|
+
|
|
65
|
+
Example:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<Input type="email" placeholder="you@company.com" required />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Loader
|
|
72
|
+
|
|
73
|
+
Import:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { Loader } from "@stamcat/craftsman/Loader";
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Props:
|
|
80
|
+
|
|
81
|
+
- Inherits all native `<div>` props.
|
|
82
|
+
- `type` is required and must be one of:
|
|
83
|
+
- `"dots"`
|
|
84
|
+
- `"dots-trace"`
|
|
85
|
+
- `"dots-bounce"`
|
|
86
|
+
- `"dots-orbit"`
|
|
87
|
+
- `"dashes"`
|
|
88
|
+
- `"spinner"`
|
|
89
|
+
- `"swirl"`
|
|
90
|
+
- `"ball"`
|
|
91
|
+
- `"boxy"`
|
|
92
|
+
- `"factory"`
|
|
93
|
+
- `color?: string` (default: `"black"`)
|
|
94
|
+
- `width?: number` (optional, variant-dependent default behavior)
|
|
95
|
+
- `styles?: SerializedStyles` (Emotion override)
|
|
96
|
+
|
|
97
|
+
Example:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<Loader type="spinner" color="var(--blue500)" width={40} aria-label="Loading" />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Styling Expectations
|
|
104
|
+
|
|
105
|
+
- Components are built with Emotion and class-based variant hooks.
|
|
106
|
+
- If your app does not include this package's global CSS variable setup, visual output may differ.
|
|
107
|
+
- Agents should avoid hard-coding assumptions about token names beyond what the consumer app already defines.
|
|
108
|
+
|
|
109
|
+
## Utility Functions
|
|
110
|
+
|
|
111
|
+
### `isEmpty`
|
|
112
|
+
|
|
113
|
+
The package exports an `isEmpty` utility. **Always use it instead of writing inline empty checks.**
|
|
114
|
+
|
|
115
|
+
Import:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
import { isEmpty } from "@stamcat/craftsman/utilities/validations";
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
It returns `true` for:
|
|
122
|
+
|
|
123
|
+
- `undefined`
|
|
124
|
+
- `null`
|
|
125
|
+
- empty objects — `{}`
|
|
126
|
+
- strings that are empty or whitespace-only — `""`, `" "`
|
|
127
|
+
- arrays with no elements — `[]`
|
|
128
|
+
|
|
129
|
+
Examples:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
// DO — use isEmpty
|
|
133
|
+
if (isEmpty(value)) { ... }
|
|
134
|
+
if (!isEmpty(items)) { ... }
|
|
135
|
+
|
|
136
|
+
// DO NOT — write these manually
|
|
137
|
+
if (value === undefined || value === null) { ... }
|
|
138
|
+
if (typeof value === "string" && value.trim().length === 0) { ... }
|
|
139
|
+
if (Object.keys(obj).length === 0) { ... }
|
|
140
|
+
if (arr.length === 0) { ... }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Code Generation Patterns to Prefer
|
|
144
|
+
|
|
145
|
+
1. Generate fully typed React usage examples.
|
|
146
|
+
2. Keep accessibility props in place (`aria-label`, `disabled`, semantic `type`).
|
|
147
|
+
3. Use `variant="primary"` for main actions and `variant="text"` for low-emphasis actions.
|
|
148
|
+
4. For loading states, pair `Loader` with accessible status text where needed.
|
|
149
|
+
|
|
150
|
+
## Known Limitations (Current Package State)
|
|
151
|
+
|
|
152
|
+
1. README is minimal; treat this guide as the source of truth for agent usage.
|
|
153
|
+
2. Theme utilities exist in source but are not guaranteed public package exports.
|
|
154
|
+
3. Additional components in source (for example `Progress`) may not yet be exported.
|
|
155
|
+
|
|
156
|
+
## Safe Fallback Strategy for Agents
|
|
157
|
+
|
|
158
|
+
If uncertain about available exports:
|
|
159
|
+
|
|
160
|
+
1. Use only `Button`, `Input`, and `Loader` from their component entry points.
|
|
161
|
+
2. Do not invent package APIs.
|
|
162
|
+
3. Prefer native HTML elements for anything not explicitly exported.
|
package/Components.esm.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { Button as e } from "./Button.esm.js";
|
|
2
|
-
import { Input as t } from "./Input.esm.js";
|
|
3
|
-
|
|
1
|
+
import { Button as e } from "./src/components/Button.esm.js";
|
|
2
|
+
import { Input as t } from "./src/components/Input.esm.js";
|
|
3
|
+
import { Loader as n } from "./src/components/Loader.esm.js";
|
|
4
|
+
import { Modal as r } from "./src/components/Modal.esm.js";
|
|
5
|
+
export { e as Button, t as Input, n as Loader, r as Modal };
|
package/components/Button.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { ButtonType } from '../styles/global/components/button';
|
|
3
|
+
export type ButtonProps = React.ComponentProps<"button"> & {
|
|
4
|
+
variant?: ButtonType;
|
|
5
|
+
styles?: SerializedStyles;
|
|
6
|
+
};
|
|
2
7
|
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LoaderStyle } from '../styles/global/components/loaders';
|
|
2
|
+
import { SerializedStyles } from '@emotion/react';
|
|
3
|
+
export type LoaderProps = React.ComponentProps<"div"> & {
|
|
4
|
+
type: LoaderStyle;
|
|
5
|
+
color?: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
styles?: SerializedStyles;
|
|
8
|
+
};
|
|
9
|
+
export declare const Loader: React.FC<LoaderProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SerializedStyles } from '@emotion/react';
|
|
3
|
+
export type ModalType = "dialog" | "panel";
|
|
4
|
+
export interface ModalProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
onDismiss?: () => void;
|
|
7
|
+
type?: ModalType;
|
|
8
|
+
header?: string | React.ReactNode;
|
|
9
|
+
backgroundDismiss?: boolean;
|
|
10
|
+
hideDismissIcon?: boolean;
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
styles?: SerializedStyles;
|
|
13
|
+
}
|
|
14
|
+
type ModalState = {
|
|
15
|
+
isClosing: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare class Modal extends React.PureComponent<ModalProps, ModalState> {
|
|
18
|
+
readonly state: ModalState;
|
|
19
|
+
onDismiss: () => void;
|
|
20
|
+
onClickBackground: () => void;
|
|
21
|
+
render(): React.JSX.Element | null;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/index.d.ts
CHANGED
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.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A powerful, lightweight framework for design systems",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
"react-date-picker": "12.0.2",
|
|
32
32
|
"react-datetime-picker": "7.0.2",
|
|
33
33
|
"react-dom": "19.2.7",
|
|
34
|
+
"react-icons": "5.7.0",
|
|
34
35
|
"react-international-phone": "4.8.0",
|
|
36
|
+
"react-toastify": "11.1.0",
|
|
37
|
+
"sass-embedded": "1.100.0",
|
|
35
38
|
"zod": "4.4.3"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {},
|
|
@@ -43,6 +46,14 @@
|
|
|
43
46
|
"./Input": {
|
|
44
47
|
"types": "./Input.d.ts",
|
|
45
48
|
"default": "./Input.es.js"
|
|
49
|
+
},
|
|
50
|
+
"./Loader": {
|
|
51
|
+
"types": "./Loader.d.ts",
|
|
52
|
+
"default": "./Loader.es.js"
|
|
53
|
+
},
|
|
54
|
+
"./Modal": {
|
|
55
|
+
"types": "./Modal.d.ts",
|
|
56
|
+
"default": "./Modal.es.js"
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useTheme as e } from "@emotion/react";
|
|
2
|
+
import t from "@emotion/styled";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Button.tsx
|
|
5
|
+
var r = t.button`
|
|
6
|
+
${(e) => e.styles}
|
|
7
|
+
`, i = (t) => {
|
|
8
|
+
let { type: i = "button", variant: a = "default", className: o, ...s } = t, c = e(), l = typeof c?.components?.button == "string" ? c.components.button : void 0;
|
|
9
|
+
return /* @__PURE__ */ n(r, {
|
|
10
|
+
type: i,
|
|
11
|
+
className: [
|
|
12
|
+
a === "default" ? void 0 : a,
|
|
13
|
+
l,
|
|
14
|
+
o
|
|
15
|
+
].filter(Boolean).join(" ") || void 0,
|
|
16
|
+
...s
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as Button };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { loaders as e } from "../styles/global/components/loaders.esm.js";
|
|
2
|
+
import t from "../styles/global/components/loaders.module.esm.js";
|
|
3
|
+
import n from "@emotion/styled";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Loader.tsx
|
|
6
|
+
var i = n.div`
|
|
7
|
+
${(t) => e[t.type](t.color, t.width)}
|
|
8
|
+
${(e) => e.styles}
|
|
9
|
+
`, a = (e) => {
|
|
10
|
+
let { type: n, color: a = "black", ...o } = e;
|
|
11
|
+
return /* @__PURE__ */ r(i, {
|
|
12
|
+
className: t[n],
|
|
13
|
+
type: n,
|
|
14
|
+
color: a || "black",
|
|
15
|
+
...o
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { a as Loader };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Button as e } from "./Button.esm.js";
|
|
2
|
+
import { breakpoint as t } from "../styles/utilities/layout.esm.js";
|
|
3
|
+
import { LuX as n } from "../../node_modules/react-icons/lu/index.esm.js";
|
|
4
|
+
import { color as r } from "../styles/utilities/color.esm.js";
|
|
5
|
+
import { css as i, keyframes as a } from "@emotion/react";
|
|
6
|
+
import o from "@emotion/styled";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import u from "react";
|
|
9
|
+
//#region src/components/Modal.tsx
|
|
10
|
+
var d = a`
|
|
11
|
+
from {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
`, f = a`
|
|
18
|
+
from {
|
|
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 {
|
|
118
|
+
state = { isClosing: !1 };
|
|
119
|
+
onDismiss = () => {
|
|
120
|
+
this.props.onDismiss && (this.setState({ isClosing: !0 }), setTimeout(() => {
|
|
121
|
+
this.props.onDismiss && this.props.onDismiss(), this.setState({ isClosing: !1 });
|
|
122
|
+
}, 280));
|
|
123
|
+
};
|
|
124
|
+
onClickBackground = () => {
|
|
125
|
+
let e = this.props.backgroundDismiss;
|
|
126
|
+
(e === !0 || e === void 0) && this.onDismiss();
|
|
127
|
+
};
|
|
128
|
+
render() {
|
|
129
|
+
return this.props.visible ? /* @__PURE__ */ l(h, {
|
|
130
|
+
styles: this.props.styles,
|
|
131
|
+
children: [/* @__PURE__ */ l(S, {
|
|
132
|
+
type: this.props.type || "dialog",
|
|
133
|
+
isClosing: this.state.isClosing,
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ l("header", { children: [this.props.header && /* @__PURE__ */ c(s, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ c(e, {
|
|
136
|
+
variant: "primary",
|
|
137
|
+
styles: C,
|
|
138
|
+
onClick: this.onDismiss,
|
|
139
|
+
children: /* @__PURE__ */ c(n, {
|
|
140
|
+
fill: r("white"),
|
|
141
|
+
viewBox: "6 8 14 14",
|
|
142
|
+
size: 24
|
|
143
|
+
})
|
|
144
|
+
})] }),
|
|
145
|
+
/* @__PURE__ */ c("section", { children: this.props.children }),
|
|
146
|
+
this.props.footer && /* @__PURE__ */ c(w, { children: this.props.footer })
|
|
147
|
+
]
|
|
148
|
+
}), /* @__PURE__ */ c(g, {
|
|
149
|
+
isClosing: this.state.isClosing,
|
|
150
|
+
onClick: this.onClickBackground
|
|
151
|
+
})]
|
|
152
|
+
}) : null;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { T as Modal };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { css as e } from "@emotion/react";
|
|
2
|
+
import t from "zod";
|
|
3
|
+
t.enum([
|
|
4
|
+
"dots",
|
|
5
|
+
"dots-trace",
|
|
6
|
+
"dots-bounce",
|
|
7
|
+
"dots-orbit",
|
|
8
|
+
"dashes",
|
|
9
|
+
"spinner",
|
|
10
|
+
"swirl",
|
|
11
|
+
"ball",
|
|
12
|
+
"boxy",
|
|
13
|
+
"factory"
|
|
14
|
+
]);
|
|
15
|
+
var n = {
|
|
16
|
+
dots: (t, n = 100) => e`
|
|
17
|
+
--_l5c: ${t};
|
|
18
|
+
--_l5w: ${Math.round(n * .125)}px;
|
|
19
|
+
--_l5w2: ${Math.round(n * .16666)}px;
|
|
20
|
+
--_l5w3: ${Math.round(n * -.16666)}px;
|
|
21
|
+
`,
|
|
22
|
+
"dots-bounce": (t, n = 60) => e`
|
|
23
|
+
--_g: no-repeat radial-gradient(circle closest-side, ${t} 90%, #0000);
|
|
24
|
+
--_gw: ${n}px;
|
|
25
|
+
`,
|
|
26
|
+
"dots-trace": (t, n = 60) => e`
|
|
27
|
+
--_dtc: ${t};
|
|
28
|
+
--_dtw: ${n}px;
|
|
29
|
+
`,
|
|
30
|
+
"dots-orbit": (t, n = 17) => e`
|
|
31
|
+
--_doc: ${t};
|
|
32
|
+
--_dow: ${n}px;
|
|
33
|
+
`,
|
|
34
|
+
dashes: (t, n = 40) => e`
|
|
35
|
+
--_dshc: ${t};
|
|
36
|
+
--_dshw: ${n}px;
|
|
37
|
+
--_dshw2: ${Math.round(n / 4)}px;
|
|
38
|
+
`,
|
|
39
|
+
spinner: (t, n = 50) => e`
|
|
40
|
+
--_spnc: ${t};
|
|
41
|
+
--_spnw: ${n}px;
|
|
42
|
+
--_spnw2: ${Math.round(n * .16)}px;
|
|
43
|
+
`,
|
|
44
|
+
swirl: (t, n = 50) => e`
|
|
45
|
+
--_swrlc: ${t};
|
|
46
|
+
--_swrlw: ${n}px;
|
|
47
|
+
--_swrlw2: ${Math.round(n * .16)}px;
|
|
48
|
+
`,
|
|
49
|
+
ball: (t, n = 50) => e`
|
|
50
|
+
--_ballc: ${t};
|
|
51
|
+
--_ballw: ${n}px;
|
|
52
|
+
--_ballw2: ${Math.round(n * .24)}px;
|
|
53
|
+
`,
|
|
54
|
+
boxy: (t, n = 120) => e`
|
|
55
|
+
--_boxc: ${t};
|
|
56
|
+
--_boxw: ${n}px;
|
|
57
|
+
--_boxw2: ${Math.round(n * .16666)}px;
|
|
58
|
+
`,
|
|
59
|
+
factory: (t, n = 0) => e`
|
|
60
|
+
--_ftyc: ${t};
|
|
61
|
+
--_ftyw: ${n};
|
|
62
|
+
`
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { n as loaders };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dots_1132g_1{aspect-ratio:1;width:var(--_l5w);margin:0 var(--_l5w2);border-radius:50%;animation:1s linear infinite alternate _l5_1132g_1}@keyframes _l5_1132g_1{0%{box-shadow:var(--_l5w2) 0 var(--_l5c), var(--_l5w3) 0 color-mix(in srgb, var(--_l5c) 80%, white 75%);background:var(--_l5c)}33%{box-shadow:var(--_l5w2) 0 var(--_l5c), var(--_l5w3) 0 color-mix(in srgb, var(--_l5c) 80%, white 75%);background:color-mix(in srgb, var(--_l5c) 80%, white 75%)}66%{box-shadow:var(--_l5w2) 0 color-mix(in srgb, var(--_l5c) 80%, white 75%), var(--_l5w3) 0 var(--_l5c);background:color-mix(in srgb, var(--_l5c) 80%, white 75%)}to{box-shadow:var(--_l5w2) 0 color-mix(in srgb, var(--_l5c) 80%, white 75%), var(--_l5w3) 0 var(--_l5c);background:var(--_l5c)}}._dots-bounce_1132g_27{width:var(--_gw);aspect-ratio:2;background:var(--_g) 0% 50%, var(--_g) 50% 50%, var(--_g) 100% 50%;background-size:33.3333% 50%;animation:1s linear infinite _l3_1132g_1}@keyframes _l3_1132g_1{to{transform:rotate(1turn)}}._dots-trace_1132g_49{width:var(--_dtw);aspect-ratio:4;background:radial-gradient(circle closest-side, var(--_dtc) 90%, #0000) 0/33.3333% 100% space;clip-path:inset(0 100% 0 0);animation:1s steps(4,end) infinite _l1_1132g_1}@keyframes _l1_1132g_1{to{clip-path:inset(0 -34% 0 0)}}._dots-orbit_1132g_62{width:var(--_dow);aspect-ratio:1;background:var(--_doc);border-radius:50%;animation:2s linear infinite _l22-0_1132g_1;display:grid}._dots-orbit_1132g_62:before,._dots-orbit_1132g_62:after{content:"";background:inherit;border-radius:50%;grid-area:1/1;margin:15%;animation:1s infinite _l22_1132g_1;transform:rotate(0)translate(150%)}._dots-orbit_1132g_62:after{animation-delay:-.5s}@keyframes _l22-0_1132g_1{to{transform:rotate(1turn)}}@keyframes _l22_1132g_1{to{transform:rotate(1turn)translate(150%)}}._dashes_1132g_93{width:var(--_dshw);height:calc(var(--_dshw) * .3);background:linear-gradient(var(--_dshc) 0 0) left/var(--_dshw2) 4px, linear-gradient(var(--_dshc) 0 0) center/var(--_dshw2) 4px, linear-gradient(var(--_dshc) 0 0) right/var(--_dshw2) 4px;background-repeat:no-repeat;animation:1s linear infinite _dashes_1132g_93}@keyframes _dashes_1132g_93{0%{background-size:var(--_dshw2) 4px, var(--_dshw2) 4px, var(--_dshw2) 4px;opacity:1}33%{background-size:var(--_dshw2) var(--_dshw2), var(--_dshw2) 4px, var(--_dshw2) 4px;opacity:.7}66%{background-size:var(--_dshw2) 4px, var(--_dshw2) var(--_dshw2), var(--_dshw2) 4px;opacity:.7}to{background-size:var(--_dshw2) 4px, var(--_dshw2) 4px, var(--_dshw2) var(--_dshw2);opacity:1}}._spinner_1132g_119{width:var(--_spnw);aspect-ratio:1;border:var(--_spnw2) solid color-mix(in srgb, var(--_spnc) 20%, transparent);border-right-color:var(--_spnc);border-radius:50%;animation:1s linear infinite _l2_1132g_1}@keyframes _l2_1132g_1{to{transform:rotate(1turn)}}._swirl_1132g_133{width:var(--_swrlw);padding:var(--_swrlw2);aspect-ratio:1;background:var(--_swrlc);--_m:conic-gradient(#0000 10%,#000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;border-radius:50%;animation:1s linear infinite _l3_1132g_1;-webkit-mask-composite:source-out;mask-composite:subtract}._ball_1132g_154{width:var(--_ballw);aspect-ratio:1;background:radial-gradient(farthest-side, var(--_ballc) 95%, #0000) 50% 1px/var(--_ballw2) var(--_ballw2) no-repeat, radial-gradient(farthest-side, #0000 calc(100% - var(--_ballw2)), #ccc 0);border-radius:50%;animation:2s linear infinite _l9_1132g_1}@keyframes _l9_1132g_1{to{transform:rotate(1turn)}}._boxy_1132g_167{width:var(--_boxw);height:var(--_boxw2);background:linear-gradient(var(--_boxc) 0 0) left -25% top 0/20% 100% no-repeat #ddd;animation:1s steps(6,end) infinite _l7_1132g_1;-webkit-mask:linear-gradient(90deg,#000 70%,#0000 0) 0/20% 100%}@keyframes _l7_1132g_1{to{background-position:right -25% top 0}}._factory_1132g_180{width:var(--_ftyw);height:var(--_ftyw2);box-shadow:0 3px 0 var(--_ftyc);clip-path:inset(-40px 0 -5px);position:relative}._factory_1132g_180:before{content:"";height:var(--_ftyw3);--g:no-repeat linear-gradient(color-mix(in srgb, var(--_ftyc) 30%, white) 0 0);background:var(--g), var(--g), var(--g), var(--g);background-size:var(--_ftyw4) 14px;animation:2s linear infinite _l7-1_1132g_1,2s linear infinite _l7-2_1132g_1;position:absolute;inset:auto calc(50% - 17px) 0}@keyframes _l7-1_1132g_1{0%,to{background-position:0 -var(--_ftyw3), 100% -var(--_ftyw3)}17.5%{background-position:0 100%, 100% -var(--_ftyw3), 0 -var(--_ftyw3), 100% -var(--_ftyw3)}35%{background-position:0 100%, 100% 100%, 0 -var(--_ftyw3), 100% -var(--_ftyw3)}52.5%{background-position:0 100%, 100% 100%, 0 calc(100% - var(--_ftyw4)), 100% -var(--_ftyw3)}70%,98%{background-position:0 100%, 100% 100%, 0 calc(100% - var(--_ftyw4)), 100% calc(100% - var(--_ftyw4))}}@keyframes _l7-2_1132g_1{0%,70%{transform:translate(0)}to{transform:translate(200%)}}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './loaders.module.css';//#region src/styles/global/components/loaders.module.scss
|
|
2
|
+
var e = "_dots_1132g_1", t = "_l5_1132g_1", n = "_l3_1132g_1", r = "_l1_1132g_1", i = "_l22_1132g_1", a = "_dashes_1132g_93", o = "_spinner_1132g_119", s = "_l2_1132g_1", c = "_swirl_1132g_133", l = "_ball_1132g_154", u = "_l9_1132g_1", d = "_boxy_1132g_167", f = "_l7_1132g_1", p = "_factory_1132g_180", m = {
|
|
3
|
+
dots: e,
|
|
4
|
+
l5: t,
|
|
5
|
+
"dots-bounce": "_dots-bounce_1132g_27",
|
|
6
|
+
l3: n,
|
|
7
|
+
"dots-trace": "_dots-trace_1132g_49",
|
|
8
|
+
l1: r,
|
|
9
|
+
"dots-orbit": "_dots-orbit_1132g_62",
|
|
10
|
+
"l22-0": "_l22-0_1132g_1",
|
|
11
|
+
l22: i,
|
|
12
|
+
dashes: a,
|
|
13
|
+
spinner: o,
|
|
14
|
+
l2: s,
|
|
15
|
+
swirl: c,
|
|
16
|
+
ball: l,
|
|
17
|
+
l9: u,
|
|
18
|
+
boxy: d,
|
|
19
|
+
l7: f,
|
|
20
|
+
factory: p,
|
|
21
|
+
"l7-1": "_l7-1_1132g_1",
|
|
22
|
+
"l7-2": "_l7-2_1132g_1"
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { l as ball, d as boxy, a as dashes, m as default, e as dots, p as factory, r as l1, s as l2, i as l22, n as l3, t as l5, f as l7, u as l9, o as spinner, c as swirl };
|