@esportsplus/ui 0.53.0 → 0.54.0

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 (308) hide show
  1. package/README.md +51 -6
  2. package/build/components/accordion/index.d.ts +2 -19
  3. package/build/components/accordion/index.js +7 -7
  4. package/build/components/anchor/scss/index.scss +1 -1
  5. package/build/components/button/scss/index.scss +1 -1
  6. package/build/components/card/scss/index.scss +1 -1
  7. package/build/components/checkbox/index.d.ts +12 -12
  8. package/build/components/checkbox/index.js +64 -36
  9. package/build/components/checkbox/scss/index.scss +1 -1
  10. package/build/components/checkbox/svg/check.svg +1 -0
  11. package/build/components/clipboard/copy.d.ts +11 -0
  12. package/build/components/clipboard/copy.js +49 -0
  13. package/build/components/clipboard/index.d.ts +1435 -1229
  14. package/build/components/clipboard/index.js +3 -2
  15. package/build/components/clipboard/onclick.d.ts +4 -38
  16. package/build/components/clipboard/onclick.js +7 -7
  17. package/build/components/counter/index.js +58 -66
  18. package/build/components/counter/scss/index.scss +1 -1
  19. package/build/components/form/action.js +8 -8
  20. package/build/components/form/index.d.ts +4 -4
  21. package/build/components/form/input.d.ts +4 -4
  22. package/build/components/grid/scss/index.scss +1 -1
  23. package/build/components/icon/index.d.ts +2 -19
  24. package/build/components/icon/index.js +6 -6
  25. package/build/components/icon/scss/index.scss +1 -1
  26. package/build/components/index.d.ts +0 -7
  27. package/build/components/index.js +0 -7
  28. package/build/components/input/index.d.ts +1 -1
  29. package/build/components/input/index.js +11 -11
  30. package/build/components/input/scss/index.scss +1 -1
  31. package/build/components/link/scss/index.scss +1 -1
  32. package/build/components/loading/index.js +5 -5
  33. package/build/components/modal/scss/index.scss +1 -1
  34. package/build/components/normalize/scss/index.scss +1 -1
  35. package/build/components/overlay/index.d.ts +2 -19
  36. package/build/components/overlay/index.js +7 -7
  37. package/build/components/page/scss/index.scss +1 -1
  38. package/build/components/radio/index.d.ts +1436 -4
  39. package/build/components/radio/index.js +0 -1
  40. package/build/components/range/index.d.ts +1 -1
  41. package/build/components/range/index.js +13 -13
  42. package/build/components/range/scss/index.scss +1 -1
  43. package/build/components/root/scss/index.scss +1 -1
  44. package/build/components/select/index.d.ts +5 -48
  45. package/build/components/select/index.js +41 -53
  46. package/build/components/select/scss/index.scss +1 -1
  47. package/build/components/sidebar/index.d.ts +2 -19
  48. package/build/components/sidebar/index.js +7 -7
  49. package/build/components/sidebar/scss/index.scss +1 -1
  50. package/build/components/switch/index.d.ts +1436 -4
  51. package/build/components/switch/index.js +0 -1
  52. package/build/components/tabs/scss/index.scss +2 -0
  53. package/build/components/text/scss/index.scss +1 -1
  54. package/build/components/textarea/index.d.ts +719 -6
  55. package/build/components/textarea/index.js +37 -15
  56. package/build/components/textarea/scss/index.scss +1 -1
  57. package/build/components/toast/index.js +43 -43
  58. package/build/components/toast/scss/index.scss +1 -1
  59. package/build/components/tooltip/index.d.ts +2151 -2544
  60. package/build/components/tooltip/menu.d.ts +2 -18
  61. package/build/components/tooltip/menu.js +21 -21
  62. package/build/components/tooltip/onclick.d.ts +717 -1229
  63. package/build/components/tooltip/onclick.js +16 -52
  64. package/build/components/tooltip/onhover.d.ts +713 -20
  65. package/build/components/tooltip/onhover.js +9 -9
  66. package/build/components/tooltip/scss/index.scss +1 -1
  67. package/build/components/typewriter/index.d.ts +2 -19
  68. package/build/components/typewriter/index.js +8 -8
  69. package/build/css-utilities/background/scss/index.scss +1 -1
  70. package/build/css-utilities/border/scss/index.scss +1 -1
  71. package/build/css-utilities/color/scss/index.scss +1 -1
  72. package/build/css-utilities/font/geist/scss/Geist-Italic-Variable.woff2 +0 -0
  73. package/build/css-utilities/font/geist/scss/Geist-Variable.woff2 +0 -0
  74. package/build/css-utilities/font/geist/scss/GeistMono-Italic-Variable.woff2 +0 -0
  75. package/build/css-utilities/font/geist/scss/GeistMono-Variable.woff2 +0 -0
  76. package/build/css-utilities/font/geist/scss/index.scss +2 -0
  77. package/build/css-utilities/font/montserrat/index.d.ts +1 -0
  78. package/build/css-utilities/font/montserrat/index.js +1 -0
  79. package/build/css-utilities/font/montserrat/scss/index.scss +2 -0
  80. package/build/css-utilities/index.scss +1 -1
  81. package/build/css-utilities/inline/scss/index.scss +1 -1
  82. package/build/css-utilities/scrollbar/scss/index.scss +1 -1
  83. package/build/css-utilities/tabular/scss/index.scss +2 -0
  84. package/build/css-utilities/text/scss/index.scss +1 -1
  85. package/build/themes/dark/index.d.ts +0 -1
  86. package/build/themes/dark/index.js +0 -1
  87. package/build/themes/dark/input.d.ts +708 -114
  88. package/build/themes/dark/select.d.ts +732 -1406
  89. package/build/themes/dark/select.js +7 -5
  90. package/build/themes/dark/textarea.d.ts +716 -119
  91. package/package.json +12 -12
  92. package/pnpm-workspace.yaml +4 -3
  93. package/scripts/css-variables.test.mjs +50 -0
  94. package/scripts/sort-scss.md +57 -0
  95. package/scripts/sort-scss.mjs +233 -0
  96. package/scripts/sort-scss.test.mjs +217 -0
  97. package/src/components/anchor/scss/index.scss +2 -2
  98. package/src/components/button/scss/index.scss +23 -57
  99. package/src/components/button/scss/variables.scss +1 -19
  100. package/src/components/card/scss/index.scss +11 -46
  101. package/src/components/card/scss/variables.scss +1 -2
  102. package/src/components/checkbox/index.ts +27 -31
  103. package/src/components/checkbox/scss/index.scss +86 -28
  104. package/src/components/checkbox/scss/variables.scss +71 -30
  105. package/src/components/checkbox/svg/check.svg +1 -0
  106. package/src/components/clipboard/copy.ts +60 -0
  107. package/src/components/clipboard/index.ts +3 -2
  108. package/src/components/counter/index.ts +57 -57
  109. package/src/components/counter/scss/index.scss +4 -5
  110. package/src/components/counter/scss/variables.scss +0 -1
  111. package/src/components/form/input.ts +4 -3
  112. package/src/components/grid/scss/index.scss +1 -1
  113. package/src/components/icon/scss/variables.scss +0 -1
  114. package/src/components/index.ts +1 -8
  115. package/src/components/input/index.ts +1 -1
  116. package/src/components/input/scss/index.scss +8 -7
  117. package/src/components/input/scss/variables.scss +0 -1
  118. package/src/components/link/scss/index.scss +9 -34
  119. package/src/components/link/scss/variables.scss +0 -12
  120. package/src/components/modal/scss/index.scss +4 -4
  121. package/src/components/normalize/scss/index.scss +0 -1
  122. package/src/components/page/scss/index.scss +0 -6
  123. package/src/components/page/scss/variables.scss +0 -2
  124. package/src/components/radio/index.ts +0 -1
  125. package/src/components/range/index.ts +1 -1
  126. package/src/components/range/scss/index.scss +5 -5
  127. package/src/components/root/scss/index.scss +37 -63
  128. package/src/components/root/scss/variables.scss +37 -67
  129. package/src/components/select/index.ts +16 -33
  130. package/src/components/select/scss/index.scss +10 -7
  131. package/src/components/select/scss/variables.scss +0 -1
  132. package/src/components/sidebar/scss/index.scss +3 -3
  133. package/src/components/switch/index.ts +1 -2
  134. package/src/components/tabs/scss/index.scss +62 -0
  135. package/src/components/tabs/scss/variables.scss +4 -0
  136. package/src/components/text/scss/index.scss +8 -1
  137. package/src/components/text/scss/variables.scss +5 -3
  138. package/src/components/textarea/index.ts +38 -5
  139. package/src/components/textarea/scss/index.scss +24 -13
  140. package/src/components/textarea/scss/variables.scss +0 -1
  141. package/src/components/toast/scss/index.scss +1 -1
  142. package/src/components/tooltip/onclick.ts +11 -67
  143. package/src/components/tooltip/scss/index.scss +2 -3
  144. package/src/css-utilities/background/scss/variables.scss +2 -2
  145. package/src/css-utilities/border/scss/index.scss +1 -27
  146. package/src/css-utilities/border/scss/variables.scss +3 -34
  147. package/src/css-utilities/color/scss/variables.scss +2 -6
  148. package/src/css-utilities/font/geist/scss/Geist-Italic-Variable.woff2 +0 -0
  149. package/src/css-utilities/font/geist/scss/Geist-Variable.woff2 +0 -0
  150. package/src/css-utilities/font/geist/scss/GeistMono-Italic-Variable.woff2 +0 -0
  151. package/src/css-utilities/font/geist/scss/GeistMono-Variable.woff2 +0 -0
  152. package/src/css-utilities/font/geist/scss/index.scss +55 -0
  153. package/src/css-utilities/font/montserrat/index.ts +1 -0
  154. package/src/{fonts → css-utilities/font}/montserrat/scss/index.scss +15 -0
  155. package/src/css-utilities/index.scss +6 -12
  156. package/src/css-utilities/inline/scss/index.scss +0 -1
  157. package/src/css-utilities/scrollbar/scss/index.scss +42 -0
  158. package/src/css-utilities/tabular/scss/index.scss +3 -0
  159. package/src/css-utilities/text/scss/index.scss +30 -71
  160. package/src/lib/scss/css-variables.scss +29 -5
  161. package/src/themes/dark/index.ts +0 -1
  162. package/src/themes/dark/select.ts +7 -5
  163. package/src/tokens/index.scss +1 -3
  164. package/src/tokens/scss/border-radius.scss +1 -6
  165. package/src/tokens/scss/color.scss +3 -3
  166. package/src/tokens/scss/scale.scss +1 -1
  167. package/src/tokens/scss/size.scss +7 -0
  168. package/src/tokens/scss/transition.scss +4 -0
  169. package/storage/svg/arrow-left.svg +1 -0
  170. package/storage/svg/arrow-right.svg +1 -0
  171. package/storage/svg/book.svg +1 -0
  172. package/storage/svg/cube.svg +1 -0
  173. package/storage/svg/github.svg +1 -0
  174. package/storage/svg/info.svg +1 -0
  175. package/storage/svg/palette.svg +1 -0
  176. package/storage/svg/search.svg +2 -0
  177. package/storage/svg/type.svg +1 -0
  178. package/vite.config.ts +8 -3
  179. package/build/components/back/index.d.ts +0 -21
  180. package/build/components/back/index.js +0 -16
  181. package/build/components/back/scss/index.scss +0 -2
  182. package/build/components/back/svg/arrow.svg +0 -15
  183. package/build/components/bubble/scss/index.scss +0 -2
  184. package/build/components/button/index.d.ts +0 -103
  185. package/build/components/button/index.js +0 -60
  186. package/build/components/ellipsis/index.d.ts +0 -4
  187. package/build/components/ellipsis/index.js +0 -8
  188. package/build/components/ellipsis/scss/index.scss +0 -2
  189. package/build/components/frame/index.d.ts +0 -21
  190. package/build/components/frame/index.js +0 -13
  191. package/build/components/frame/scss/index.scss +0 -2
  192. package/build/components/highlight/index.d.ts +0 -22
  193. package/build/components/highlight/index.js +0 -56
  194. package/build/components/highlight/scss/index.scss +0 -2
  195. package/build/components/loader/index.d.ts +0 -22
  196. package/build/components/loader/index.js +0 -78
  197. package/build/components/loader/scss/index.scss +0 -2
  198. package/build/components/radio/scss/index.scss +0 -2
  199. package/build/components/root/index.d.ts +0 -7
  200. package/build/components/root/index.js +0 -4
  201. package/build/components/root/onclick.d.ts +0 -5
  202. package/build/components/root/onclick.js +0 -12
  203. package/build/components/switch/scss/index.scss +0 -2
  204. package/build/css-utilities/[margin,padding]/scss/index.scss +0 -2
  205. package/build/css-utilities/error/scss/index.scss +0 -2
  206. package/build/css-utilities/flicker/scss/index.scss +0 -2
  207. package/build/css-utilities/focus/scss/index.scss +0 -2
  208. package/build/css-utilities/gap/scss/index.scss +0 -2
  209. package/build/css-utilities/line-height/scss/index.scss +0 -2
  210. package/build/css-utilities/pointer/scss/index.scss +0 -2
  211. package/build/css-utilities/scroll-fade/scss/index.scss +0 -2
  212. package/build/css-utilities/size/scss/index.scss +0 -2
  213. package/build/css-utilities/viewport/scss/index.scss +0 -2
  214. package/build/css-utilities/width/scss/index.scss +0 -2
  215. package/build/fonts/index.d.ts +0 -1
  216. package/build/fonts/index.js +0 -1
  217. package/build/fonts/montserrat/scss/index.scss +0 -2
  218. package/build/themes/dark/back.d.ts +0 -19
  219. package/build/themes/dark/back.js +0 -7
  220. package/build/themes/dark/button/scss/index.scss +0 -2
  221. package/build/themes/dark/link/scss/index.scss +0 -2
  222. package/src/components/back/index.ts +0 -20
  223. package/src/components/back/scss/index.scss +0 -17
  224. package/src/components/back/svg/arrow.svg +0 -15
  225. package/src/components/bubble/scss/index.scss +0 -32
  226. package/src/components/bubble/scss/variables.scss +0 -20
  227. package/src/components/button/index.ts +0 -53
  228. package/src/components/ellipsis/index.ts +0 -11
  229. package/src/components/ellipsis/scss/index.scss +0 -30
  230. package/src/components/ellipsis/scss/variables.scss +0 -5
  231. package/src/components/frame/index.ts +0 -13
  232. package/src/components/frame/scss/index.scss +0 -39
  233. package/src/components/frame/scss/variables.scss +0 -4
  234. package/src/components/highlight/index.ts +0 -66
  235. package/src/components/highlight/scss/index.scss +0 -7
  236. package/src/components/highlight/scss/variables.scss +0 -4
  237. package/src/components/loader/index.ts +0 -80
  238. package/src/components/loader/scss/index.scss +0 -71
  239. package/src/components/loader/scss/variables.scss +0 -6
  240. package/src/components/radio/scss/index.scss +0 -50
  241. package/src/components/radio/scss/variables.scss +0 -67
  242. package/src/components/root/index.ts +0 -6
  243. package/src/components/root/onclick.ts +0 -20
  244. package/src/components/switch/scss/index.scss +0 -48
  245. package/src/components/switch/scss/variables.scss +0 -74
  246. package/src/css-utilities/[margin,padding]/scss/index.scss +0 -43
  247. package/src/css-utilities/[margin,padding]/scss/variables.scss +0 -54
  248. package/src/css-utilities/error/scss/index.scss +0 -24
  249. package/src/css-utilities/error/scss/variables.scss +0 -3
  250. package/src/css-utilities/flicker/scss/index.scss +0 -15
  251. package/src/css-utilities/flicker/scss/variables.scss +0 -5
  252. package/src/css-utilities/focus/scss/index.scss +0 -7
  253. package/src/css-utilities/focus/scss/variables.scss +0 -5
  254. package/src/css-utilities/gap/scss/index.scss +0 -13
  255. package/src/css-utilities/gap/scss/variables.scss +0 -39
  256. package/src/css-utilities/line-height/scss/index.scss +0 -1
  257. package/src/css-utilities/line-height/scss/variables.scss +0 -10
  258. package/src/css-utilities/pointer/scss/index.scss +0 -5
  259. package/src/css-utilities/scroll-fade/scss/index.scss +0 -47
  260. package/src/css-utilities/scroll-fade/scss/variables.scss +0 -3
  261. package/src/css-utilities/size/scss/index.scss +0 -1
  262. package/src/css-utilities/size/scss/variables.scss +0 -12
  263. package/src/css-utilities/text/scss/variables.scss +0 -31
  264. package/src/css-utilities/viewport/scss/index.scss +0 -5
  265. package/src/css-utilities/width/scss/index.scss +0 -5
  266. package/src/css-utilities/width/scss/variables.scss +0 -9
  267. package/src/fonts/index.ts +0 -1
  268. package/src/themes/dark/back.ts +0 -9
  269. package/src/themes/dark/button/scss/index.scss +0 -46
  270. package/src/themes/dark/link/scss/index.scss +0 -26
  271. package/src/tokens/scss/font-weight.scss +0 -6
  272. package/src/tokens/scss/line-height.scss +0 -9
  273. package/src/tokens/scss/transition-duration.scss +0 -1
  274. /package/build/{fonts/montserrat → css-utilities/font/geist}/index.d.ts +0 -0
  275. /package/build/{fonts/montserrat → css-utilities/font/geist}/index.js +0 -0
  276. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff +0 -0
  277. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff2 +0 -0
  278. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
  279. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
  280. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff +0 -0
  281. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff2 +0 -0
  282. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff +0 -0
  283. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff2 +0 -0
  284. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
  285. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
  286. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff +0 -0
  287. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff2 +0 -0
  288. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff +0 -0
  289. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
  290. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
  291. /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
  292. /package/src/{fonts/montserrat → css-utilities/font/geist}/index.ts +0 -0
  293. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff +0 -0
  294. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff2 +0 -0
  295. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
  296. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
  297. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff +0 -0
  298. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff2 +0 -0
  299. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff +0 -0
  300. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff2 +0 -0
  301. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
  302. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
  303. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff +0 -0
  304. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff2 +0 -0
  305. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff +0 -0
  306. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
  307. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
  308. /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
@@ -1,48 +1,15 @@
1
1
  import { component, html, type Attributes } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { omit } from '@esportsplus/utilities';
4
- import root from '~/components/root';
5
4
 
6
5
 
7
6
  const OMIT = ['state', 'toggle'];
8
7
 
9
8
 
10
- let parent: HTMLElement | null | undefined = null,
11
- queue: { fn: VoidFunction, tooltip: HTMLElement }[] = [],
12
- running = false,
13
- scheduled = false;
14
-
15
-
16
- function frame() {
17
- if (running) {
18
- return;
19
- }
20
-
21
- running = true;
22
-
23
- let item,
24
- keep;
25
-
26
- while (item = queue.pop()) {
27
- if (parent === item.tooltip) {
28
- keep = item;
29
- continue;
30
- }
31
-
32
- item.fn();
33
- }
34
-
35
- if (keep) {
36
- queue.push(keep);
37
- }
38
-
39
- running = false;
40
- }
41
-
42
-
43
9
  export default component<Attributes & { state?: { active: boolean }, toggle?: boolean }>(
44
10
  (attributes, content) => {
45
- let state = attributes.state || reactive({ active: false }),
11
+ let ref: HTMLElement,
12
+ state = attributes.state || reactive({ active: false }),
46
13
  toggle = attributes.toggle || false;
47
14
 
48
15
  return html`
@@ -51,42 +18,19 @@ export default component<Attributes & { state?: { active: boolean }, toggle?: bo
51
18
  ${omit(attributes, OMIT)}
52
19
  ${{
53
20
  class: () => state.active && '--active',
54
- onclick: function(e) {
55
- let active = true,
56
- node = e.target as Node | null;
57
-
58
- if (this === node || (toggle && this.contains(node))) {
59
- active = !state.active;
60
- }
61
-
62
- if (parent !== this && !parent?.contains(this)) {
63
- parent = this.parentElement?.closest('.tooltip');
64
- }
65
-
66
- frame();
67
-
68
- if (parent === this) {
69
- parent = null;
21
+ ondocumentclick: (event) => {
22
+ if (!state.active || !ref?.isConnected) {
70
23
  return;
71
24
  }
72
25
 
73
- state.active = active;
74
-
75
- if (active) {
76
- queue.push({
77
- fn: () => state.active = false,
78
- tooltip: this
79
- });
80
- }
81
-
82
- if (!scheduled) {
83
- root.onclick.push(() => {
84
- frame();
85
- scheduled = false;
86
- });
87
- scheduled = true;
26
+ if (!ref.contains(event.target as Node | null)) {
27
+ state.active = false;
88
28
  }
89
- }
29
+ },
30
+ onclick: function(e) {
31
+ state.active = this === e.target || toggle ? !state.active : true;
32
+ },
33
+ onrender: (element) => ref = element
90
34
  }}
91
35
  >
92
36
  ${content}
@@ -54,8 +54,8 @@
54
54
  opacity: 0;
55
55
  overflow: hidden;
56
56
  transition:
57
- opacity var(--transition-duration) ease-in-out,
58
- transform var(--transition-duration) ease-in-out;
57
+ opacity var(--transition-duration) var(--transition-timing-function),
58
+ transform var(--transition-duration) var(--transition-timing-function);
59
59
  width: var(--width);
60
60
  z-index: 9;
61
61
 
@@ -88,7 +88,6 @@
88
88
  cursor: auto;
89
89
  font-size: var(--font-size);
90
90
  font-weight: var(--font-weight);
91
- line-height: normal;
92
91
  padding: var(--padding-vertical) var(--padding-horizontal);
93
92
  pointer-events: none;
94
93
  white-space: nowrap;
@@ -1,6 +1,8 @@
1
1
  @use '/tokens';
2
2
 
3
3
  .--background {
4
+ @include tokens.state-utility('background', tokens.$colors);
5
+
4
6
  &-default {
5
7
  --background: var(--background-default);
6
8
  --background-active: var(--background-default);
@@ -27,7 +29,5 @@
27
29
  --background: var(--background-pressed);
28
30
  }
29
31
  }
30
-
31
- @include tokens.state-utility('background', tokens.$colors);
32
32
  }
33
33
 
@@ -1,27 +1 @@
1
- @use './variables';
2
-
3
- .--border {
4
- border: var(--border-width) var(--border-style) var(--border-color);
5
-
6
- @each $key in 'bottom' 'left' 'right' 'top' {
7
- &-#{$key} {
8
- border-#{$key}: var(--border-width) var(--border-style) var(--border-color);
9
- }
10
- }
11
-
12
- &-offset {
13
- @each $key in 'bottom' 'left' 'right' 'top' {
14
- &-#{$key} {
15
- margin-#{$key}: calc(var(--border-width) * -1);
16
- }
17
- }
18
- }
19
-
20
- &-radius {
21
- border-radius: var(--border-radius);
22
-
23
- &-circle {
24
- aspect-ratio: 1;
25
- }
26
- }
27
- }
1
+ @use './variables';
@@ -2,30 +2,11 @@
2
2
  @use '/tokens';
3
3
 
4
4
  .--border {
5
- &,
6
- &-bottom,
7
- &-left,
8
- &-right,
9
- &-top {
10
- --border-style: solid;
11
- --border-width: var(--border-width-400);
12
- }
13
-
14
- &-dashed {
15
- --border-style: dashed;
16
- }
17
-
18
- &-dotted {
19
- --border-style: dotted;
20
- }
5
+ @include tokens.state-utility('border-color', tokens.$colors);
21
6
 
22
7
  &-radius {
23
- --border-radius: var(--border-radius-400);
24
-
25
- @each $key in lib.map-keys(tokens.$border-radius) {
26
- &-#{$key} {
27
- --border-radius: var(--border-radius-#{$key});
28
- }
8
+ &-responsive {
9
+ --border-radius: #{"calc( progress((100vi - 100cqi) / 2, 0px, var(--gap-horizontal)) * var(--border-radius) )"};
29
10
  }
30
11
  }
31
12
 
@@ -55,16 +36,4 @@
55
36
  --border-color: var(--border-color-pressed);
56
37
  }
57
38
  }
58
-
59
- &-width {
60
- --border-width: var(--border-width-400);
61
-
62
- @each $key in lib.map-keys(tokens.$border-width) {
63
- &-#{$key} {
64
- --border-width: var(--border-width-#{$key});
65
- }
66
- }
67
- }
68
-
69
- @include tokens.state-utility('border-color', tokens.$colors);
70
39
  }
@@ -1,6 +1,8 @@
1
1
  @use '/tokens';
2
2
 
3
3
  .--color {
4
+ @include tokens.state-utility('color', tokens.$colors);
5
+
4
6
  &-default {
5
7
  --color: var(--color-default);
6
8
  --color-active: var(--color-default);
@@ -8,10 +10,6 @@
8
10
  --color-pressed: var(--color-default);
9
11
  }
10
12
 
11
- &-inherit {
12
- --color: inherit;
13
- }
14
-
15
13
  &-state {
16
14
  --color: var(--color-default);
17
15
  --color-active: var(--color-default);
@@ -31,6 +29,4 @@
31
29
  --color: var(--color-pressed);
32
30
  }
33
31
  }
34
-
35
- @include tokens.state-utility('color', tokens.$colors);
36
32
  }
@@ -0,0 +1,55 @@
1
+ @use '/lib';
2
+
3
+
4
+ @font-face {
5
+ font-display: swap;
6
+ font-family: 'Geist';
7
+ font-style: normal;
8
+ font-weight: 100 900;
9
+ src: url('./Geist-Variable.woff2') format('woff2');
10
+ }
11
+
12
+ @font-face {
13
+ font-display: swap;
14
+ font-family: 'Geist';
15
+ font-style: italic;
16
+ font-weight: 100 900;
17
+ src: url('./Geist-Italic-Variable.woff2') format('woff2');
18
+ }
19
+
20
+ @font-face {
21
+ font-display: swap;
22
+ font-family: 'Geist Mono';
23
+ font-style: normal;
24
+ font-weight: 100 900;
25
+ src: url('./GeistMono-Variable.woff2') format('woff2');
26
+ }
27
+
28
+ @font-face {
29
+ font-display: swap;
30
+ font-family: 'Geist Mono';
31
+ font-style: italic;
32
+ font-weight: 100 900;
33
+ src: url('./GeistMono-Italic-Variable.woff2') format('woff2');
34
+ }
35
+
36
+
37
+ .--font-geist {
38
+ --font-family: 'Geist', sans-serif;
39
+
40
+ &,
41
+ &-mono {
42
+ @include lib.css-variables(font-weight, (
43
+ 300: 300,
44
+ 400: 400,
45
+ 500: 500,
46
+ 600: 600
47
+ ));
48
+ }
49
+
50
+ &-mono {
51
+ --font-family: 'Geist Mono', monospace;
52
+ }
53
+ }
54
+
55
+
@@ -0,0 +1 @@
1
+ import './scss/index.scss';
@@ -1,3 +1,6 @@
1
+ @use '/lib';
2
+
3
+
1
4
  @font-face {
2
5
  font-display: swap;
3
6
  font-family: 'Montserrat';
@@ -77,3 +80,15 @@
77
80
  url('Montserrat-BoldItalic.woff2') format('woff2'),
78
81
  url('Montserrat-BoldItalic.woff') format('woff');
79
82
  }
83
+
84
+
85
+ .--font-montserrat {
86
+ --font-family: 'Montserrat', sans-serif;
87
+
88
+ @include lib.css-variables(font-weight, (
89
+ 300: 400,
90
+ 400: 500,
91
+ 500: 600,
92
+ 600: 700
93
+ ));
94
+ }
@@ -1,24 +1,18 @@
1
- @forward './[margin,padding]/scss/index.scss';
2
1
  @forward './absolute/scss/index.scss';
3
2
  @forward './background/scss/index.scss';
4
3
  @forward './border/scss/index.scss';
5
4
  @forward './color/scss/index.scss';
6
5
  @forward './disabled/scss/index.scss';
7
- @forward './error/scss/index.scss';
8
6
  @forward './flex/scss/index.scss';
9
- @forward './flicker/scss/index.scss';
10
- @forward './focus/scss/index.scss';
11
- @forward './gap/scss/index.scss';
7
+
8
+ @forward './font/geist/scss/index.scss';
9
+ @forward './font/montserrat/scss/index.scss';
10
+
12
11
  @forward './glass/scss/index.scss';
13
12
  @forward './hidden/scss/index.scss';
14
13
  @forward './inline/scss/index.scss';
15
- @forward './line-height/scss/index.scss';
16
14
  @forward './not-allowed/scss/index.scss';
17
- @forward './pointer/scss/index.scss';
18
- @forward './scroll-fade/scss/index.scss';
19
15
  @forward './scrollbar/scss/index.scss';
20
- @forward './size/scss/index.scss';
21
16
  @forward './skeleton/scss/index.scss';
22
- @forward './text/scss/index.scss';
23
- @forward './viewport/scss/index.scss';
24
- @forward './width/scss/index.scss';
17
+ @forward './tabular/scss/index.scss';
18
+ @forward './text/scss/index.scss';
@@ -1,7 +1,6 @@
1
1
  .--inline {
2
2
  display: inline;
3
3
  font-size: inherit;
4
- line-height: inherit;
5
4
  margin: 0;
6
5
  padding: 0;
7
6
  }
@@ -1,5 +1,19 @@
1
1
  @use 'variables';
2
2
 
3
+ // Registered so the length custom properties can be interpolated by the
4
+ // scroll-driven animation below.
5
+ @property --scroll-fade-bottom {
6
+ inherits: false;
7
+ initial-value: 0px;
8
+ syntax: '<length>';
9
+ }
10
+
11
+ @property --scroll-fade-top {
12
+ inherits: false;
13
+ initial-value: 0px;
14
+ syntax: '<length>';
15
+ }
16
+
3
17
  .--scrollbar {
4
18
  overflow: auto;
5
19
  overscroll-behavior: contain;
@@ -32,6 +46,34 @@
32
46
  overflow-y: hidden;
33
47
  }
34
48
 
49
+ &-fade {
50
+ overflow-y: auto;
51
+
52
+ @supports (animation-timeline: scroll()) {
53
+ animation: scrollbar-fade linear both;
54
+ animation-timeline: scroll(self);
55
+ -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent);
56
+ mask-image: linear-gradient(to bottom, transparent, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent);
57
+ }
58
+
59
+ @keyframes scrollbar-fade {
60
+ 0% {
61
+ --scroll-fade-bottom: var(--scroll-fade-size);
62
+ --scroll-fade-top: 0px;
63
+ }
64
+
65
+ 5%, 95% {
66
+ --scroll-fade-bottom: var(--scroll-fade-size);
67
+ --scroll-fade-top: var(--scroll-fade-size);
68
+ }
69
+
70
+ 100% {
71
+ --scroll-fade-bottom: 0px;
72
+ --scroll-fade-top: var(--scroll-fade-size);
73
+ }
74
+ }
75
+ }
76
+
35
77
  &-hidden {
36
78
  scrollbar-width: none;
37
79
 
@@ -0,0 +1,3 @@
1
+ .--tabular {
2
+ font-variant-numeric: tabular-nums;
3
+ }
@@ -1,43 +1,42 @@
1
1
  @use '/lib';
2
2
  @use '/tokens';
3
- @use './variables';
4
3
 
5
4
  .--text {
6
- &-bold {
7
- font-weight: var(--font-weight-500);
8
-
9
- @each $key in lib.map-keys(tokens.$font-weight) {
10
- @if $key > 500 {
11
- &-#{$key} {
12
- font-weight: var(--font-weight-#{$key});
13
- }
5
+ &-crop {
6
+ @supports (text-box: trim-both cap alphabetic) {
7
+ & {
8
+ text-box: trim-both cap alphabetic;
14
9
  }
15
- }
16
- }
17
10
 
18
- &-center {
19
- text-align: center;
20
- }
11
+ &-top {
12
+ text-box: trim-start cap alphabetic;
13
+ }
21
14
 
22
- &-crop {
23
- &::after,
24
- &::before,
25
- &-bottom::after,
26
- &-top::before {
27
- content: '';
28
- display: block;
29
- height: 0;
30
- width: 100%;
15
+ &-bottom {
16
+ text-box: trim-end cap alphabetic;
17
+ }
31
18
  }
32
19
 
33
- &::after,
34
- &-bottom::after {
35
- margin-bottom: calc((1 - var(--line-height)) * 0.618em);
36
- }
20
+ @supports not (text-box: trim-both cap alphabetic) {
21
+ &::after,
22
+ &::before,
23
+ &-bottom::after,
24
+ &-top::before {
25
+ content: '';
26
+ display: block;
27
+ height: 0;
28
+ width: 100%;
29
+ }
30
+
31
+ &::after,
32
+ &-bottom::after {
33
+ margin-bottom: calc((1em - 1lh) * 0.618);
34
+ }
37
35
 
38
- &::before,
39
- &-top::before {
40
- margin-top: calc((1 - var(--line-height)) * 0.618em);
36
+ &::before,
37
+ &-top::before {
38
+ margin-top: calc((1em - 1lh) * 0.618);
39
+ }
41
40
  }
42
41
 
43
42
  &-first-child {
@@ -53,50 +52,10 @@
53
52
  }
54
53
  }
55
54
 
56
- &-italic {
57
- font-style: italic;
58
- }
59
-
60
- &-line-through {
61
- text-decoration: line-through;
62
- text-decoration-thickness: var(--line-width);
63
- }
64
-
65
- &-multiplier {
66
- font-size: calc(var(--font-size) * var(--text-multiplier));
67
- }
68
-
69
- &-outline {
70
- color: var(--color);
71
- word-break: break-word;
72
- word-wrap: break-word;
73
-
74
- @supports (-webkit-text-stroke-width: 1px) {
75
- color: transparent;
76
- -webkit-text-fill-color: transparent;
77
- -webkit-text-stroke-color: var(--color);
78
- -webkit-text-stroke-width: var(--stroke-width);
79
- }
80
- }
81
-
82
55
  &-truncate {
83
- line-height: var(--size);
84
56
  max-width: 100%;
85
57
  overflow: hidden;
86
58
  text-overflow: ellipsis;
87
59
  white-space: nowrap;
88
60
  }
89
-
90
- &-underline {
91
- text-decoration: underline;
92
-
93
- &-dotted {
94
- text-decoration: underline;
95
- text-decoration-style: dotted;
96
- }
97
- }
98
-
99
- &-uppercase {
100
- text-transform: uppercase;
101
- }
102
- }
61
+ }
@@ -1,16 +1,40 @@
1
1
  @use 'sass:meta';
2
2
 
3
3
 
4
- @mixin css-variables($prefix, $tokens) {
4
+ // css-variables($prefix, $tokens): custom-property declarations.
5
+ // css-variables($class, $prefix, $tokens): custom-property declarations inside classes.
6
+ @mixin css-variables($class: null, $prefix: null, $tokens: null) {
7
+ @if $tokens == null {
8
+ $tokens: $prefix;
9
+ $prefix: $class;
10
+ $class: null;
11
+ }
12
+ @else if $prefix == null {
13
+ $prefix: $class;
14
+ $class: null;
15
+ }
16
+
17
+ @if $prefix == null or (meta.type-of($tokens) != 'map' and $tokens != ()) {
18
+ @error 'css-variables expects ($prefix, $tokens) or ($class, $prefix, $tokens), with a token map.';
19
+ }
20
+
21
+ @include -tokens($class, $prefix, '', $tokens);
22
+ }
23
+
24
+ @mixin -tokens($class, $prefix, $suffix, $tokens) {
5
25
  @each $key, $value in $tokens {
26
+ $name: '#{$suffix}-#{$key}';
27
+
6
28
  @if meta.type-of($value) == 'map' {
7
- @each $subkey, $subvalue in $value {
8
- --#{$prefix}-#{$key}-#{$subkey}: #{$subvalue};
29
+ @include -tokens($class, $prefix, $name, $value);
30
+ }
31
+ @else if $class != null {
32
+ .#{$class}#{$name} {
33
+ --#{$prefix}#{$name}: #{$value};
9
34
  }
10
35
  }
11
36
  @else {
12
- --#{$prefix}-#{$key}: #{$value};
37
+ --#{$prefix}#{$name}: #{$value};
13
38
  }
14
39
  }
15
40
  }
16
-
@@ -1,4 +1,3 @@
1
- export { default as back } from './back';
2
1
  export { default as input } from './input';
3
2
  export { default as select } from './select';
4
3
  export { default as textarea } from './textarea';
@@ -3,19 +3,21 @@ import select from '~/components/select';
3
3
 
4
4
  export default select.bind({
5
5
  attributes: {
6
- class: '--background-black --border --border-black --color-white',
6
+ class: '--background-black --border-black --color-white',
7
7
  option: {
8
- class: '--background-black --color-white --padding-horizontal-500 --width-full',
9
- style: '--color-default: var(--color-grey-500);white-space: nowrap;'
8
+ class: '--background-black --color-white',
9
+ style: '--color-default: var(--color-grey-500); --padding-horizontal: var(--size-500); white-space: nowrap; width: 100%;'
10
10
  },
11
- style: '--border-color-default: var(--color-black-300);',
11
+ style: '--border-color-default: var(--color-black-300); --border-width: var(--border-width-400); border: var(--border-width) solid var(--border-color);',
12
12
 
13
13
  'tooltip-content': {
14
- class: '--border --border-radius-500',
15
14
  direction: 'sw',
16
15
  style: `
17
16
  --background: var(--color-black-400);
18
17
  --border-color: var(--color-black-300);
18
+ --border-radius: var(--border-radius-500);
19
+ --border-width: var(--border-width-400);
20
+ border: var(--border-width) solid var(--border-color);
19
21
  `
20
22
  }
21
23
  }
@@ -3,9 +3,7 @@
3
3
  @forward 'scss/box-shadow';
4
4
  @forward 'scss/color';
5
5
  @forward 'scss/font-size';
6
- @forward 'scss/font-weight';
7
- @forward 'scss/line-height';
8
6
  @forward 'scss/size';
9
7
  @forward 'scss/spacer';
10
8
  @forward 'scss/state';
11
- @forward 'scss/transition-duration';
9
+ @forward 'scss/transition';
@@ -5,10 +5,5 @@ $border-radius: (
5
5
  400: 8px,
6
6
  500: 10px,
7
7
  600: 12px,
8
- 700: 16px,
9
- 800: 20px,
10
-
11
- 0px: 0px,
12
- circle: 100%,
13
- curved: 240px,
8
+ 700: 16px
14
9
  );
@@ -13,9 +13,9 @@ $color: (
13
13
  500: oklch(48.45% 0.2617 266.3)
14
14
  ),
15
15
  'border': (
16
- 300: oklch(0.9683 0.0069 247.9),
17
- 400: oklch(0.9288 0.0126 255.51),
18
- 500: oklch(0.869 0.0198 252.89)
16
+ 300: oklch(92.9% 0.013 255.508),
17
+ 400: oklch(86.9% 0.022 252.894),
18
+ 500: oklch(70.4% 0.04 256.788)
19
19
  ),
20
20
  'green': (
21
21
  300: oklch(87.03% 0.2708 144.9),