@stamcat/craftsman 0.0.27-alpha.2 → 0.0.27-alpha.4
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 +54 -2
- package/Components.esm.js +11 -9
- package/README.md +5 -0
- package/Styles.esm.js +5 -5
- package/package.json +5 -4
- package/src/components/Button.d.ts +1 -1
- package/src/components/Button.esm.js +14 -16
- package/src/components/{Checkbox.esm.js → Input/Checkbox.esm.js} +1 -1
- package/src/components/Input/Input.d.ts +6 -0
- package/src/components/Input/Input.esm.js +33 -0
- package/src/components/Input/Input.module.css +1 -0
- package/src/components/Input/Input.module.esm.js +13 -0
- package/src/components/Input/Input.module.scss +165 -0
- package/src/components/{InputPassword.d.ts → Input/InputPassword.d.ts} +1 -1
- package/src/components/Input/InputPassword.esm.js +29 -0
- package/src/components/Input/InputWrapper.d.ts +11 -0
- package/src/components/Input/InputWrapper.esm.js +28 -0
- package/src/components/{RadioButton.esm.js → Input/RadioButton.esm.js} +1 -1
- package/src/components/Input/Textarea.d.ts +3 -0
- package/src/components/Input/Textarea.esm.js +25 -0
- package/src/components/Modal.esm.js +18 -26
- package/src/components/Modal.module.css +1 -1
- package/src/components/Modal.module.esm.js +6 -3
- package/src/components/Modal.module.scss +28 -14
- package/src/components/index.d.ts +5 -4
- package/src/styles/components/ThemeProvider.esm.js +1 -1
- package/src/styles/global/components/_button.scss +52 -51
- package/src/styles/global/components/_checkbox.scss +63 -59
- package/src/styles/global/components/_code.scss +19 -15
- package/src/styles/global/components/_input.scss +35 -37
- package/src/styles/global/components/_radioButton.scss +29 -26
- package/src/styles/global/components/_typography.scss +61 -6
- package/src/styles/global/components/loaders.module.css +1 -1
- package/src/styles/global/components/loaders.module.esm.js +1 -1
- package/src/styles/global/components/loaders.module.scss +2 -1
- package/src/styles/global/globalStyles.module.scss +1 -129
- package/src/styles/global/globalStyles.scss +83 -1
- package/src/styles/index.d.ts +1 -1
- package/src/styles/theme/components.esm.js +11 -5
- package/src/styles/theme/theme.esm.js +29 -43
- package/src/styles/theme/types.d.ts +1 -1
- package/src/styles/utilities/_functions.scss +116 -0
- package/src/styles/utilities/_mixins.scss +0 -0
- package/src/styles/utilities/color.d.ts +1 -1
- package/src/styles/utilities/constants.d.ts +1 -1
- package/src/styles/utilities/layout.d.ts +1 -1
- package/src/styles/utilities/layout.esm.js +1 -1
- package/src/{styles/utilities → utilities}/types.d.ts +7 -1
- package/src/{styles/utilities → utilities}/types.esm.js +6 -2
- package/src/components/Button.module.css +0 -1
- package/src/components/Button.module.esm.js +0 -9
- package/src/components/Button.module.scss +0 -5
- package/src/components/Input.d.ts +0 -11
- package/src/components/Input.esm.js +0 -41
- package/src/components/Input.module.css +0 -1
- package/src/components/Input.module.esm.js +0 -11
- package/src/components/Input.module.scss +0 -141
- package/src/components/InputPassword.esm.js +0 -33
- package/src/styles/global/components/_mixins.scss +0 -2
- package/src/styles/global/components/button.d.ts +0 -7
- /package/src/components/{Checkbox.d.ts → Input/Checkbox.d.ts} +0 -0
- /package/src/components/{RadioButton.d.ts → Input/RadioButton.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
@layer craftsman-base{._dots_mugu5_2{aspect-ratio:1;width:var(--_l5w);margin:0 var(--_l5w2);border-radius:50%;animation:1s linear infinite alternate _l5_mugu5_1}@keyframes _l5_mugu5_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)}}@keyframes _l3_mugu5_1{to{transform:rotate(1turn)}}._dots-trace_mugu5_41{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_mugu5_1}@keyframes _l1_mugu5_1{to{clip-path:inset(0 -34% 0 0)}}._dots-orbit_mugu5_53{width:var(--_dow);aspect-ratio:1;background:var(--_doc);border-radius:50%;animation:2s linear infinite _l22-0_mugu5_1;display:grid}._dots-orbit_mugu5_53:before,._dots-orbit_mugu5_53:after{content:"";background:inherit;border-radius:50%;grid-area:1/1;margin:15%;animation:1s infinite _l22_mugu5_1;transform:rotate(0)translate(150%)}._dots-orbit_mugu5_53:after{animation-delay:-.5s}@keyframes _l22-0_mugu5_1{to{transform:rotate(1turn)}}@keyframes _l22_mugu5_1{to{transform:rotate(1turn)translate(150%)}}._dashes_mugu5_83{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_mugu5_83}@keyframes _dashes_mugu5_83{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_mugu5_108{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_mugu5_1}@keyframes _l2_mugu5_1{to{transform:rotate(1turn)}}._swirl_mugu5_121{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_mugu5_1;-webkit-mask-composite:source-out;mask-composite:subtract}._ball_mugu5_141{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_mugu5_1}@keyframes _l9_mugu5_1{to{transform:rotate(1turn)}}._boxy_mugu5_153{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_mugu5_1;-webkit-mask:linear-gradient(90deg,#000 70%,#0000 0) 0/20% 100%}@keyframes _l7_mugu5_1{to{background-position:right -25% top 0}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './loaders.module.css';//#region src/styles/global/components/loaders.module.scss
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_dots_mugu5_2", t = "_l5_mugu5_1", n = "_dots-trace_mugu5_41", r = "_l1_mugu5_1", i = "_dots-orbit_mugu5_53", a = "_l22-0_mugu5_1", o = "_l22_mugu5_1", s = "_dashes_mugu5_83", c = "_spinner_mugu5_108", l = "_l2_mugu5_1", u = "_swirl_mugu5_121", d = "_l3_mugu5_1", f = "_ball_mugu5_141", p = "_l9_mugu5_1", m = "_boxy_mugu5_153", h = "_l7_mugu5_1", g = {
|
|
3
3
|
dots: e,
|
|
4
4
|
l5: t,
|
|
5
5
|
dotsTrace: n,
|
|
@@ -1,129 +1 @@
|
|
|
1
|
-
@use "./
|
|
2
|
-
@use "./components/code";
|
|
3
|
-
@use "./components/mixins" as mixins;
|
|
4
|
-
@use "./components/checkbox";
|
|
5
|
-
@use "./components/radioButton";
|
|
6
|
-
@use "./components/button";
|
|
7
|
-
@use "./components/input";
|
|
8
|
-
|
|
9
|
-
:global {
|
|
10
|
-
:root {
|
|
11
|
-
color-scheme: light dark;
|
|
12
|
-
font-synthesis: none;
|
|
13
|
-
text-rendering: optimizeLegibility;
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
-moz-osx-font-smoothing: grayscale;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
::-webkit-scrollbar {
|
|
19
|
-
width: 4px;
|
|
20
|
-
height: 4px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
::-webkit-scrollbar-track {
|
|
24
|
-
background: #ddd;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
::-webkit-scrollbar-thumb {
|
|
28
|
-
background: #000;
|
|
29
|
-
border-radius: 6px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
::-webkit-scrollbar-thumb:hover {
|
|
33
|
-
background: #555;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
body {
|
|
37
|
-
@extend %body-typography;
|
|
38
|
-
}
|
|
39
|
-
body,
|
|
40
|
-
ul {
|
|
41
|
-
margin: 0;
|
|
42
|
-
padding: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
body {
|
|
46
|
-
background-color: #fff;
|
|
47
|
-
-webkit-overflow-scrolling: touch;
|
|
48
|
-
overscroll-behavior: contain;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
fieldset {
|
|
52
|
-
padding: 0;
|
|
53
|
-
border: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
code {
|
|
57
|
-
@extend %code;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
button {
|
|
61
|
-
@extend %button-styles;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
input {
|
|
65
|
-
@extend %input-base;
|
|
66
|
-
|
|
67
|
-
&[type="radio"] {
|
|
68
|
-
@extend %radio;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&[type="checkbox"] {
|
|
72
|
-
@extend %checkbox;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
a {
|
|
77
|
-
@extend %text-link;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
h1 {
|
|
81
|
-
font-size: calc(var(--w-text, 14px) * 3.125);
|
|
82
|
-
line-height: 1.2;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
h2 {
|
|
86
|
-
font-size: calc(var(--w-text, 14px) * 2.625);
|
|
87
|
-
font-weight: 625;
|
|
88
|
-
line-height: 1.1;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
h3 {
|
|
92
|
-
font-size: calc(var(--w-text, 14px) * 1.625);
|
|
93
|
-
line-height: 1.1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
h4 {
|
|
97
|
-
font-size: calc(var(--w-text, 14px) * 1.25);
|
|
98
|
-
line-height: 1.1;
|
|
99
|
-
margin: calc(var(--w-gutter, 16px) * 0.5) 0;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
h5 {
|
|
103
|
-
font-size: var(--w-text, 14px);
|
|
104
|
-
line-height: 1.2;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
h6 {
|
|
108
|
-
font-size: calc(var(--w-text, 14px) * 0.875);
|
|
109
|
-
line-height: 1.2;
|
|
110
|
-
font-weight: 600;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
p {
|
|
114
|
-
font-style: normal;
|
|
115
|
-
font-size: var(--w-text, 14px);
|
|
116
|
-
line-height: 1.5;
|
|
117
|
-
margin: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
@media (max-width: 659.99999px) {
|
|
121
|
-
h4 {
|
|
122
|
-
font-size: var(--w-text, 14px);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
p {
|
|
126
|
-
font-size: calc(var(--w-text, 14px) * 0.875);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
1
|
+
@use "./globalStyles.scss";
|
|
@@ -1 +1,83 @@
|
|
|
1
|
-
@use "./
|
|
1
|
+
@use "./components/typography";
|
|
2
|
+
@use "./components/code";
|
|
3
|
+
@use "./components/checkbox";
|
|
4
|
+
@use "./components/radioButton";
|
|
5
|
+
@use "./components/button";
|
|
6
|
+
@use "./components/input";
|
|
7
|
+
|
|
8
|
+
@layer craftsman-base, craftsman-theme;
|
|
9
|
+
|
|
10
|
+
@layer craftsman-base {
|
|
11
|
+
:global {
|
|
12
|
+
:root {
|
|
13
|
+
color-scheme: light dark;
|
|
14
|
+
font-synthesis: none;
|
|
15
|
+
text-rendering: optimizeLegibility;
|
|
16
|
+
-webkit-font-smoothing: antialiased;
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
::-webkit-scrollbar {
|
|
21
|
+
width: 4px;
|
|
22
|
+
height: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
::-webkit-scrollbar-track {
|
|
26
|
+
background: #ddd;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
::-webkit-scrollbar-thumb {
|
|
30
|
+
background: #000;
|
|
31
|
+
border-radius: 6px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
::-webkit-scrollbar-thumb:hover {
|
|
35
|
+
background: #555;
|
|
36
|
+
}
|
|
37
|
+
body, ul {
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
body {
|
|
43
|
+
@extend %body-typography;
|
|
44
|
+
background-color: #fff;
|
|
45
|
+
-webkit-overflow-scrolling: touch;
|
|
46
|
+
overscroll-behavior: contain;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fieldset {
|
|
50
|
+
padding: 0;
|
|
51
|
+
border: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
code {
|
|
55
|
+
@extend %code;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button {
|
|
59
|
+
@extend %button-styles;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
input {
|
|
63
|
+
&:not([type="radio"]):not([type="checkbox"]) {
|
|
64
|
+
@extend %input-base;
|
|
65
|
+
}
|
|
66
|
+
&[type="checkbox"] {
|
|
67
|
+
@extend %checkbox;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&[type="radio"] {
|
|
71
|
+
@extend %radio;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
textarea {
|
|
75
|
+
@extend %input-base;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
a {
|
|
79
|
+
@extend %text-link;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
package/src/styles/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './utilities/color';
|
|
2
2
|
export * from './utilities/constants';
|
|
3
3
|
export * from './utilities/layout';
|
|
4
|
-
export * from '
|
|
4
|
+
export * from '../utilities/types';
|
|
5
5
|
export * from './theme/theme';
|
|
6
6
|
export { ThemeProvider } from './components/ThemeProvider';
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { htmlTagNames as e } from "./constants.esm.js";
|
|
2
2
|
import { components_exports as t } from "../../../Components.esm.js";
|
|
3
3
|
//#region src/styles/theme/components.ts
|
|
4
|
-
|
|
4
|
+
var n = {
|
|
5
|
+
button: "button",
|
|
6
|
+
input: "input:not([type='radio']):not([type='checkbox'])",
|
|
7
|
+
checkbox: "input[type='checkbox']",
|
|
8
|
+
radioButton: "input[type='radio']"
|
|
9
|
+
};
|
|
10
|
+
function r(e) {
|
|
5
11
|
return e.charAt(0).toLowerCase() + e.slice(1);
|
|
6
12
|
}
|
|
7
|
-
function
|
|
8
|
-
return e.has(t) ? `${t}, .${t}` : `.${t}
|
|
13
|
+
function i(t) {
|
|
14
|
+
return n[t] || (e.has(t) ? `${t}, .${t}` : `.${t}`);
|
|
9
15
|
}
|
|
10
|
-
var
|
|
16
|
+
var a = Object.keys(t).map(r), o = Object.fromEntries(a.map((e) => [e, i(e)]));
|
|
11
17
|
//#endregion
|
|
12
|
-
export {
|
|
18
|
+
export { o as componentSelectors };
|
|
@@ -2,55 +2,41 @@ import { componentSelectors as e } from "./components.esm.js";
|
|
|
2
2
|
import { cssObjectToCssText as t, toCSSObject as n } from "./utilities.esm.js";
|
|
3
3
|
import { colors as r, widths as i } from "../global/variables.esm.js";
|
|
4
4
|
//#region src/styles/theme/theme.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (a instanceof CSSStyleRule) {
|
|
11
|
-
if (!a.selectorText.split(",").map((e) => e.trim()).includes(t)) continue;
|
|
12
|
-
r = !0;
|
|
13
|
-
for (let e of Array.from(a.style)) n[e] = a.style.getPropertyValue(e);
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
a instanceof CSSGroupingRule && i(a.cssRules);
|
|
5
|
+
function a(e) {
|
|
6
|
+
if (e) {
|
|
7
|
+
if (typeof e == "string") {
|
|
8
|
+
let t = e.trim();
|
|
9
|
+
return t.includes("{") ? t : `:root { ${t} }`;
|
|
17
10
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
e.cssRules && i(e.cssRules);
|
|
21
|
-
} catch {}
|
|
22
|
-
return r ? n : void 0;
|
|
11
|
+
return t(":root", n(e));
|
|
12
|
+
}
|
|
23
13
|
}
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
function o(e, r) {
|
|
15
|
+
if (typeof r == "string") {
|
|
16
|
+
let t = r.trim();
|
|
17
|
+
return t.includes("{") ? t : `${e} { ${t} }`;
|
|
18
|
+
}
|
|
19
|
+
return t(e, n(r));
|
|
28
20
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (typeof o == "string") {
|
|
35
|
-
let n = s(o);
|
|
36
|
-
if (!n) return;
|
|
37
|
-
i.push(t(e[a], n));
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
i.push(t(e[a], n(o)));
|
|
41
|
-
}
|
|
42
|
-
}), i;
|
|
21
|
+
function s(t) {
|
|
22
|
+
return Object.keys(e).map((n) => {
|
|
23
|
+
let r = t?.[n];
|
|
24
|
+
return r ? o(e[n], r) : void 0;
|
|
25
|
+
}).filter((e) => !!e);
|
|
43
26
|
}
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
...e.colors || {},
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
function c(e) {
|
|
28
|
+
let n = [
|
|
29
|
+
t(":root", { ...e.colors || {} }),
|
|
30
|
+
a(e.root),
|
|
31
|
+
...s(e.components)
|
|
32
|
+
].filter(Boolean).join("\n");
|
|
49
33
|
return [
|
|
50
34
|
`:root { ${i} ${r} }`,
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
"@layer craftsman-base, craftsman-theme;",
|
|
36
|
+
"@layer craftsman-theme {",
|
|
37
|
+
n,
|
|
38
|
+
"}"
|
|
53
39
|
].filter(Boolean).join("\n");
|
|
54
40
|
}
|
|
55
41
|
//#endregion
|
|
56
|
-
export {
|
|
42
|
+
export { c as themeBuilder };
|
|
@@ -16,7 +16,7 @@ export type ComponentThemeOverrides = {
|
|
|
16
16
|
export type Colors = Partial<Record<ColorVariableName, string>>;
|
|
17
17
|
export type Theme = {
|
|
18
18
|
colors?: Colors;
|
|
19
|
-
root?: CSSObject | LegacySerializedStyles;
|
|
19
|
+
root?: CSSObject | LegacySerializedStyles | string;
|
|
20
20
|
components?: ComponentThemeOverrides;
|
|
21
21
|
};
|
|
22
22
|
export type ThemeProviderProps = {
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
|
|
4
|
+
$width-defaults: (
|
|
5
|
+
text: var(--w-text),
|
|
6
|
+
gutter: var(--w-gutter),
|
|
7
|
+
column: var(--w-column),
|
|
8
|
+
mobileMax: var(--w-mobile-max),
|
|
9
|
+
tablet: var(--w-tablet),
|
|
10
|
+
tabletMax: var(--w-tabletMax),
|
|
11
|
+
desktop: var(--w-desktop),
|
|
12
|
+
desktopMax: var(--w-desktopMax),
|
|
13
|
+
extDesktop: var(--w-extDesktop),
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
@function color($name, $type: hex, $alpha: 1) {
|
|
17
|
+
@if $type == rgba {
|
|
18
|
+
@return string.unquote("rgb(from var(--#{$name}) r g b / #{$alpha})");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@return string.unquote("var(--#{$name})");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@function width-var($name) {
|
|
25
|
+
@if not map.has-key($width-defaults, $name) {
|
|
26
|
+
@error "Unknown width key `#{$name}`.";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$fallback: map.get($width-defaults, $name);
|
|
30
|
+
@return string.unquote("var(--w-#{$name}, #{$fallback}px)");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@function width($name, $multiplier: 1, $px: true) {
|
|
34
|
+
$value: width-var($name);
|
|
35
|
+
|
|
36
|
+
@if $name == column {
|
|
37
|
+
$gutter-steps: $multiplier - 1;
|
|
38
|
+
$gutter: width-var(gutter);
|
|
39
|
+
|
|
40
|
+
@if $px {
|
|
41
|
+
@return string.unquote("calc((#{$value} * #{$multiplier}) + (#{$gutter} * #{$gutter-steps}))");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@return string.unquote("calc((#{$value} * #{$multiplier}) + (#{$gutter} * #{$gutter-steps}))");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@if $px {
|
|
48
|
+
@if $multiplier == 1 {
|
|
49
|
+
@return $value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@return string.unquote("calc(#{$value} * #{$multiplier})");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@if $multiplier == 1 {
|
|
56
|
+
@return string.unquote("#{$value}");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@return string.unquote("calc(#{$value} * #{$multiplier})");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@function media($bp) {
|
|
63
|
+
@if $bp == mobile {
|
|
64
|
+
@return string.unquote("(min-width: 0px)");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@if $bp == mobileMax {
|
|
68
|
+
@return string.unquote("(max-width: #{width(mobileMax)})");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@if $bp == tablet {
|
|
72
|
+
@return string.unquote("(min-width: #{width(tablet)})");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@if $bp == tabletMax {
|
|
76
|
+
@return string.unquote("(max-width: #{width(tabletMax)})");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@if $bp == desktop {
|
|
80
|
+
@return string.unquote("(min-width: #{width(desktop)})");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@if $bp == desktopMax {
|
|
84
|
+
@return string.unquote("(max-width: #{width(desktopMax)})");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@if $bp == extDesktop {
|
|
88
|
+
@return string.unquote("(min-width: #{width(extDesktop)})");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@if $bp == mobileOnly {
|
|
92
|
+
@return string.unquote("(min-width: 0px) and (max-width: #{width(mobileMax)})");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@if $bp == tabletOnly {
|
|
96
|
+
@return string.unquote("(min-width: #{width(tablet)}) and (max-width: #{width(tabletMax)})");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@if $bp == mobileTablet {
|
|
100
|
+
@return string.unquote("(min-width: 0px) and (max-width: #{width(tabletMax)})");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@if $bp == desktopOnly {
|
|
104
|
+
@return string.unquote("(min-width: #{width(desktop)}) and (max-width: #{width(desktopMax)})");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@error "Unknown breakpoint `#{$bp}`.";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@mixin breakpoint($bp) {
|
|
111
|
+
@media #{media($bp)} {
|
|
112
|
+
@content;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultWidths as e } from "./constants.esm.js";
|
|
2
|
-
import { LayoutWidthsSchema as t } from "
|
|
2
|
+
import { LayoutWidthsSchema as t } from "../../utilities/types.esm.js";
|
|
3
3
|
//#region src/styles/utilities/layout.ts
|
|
4
4
|
var n = Object.fromEntries(t.options.map((t) => [t, `var(--w-${t}, ${e[t]}px)`])), r = {
|
|
5
5
|
get mobile() {
|
|
@@ -26,7 +26,6 @@ export declare const BreakpointSchema: z.ZodEnum<{
|
|
|
26
26
|
desktopOnly: "desktopOnly";
|
|
27
27
|
}>;
|
|
28
28
|
export declare const LayoutWidthsSchema: z.ZodEnum<{
|
|
29
|
-
text: "text";
|
|
30
29
|
gutter: "gutter";
|
|
31
30
|
column: "column";
|
|
32
31
|
tablet: "tablet";
|
|
@@ -35,6 +34,7 @@ export declare const LayoutWidthsSchema: z.ZodEnum<{
|
|
|
35
34
|
mobileMax: "mobileMax";
|
|
36
35
|
tabletMax: "tabletMax";
|
|
37
36
|
desktopMax: "desktopMax";
|
|
37
|
+
text: "text";
|
|
38
38
|
}>;
|
|
39
39
|
export type BaseWidth = z.infer<typeof BaseWidthSchema>;
|
|
40
40
|
export type ScreenWidth = z.infer<typeof ScreenWidthSchema>;
|
|
@@ -83,3 +83,9 @@ export declare const zLabelPosition: z.ZodEnum<{
|
|
|
83
83
|
inside: "inside";
|
|
84
84
|
}>;
|
|
85
85
|
export type LabelPosition = z.infer<typeof zLabelPosition>;
|
|
86
|
+
export declare const ButtonType: z.ZodEnum<{
|
|
87
|
+
text: "text";
|
|
88
|
+
primary: "primary";
|
|
89
|
+
default: "default";
|
|
90
|
+
}>;
|
|
91
|
+
export type ButtonType = z.infer<typeof ButtonType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from "zod";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/utilities/types.ts
|
|
3
3
|
var t = e.enum(["gutter", "column"]), n = e.enum([
|
|
4
4
|
"tablet",
|
|
5
5
|
"desktop",
|
|
@@ -49,6 +49,10 @@ var t = e.enum(["gutter", "column"]), n = e.enum([
|
|
|
49
49
|
"right",
|
|
50
50
|
"inside",
|
|
51
51
|
"hidden"
|
|
52
|
+
]), u = e.enum([
|
|
53
|
+
"primary",
|
|
54
|
+
"default",
|
|
55
|
+
"text"
|
|
52
56
|
]);
|
|
53
57
|
//#endregion
|
|
54
|
-
export { t as BaseWidthSchema, i as BreakpointSchema, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, l as zLabelPosition, o as zTextInputExclusions, c as zTextInputType, s as zTextInputTypes };
|
|
58
|
+
export { t as BaseWidthSchema, i as BreakpointSchema, u as ButtonType, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, l as zLabelPosition, o as zTextInputExclusions, c as zTextInputType, s as zTextInputTypes };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._text_1l9fp_1._button_1l9fp_1,[data-variant=text]._button_1l9fp_1{color:var(--blue500);background:0 0;border:none;padding:0}._text_1l9fp_1._button_1l9fp_1:not(:disabled):not(._disabled_1l9fp_7):hover,[data-variant=text]._button_1l9fp_1:not(:disabled):not(._disabled_1l9fp_7):hover{color:var(--teal700);cursor:pointer;background-color:#0000;text-decoration:underline}._button_1l9fp_1{--btn-pad-y:calc(var(--w-gutter,16px) * .5);--btn-pad-x:calc(var(--w-gutter,16px) * .75);--btn-border-radius:calc(var(--w-gutter,16px) * .75);color:var(--blue600);cursor:pointer;padding:var(--btn-pad-y) var(--btn-pad-x);border-radius:var(--btn-border-radius);border:none;border:1px solid var(--blue500);background-color:var(--white);flex-flow:wrap;align-items:center;font-weight:500;transition:all .125s;display:inline-flex}._button_1l9fp_1:not(:disabled):not(._disabled_1l9fp_7):hover{background-color:var(--teal200)}._button_1l9fp_1:disabled,._disabled_1l9fp_7._button_1l9fp_1{cursor:not-allowed;border-color:var(--gray200);color:var(--gray400)}._button_1l9fp_1:disabled._primary_1l9fp_39,._button_1l9fp_1:disabled[data-variant=primary],._disabled_1l9fp_7._primary_1l9fp_39._button_1l9fp_1,._disabled_1l9fp_7[data-variant=primary]._button_1l9fp_1{border-color:var(--gray200);background-color:var(--gray400);color:var(--gray200)}._primary_1l9fp_39._button_1l9fp_1,[data-variant=primary]._button_1l9fp_1{color:var(--white);background-color:var(--blue500)}._primary_1l9fp_39._button_1l9fp_1:not(:disabled):not(._disabled_1l9fp_7):hover,[data-variant=primary]._button_1l9fp_1:not(:disabled):not(._disabled_1l9fp_7):hover{background-color:var(--blue700)}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './Button.module.css';//#region src/components/Button.module.scss
|
|
2
|
-
var e = "_text_1l9fp_1", t = "_button_1l9fp_1", n = "_disabled_1l9fp_7", r = "_primary_1l9fp_39", i = {
|
|
3
|
-
text: e,
|
|
4
|
-
button: t,
|
|
5
|
-
disabled: n,
|
|
6
|
-
primary: r
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { t as button, i as default, n as disabled, r as primary, e as text };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LabelPosition, TextInputType } from '../styles/utilities/types';
|
|
2
|
-
export type InputProps = React.ComponentProps<"input"> & {
|
|
3
|
-
label?: string | React.ReactNode;
|
|
4
|
-
labelPosition?: LabelPosition;
|
|
5
|
-
error?: string | boolean | React.ReactNode;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
styles?: React.CSSProperties;
|
|
8
|
-
endAdornment?: React.ReactNode;
|
|
9
|
-
type?: TextInputType;
|
|
10
|
-
};
|
|
11
|
-
export declare const Input: React.FC<InputProps>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { isEmpty as e } from "../utilities/validations.esm.js";
|
|
3
|
-
import t from "./Input.module.esm.js";
|
|
4
|
-
import n from "clsx";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
import { useId as a } from "react";
|
|
7
|
-
//#region src/components/Input.tsx
|
|
8
|
-
var o = ({ label: o, id: s, labelPosition: c = "top", required: l = !1, type: u = "text", error: d, styles: f, className: p, style: m, endAdornment: h, ...g }) => {
|
|
9
|
-
let _ = a(), v = s || _, y = !e(g.value) || !e(g.defaultValue), b = e(f) ? void 0 : f, x = /* @__PURE__ */ i("span", {
|
|
10
|
-
className: t.inputField,
|
|
11
|
-
"data-has-end-adornment": !e(h),
|
|
12
|
-
children: [/* @__PURE__ */ r("input", {
|
|
13
|
-
id: v,
|
|
14
|
-
type: u,
|
|
15
|
-
className: t.input,
|
|
16
|
-
...g
|
|
17
|
-
}), !e(h) && /* @__PURE__ */ r("span", {
|
|
18
|
-
className: t.inputAdornment,
|
|
19
|
-
children: h
|
|
20
|
-
})]
|
|
21
|
-
});
|
|
22
|
-
return /* @__PURE__ */ i("div", {
|
|
23
|
-
"data-label-position": c,
|
|
24
|
-
"data-required": l,
|
|
25
|
-
"data-has-input": y,
|
|
26
|
-
className: n(t.wrapper, p),
|
|
27
|
-
style: {
|
|
28
|
-
...b,
|
|
29
|
-
...m
|
|
30
|
-
},
|
|
31
|
-
children: [e(o) ? x : /* @__PURE__ */ i("label", { children: [c !== "hidden" && /* @__PURE__ */ r("div", {
|
|
32
|
-
className: t.inputLabel,
|
|
33
|
-
children: o
|
|
34
|
-
}), x] }), !e(d) && /* @__PURE__ */ r("div", {
|
|
35
|
-
className: t.error,
|
|
36
|
-
children: d
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { o as Input };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._wrapper_h3ihm_1[data-label-position=inside]{--react-international-phone-height:50px;--react-international-phone-border-radius:8px;--react-international-phone-border-color:silver;position:relative}._wrapper_h3ihm_1[data-label-position=inside]:focus-within ._inputLabel_h3ihm_8,._wrapper_h3ihm_1[data-label-position=inside][data-has-input=true] ._inputLabel_h3ihm_8{top:-.5rem;left:calc(var(--w-gutter,16px) * .25);font-size:calc(var(--w-text,14px) * .75)}._wrapper_h3ihm_1[data-label-position=inside]:has(._input_h3ihm_8:not(:placeholder-shown)) ._inputLabel_h3ihm_8{top:-.5rem;left:calc(var(--w-gutter,16px) * .25);font-size:calc(var(--w-text,14px) * .75)}._wrapper_h3ihm_1[data-label-position=inside]:has(._input_h3ihm_8:-webkit-autofill) ._inputLabel_h3ihm_8{top:-.5rem;left:calc(var(--w-gutter,16px) * .25);font-size:calc(var(--w-text,14px) * .75)}._wrapper_h3ihm_1 label ._inputLabel_h3ihm_8{margin-bottom:calc(var(--w-gutter,16px) * .25)}._wrapper_h3ihm_1[data-required=true] label ._inputLabel_h3ihm_8:after{content:"*";color:var(--red700)}._wrapper_h3ihm_1[data-label-position=left] label{align-items:center;display:inline-flex}._wrapper_h3ihm_1[data-label-position=left] label ._inputLabel_h3ihm_8{width:fit-content;margin-right:calc(var(--w-gutter,16px) * .75)}._wrapper_h3ihm_1[data-label-position=bottom] label{flex-direction:column-reverse;align-items:flex-start;display:inline-flex}._wrapper_h3ihm_1[data-label-position=bottom] label ._inputLabel_h3ihm_8{margin-bottom:0;margin-top:calc(var(--w-gutter,16px) * .25)}._wrapper_h3ihm_1[data-label-position=right] label{flex-direction:row-reverse;align-items:baseline;display:inline-flex}._wrapper_h3ihm_1[data-label-position=right] label ._inputLabel_h3ihm_8{margin-left:calc(var(--w-gutter,16px) * .25);margin-bottom:0}._wrapper_h3ihm_1[data-label-position=inside] ._inputLabel_h3ihm_8{background-color:var(--white);z-index:1;width:fit-content;top:calc(var(--w-gutter,16px) * .25);left:calc(var(--w-gutter,16px) * .25);pointer-events:none;padding:0 5px;transition:top .15s,left .15s,font-size .15s,color .15s;position:absolute}._wrapper_h3ihm_1[data-label-position=inside]>label>._inputField_h3ihm_58>._input_h3ihm_8,._wrapper_h3ihm_1[data-label-position=inside]>._input_h3ihm_8{transition:border-color .2s}._wrapper_h3ihm_1[data-label-position=inside]:focus-within ._inputLabel_h3ihm_8{color:var(--blue500)}._wrapper_h3ihm_1[data-label-position=inside]:focus-within ._input_h3ihm_8{border-color:var(--blue500)}._wrapper_h3ihm_1[data-label-position=inside]:focus-within ._input_h3ihm_8::placeholder{opacity:1}._wrapper_h3ihm_1[data-label-position=inside] ._input_h3ihm_8[type=tel]{width:100%}._wrapper_h3ihm_1[data-label-position=inside] ._input_h3ihm_8::placeholder{opacity:0;transition:opacity .2s}._inputField_h3ihm_58{align-items:center;display:inline-flex;position:relative}._inputField_h3ihm_58[data-has-end-adornment=true]>._input_h3ihm_8{width:100%;padding-right:calc(var(--w-gutter,16px) * .5 + 24px + var(--w-gutter,16px) * .5)}._inputAdornment_h3ihm_89{right:calc(var(--w-gutter,16px) * .5);z-index:1;align-items:center;margin-top:0;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}._error_h3ihm_100{margin-top:calc(var(--w-gutter,16px) * .25);font-size:calc(var(--w-text,14px) * .75);color:var(--red600)}
|