@stamcat/craftsman 0.0.27-alpha.3 → 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.
Files changed (63) hide show
  1. package/AGENTS.md +54 -2
  2. package/Components.esm.js +11 -9
  3. package/README.md +5 -0
  4. package/Styles.esm.js +5 -5
  5. package/package.json +5 -1
  6. package/src/components/Button.d.ts +1 -1
  7. package/src/components/Button.esm.js +14 -16
  8. package/src/components/{Checkbox.esm.js → Input/Checkbox.esm.js} +1 -1
  9. package/src/components/Input/Input.d.ts +6 -0
  10. package/src/components/Input/Input.esm.js +33 -0
  11. package/src/components/Input/Input.module.css +1 -0
  12. package/src/components/Input/Input.module.esm.js +13 -0
  13. package/src/components/Input/Input.module.scss +165 -0
  14. package/src/components/{InputPassword.d.ts → Input/InputPassword.d.ts} +1 -1
  15. package/src/components/Input/InputPassword.esm.js +29 -0
  16. package/src/components/Input/InputWrapper.d.ts +11 -0
  17. package/src/components/Input/InputWrapper.esm.js +28 -0
  18. package/src/components/{RadioButton.esm.js → Input/RadioButton.esm.js} +1 -1
  19. package/src/components/Input/Textarea.d.ts +3 -0
  20. package/src/components/Input/Textarea.esm.js +25 -0
  21. package/src/components/Modal.esm.js +18 -26
  22. package/src/components/Modal.module.css +1 -1
  23. package/src/components/Modal.module.esm.js +6 -3
  24. package/src/components/Modal.module.scss +28 -14
  25. package/src/components/index.d.ts +5 -4
  26. package/src/styles/components/ThemeProvider.esm.js +1 -1
  27. package/src/styles/global/components/_button.scss +52 -51
  28. package/src/styles/global/components/_checkbox.scss +63 -59
  29. package/src/styles/global/components/_code.scss +19 -15
  30. package/src/styles/global/components/_input.scss +35 -37
  31. package/src/styles/global/components/_radioButton.scss +29 -26
  32. package/src/styles/global/components/_typography.scss +61 -6
  33. package/src/styles/global/components/loaders.module.css +1 -1
  34. package/src/styles/global/components/loaders.module.esm.js +1 -1
  35. package/src/styles/global/components/loaders.module.scss +2 -1
  36. package/src/styles/global/globalStyles.d.ts +3 -0
  37. package/src/styles/global/globalStyles.module.scss +1 -0
  38. package/src/styles/global/globalStyles.scss +16 -60
  39. package/src/styles/index.d.ts +1 -1
  40. package/src/styles/theme/components.esm.js +11 -5
  41. package/src/styles/theme/theme.esm.js +29 -43
  42. package/src/styles/theme/types.d.ts +1 -1
  43. package/src/styles/utilities/_functions.scss +116 -0
  44. package/src/styles/utilities/_mixins.scss +0 -0
  45. package/src/styles/utilities/color.d.ts +1 -1
  46. package/src/styles/utilities/constants.d.ts +1 -1
  47. package/src/styles/utilities/layout.d.ts +1 -1
  48. package/src/styles/utilities/layout.esm.js +1 -1
  49. package/src/{styles/utilities → utilities}/types.d.ts +7 -1
  50. package/src/{styles/utilities → utilities}/types.esm.js +6 -2
  51. package/src/components/Button.module.css +0 -1
  52. package/src/components/Button.module.esm.js +0 -9
  53. package/src/components/Button.module.scss +0 -5
  54. package/src/components/Input.d.ts +0 -11
  55. package/src/components/Input.esm.js +0 -41
  56. package/src/components/Input.module.css +0 -1
  57. package/src/components/Input.module.esm.js +0 -11
  58. package/src/components/Input.module.scss +0 -141
  59. package/src/components/InputPassword.esm.js +0 -33
  60. package/src/styles/global/components/_mixins.scss +0 -2
  61. package/src/styles/global/components/button.d.ts +0 -7
  62. /package/src/components/{Checkbox.d.ts → Input/Checkbox.d.ts} +0 -0
  63. /package/src/components/{RadioButton.d.ts → Input/RadioButton.d.ts} +0 -0
