@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.
Files changed (62) 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 -4
  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.module.scss +1 -129
  37. package/src/styles/global/globalStyles.scss +83 -1
  38. package/src/styles/index.d.ts +1 -1
  39. package/src/styles/theme/components.esm.js +11 -5
  40. package/src/styles/theme/theme.esm.js +29 -43
  41. package/src/styles/theme/types.d.ts +1 -1
  42. package/src/styles/utilities/_functions.scss +116 -0
  43. package/src/styles/utilities/_mixins.scss +0 -0
  44. package/src/styles/utilities/color.d.ts +1 -1
  45. package/src/styles/utilities/constants.d.ts +1 -1
  46. package/src/styles/utilities/layout.d.ts +1 -1
  47. package/src/styles/utilities/layout.esm.js +1 -1
  48. package/src/{styles/utilities → utilities}/types.d.ts +7 -1
  49. package/src/{styles/utilities → utilities}/types.esm.js +6 -2
  50. package/src/components/Button.module.css +0 -1
  51. package/src/components/Button.module.esm.js +0 -9
  52. package/src/components/Button.module.scss +0 -5
  53. package/src/components/Input.d.ts +0 -11
  54. package/src/components/Input.esm.js +0 -41
  55. package/src/components/Input.module.css +0 -1
  56. package/src/components/Input.module.esm.js +0 -11
  57. package/src/components/Input.module.scss +0 -141
  58. package/src/components/InputPassword.esm.js +0 -33
  59. package/src/styles/global/components/_mixins.scss +0 -2
  60. package/src/styles/global/components/button.d.ts +0 -7
  61. /package/src/components/{Checkbox.d.ts → Input/Checkbox.d.ts} +0 -0
  62. /package/src/components/{RadioButton.d.ts → Input/RadioButton.d.ts} +0 -0
@@ -1 +1 @@
1
- ._wrapper_16mh3_1,._background_16mh3_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_16mh3_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_16mh3_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_16mh3_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_16mh3_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_16mh3_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_16mh3_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_16mh3_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_16mh3_1}._background_16mh3_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_16mh3_1}._content_16mh3_62{padding:var(--w-gutter,16px);z-index:1002;background-color:var(--white);-webkit-overflow-scrolling:touch;touch-action:pan-y;max-height:80vh;animation-fill-mode:forwards;overflow-y:auto}._content_16mh3_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_16mh3_1}._content_16mh3_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_16mh3_1}._content_16mh3_62[data-type=panel]{height:100%;position:fixed;top:0;right:0}._content_16mh3_62[data-type=dialog]{border-radius:8px}._content_16mh3_62>header{width:100%;margin-bottom:calc(var(--w-gutter,16px) * .5);justify-content:space-between;display:inline-flex}._actionContainer_16mh3_94{margin-top:calc(var(--w-gutter,16px) * 2);background-color:var(--white);gap:var(--w-gutter,16px);height:fit-content;display:flex}@media (width>=0) and (width<=660px){._content_16mh3_62[data-type=panel],._content_16mh3_62[data-type=dialog]{width:100%;height:100%}}@media (width>=660px){._content_16mh3_62[data-type=panel]{width:calc(var(--w-column,60px) * 4 + var(--w-gutter,16px) * 3)}._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 6 + var(--w-gutter,16px) * 5)}}@media (width>=1040px){._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 8 + var(--w-gutter,16px) * 7)}}
1
+ ._wrapper_4fpb9_1,._background_4fpb9_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_4fpb9_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_4fpb9_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_4fpb9_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_4fpb9_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_4fpb9_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_4fpb9_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_4fpb9_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_4fpb9_1}._background_4fpb9_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_4fpb9_1}._content_4fpb9_62{padding:var(--w-gutter,var(--w-gutter)px);z-index:1002;background-color:var(--white);-webkit-overflow-scrolling:touch;touch-action:pan-y;max-height:80vh;animation-fill-mode:forwards;overflow-y:auto}._content_4fpb9_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_4fpb9_1}._content_4fpb9_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_4fpb9_1}._content_4fpb9_62._panel_4fpb9_78{height:100%;position:fixed;top:0;right:0}._content_4fpb9_62._dialog_4fpb9_84{border-radius:8px}._content_4fpb9_62>header{width:100%;margin-bottom:calc(var(--w-gutter,var(--w-gutter)px) * .5);justify-content:space-between;display:inline-flex}._content_4fpb9_62>header>button:only-child{margin-left:auto}._actionContainer_4fpb9_97{margin-top:calc(var(--w-gutter,var(--w-gutter)px) * 2);background-color:var(--white);gap:var(--w-gutter,var(--w-gutter)px);height:fit-content;display:flex}._closeModal_4fpb9_105{border-radius:50%;justify-content:center;width:30px;height:30px;padding:0;text-decoration:none;display:inline-flex}@media (width>=0) and (width<=660px){._content_4fpb9_62._panel_4fpb9_78,._content_4fpb9_62._dialog_4fpb9_84{width:100%;height:100%}}@media (width>=660px){._content_4fpb9_62._panel_4fpb9_78{width:calc((var(--w-column,var(--w-column)px) * 4) + (var(--w-gutter,var(--w-gutter)px) * 3))}._content_4fpb9_62._dialog_4fpb9_84{width:calc((var(--w-column,var(--w-column)px) * 6) + (var(--w-gutter,var(--w-gutter)px) * 5))}}@media (width>=1040px){._content_4fpb9_62._dialog_4fpb9_84{width:calc((var(--w-column,var(--w-column)px) * 8) + (var(--w-gutter,var(--w-gutter)px) * 7))}}
@@ -1,5 +1,5 @@
1
1
  import './Modal.module.css';//#region src/components/Modal.module.scss
