shinkansen-cogs 1.9.2 → 2.0.1

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 (243) hide show
  1. package/.prettierignore +4 -0
  2. package/index.d.mts +1 -1
  3. package/package.json +52 -45
  4. package/src/{cogs → js/cogs}/checkbox/index.jsx +1 -1
  5. package/src/{cogs → js/cogs}/email/index.jsx +1 -1
  6. package/src/{cogs → js/cogs}/index.jsx +2 -2
  7. package/src/{cogs → js/cogs}/number/index.jsx +1 -1
  8. package/src/{cogs → js/cogs}/password/index.jsx +1 -1
  9. package/src/{cogs → js/cogs}/radio/index.jsx +1 -1
  10. package/src/{cogs → js/cogs}/select/field/index.jsx +74 -3
  11. package/src/{cogs → js/cogs}/select/index.jsx +1 -1
  12. package/src/{cogs → js/cogs}/text/index.jsx +1 -1
  13. package/src/{cogs → js/cogs}/textarea/index.jsx +1 -1
  14. package/src/{components → js/components}/field/index.d.mts +12 -0
  15. package/src/{components → js/components}/field/index.jsx +114 -2
  16. package/src/{super → js/super}/cogs/index.jsx +4 -4
  17. package/src/{super → js/super}/components/field/index.jsx +4 -2
  18. package/src/sass/.stylelintrc +14 -0
  19. package/src/sass/_cogs.scss +64 -0
  20. package/src/sass/cogs/_checkbox.scss +88 -0
  21. package/src/sass/cogs/_disabled.scss +15 -0
  22. package/src/sass/cogs/_error.scss +50 -0
  23. package/src/sass/cogs/_radio.scss +94 -0
  24. package/src/common/index.d.mts +0 -5
  25. package/src/common/index.mjs +0 -3
  26. /package/src/{cogs → js/cogs}/checkbox/description/index.cjs +0 -0
  27. /package/src/{cogs → js/cogs}/checkbox/description/index.d.cts +0 -0
  28. /package/src/{cogs → js/cogs}/checkbox/description/index.d.mts +0 -0
  29. /package/src/{cogs → js/cogs}/checkbox/description/index.jsx +0 -0
  30. /package/src/{cogs → js/cogs}/checkbox/error-message/index.cjs +0 -0
  31. /package/src/{cogs → js/cogs}/checkbox/error-message/index.d.cts +0 -0
  32. /package/src/{cogs → js/cogs}/checkbox/error-message/index.d.mts +0 -0
  33. /package/src/{cogs → js/cogs}/checkbox/error-message/index.jsx +0 -0
  34. /package/src/{cogs → js/cogs}/checkbox/field/index.cjs +0 -0
  35. /package/src/{cogs → js/cogs}/checkbox/field/index.d.cts +0 -0
  36. /package/src/{cogs → js/cogs}/checkbox/field/index.d.mts +0 -0
  37. /package/src/{cogs → js/cogs}/checkbox/field/index.jsx +0 -0
  38. /package/src/{cogs → js/cogs}/checkbox/index.cjs +0 -0
  39. /package/src/{cogs → js/cogs}/checkbox/index.d.cts +0 -0
  40. /package/src/{cogs → js/cogs}/checkbox/index.d.mts +0 -0
  41. /package/src/{cogs → js/cogs}/checkbox/title/index.cjs +0 -0
  42. /package/src/{cogs → js/cogs}/checkbox/title/index.d.cts +0 -0
  43. /package/src/{cogs → js/cogs}/checkbox/title/index.d.mts +0 -0
  44. /package/src/{cogs → js/cogs}/checkbox/title/index.jsx +0 -0
  45. /package/src/{cogs → js/cogs}/email/description/index.cjs +0 -0
  46. /package/src/{cogs → js/cogs}/email/description/index.d.cts +0 -0
  47. /package/src/{cogs → js/cogs}/email/description/index.d.mts +0 -0
  48. /package/src/{cogs → js/cogs}/email/description/index.jsx +0 -0
  49. /package/src/{cogs → js/cogs}/email/error-message/index.cjs +0 -0
  50. /package/src/{cogs → js/cogs}/email/error-message/index.d.cts +0 -0
  51. /package/src/{cogs → js/cogs}/email/error-message/index.d.mts +0 -0
  52. /package/src/{cogs → js/cogs}/email/error-message/index.jsx +0 -0
  53. /package/src/{cogs → js/cogs}/email/field/index.cjs +0 -0
  54. /package/src/{cogs → js/cogs}/email/field/index.d.cts +0 -0
  55. /package/src/{cogs → js/cogs}/email/field/index.d.mts +0 -0
  56. /package/src/{cogs → js/cogs}/email/field/index.jsx +0 -0
  57. /package/src/{cogs → js/cogs}/email/index.cjs +0 -0
  58. /package/src/{cogs → js/cogs}/email/index.d.cts +0 -0
  59. /package/src/{cogs → js/cogs}/email/index.d.mts +0 -0
  60. /package/src/{cogs → js/cogs}/email/title/index.cjs +0 -0
  61. /package/src/{cogs → js/cogs}/email/title/index.d.cts +0 -0
  62. /package/src/{cogs → js/cogs}/email/title/index.d.mts +0 -0
  63. /package/src/{cogs → js/cogs}/email/title/index.jsx +0 -0
  64. /package/src/{cogs → js/cogs}/index.cjs +0 -0
  65. /package/src/{cogs → js/cogs}/index.d.cts +0 -0
  66. /package/src/{cogs → js/cogs}/index.d.mts +0 -0
  67. /package/src/{cogs → js/cogs}/number/description/index.cjs +0 -0
  68. /package/src/{cogs → js/cogs}/number/description/index.d.cts +0 -0
  69. /package/src/{cogs → js/cogs}/number/description/index.d.mts +0 -0
  70. /package/src/{cogs → js/cogs}/number/description/index.jsx +0 -0
  71. /package/src/{cogs → js/cogs}/number/error-message/index.cjs +0 -0
  72. /package/src/{cogs → js/cogs}/number/error-message/index.d.cts +0 -0
  73. /package/src/{cogs → js/cogs}/number/error-message/index.d.mts +0 -0
  74. /package/src/{cogs → js/cogs}/number/error-message/index.jsx +0 -0
  75. /package/src/{cogs → js/cogs}/number/field/index.cjs +0 -0
  76. /package/src/{cogs → js/cogs}/number/field/index.d.cts +0 -0
  77. /package/src/{cogs → js/cogs}/number/field/index.d.mts +0 -0
  78. /package/src/{cogs → js/cogs}/number/field/index.jsx +0 -0
  79. /package/src/{cogs → js/cogs}/number/index.cjs +0 -0
  80. /package/src/{cogs → js/cogs}/number/index.d.cts +0 -0
  81. /package/src/{cogs → js/cogs}/number/index.d.mts +0 -0
  82. /package/src/{cogs → js/cogs}/number/title/index.cjs +0 -0
  83. /package/src/{cogs → js/cogs}/number/title/index.d.cts +0 -0
  84. /package/src/{cogs → js/cogs}/number/title/index.d.mts +0 -0
  85. /package/src/{cogs → js/cogs}/number/title/index.jsx +0 -0
  86. /package/src/{cogs → js/cogs}/password/description/index.cjs +0 -0
  87. /package/src/{cogs → js/cogs}/password/description/index.d.cts +0 -0
  88. /package/src/{cogs → js/cogs}/password/description/index.d.mts +0 -0
  89. /package/src/{cogs → js/cogs}/password/description/index.jsx +0 -0
  90. /package/src/{cogs → js/cogs}/password/error-message/index.cjs +0 -0
  91. /package/src/{cogs → js/cogs}/password/error-message/index.d.cts +0 -0
  92. /package/src/{cogs → js/cogs}/password/error-message/index.d.mts +0 -0
  93. /package/src/{cogs → js/cogs}/password/error-message/index.jsx +0 -0
  94. /package/src/{cogs → js/cogs}/password/field/index.cjs +0 -0
  95. /package/src/{cogs → js/cogs}/password/field/index.d.cts +0 -0
  96. /package/src/{cogs → js/cogs}/password/field/index.d.mts +0 -0
  97. /package/src/{cogs → js/cogs}/password/field/index.jsx +0 -0
  98. /package/src/{cogs → js/cogs}/password/index.cjs +0 -0
  99. /package/src/{cogs → js/cogs}/password/index.d.cts +0 -0
  100. /package/src/{cogs → js/cogs}/password/index.d.mts +0 -0
  101. /package/src/{cogs → js/cogs}/password/title/index.cjs +0 -0
  102. /package/src/{cogs → js/cogs}/password/title/index.d.cts +0 -0
  103. /package/src/{cogs → js/cogs}/password/title/index.d.mts +0 -0
  104. /package/src/{cogs → js/cogs}/password/title/index.jsx +0 -0
  105. /package/src/{cogs → js/cogs}/radio/description/index.cjs +0 -0
  106. /package/src/{cogs → js/cogs}/radio/description/index.d.cts +0 -0
  107. /package/src/{cogs → js/cogs}/radio/description/index.d.mts +0 -0
  108. /package/src/{cogs → js/cogs}/radio/description/index.jsx +0 -0
  109. /package/src/{cogs → js/cogs}/radio/error-message/index.cjs +0 -0
  110. /package/src/{cogs → js/cogs}/radio/error-message/index.d.cts +0 -0
  111. /package/src/{cogs → js/cogs}/radio/error-message/index.d.mts +0 -0
  112. /package/src/{cogs → js/cogs}/radio/error-message/index.jsx +0 -0
  113. /package/src/{cogs → js/cogs}/radio/field/index.cjs +0 -0
  114. /package/src/{cogs → js/cogs}/radio/field/index.d.cts +0 -0
  115. /package/src/{cogs → js/cogs}/radio/field/index.d.mts +0 -0
  116. /package/src/{cogs → js/cogs}/radio/field/index.jsx +0 -0
  117. /package/src/{cogs → js/cogs}/radio/index.cjs +0 -0
  118. /package/src/{cogs → js/cogs}/radio/index.d.cts +0 -0
  119. /package/src/{cogs → js/cogs}/radio/index.d.mts +0 -0
  120. /package/src/{cogs → js/cogs}/radio/title/index.cjs +0 -0
  121. /package/src/{cogs → js/cogs}/radio/title/index.d.cts +0 -0
  122. /package/src/{cogs → js/cogs}/radio/title/index.d.mts +0 -0
  123. /package/src/{cogs → js/cogs}/radio/title/index.jsx +0 -0
  124. /package/src/{cogs → js/cogs}/select/description/index.cjs +0 -0
  125. /package/src/{cogs → js/cogs}/select/description/index.d.cts +0 -0
  126. /package/src/{cogs → js/cogs}/select/description/index.d.mts +0 -0
  127. /package/src/{cogs → js/cogs}/select/description/index.jsx +0 -0
  128. /package/src/{cogs → js/cogs}/select/error-message/index.cjs +0 -0
  129. /package/src/{cogs → js/cogs}/select/error-message/index.d.cts +0 -0
  130. /package/src/{cogs → js/cogs}/select/error-message/index.d.mts +0 -0
  131. /package/src/{cogs → js/cogs}/select/error-message/index.jsx +0 -0
  132. /package/src/{cogs → js/cogs}/select/field/index.cjs +0 -0
  133. /package/src/{cogs → js/cogs}/select/field/index.d.cts +0 -0
  134. /package/src/{cogs → js/cogs}/select/field/index.d.mts +0 -0
  135. /package/src/{cogs → js/cogs}/select/index.cjs +0 -0
  136. /package/src/{cogs → js/cogs}/select/index.d.cts +0 -0
  137. /package/src/{cogs → js/cogs}/select/index.d.mts +0 -0
  138. /package/src/{cogs → js/cogs}/select/title/index.cjs +0 -0
  139. /package/src/{cogs → js/cogs}/select/title/index.d.cts +0 -0
  140. /package/src/{cogs → js/cogs}/select/title/index.d.mts +0 -0
  141. /package/src/{cogs → js/cogs}/select/title/index.jsx +0 -0
  142. /package/src/{cogs → js/cogs}/text/description/index.cjs +0 -0
  143. /package/src/{cogs → js/cogs}/text/description/index.d.cts +0 -0
  144. /package/src/{cogs → js/cogs}/text/description/index.d.mts +0 -0
  145. /package/src/{cogs → js/cogs}/text/description/index.jsx +0 -0
  146. /package/src/{cogs → js/cogs}/text/error-message/index.cjs +0 -0
  147. /package/src/{cogs → js/cogs}/text/error-message/index.d.cts +0 -0
  148. /package/src/{cogs → js/cogs}/text/error-message/index.d.mts +0 -0
  149. /package/src/{cogs → js/cogs}/text/error-message/index.jsx +0 -0
  150. /package/src/{cogs → js/cogs}/text/field/index.cjs +0 -0
  151. /package/src/{cogs → js/cogs}/text/field/index.d.cts +0 -0
  152. /package/src/{cogs → js/cogs}/text/field/index.d.mts +0 -0
  153. /package/src/{cogs → js/cogs}/text/field/index.jsx +0 -0
  154. /package/src/{cogs → js/cogs}/text/index.cjs +0 -0
  155. /package/src/{cogs → js/cogs}/text/index.d.cts +0 -0
  156. /package/src/{cogs → js/cogs}/text/index.d.mts +0 -0
  157. /package/src/{cogs → js/cogs}/text/title/index.cjs +0 -0
  158. /package/src/{cogs → js/cogs}/text/title/index.d.cts +0 -0
  159. /package/src/{cogs → js/cogs}/text/title/index.d.mts +0 -0
  160. /package/src/{cogs → js/cogs}/text/title/index.jsx +0 -0
  161. /package/src/{cogs → js/cogs}/textarea/description/index.cjs +0 -0
  162. /package/src/{cogs → js/cogs}/textarea/description/index.d.cts +0 -0
  163. /package/src/{cogs → js/cogs}/textarea/description/index.d.mts +0 -0
  164. /package/src/{cogs → js/cogs}/textarea/description/index.jsx +0 -0
  165. /package/src/{cogs → js/cogs}/textarea/error-message/index.cjs +0 -0
  166. /package/src/{cogs → js/cogs}/textarea/error-message/index.d.cts +0 -0
  167. /package/src/{cogs → js/cogs}/textarea/error-message/index.d.mts +0 -0
  168. /package/src/{cogs → js/cogs}/textarea/error-message/index.jsx +0 -0
  169. /package/src/{cogs → js/cogs}/textarea/field/index.cjs +0 -0
  170. /package/src/{cogs → js/cogs}/textarea/field/index.d.cts +0 -0
  171. /package/src/{cogs → js/cogs}/textarea/field/index.d.mts +0 -0
  172. /package/src/{cogs → js/cogs}/textarea/field/index.jsx +0 -0
  173. /package/src/{cogs → js/cogs}/textarea/index.cjs +0 -0
  174. /package/src/{cogs → js/cogs}/textarea/index.d.cts +0 -0
  175. /package/src/{cogs → js/cogs}/textarea/index.d.mts +0 -0
  176. /package/src/{cogs → js/cogs}/textarea/title/index.cjs +0 -0
  177. /package/src/{cogs → js/cogs}/textarea/title/index.d.cts +0 -0
  178. /package/src/{cogs → js/cogs}/textarea/title/index.d.mts +0 -0
  179. /package/src/{cogs → js/cogs}/textarea/title/index.jsx +0 -0
  180. /package/src/{components → js/components}/common/disabled/index.cjs +0 -0
  181. /package/src/{components → js/components}/common/disabled/index.d.cts +0 -0
  182. /package/src/{components → js/components}/common/disabled/index.d.mts +0 -0
  183. /package/src/{components → js/components}/common/disabled/index.jsx +0 -0
  184. /package/src/{components → js/components}/common/readonly/index.cjs +0 -0
  185. /package/src/{components → js/components}/common/readonly/index.d.cts +0 -0
  186. /package/src/{components → js/components}/common/readonly/index.d.mts +0 -0
  187. /package/src/{components → js/components}/common/readonly/index.jsx +0 -0
  188. /package/src/{components → js/components}/common/required/index.cjs +0 -0
  189. /package/src/{components → js/components}/common/required/index.d.cts +0 -0
  190. /package/src/{components → js/components}/common/required/index.d.mts +0 -0
  191. /package/src/{components → js/components}/common/required/index.jsx +0 -0
  192. /package/src/{components → js/components}/common/text-content/index.cjs +0 -0
  193. /package/src/{components → js/components}/common/text-content/index.d.cts +0 -0
  194. /package/src/{components → js/components}/common/text-content/index.d.mts +0 -0
  195. /package/src/{components → js/components}/common/text-content/index.jsx +0 -0
  196. /package/src/{components → js/components}/description/index.cjs +0 -0
  197. /package/src/{components → js/components}/description/index.d.cts +0 -0
  198. /package/src/{components → js/components}/description/index.d.mts +0 -0
  199. /package/src/{components → js/components}/description/index.jsx +0 -0
  200. /package/src/{components → js/components}/error-message/index.cjs +0 -0
  201. /package/src/{components → js/components}/error-message/index.d.cts +0 -0
  202. /package/src/{components → js/components}/error-message/index.d.mts +0 -0
  203. /package/src/{components → js/components}/error-message/index.jsx +0 -0
  204. /package/src/{components → js/components}/field/index.cjs +0 -0
  205. /package/src/{components → js/components}/field/index.d.cts +0 -0
  206. /package/src/{components → js/components}/index.cjs +0 -0
  207. /package/src/{components → js/components}/index.d.cts +0 -0
  208. /package/src/{components → js/components}/index.d.mts +0 -0
  209. /package/src/{components → js/components}/index.mjs +0 -0
  210. /package/src/{components → js/components}/title/index.cjs +0 -0
  211. /package/src/{components → js/components}/title/index.d.cts +0 -0
  212. /package/src/{components → js/components}/title/index.d.mts +0 -0
  213. /package/src/{components → js/components}/title/index.jsx +0 -0
  214. /package/src/{index.cjs → js/index.cjs} +0 -0
  215. /package/src/{index.d.cts → js/index.d.cts} +0 -0
  216. /package/src/{index.d.mts → js/index.d.mts} +0 -0
  217. /package/src/{index.mjs → js/index.mjs} +0 -0
  218. /package/src/{super → js/super}/cogs/index.cjs +0 -0
  219. /package/src/{super → js/super}/cogs/index.d.cts +0 -0
  220. /package/src/{super → js/super}/cogs/index.d.mts +0 -0
  221. /package/src/{super → js/super}/components/description/index.cjs +0 -0
  222. /package/src/{super → js/super}/components/description/index.d.cts +0 -0
  223. /package/src/{super → js/super}/components/description/index.d.mts +0 -0
  224. /package/src/{super → js/super}/components/description/index.jsx +0 -0
  225. /package/src/{super → js/super}/components/error-message/index.cjs +0 -0
  226. /package/src/{super → js/super}/components/error-message/index.d.cts +0 -0
  227. /package/src/{super → js/super}/components/error-message/index.d.mts +0 -0
  228. /package/src/{super → js/super}/components/error-message/index.jsx +0 -0
  229. /package/src/{super → js/super}/components/field/index.cjs +0 -0
  230. /package/src/{super → js/super}/components/field/index.d.cts +0 -0
  231. /package/src/{super → js/super}/components/field/index.d.mts +0 -0
  232. /package/src/{super → js/super}/components/index.cjs +0 -0
  233. /package/src/{super → js/super}/components/index.d.cts +0 -0
  234. /package/src/{super → js/super}/components/index.d.mts +0 -0
  235. /package/src/{super → js/super}/components/index.mjs +0 -0
  236. /package/src/{super → js/super}/components/title/index.cjs +0 -0
  237. /package/src/{super → js/super}/components/title/index.d.cts +0 -0
  238. /package/src/{super → js/super}/components/title/index.d.mts +0 -0
  239. /package/src/{super → js/super}/components/title/index.jsx +0 -0
  240. /package/src/{transformers → js/transformers}/error-message/index.d.mts +0 -0
  241. /package/src/{transformers → js/transformers}/error-message/index.mjs +0 -0
  242. /package/src/{transformers → js/transformers}/index.d.mts +0 -0
  243. /package/src/{transformers → js/transformers}/index.mjs +0 -0