@@ -1 +1 @@
1
- ._dots_1w7tl_1{aspect-ratio:1;width:var(--_l5w);margin:0 var(--_l5w2);border-radius:50%;animation:1s linear infinite alternate _l5_1w7tl_1}@keyframes _l5_1w7tl_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_1w7tl_1{to{transform:rotate(1turn)}}._dots-trace_1w7tl_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_1w7tl_1}@keyframes _l1_1w7tl_1{to{clip-path:inset(0 -34% 0 0)}}._dots-orbit_1w7tl_54{width:var(--_dow);aspect-ratio:1;background:var(--_doc);border-radius:50%;animation:2s linear infinite _l22-0_1w7tl_1;display:grid}._dots-orbit_1w7tl_54:before,._dots-orbit_1w7tl_54:after{content:"";background:inherit;border-radius:50%;grid-area:1/1;margin:15%;animation:1s infinite _l22_1w7tl_1;transform:rotate(0)translate(150%)}._dots-orbit_1w7tl_54:after{animation-delay:-.5s}@keyframes _l22-0_1w7tl_1{to{transform:rotate(1turn)}}@keyframes _l22_1w7tl_1{to{transform:rotate(1turn)translate(150%)}}._dashes_1w7tl_85{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_1w7tl_85}@keyframes _dashes_1w7tl_85{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_1w7tl_111{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_1w7tl_1}@keyframes _l2_1w7tl_1{to{transform:rotate(1turn)}}._swirl_1w7tl_125{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_1w7tl_1;-webkit-mask-composite:source-out;mask-composite:subtract}._ball_1w7tl_146{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_1w7tl_1}@keyframes _l9_1w7tl_1{to{transform:rotate(1turn)}}._boxy_1w7tl_159{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_1w7tl_1;-webkit-mask:linear-gradient(90deg,#000 70%,#0000 0) 0/20% 100%}@keyframes _l7_1w7tl_1{to{background-position:right -25% top 0}}
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 = "_dots_1w7tl_1", t = "_l5_1w7tl_1", n = "_dots-trace_1w7tl_41", r = "_l1_1w7tl_1", i = "_dots-orbit_1w7tl_54", a = "_l22-0_1w7tl_1", o = "_l22_1w7tl_1", s = "_dashes_1w7tl_85", c = "_spinner_1w7tl_111", l = "_l2_1w7tl_1", u = "_swirl_1w7tl_125", d = "_l3_1w7tl_1", f = "_ball_1w7tl_146", p = "_l9_1w7tl_1", m = "_boxy_1w7tl_159", h = "_l7_1w7tl_1", g = {
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,3 +1,4 @@
1
+ @layer craftsman-base {
1
2
  .dots {
2
3
  aspect-ratio: 1;
3
4
  border-radius: 50%;
@@ -243,4 +244,4 @@
243
244
  // 0%,70% {transform:translate(0)}
244
245
  // 100% {transform:translate(200%)}
245
246
  // }
246
-
247
+ }
@@ -0,0 +1,3 @@
1
+ import { default as styles } from './globalStyles.module.scss';
2
+ export declare const globalStyles: CSSModuleClasses;
3
+ export default styles;
@@ -0,0 +1 @@
1
+ @use "./globalStyles.scss";
@@ -1,11 +1,14 @@
1
1
  @use "./components/typography";
2
2
  @use "./components/code";
3
- @use "./components/mixins" as mixins;
4
3
  @use "./components/checkbox";
5
4
  @use "./components/radioButton";
6
5
  @use "./components/button";
7
6
  @use "./components/input";
8
7
 
8
+ @layer craftsman-base, craftsman-theme;
9
+
10
+ @layer craftsman-base {
11
+ :global {
9
12
  :root {
10
13
  color-scheme: light dark;
11
14
  font-synthesis: none;
@@ -31,17 +34,13 @@
31
34
  ::-webkit-scrollbar-thumb:hover {
32
35
  background: #555;
33
36
  }
34
-
35
- body {
36
- @extend %body-typography;
37
- }
38
- body,
39
- ul {
37
+ body, ul {
40
38
  margin: 0;
41
39
  padding: 0;
42
40
  }
43
41
 
44
42
  body {
43
+ @extend %body-typography;
45
44
  background-color: #fff;
46
45
  -webkit-overflow-scrolling: touch;
47
46
  overscroll-behavior: contain;
@@ -61,67 +60,24 @@ button {
61
60
  }
62
61
 
63
62
  input {
64
- @extend %input-base;
65
-
66
- &[type="radio"] {
67
- @extend %radio;
63
+ &:not([type="radio"]):not([type="checkbox"]) {
64
+ @extend %input-base;
68
65
  }
69
-
70
66
  &[type="checkbox"] {
71
- @extend %checkbox;
67
+ @extend %checkbox;
72
68
  }
73
- }
74
-
75
- a {
76
- @extend %text-link;
77
- }
78
-
79
- h1 {
80
- font-size: calc(var(--w-text, 14px) * 3.125);
81
- line-height: 1.2;
82
- }
83
-
84
- h2 {
85
- font-size: calc(var(--w-text, 14px) * 2.625);
86
- font-weight: 625;
87
- line-height: 1.1;
88
- }
89
-
90
- h3 {
91
- font-size: calc(var(--w-text, 14px) * 1.625);
92
- line-height: 1.1;
93
- }
94
69
 
95
- h4 {
96
- font-size: calc(var(--w-text, 14px) * 1.25);
97
- line-height: 1.1;
98
- margin: calc(var(--w-gutter, 16px) * 0.5) 0;
70
+ &[type="radio"] {
71
+ @extend %radio;
72
+ }
99
73
  }
100
-
101
- h5 {
102
- font-size: var(--w-text, 14px);
103
- line-height: 1.2;
74
+ textarea {
75
+ @extend %input-base;
104
76
  }
105
77
 
106
- h6 {
107
- font-size: calc(var(--w-text, 14px) * 0.875);
108
- line-height: 1.2;
109
- font-weight: 600;
78
+ a {
79
+ @extend %text-link;
110
80
  }
111
-
112
- p {
113
- font-style: normal;
114
- font-size: var(--w-text, 14px);
115
- line-height: 1.5;
116
- margin: 0;
117
81
  }
118
82
 
119
- @media (max-width: 659.99999px) {
120
- h4 {
121
- font-size: var(--w-text, 14px);
122
- }
123
-
124
- p {
125
- font-size: calc(var(--w-text, 14px) * 0.875);
126
- }
127
83
  }
@@ -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 './utilities/types';
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
- function n(e) {
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 r(t) {
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 i = Object.keys(t).map(n), a = Object.fromEntries(i.map((e) => [e, r(e)]));
16
+ var a = Object.keys(t).map(r), o = Object.fromEntries(a.map((e) => [e, i(e)]));
11
17
  //#endregion
12
- export { a as componentSelectors };
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
- var a = /* @__PURE__ */ new Map();
6
- function o(e) {
7
- if (typeof document > "u") return;
8
- let t = `.${e}`, n = {}, r = !1, i = (e) => {
9
- for (let a of Array.from(e)) {
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
- for (let e of Array.from(document.styleSheets)) try {
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 s(e) {
25
- if (a.has(e)) return a.get(e) ?? void 0;
26
- let t = o(e);
27
- return a.set(e, t ?? null), t;
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 c(r) {
30
- let i = [];
31
- return Object.keys(e).forEach((a) => {
32
- let o = r?.[a];
33
- if (o) {
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 l(e) {
45
- let a = t(":root", {
46
- ...e.colors || {},
47
- ...e.root ? n(e.root) : {}
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
- a,
52
- ...c(e.components)
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 { l as themeBuilder };
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,4 +1,4 @@
1
- import { ColorType } from './types';
1
+ import { ColorType } from '../../utilities/types';
2
2
  export declare const colors: {
3
3
  red990: string;
4
4
  red950: string;
@@ -1,4 +1,4 @@
1
- import { LayoutWidthsType } from './types';
1
+ import { LayoutWidthsType } from '../../utilities/types';
2
2
  export declare const defaultColors: {
3
3
  red990: string;
4
4
  red950: string;
@@ -1,4 +1,4 @@
1
- import { Breakpoint, LayoutWidthsType } from './types';
1
+ import { Breakpoint, LayoutWidthsType } from '../../utilities/types';
2
2
  export declare const widths: Record<LayoutWidthsType, string>;
3
3
  export declare const media: {
4
4
  readonly mobile: string;
@@ -1,5 +1,5 @@
1
1
  import { defaultWidths as e } from "./constants.esm.js";
2
- import { LayoutWidthsSchema as t } from "./types.esm.js";
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/styles/utilities/types.ts
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,5 +0,0 @@
1
- @use "../styles/global/components/button";
2
-
3
- .button {
4
- @extend %button-styles;
5
- }
@@ -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)}
@@ -1,11 +0,0 @@
1
- import './Input.module.css';//#region src/components/Input.module.scss
2
- var e = "_wrapper_h3ihm_1", t = "_inputLabel_h3ihm_8", n = "_input_h3ihm_8", r = "_inputField_h3ihm_58", i = "_inputAdornment_h3ihm_89", a = "_error_h3ihm_100", o = {
3
- wrapper: e,
4
- inputLabel: t,
5
- input: n,
6
- inputField: r,
7
- inputAdornment: i,
8
- error: a
9
- };
10
- //#endregion
11
- export { o as default, a as error, n as input, i as inputAdornment, r as inputField, t as inputLabel, e as wrapper };