2
- var e = "_wrapper_16mh3_1", t = "_background_16mh3_1", n = "_fadeOut_16mh3_1", r = "_fadeIn_16mh3_1", i = "_content_16mh3_62", a = "_slideOut_16mh3_1", o = "_slideIn_16mh3_1", s = "_actionContainer_16mh3_94", c = {
2
+ var e = "_wrapper_4fpb9_1", t = "_background_4fpb9_1", n = "_fadeOut_4fpb9_1", r = "_fadeIn_4fpb9_1", i = "_content_4fpb9_62", a = "_slideOut_4fpb9_1", o = "_slideIn_4fpb9_1", s = "_panel_4fpb9_78", c = "_dialog_4fpb9_84", l = "_actionContainer_4fpb9_97", u = "_closeModal_4fpb9_105", d = {
3
3
  wrapper: e,
4
4
  background: t,
5
5
  fadeOut: n,
@@ -7,7 +7,10 @@ var e = "_wrapper_16mh3_1", t = "_background_16mh3_1", n = "_fadeOut_16mh3_1", r
7
7
  content: i,
8
8
  slideOut: a,
9
9
  slideIn: o,
10
- actionContainer: s
10
+ panel: s,
11
+ dialog: c,
12
+ actionContainer: l,
13
+ closeModal: u
11
14
  };
12
15
  //#endregion
13
- export { s as actionContainer, t as background, i as content, c as default, r as fadeIn, n as fadeOut, o as slideIn, a as slideOut, e as wrapper };
16
+ export { l as actionContainer, t as background, u as closeModal, i as content, d as default, c as dialog, r as fadeIn, n as fadeOut, s as panel, o as slideIn, a as slideOut, e as wrapper };
@@ -1,4 +1,5 @@
1
1
  @use "../styles/global/components/modal";
2
+ @use "../styles/utilities/functions" as u;
2
3
 
3
4
  @keyframes fadeIn {
4
5
  from {
@@ -64,7 +65,7 @@
64
65
  }
65
66
 
66
67
  .content {
67
- padding: var(--w-gutter, 16px);
68
+ padding: #{u.width("gutter")};
68
69
  z-index: 1002;
69
70
  background-color: var(--white);
70
71
  max-height: 80vh;
@@ -81,14 +82,14 @@
81
82
  animation: slideIn 0.3s ease-in-out;
82
83
  }
83
84
 
84
- &[data-type="panel"] {
85
+ &.panel {
85
86
  position: fixed;
86
87
  top: 0;
87
88
  right: 0;
88
89
  height: 100%;
89
90
  }
90
91
 
91
- &[data-type="dialog"] {
92
+ &.dialog {
92
93
  border-radius: 8px;
93
94
  }
94
95
 
@@ -96,38 +97,51 @@
96
97
  display: inline-flex;
97
98
  width: 100%;
98
99
  justify-content: space-between;
99
- margin-bottom: calc(var(--w-gutter, 16px) * 0.5);
100
+ margin-bottom: #{u.width("gutter", 0.5)};
101
+
102
+ > button:only-child {
103
+ margin-left: auto;
104
+ }
100
105
  }
101
106
  }
102
107
 
103
108
  .actionContainer {
104
- margin-top: calc(var(--w-gutter, 16px) * 2);
109
+ margin-top: #{u.width("gutter", 2)};
105
110
  background-color: var(--white);
106
111
  height: fit-content;
107
112
  display: flex;
108
- gap: var(--w-gutter, 16px);
113
+ gap: #{u.width("gutter")};
109
114
  }
115
+ .closeModal {
116
+ text-decoration: none;
117
+ height: 30px;
118
+ width: 30px;
119
+ border-radius: 50%;
120
+ padding: 0;
121
+ display: inline-flex;
122
+ justify-content: center;
123
+ };
110
124
 
111
125
  @media (min-width: 0px) and (max-width: 659.99999px) {
112
- .content[data-type="panel"],
113
- .content[data-type="dialog"] {
126
+ .content.panel,
127
+ .content.dialog {
114
128
  width: 100%;
115
129
  height: 100%;
116
130
  }
117
131
  }
118
132
 
119
133
  @media (min-width: 660px) {
120
- .content[data-type="panel"] {
121
- width: calc((var(--w-column, 60px) * 4) + (var(--w-gutter, 16px) * 3));
134
+ .content.panel {
135
+ width: #{u.width("column", 4)};
122
136
  }
123
137
 
124
- .content[data-type="dialog"] {
125
- width: calc((var(--w-column, 60px) * 6) + (var(--w-gutter, 16px) * 5));
138
+ .content.dialog {
139
+ width: #{u.width("column", 6)};
126
140
  }
127
141
  }
128
142
 
129
143
  @media (min-width: 1040px) {
130
- .content[data-type="dialog"] {
131
- width: calc((var(--w-column, 60px) * 8) + (var(--w-gutter, 16px) * 7));
144
+ .content.dialog {
145
+ width: #{u.width("column", 8)};
132
146
  }
133
147
  }
@@ -1,7 +1,8 @@
1
1
  export { Button } from './Button';
2
- export { Input } from './Input';
3
- export { InputPassword } from './InputPassword';
2
+ export { Input } from './Input/Input';
3
+ export { InputPassword } from './Input/InputPassword';
4
4
  export { Loader } from './Loader';
5
- export { RadioButton } from './RadioButton';
6
- export { Checkbox } from './Checkbox';
5
+ export { RadioButton } from './Input/RadioButton';
6
+ export { Checkbox } from './Input/Checkbox';
7
+ export { Textarea } from './Input/Textarea';
7
8
  export { Modal } from './Modal';
@@ -1,7 +1,7 @@
1
1
  import { themeBuilder as e } from "../theme/theme.esm.js";
2
2
  import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
3
  //#region src/styles/components/ThemeProvider.tsx
4
- function i({ theme: i, children: a, precedence: o = "default", href: s = "stamcat-craftsman-theme-provider" }) {
4
+ function i({ theme: i, children: a, precedence: o = "high", href: s = "stamcat-craftsman-theme-provider" }) {
5
5
  return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("style", {
6
6
  precedence: o,
7
7
  href: s,
@@ -1,64 +1,65 @@
1
- %text-link {
2
- padding: 0;
3
- border: none;
4
- background: none;
5
- color: var(--blue500);
1
+ @use "../../utilities/functions" as u;
6
2
 
7
- &:not(:disabled):not(.disabled):hover {
8
- color: var(--teal700);
9
- background-color: transparent;
10
- text-decoration: underline;
11
- cursor: pointer;
12
- }
13
- }
3
+ @layer craftsman-base {
4
+ %text-link {
5
+ padding: 0;
6
+ border: none;
7
+ background: none;
8
+ color: var(--blue500);
14
9
 
15
- %button-styles {
16
- --btn-pad-y: calc(var(--w-gutter, 16px) * 0.5);
17
- --btn-pad-x: calc(var(--w-gutter, 16px) * 0.75);
18
- --btn-border-radius: calc(var(--w-gutter, 16px) * 0.75);
19
- color: var(--blue600);
20
- border: none;
21
- cursor: pointer;
22
- display: inline-flex;
23
- flex-flow: row wrap;
24
- align-items: center;
25
- font-weight: 500;
26
- transition: 0.125s;
27
- padding: var(--btn-pad-y) var(--btn-pad-x);
28
- border-radius: var(--btn-border-radius);
29
- border: 1px solid var(--blue500);
30
- background-color: var(--white);
31
-
32
- &:not(:disabled):not(.disabled):hover {
33
- background-color: var(--teal200);
10
+ &:not(:disabled):not(.disabled):hover {
11
+ color: var(--teal700);
12
+ background-color: transparent;
13
+ text-decoration: underline;
14
+ cursor: pointer;
15
+ }
34
16
  }
35
17
 
36
- &.text,
37
- &[data-variant="text"] {
38
- @extend %text-link;
39
- }
18
+ %button-styles {
19
+ --btn-pad-y: #{u.width(gutter, 0.5)};
20
+ --btn-pad-x: #{u.width(gutter, 0.75)};
21
+ --btn-border-radius: #{u.width(gutter, 0.75)};
22
+ color: var(--blue600);
23
+ border: none;
24
+ cursor: pointer;
25
+ display: inline-flex;
26
+ flex-flow: row wrap;
27
+ align-items: center;
28
+ font-weight: 500;
29
+ transition: 0.125s;
30
+ padding: var(--btn-pad-y) var(--btn-pad-x);
31
+ border-radius: var(--btn-border-radius);
32
+ border: 1px solid var(--blue500);
33
+ background-color: var(--white);
40
34
 
41
- &:disabled,
42
- &.disabled {
43
- cursor: not-allowed;
44
- border-color: var(--gray200);
45
- color: var(--gray400);
35
+ &:not(:disabled):not(.disabled):hover {
36
+ background-color: var(--teal200);
37
+ }
38
+
39
+ &.text {
40
+ @extend %text-link;
41
+ }
46
42
 
47
- &.primary,
48
- &[data-variant="primary"] {
43
+ &:disabled,
44
+ &.disabled {
45
+ cursor: not-allowed;
49
46
  border-color: var(--gray200);
50
- background-color: var(--gray400);
51
- color: var(--gray200);
47
+ color: var(--gray400);
48
+
49
+ &.primary {
50
+ border-color: var(--gray200);
51
+ background-color: var(--gray400);
52
+ color: var(--gray200);
53
+ }
52
54
  }
53
- }
54
55
 
55
- &.primary,
56
- &[data-variant="primary"] {
57
- color: var(--white);
58
- background-color: var(--blue500);
56
+ &.primary {
57
+ color: var(--white);
58
+ background-color: var(--blue500);
59
59
 
60
- &:not(:disabled):not(.disabled):hover {
61
- background-color: var(--blue700);
60
+ &:not(:disabled):not(.disabled):hover {
61
+ background-color: var(--blue700);
62
+ }
62
63
  }
63
64
  }
64
65
  }
@@ -1,78 +1,82 @@
1
- %checkbox {
2
- appearance: none;
3
- box-sizing: border-box;
4
- position: relative;
5
- display: inline-block;
6
- vertical-align: baseline;
7
- top: 0.08em;
8
- margin: 0;
9
- padding: 0;
10
- height: 16px;
11
- width: 16px;
12
- border-radius: 4px;
13
- border: 1px solid var(--blue500);
14
- background: #fff;
1
+ @use "../../utilities/functions" as u;
15
2
 
16
- &::before {
17
- content: "";
18
- position: absolute;
19
- inset: 0;
3
+ @layer craftsman-base {
4
+ %checkbox {
5
+ appearance: none;
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ display: inline-block;
9
+ vertical-align: baseline;
10
+ top: 0.08em;
11
+ margin: 0;
12
+ padding: 0;
13
+ height: #{u.width("gutter")};
14
+ width: #{u.width("gutter")};
20
15
  border-radius: 4px;
21
- background: transparent;
22
- transition: background-color 0.15s ease;
23
- }
24
-
25
- &::after {
26
- position: absolute;
27
- left: 50%;
28
- top: 45%;
29
- width: 5px;
30
- height: 8px;
31
- content: "";
32
- display: block;
33
- border: solid white;
34
- border-width: 0 2px 2px 0;
35
- transform: translate(-50%, -58%) rotate(45deg) scale(0);
36
- transform-origin: center;
37
- transition: transform 0.15s ease;
38
- }
39
-
40
- &:checked {
41
- border-color: var(--blue500);
16
+ border: 1px solid var(--blue500);
17
+ background: #fff;
42
18
 
43
19
  &::before {
44
- background-color: var(--blue500);
45
- border-radius: unset;
20
+ content: "";
21
+ position: absolute;
22
+ inset: 0;
23
+ border-radius: 4px;
24
+ background: transparent;
25
+ transition: background-color 0.15s ease;
46
26
  }
47
27
 
48
28
  &::after {
49
- transform: translate(-50%, -58%) rotate(45deg) scale(1);
29
+ position: absolute;
30
+ left: 50%;
31
+ top: 45%;
32
+ width: 5px;
33
+ height: 8px;
34
+ content: "";
35
+ display: block;
36
+ border: solid white;
37
+ border-width: 0 2px 2px 0;
38
+ transform: translate(-50%, -58%) rotate(45deg) scale(0);
39
+ transform-origin: center;
40
+ transition: transform 0.15s ease;
50
41
  }
51
- }
52
42
 
53
- &:disabled {
54
- border-color: var(--gray500);
43
+ &:checked {
44
+ border-color: var(--blue500);
55
45
 
56
- &::before {
57
- background-color: var(--gray200);
58
- }
46
+ &::before {
47
+ background-color: var(--blue500);
48
+ border-radius: unset;
49
+ }
59
50
 
60
- &::after {
61
- border-color: var(--gray200);
62
- transform: translate(-50%, -58%) rotate(45deg) scale(1);
51
+ &::after {
52
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
53
+ }
63
54
  }
64
- }
65
55
 
66
- &:checked:disabled {
67
- border-color: var(--gray400);
56
+ &:disabled {
57
+ border-color: var(--gray500);
68
58
 
69
- &::before {
70
- background: var(--gray400);
59
+ &::before {
60
+ background-color: var(--gray200);
61
+ }
62
+
63
+ &::after {
64
+ border-color: var(--gray200);
65
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
66
+ }
71
67
  }
72
68
 
73
- &::after {
74
- border-color: var(--white);
75
- transform: translate(-50%, -58%) rotate(45deg) scale(1);
69
+ &:checked:disabled {
70
+ border-color: var(--gray400);
71
+
72
+ &::before {
73
+ background: var(--gray400);
74
+ }
75
+
76
+ &::after {
77
+ border-color: var(--white);
78
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
79
+ }
76
80
  }
77
81
  }
78
82
  }
@@ -1,19 +1,23 @@
1
- %code {
2
- background-color: var(--gray200);
3
- color: var(--gray800);
4
- padding: calc(var(--w-gutter, 16px) * 0.125) calc(var(--w-gutter, 16px) * 0.25);
5
- margin: calc(var(--w-gutter, 16px) * 0.125);
6
- display: inline-block;
7
- font-size: var(--w-text, 14px);
1
+ @use "../../utilities/functions" as u;
8
2
 
9
- &:has(pre) {
10
- padding: var(--w-gutter, 16px);
11
- border-radius: calc(var(--w-gutter, 16px) * 0.5);
12
- background-color: var(--gray800);
13
- color: var(--gray200);
14
- }
3
+ @layer craftsman-base {
4
+ %code {
5
+ background-color: var(--gray200);
6
+ color: var(--gray800);
7
+ padding: #{u.width(gutter, 0.125)} #{u.width(gutter, 0.25)};
8
+ margin: #{u.width(gutter, 0.125)};
9
+ display: inline-block;
10
+ font-size: var(--w-text, 14px);
11
+
12
+ &:has(pre) {
13
+ padding: #{u.width(gutter)};
14
+ border-radius: #{u.width(gutter, 0.5)};
15
+ background-color: var(--gray800);
16
+ color: var(--gray200);
17
+ }
15
18
 
16
- &:has(pre) pre {
17
- margin: 0;
19
+ &:has(pre) pre {
20
+ margin: 0;
21
+ }
18
22
  }
19
23
  }
@@ -1,46 +1,44 @@
1
- %inside-input-label-base {
2
- --react-international-phone-height: 50px;
3
- --react-international-phone-border-radius: 8px;
4
- --react-international-phone-border-color: #c0c0c0ff;
5
- position: relative;
6
- }
1
+ @use "../../utilities/functions" as u;
7
2
 
8
- %inside-input-label-floating {
9
- top: -0.5rem;
10
- left: calc(var(--w-gutter, 16px) * 0.25);
11
- font-size: calc(var(--w-text, 14px) * 0.75);
12
- }
3
+ @layer craftsman-base {
4
+ %inside-input-label-base {
5
+ --react-international-phone-height: 50px;
6
+ --react-international-phone-border-radius: 8px;
7
+ --react-international-phone-border-color: #c0c0c0ff;
8
+ position: relative;
9
+ }
13
10
 
14
- %interactive-focus-reset {
15
- &:focus {
16
- outline: 0;
17
- box-shadow: none;
11
+ %interactive-focus-reset {
12
+ &:focus {
13
+ outline: 0;
14
+ box-shadow: none;
15
+ }
18
16
  }
19
- }
20
17
 
21
- %input-base {
22
- color: var(--text);
23
- border-radius: 3px;
24
- border: 1px solid var(--gray400);
25
- padding: calc(var(--w-gutter, 16px) * 0.5);
26
- background-color: var(--white);
18
+ %input-base {
19
+ color: var(--text);
20
+ border-radius: 3px;
21
+ border: 1px solid var(--gray400);
22
+ padding: #{u.width("gutter", 0.5)};
23
+ background-color: var(--white);
27
24
 
28
- &[type="number"]::-webkit-outer-spin-button,
29
- &[type="number"]::-webkit-inner-spin-button {
30
- -webkit-appearance: none;
31
- margin: 0;
32
- }
25
+ &[type="number"]::-webkit-outer-spin-button,
26
+ &[type="number"]::-webkit-inner-spin-button {
27
+ -webkit-appearance: none;
28
+ margin: 0;
29
+ }
33
30
 
34
- &[type="number"] {
35
- -moz-appearance: textfield;
36
- appearance: textfield;
37
- }
31
+ &[type="number"] {
32
+ -moz-appearance: textfield;
33
+ appearance: textfield;
34
+ }
38
35
 
39
- &:disabled,
40
- &.disabled {
41
- border-color: var(--gray200);
42
- background-color: var(--gray100);
43
- }
36
+ &:disabled,
37
+ &.disabled {
38
+ border-color: var(--gray200);
39
+ background-color: var(--gray100);
40
+ }
44
41
 
45
- @extend %interactive-focus-reset;
42
+ @extend %interactive-focus-reset;
43
+ }
46
44
  }
@@ -1,33 +1,36 @@
1
- %radio {
2
- --radio-btn-size: 16px;
3
- transition: border-color 0.2s ease;
4
- appearance: none;
5
- cursor: pointer;
6
- position: relative;
7
- display: inline-grid;
8
- place-content: center;
9
- padding: 0;
10
- width: var(--radio-btn-size);
11
- height: var(--radio-btn-size);
12
- border: 1px solid var(--blue600);
13
- border-radius: 50%;
14
- box-sizing: border-box;
1
+ @use "../../utilities/functions" as u;
15
2
 
16
- &::before {
17
- content: "";
18
- width: calc(var(--radio-btn-size) * 0.5);
19
- height: calc(var(--radio-btn-size) * 0.5);
3
+ @layer craftsman-base {
4
+ %radio {
5
+ transition: border-color 0.2s ease;
6
+ appearance: none;
7
+ cursor: pointer;
8
+ position: relative;
9
+ display: inline-grid;
10
+ place-content: center;
11
+ padding: 0;
12
+ width: #{u.width("gutter")};
13
+ height: #{u.width("gutter")};
14
+ border: 1px solid var(--blue600);
20
15
  border-radius: 50%;
21
- transform: scale(0);
22
- transition: transform 0.2s ease;
23
- background-color: var(--blue600);
24
- }
25
-
26
- &:checked {
27
- border-color: var(--gray500);
16
+ box-sizing: border-box;
28
17
 
29
18
  &::before {
30
- transform: scale(1);
19
+ content: "";
20
+ width: #{u.width("gutter", 0.5)};
21
+ height: #{u.width("gutter", 0.5)};
22
+ border-radius: 50%;
23
+ transform: scale(0);
24
+ transition: transform 0.2s ease;
25
+ background-color: var(--blue600);
26
+ }
27
+
28
+ &:checked {
29
+ border-color: var(--gray500);
30
+
31
+ &::before {
32
+ transform: scale(1);
33
+ }
31
34
  }
32
35
  }
33
36
  }
@@ -1,7 +1,62 @@
1
- %body-typography {
2
- font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
- color: var(--text);
4
- line-height: 1.5;
5
- font-weight: 400;
6
- font-size: var(--w-text, 14px);
1
+ @use "../../utilities/functions" as u;
2
+
3
+ @layer craftsman-base {
4
+ %body-typography {
5
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
6
+ color: var(--text);
7
+ line-height: 1.5;
8
+ font-weight: 400;
9
+ font-size: var(--w-text, 14px);
10
+ }
11
+
12
+ // TODO: These h* declarations need to be moved somewhere not-terrible
13
+ :where(h1) {
14
+ font-size: calc(var(--w-text, 14px) * 3.125);
15
+ line-height: 1.2;
16
+ }
17
+
18
+ :where(h2) {
19
+ font-size: calc(var(--w-text, 14px) * 2.625);
20
+ font-weight: 625;
21
+ line-height: 1.1;
22
+ }
23
+
24
+ :where(h3) {
25
+ font-size: calc(var(--w-text, 14px) * 1.625);
26
+ line-height: 1.1;
27
+ }
28
+
29
+ :where(h4) {
30
+ font-size: calc(var(--w-text, 14px) * 1.25);
31
+ line-height: 1.1;
32
+ margin: calc(var(--w-gutter, 16px) * 0.5) 0;
33
+ }
34
+
35
+ :where(h5) {
36
+ font-size: var(--w-text, 14px);
37
+ line-height: 1.2;
38
+ }
39
+
40
+ :where(h6) {
41
+ font-size: calc(var(--w-text, 14px) * 0.875);
42
+ line-height: 1.2;
43
+ font-weight: 600;
44
+ }
45
+
46
+ :where(p) {
47
+ font-style: normal;
48
+ font-size: var(--w-text, 14px);
49
+ line-height: 1.5;
50
+ margin: 0;
51
+ }
52
+
53
+ @include u.breakpoint(mobileMax) {
54
+ :where(h4) {
55
+ font-size: var(--w-text, 14px);
56
+ }
57
+
58
+ :where(p) {
59
+ font-size: calc(var(--w-text, 14px) * 0.875);
60
+ }
61
+ }
7
62
  }