@@ -0,0 +1,64 @@
1
+ @use "design-system/palette";
2
+ @use "design-system/typography";
3
+
4
+ @use "cogs/radio";
5
+ @use "cogs/checkbox";
6
+ @use "cogs/disabled";
7
+ @use "cogs/error";
8
+
9
+ @mixin cogs {
10
+ padding: 0;
11
+ margin: 1rem 0;
12
+
13
+ &:first-child {
14
+ margin-top: 0;
15
+ }
16
+
17
+ &:last-child {
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ line-height: 1.375rem;
22
+
23
+ &.radio {
24
+ @include radio.cog-radio;
25
+ }
26
+
27
+ &.checkbox {
28
+ @include checkbox.cog-checkbox;
29
+ }
30
+
31
+ &.disabled {
32
+ @include disabled.cog-disabled;
33
+ }
34
+
35
+ &.error {
36
+ @include error.cog-error;
37
+ }
38
+
39
+ .description {
40
+ @include typography.secondary-text;
41
+
42
+ // stylelint-disable-next-line no-duplicate-selectors
43
+ & {
44
+ display: block;
45
+ padding: 0;
46
+ margin: 0 0 0.25rem 0;
47
+ }
48
+ }
49
+
50
+ .error-message {
51
+ @include typography.error-standard;
52
+
53
+ // stylelint-disable-next-line no-duplicate-selectors
54
+ & {
55
+ display: block;
56
+ padding: 0;
57
+ margin: 0 0 0.25rem 0;
58
+ }
59
+ }
60
+ }
61
+
62
+ %cogs {
63
+ @include cogs;
64
+ }
@@ -0,0 +1,88 @@
1
+ @use "design-system/helpers/breakpoints";
2
+ @use "design-system/palette";
3
+
4
+ @mixin cog-checkbox {
5
+ position: relative;
6
+ padding-left: 3rem;
7
+ margin-bottom: 0.5rem;
8
+ min-height: 2rem;
9
+
10
+ &:last-of-type {
11
+ margin-bottom: 0;
12
+ }
13
+
14
+ label {
15
+ @include breakpoints.breakpoint(mobile) {
16
+ padding-top: 0.375rem;
17
+ }
18
+
19
+ @include breakpoints.breakpoint(large-mobile) {
20
+ padding-top: 0.375rem;
21
+ }
22
+
23
+ @include breakpoints.breakpoint(small-mobile) {
24
+ padding-top: 0.375rem;
25
+ }
26
+ }
27
+
28
+ label:before {
29
+ box-sizing: border-box;
30
+ position: absolute;
31
+ left: 0;
32
+ height: 2rem;
33
+ top: 0;
34
+ width: 2rem;
35
+ overflow: hidden;
36
+ border: 2px solid currentColor;
37
+ content: "\200b";
38
+ background-color: palette.$white;
39
+ }
40
+
41
+ input {
42
+ position: absolute;
43
+ left: 0.5rem;
44
+ top: 0.5rem;
45
+
46
+ &:focus + label:before {
47
+ box-shadow: 0 0 0 2px palette.$outline;
48
+ }
49
+
50
+ &:checked + label:after {
51
+ box-sizing: border-box;
52
+ position: absolute;
53
+ top: 0.625rem; // 10px;
54
+ bottom: 0.625rem; // 10px;
55
+ left: 0.3125rem; // 5px;
56
+ width: 1.375rem; // 22px;
57
+ height: 0.625rem; // 10px;
58
+ overflow: hidden;
59
+ border-bottom: 4px solid currentColor;
60
+ border-left: 4px solid currentColor;
61
+ content: "\200b";
62
+ background-color: palette.$white;
63
+ transform: rotate(-45deg);
64
+ }
65
+ }
66
+
67
+ &.disabled {
68
+ input:checked + {
69
+ label::before {
70
+ border-color: palette.$disabled;
71
+ }
72
+
73
+ label::after {
74
+ border-left-color: palette.$disabled;
75
+ border-bottom-color: palette.$disabled;
76
+ }
77
+ }
78
+
79
+ // stylelint-disable-next-line no-descending-specificity
80
+ input + label::before {
81
+ border-color: palette.$disabled;
82
+ }
83
+ }
84
+ }
85
+
86
+ %cog-checkbox {
87
+ @include cog-checkbox;
88
+ }
@@ -0,0 +1,15 @@
1
+ @use "design-system/palette";
2
+ @use "design-system/typography";
3
+
4
+ @mixin cog-disabled {
5
+ input:not([type="checkbox"]):not([type="radio"]),
6
+ select,
7
+ textarea {
8
+ border-color: palette.$disabled;
9
+ color: palette.$disabled;
10
+ }
11
+ }
12
+
13
+ %cog-disabled {
14
+ @include cog-disabled;
15
+ }
@@ -0,0 +1,50 @@
1
+ @use "design-system/palette";
2
+ @use "design-system/typography";
3
+
4
+ @mixin cog-error {
5
+ border-left: 0.25rem solid palette.$error-standard;
6
+ padding: 0 1rem;
7
+
8
+ input:not([type="checkbox"]):not([type="radio"]),
9
+ select,
10
+ textarea {
11
+ border: 2px solid palette.$error-standard;
12
+
13
+ &:focus {
14
+ border-color: palette.$black;
15
+ }
16
+ }
17
+
18
+ &.radio,
19
+ &.checkbox {
20
+ padding-left: 4rem;
21
+
22
+ // stylelint-disable-next-line no-descending-specificity
23
+ input {
24
+ left: 1.5rem;
25
+ }
26
+
27
+ // stylelint-disable-next-line no-descending-specificity
28
+ label:before {
29
+ left: 1rem;
30
+
31
+ border: 2px solid palette.$error-standard;
32
+ }
33
+ }
34
+
35
+ &.radio {
36
+ input:checked + label:after {
37
+ left: 1.5rem;
38
+ }
39
+ }
40
+
41
+ &.checkbox {
42
+ input:checked + label:after {
43
+ left: 1.3125rem; // 21px;
44
+ }
45
+ }
46
+ }
47
+
48
+ %cog-error {
49
+ @include cog-error;
50
+ }
@@ -0,0 +1,94 @@
1
+ @use "design-system/helpers/breakpoints";
2
+
3
+ @use "design-system/palette";
4
+ @use "design-system/typography";
5
+
6
+ @mixin cog-radio {
7
+ position: relative;
8
+ padding-left: 3rem;
9
+ margin-bottom: 0.5rem;
10
+ min-height: 2rem;
11
+
12
+ &:last-of-type {
13
+ margin-bottom: 0;
14
+ }
15
+
16
+ label {
17
+ @include breakpoints.breakpoint(mobile) {
18
+ padding-top: 0.375rem;
19
+ }
20
+
21
+ @include breakpoints.breakpoint(large-mobile) {
22
+ padding-top: 0.375rem;
23
+ }
24
+
25
+ @include breakpoints.breakpoint(small-mobile) {
26
+ padding-top: 0.375rem;
27
+ }
28
+ }
29
+
30
+ label:before {
31
+ box-sizing: border-box;
32
+ position: absolute;
33
+ left: 0;
34
+ height: 32px;
35
+ top: 0;
36
+ width: 32px;
37
+ overflow: hidden;
38
+ border: 2px solid currentColor;
39
+ border-radius: 50%;
40
+ content: "\200b";
41
+ background-color: palette.$white;
42
+ }
43
+
44
+ input {
45
+ position: absolute;
46
+ left: 0.5rem;
47
+ top: 0.5rem;
48
+
49
+ &:focus + label:before {
50
+ box-shadow: 0 0 0 2px palette.$outline;
51
+ }
52
+
53
+ &:checked + label:after {
54
+ box-sizing: border-box;
55
+ position: absolute;
56
+ top: 0.5rem;
57
+ bottom: 0.5rem;
58
+ left: 0.5rem;
59
+ right: 0.5rem;
60
+ width: 1rem;
61
+ height: 1rem;
62
+ overflow: hidden;
63
+ border: 2px solid currentColor;
64
+ border-radius: 50%;
65
+ content: "\200b";
66
+ background-color: palette.$black;
67
+ }
68
+ }
69
+
70
+ &.disabled {
71
+ input + label {
72
+ &::before,
73
+ &::after {
74
+ border-color: palette.$disabled;
75
+ }
76
+ }
77
+
78
+ input:checked + label {
79
+ &::before,
80
+ &::after {
81
+ border-color: palette.$disabled;
82
+ }
83
+
84
+ // stylelint-disable-next-line no-descending-specificity
85
+ &::after {
86
+ background-color: palette.$disabled;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ %cog-radio {
93
+ @include cog-radio;
94
+ }
@@ -1,5 +0,0 @@
1
- export function DEFAULT_HANDLE_EVENT (
2
- name: string,
3
- value?: string | string[],
4
- checked?: boolean
5
- ): void
@@ -1,3 +0,0 @@
1
- export function DEFAULT_HANDLE_EVENT () {
2
- /* */
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes