winduum 1.2.1 → 2.0.0-next.10

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 (332) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/tailwind.css +1 -1
  3. package/package.json +15 -15
  4. package/plugin/index.cjs +81 -43
  5. package/plugin/index.js +73 -22
  6. package/plugin/utilities/common.js +4 -4
  7. package/plugin/utilities/dot.js +4 -5
  8. package/src/base/breakpoints.css +10 -10
  9. package/src/base/config/font.css +22 -9
  10. package/src/base/config/rounded.css +12 -12
  11. package/src/base/config/transition.css +14 -14
  12. package/src/base/config/z.css +5 -5
  13. package/src/base/config.css +0 -1
  14. package/src/base/defaults.css +10 -12
  15. package/src/base/keyframes.css +13 -1
  16. package/src/base/reset.css +2 -7
  17. package/src/base/theme/dark-rgb.css +1 -1
  18. package/src/base/theme/dark.css +1 -1
  19. package/src/base/theme/default-rgb.css +6 -6
  20. package/src/base/theme/default.css +6 -6
  21. package/src/components/badge/bordered.css +6 -0
  22. package/src/components/badge/circle.css +5 -0
  23. package/src/components/badge/default.css +42 -0
  24. package/src/{ui → components}/badge/index.css +1 -1
  25. package/src/components/badge/lg.css +3 -0
  26. package/src/components/badge/muted.css +4 -0
  27. package/src/components/badge/props/default.css +9 -0
  28. package/src/components/badge/readme.md +37 -0
  29. package/src/components/badge/sm.css +4 -0
  30. package/src/components/badge/square.css +4 -0
  31. package/src/components/breadcrumb/default.css +7 -7
  32. package/src/components/breadcrumb/index.css +1 -1
  33. package/src/components/breadcrumb/props/default.css +5 -0
  34. package/src/components/breadcrumb/readme.md +1 -1
  35. package/src/components/button/bordered.css +19 -0
  36. package/src/components/button/circle.css +6 -0
  37. package/src/components/button/default.css +63 -0
  38. package/src/components/button/fill.css +6 -0
  39. package/src/components/button/ghosted.css +14 -0
  40. package/src/{ui/btn → components/button}/index.css +2 -7
  41. package/src/components/button/interactive.css +56 -0
  42. package/src/components/button/lg.css +4 -0
  43. package/src/components/button/muted.css +14 -0
  44. package/src/components/button/props/default.css +11 -0
  45. package/src/components/button/props/interactive.css +9 -0
  46. package/src/components/button/raised.css +6 -0
  47. package/src/components/button/readme.md +46 -0
  48. package/src/components/button/sm.css +4 -0
  49. package/src/components/button/square.css +5 -0
  50. package/src/components/card/default.css +4 -6
  51. package/src/components/card/index.css +1 -1
  52. package/src/components/card/props/default.css +6 -0
  53. package/src/components/card/readme.md +1 -1
  54. package/src/components/carousel/content.css +2 -2
  55. package/src/components/carousel/default.css +1 -1
  56. package/src/components/carousel/index.d.ts +3 -3
  57. package/src/components/carousel/index.js +13 -11
  58. package/src/components/check/default.css +67 -0
  59. package/src/{ui/switch → components/check}/index.css +1 -1
  60. package/src/components/check/interactive.css +56 -0
  61. package/src/components/check/invalid.css +9 -0
  62. package/src/components/check/props/default.css +13 -0
  63. package/src/{ui/color → components/check}/readme.md +8 -9
  64. package/src/components/color/default.css +36 -0
  65. package/src/components/color/index.css +3 -0
  66. package/src/components/color/interactive.css +36 -0
  67. package/src/components/color/props/default.css +7 -0
  68. package/src/{ui/title → components/color}/readme.md +7 -8
  69. package/src/components/compare/default.css +17 -18
  70. package/src/components/compare/index.js +2 -2
  71. package/src/components/control/color.css +24 -0
  72. package/src/components/control/default.css +74 -0
  73. package/src/components/control/file.css +27 -0
  74. package/src/components/control/floating-interactive.css +13 -0
  75. package/src/components/control/floating.css +36 -0
  76. package/src/components/control/icon.css +32 -0
  77. package/src/{ui → components}/control/index.css +5 -6
  78. package/src/components/control/interactive.css +19 -0
  79. package/src/components/control/invalid.css +10 -0
  80. package/src/components/control/props/color.css +5 -0
  81. package/src/components/control/props/default.css +16 -0
  82. package/src/components/control/props/floating.css +4 -0
  83. package/src/components/control/props/icon.css +4 -0
  84. package/src/components/control/props/select.css +4 -0
  85. package/src/components/control/readme.md +43 -0
  86. package/src/{ui → components}/control/select-multiple.css +2 -2
  87. package/src/components/control/select.css +23 -0
  88. package/src/components/dialog/content.css +7 -7
  89. package/src/components/dialog/default.css +14 -12
  90. package/src/components/dialog/index.css +2 -2
  91. package/src/components/dialog/index.d.ts +4 -19
  92. package/src/components/dialog/index.js +24 -83
  93. package/src/components/dialog/props/content.css +5 -0
  94. package/src/components/dialog/props/default.css +6 -0
  95. package/src/components/dialog/readme.md +2 -2
  96. package/src/components/drawer/content.css +4 -4
  97. package/src/components/drawer/default.css +9 -6
  98. package/src/components/drawer/index.css +2 -2
  99. package/src/components/drawer/index.js +3 -3
  100. package/src/components/drawer/props/content.css +7 -0
  101. package/src/components/drawer/props/default.css +3 -0
  102. package/src/components/drawer/readme.md +2 -2
  103. package/src/components/field/default.css +6 -6
  104. package/src/components/form/index.js +5 -5
  105. package/src/components/group/default.css +42 -0
  106. package/src/{ui → components}/group/readme.md +6 -6
  107. package/src/{ui → components}/group/vertical.css +2 -2
  108. package/src/components/heading/default.css +8 -0
  109. package/src/{ui → components}/heading/index.css +1 -1
  110. package/src/components/heading/lg.css +3 -0
  111. package/src/components/heading/props/default.css +6 -0
  112. package/src/{ui/check → components/heading}/readme.md +8 -9
  113. package/src/components/heading/sm.css +3 -0
  114. package/src/{ui → components}/image/avatar.css +3 -3
  115. package/src/{ui → components}/image/default.css +2 -2
  116. package/src/{ui/notice → components/image}/readme.md +6 -6
  117. package/src/components/index.css +18 -0
  118. package/src/components/info/default.css +8 -0
  119. package/src/components/info/index.css +2 -0
  120. package/src/components/info/props/default.css +4 -0
  121. package/src/{ui/rating → components/info}/readme.md +6 -7
  122. package/src/components/label/default.css +8 -0
  123. package/src/components/label/index.css +2 -0
  124. package/src/components/label/props/default.css +4 -0
  125. package/src/{ui → components}/label/readme.md +6 -6
  126. package/src/components/link/default.css +8 -0
  127. package/src/components/link/index.css +3 -0
  128. package/src/components/link/interactive.css +9 -0
  129. package/src/components/link/props/default.css +4 -0
  130. package/src/{ui → components}/link/readme.md +7 -7
  131. package/src/components/notice/default.css +21 -0
  132. package/src/components/notice/index.css +2 -0
  133. package/src/components/notice/props/default.css +8 -0
  134. package/src/{ui/image → components/notice}/readme.md +6 -6
  135. package/src/components/pagination/default.css +2 -2
  136. package/src/components/popover/content.css +18 -19
  137. package/src/components/popover/default.css +1 -1
  138. package/src/components/popover/index.css +1 -1
  139. package/src/components/popover/index.d.ts +5 -1
  140. package/src/components/popover/index.js +11 -9
  141. package/src/components/popover/props/content.css +8 -0
  142. package/src/components/popover/readme.md +1 -1
  143. package/src/components/progress/default.css +46 -0
  144. package/src/{ui → components}/progress/index.css +1 -1
  145. package/src/components/progress/lg.css +3 -0
  146. package/src/{ui → components}/progress/meter.css +7 -7
  147. package/src/components/progress/props/default.css +6 -0
  148. package/src/components/progress/readme.md +33 -0
  149. package/src/components/progress/sm.css +3 -0
  150. package/src/components/range/default.css +99 -0
  151. package/src/{ui → components}/range/index.css +1 -1
  152. package/src/{ui → components}/range/index.js +2 -2
  153. package/src/components/range/multi.css +22 -0
  154. package/src/components/range/props/default.css +9 -0
  155. package/src/{ui → components}/range/readme.md +8 -8
  156. package/src/{ui → components}/range/vertical.css +3 -3
  157. package/src/{ui → components}/rating/default.css +11 -11
  158. package/src/{ui → components}/rating/index.css +1 -1
  159. package/src/components/rating/invalid.css +5 -0
  160. package/src/components/rating/props/default.css +8 -0
  161. package/src/components/rating/readme.md +31 -0
  162. package/src/components/switch/default.css +43 -0
  163. package/src/{ui/check → components/switch}/index.css +1 -2
  164. package/src/components/switch/interactive.css +43 -0
  165. package/src/components/switch/invalid.css +6 -0
  166. package/src/components/switch/props/default.css +17 -0
  167. package/src/{ui/progress → components/switch}/readme.md +8 -9
  168. package/src/components/table/default.css +11 -11
  169. package/src/components/table/index.css +1 -2
  170. package/src/components/table/interactive.css +14 -14
  171. package/src/components/table/props/default.css +8 -0
  172. package/src/components/table/readme.md +1 -2
  173. package/src/components/tabs/index.css +1 -1
  174. package/src/components/tabs/list.css +8 -0
  175. package/src/components/tabs/readme.md +1 -1
  176. package/src/components/text/default.css +223 -0
  177. package/src/components/text/index.css +2 -0
  178. package/src/components/text/props/default.css +9 -0
  179. package/src/{ui/info → components/text}/readme.md +6 -6
  180. package/src/components/title/default.css +8 -0
  181. package/src/{ui → components}/title/index.css +1 -1
  182. package/src/components/title/lg.css +3 -0
  183. package/src/components/title/props/default.css +5 -0
  184. package/src/{ui/heading → components/title}/readme.md +9 -8
  185. package/src/components/title/sm.css +3 -0
  186. package/src/components/toast/content.css +16 -15
  187. package/src/components/toast/default.css +8 -8
  188. package/src/components/toast/index.css +2 -2
  189. package/src/components/toast/props/content.css +7 -0
  190. package/src/components/toast/props/default.css +4 -0
  191. package/src/components/toast/readme.md +2 -2
  192. package/src/components/toaster/default.css +4 -4
  193. package/src/components/toaster/index.css +1 -1
  194. package/src/components/toaster/index.js +8 -8
  195. package/src/components/toaster/props/default.css +4 -0
  196. package/src/components/toaster/readme.md +1 -1
  197. package/src/components/tooltip/default.css +15 -15
  198. package/src/components/tooltip/index.css +1 -1
  199. package/src/components/tooltip/props/default.css +12 -0
  200. package/src/components/tooltip/readme.md +2 -2
  201. package/src/main.css +0 -1
  202. package/src/test.css +7 -0
  203. package/src/utilities/common.css +2 -6
  204. package/src/utilities/container/default.css +3 -4
  205. package/src/utilities/container/index.css +1 -1
  206. package/src/utilities/divider.css +13 -4
  207. package/src/utilities/ripple/index.css +9 -6
  208. package/src/utilities/skeleton/default.css +8 -1
  209. package/src/utilities/skeleton/index.css +1 -1
  210. package/src/utilities/skeleton/props/default.css +5 -0
  211. package/src/utilities/swap/default.css +6 -6
  212. package/src/utilities/underline.css +3 -3
  213. package/types/index.d.ts +39 -24
  214. package/types/index.d.ts.map +3 -8
  215. package/plugin/utilities/flex.js +0 -12
  216. package/src/base/config/text.css +0 -15
  217. package/src/components/breadcrumb/default-props.css +0 -5
  218. package/src/components/card/default-props.css +0 -4
  219. package/src/components/dialog/content-props.css +0 -5
  220. package/src/components/dialog/default-props.css +0 -6
  221. package/src/components/drawer/content-props.css +0 -6
  222. package/src/components/drawer/default-props.css +0 -3
  223. package/src/components/popover/content-props.css +0 -8
  224. package/src/components/table/default-props.css +0 -8
  225. package/src/components/table/interactive-props.css +0 -4
  226. package/src/components/tabs/default.css +0 -8
  227. package/src/components/toast/content-props.css +0 -7
  228. package/src/components/toast/default-props.css +0 -4
  229. package/src/components/toaster/default-props.css +0 -4
  230. package/src/components/tooltip/default-props.css +0 -12
  231. package/src/ui/badge/bordered.css +0 -16
  232. package/src/ui/badge/circle.css +0 -5
  233. package/src/ui/badge/default-props.css +0 -8
  234. package/src/ui/badge/default.css +0 -26
  235. package/src/ui/badge/lg.css +0 -3
  236. package/src/ui/badge/muted.css +0 -4
  237. package/src/ui/badge/readme.md +0 -37
  238. package/src/ui/badge/sm.css +0 -4
  239. package/src/ui/badge/square.css +0 -4
  240. package/src/ui/btn/bordered.css +0 -21
  241. package/src/ui/btn/circle.css +0 -6
  242. package/src/ui/btn/default-props.css +0 -10
  243. package/src/ui/btn/default.css +0 -49
  244. package/src/ui/btn/fill.css +0 -6
  245. package/src/ui/btn/ghosted.css +0 -9
  246. package/src/ui/btn/gradient-bordered.css +0 -24
  247. package/src/ui/btn/gradient.css +0 -10
  248. package/src/ui/btn/interactive-props.css +0 -9
  249. package/src/ui/btn/interactive.css +0 -53
  250. package/src/ui/btn/lg.css +0 -4
  251. package/src/ui/btn/loading-props.css +0 -4
  252. package/src/ui/btn/loading.css +0 -24
  253. package/src/ui/btn/muted.css +0 -9
  254. package/src/ui/btn/raised.css +0 -7
  255. package/src/ui/btn/readme.md +0 -51
  256. package/src/ui/btn/sm.css +0 -4
  257. package/src/ui/btn/square.css +0 -5
  258. package/src/ui/btn/wide.css +0 -3
  259. package/src/ui/check/default-props.css +0 -13
  260. package/src/ui/check/default.css +0 -74
  261. package/src/ui/check/interactive-props.css +0 -3
  262. package/src/ui/check/interactive.css +0 -50
  263. package/src/ui/check/invalid.css +0 -8
  264. package/src/ui/color/default-props.css +0 -11
  265. package/src/ui/color/default.css +0 -48
  266. package/src/ui/color/index.css +0 -4
  267. package/src/ui/color/interactive-props.css +0 -3
  268. package/src/ui/color/interactive.css +0 -30
  269. package/src/ui/control/color-props.css +0 -5
  270. package/src/ui/control/color.css +0 -24
  271. package/src/ui/control/default-props.css +0 -16
  272. package/src/ui/control/default.css +0 -77
  273. package/src/ui/control/file.css +0 -25
  274. package/src/ui/control/floating-interactive.css +0 -13
  275. package/src/ui/control/floating-props.css +0 -4
  276. package/src/ui/control/floating.css +0 -36
  277. package/src/ui/control/icon-props.css +0 -4
  278. package/src/ui/control/icon.css +0 -32
  279. package/src/ui/control/interactive-props.css +0 -3
  280. package/src/ui/control/interactive.css +0 -19
  281. package/src/ui/control/invalid.css +0 -10
  282. package/src/ui/control/readme.md +0 -44
  283. package/src/ui/control/select-props.css +0 -4
  284. package/src/ui/control/select.css +0 -23
  285. package/src/ui/group/default.css +0 -42
  286. package/src/ui/heading/default-props.css +0 -6
  287. package/src/ui/heading/default.css +0 -8
  288. package/src/ui/heading/lg.css +0 -3
  289. package/src/ui/heading/sm.css +0 -3
  290. package/src/ui/index.css +0 -18
  291. package/src/ui/info/default-props.css +0 -4
  292. package/src/ui/info/default.css +0 -8
  293. package/src/ui/info/index.css +0 -2
  294. package/src/ui/label/default-props.css +0 -4
  295. package/src/ui/label/default.css +0 -8
  296. package/src/ui/label/index.css +0 -2
  297. package/src/ui/link/default-props.css +0 -4
  298. package/src/ui/link/default.css +0 -8
  299. package/src/ui/link/index.css +0 -4
  300. package/src/ui/link/interactive-props.css +0 -5
  301. package/src/ui/link/interactive.css +0 -16
  302. package/src/ui/notice/default-props.css +0 -8
  303. package/src/ui/notice/default.css +0 -25
  304. package/src/ui/notice/index.css +0 -2
  305. package/src/ui/progress/default-props.css +0 -4
  306. package/src/ui/progress/default.css +0 -47
  307. package/src/ui/progress/lg.css +0 -3
  308. package/src/ui/progress/sm.css +0 -3
  309. package/src/ui/range/default-props.css +0 -10
  310. package/src/ui/range/default.css +0 -101
  311. package/src/ui/range/multi.css +0 -22
  312. package/src/ui/rating/default-props.css +0 -5
  313. package/src/ui/rating/invalid.css +0 -5
  314. package/src/ui/switch/default-props.css +0 -17
  315. package/src/ui/switch/default.css +0 -46
  316. package/src/ui/switch/interactive-props.css +0 -3
  317. package/src/ui/switch/interactive.css +0 -39
  318. package/src/ui/switch/invalid.css +0 -6
  319. package/src/ui/switch/readme.md +0 -32
  320. package/src/ui/text/default-props.css +0 -9
  321. package/src/ui/text/default.css +0 -193
  322. package/src/ui/text/index.css +0 -2
  323. package/src/ui/text/readme.md +0 -30
  324. package/src/ui/title/default-props.css +0 -5
  325. package/src/ui/title/default.css +0 -8
  326. package/src/ui/title/lg.css +0 -3
  327. package/src/ui/title/sm.css +0 -3
  328. package/src/utilities/skeleton/default-props.css +0 -5
  329. /package/src/{ui → components}/group/index.css +0 -0
  330. /package/src/{ui → components}/image/index.css +0 -0
  331. /package/src/{ui → components}/range/index.d.ts +0 -0
  332. /package/src/utilities/container/{default-props.css → props/default.css} +0 -0
@@ -47,21 +47,21 @@ export const getItemCount = (element, scrollWidth = element.scrollWidth - elemen
47
47
  /**
48
48
  * @param {HTMLElement | Element} element
49
49
  * @param {import("./").ObserveCarouselOptions} options
50
- * @returns void
50
+ * @returns IntersectionObserver
51
51
  */
52
52
  export const observeCarousel = (element, options = {}) => {
53
53
  options = {
54
- visibleClass: 'visible',
54
+ visibleAttribute: 'visible',
55
55
  observerOptions: {},
56
56
  ...options
57
57
  }
58
58
 
59
59
  element._observer = new IntersectionObserver(entries => {
60
60
  entries.forEach(entry => {
61
- entry.target.classList.toggle(options.visibleClass, entry.isIntersecting)
61
+ entry.target.toggleAttribute(options.visibleAttribute, entry.isIntersecting)
62
62
  })
63
63
 
64
- const activeElement = [...element.children].find(children => children.classList.contains(options.visibleClass))
64
+ const activeElement = [...element.children].find(children => children.hasAttribute(options.visibleAttribute))
65
65
 
66
66
  if (activeElement) {
67
67
  element._activeIndex = [...element.children].indexOf(activeElement)
@@ -73,6 +73,8 @@ export const observeCarousel = (element, options = {}) => {
73
73
  })
74
74
 
75
75
  ;[...element.children].forEach(children => element._observer.observe(children))
76
+
77
+ return element._observer
76
78
  }
77
79
 
78
80
  /**
@@ -82,7 +84,7 @@ export const observeCarousel = (element, options = {}) => {
82
84
  */
83
85
  export const scrollCarousel = (element, options = {}) => {
84
86
  options.pagination = {
85
- activeClass: 'active',
87
+ activeAttribute: 'data-active',
86
88
  ...options.pagination
87
89
  }
88
90
 
@@ -90,9 +92,9 @@ export const scrollCarousel = (element, options = {}) => {
90
92
  const activeItemMax = getItemCount(element)
91
93
 
92
94
  if (options?.pagination?.element) {
93
- ;[...options.pagination.element.children].forEach(children => children.classList.remove(options.pagination.activeClass))
95
+ ;[...options.pagination.element.children].forEach(children => children.removeAttribute(options.pagination.activeAttribute))
94
96
 
95
- options.pagination.element.children[activeItem - 1]?.classList.add(options.pagination.activeClass)
97
+ options.pagination.element.children[activeItem - 1]?.setAttribute(options.pagination.activeAttribute, '')
96
98
  }
97
99
 
98
100
  if (options.progressElement) {
@@ -129,7 +131,7 @@ export const paginationCarousel = (element, options = {}) => {
129
131
  ).join(''))
130
132
 
131
133
  ;[...options.element.children].forEach((children, i) => {
132
- (i === 0) && children.classList.add(options.activeClass)
134
+ (i === 0) && children.setAttribute(options.activeAttribute, '')
133
135
  children.addEventListener('click', ({ currentTarget }) => {
134
136
  scrollTo(element, [...options.element.children].indexOf(currentTarget))
135
137
  })
@@ -173,7 +175,7 @@ export const autoplayCarousel = (element, options = {}) => {
173
175
  */
174
176
  export const dragCarousel = (element, options = {}) => {
175
177
  options = {
176
- activeClass: 'grabbing',
178
+ activeAttribute: 'data-grabbing',
177
179
  ...options
178
180
  }
179
181
 
@@ -188,7 +190,7 @@ export const dragCarousel = (element, options = {}) => {
188
190
 
189
191
  const endGrabbing = () => {
190
192
  isDown = false
191
- element.classList.remove(options.activeClass)
193
+ element.removeAttribute(options.activeAttribute)
192
194
 
193
195
  scrollTo(element, element._activeIndex)
194
196
 
@@ -215,7 +217,7 @@ export const dragCarousel = (element, options = {}) => {
215
217
 
216
218
  const x = e.pageX - element.offsetLeft
217
219
 
218
- element.classList.add(options.activeClass)
220
+ element.setAttribute(options.activeAttribute, '')
219
221
  element.style.scrollSnapType = 'unset'
220
222
  element.scroll({ left: scrollLeft - ((x - startX) * 1.25), behavior: 'instant' })
221
223
  element.ondragstart = e => e.preventDefault()
@@ -0,0 +1,67 @@
1
+ .x-check {
2
+ --x-check-outline-color: var(--color-accent);
3
+ --x-check-icon-color: var(--color-accent-foreground);
4
+
5
+ font-weight: var(--x-check-font-weight);
6
+ font-size: var(--x-check-font-size);
7
+ line-height: var(--x-check-line-height);
8
+ letter-spacing: var(--x-check-letter-spacing);
9
+ gap: var(--x-check-gap);
10
+ display: inline-flex;
11
+ text-wrap: pretty;
12
+
13
+ &:has([type="radio"]) {
14
+ --x-check-icon: var(--mask-radio);
15
+ --x-check-border-radius: 50%;
16
+ }
17
+
18
+ :where(input) {
19
+ inline-size: var(--x-check-size);
20
+ block-size: var(--x-check-size);
21
+ border-radius: var(--x-check-border-radius);
22
+ background-color:
23
+ color-mix(
24
+ in var(--x-check-background-color-space, srgb),
25
+ var(--x-check-background-color) var(--x-check-background-color-opacity, 0%),
26
+ var(--x-check-background-color-mix, transparent)
27
+ );
28
+ border:
29
+ var(--x-check-border-width) solid
30
+ color-mix(
31
+ in var(--x-check-border-color-space, srgb),
32
+ var(--x-check-border-color) var(--x-check-border-color-opacity, 20%),
33
+ var(--x-check-border-color-mix, transparent)
34
+ );
35
+ outline:
36
+ var(--x-check-outline-width) solid
37
+ color-mix(
38
+ in var(--x-check-outline-color-space, srgb),
39
+ var(--x-check-outline-color) var(--x-check-outline-color-opacity, 0%),
40
+ var(--x-check-outline-color-mix, transparent)
41
+ );
42
+ outline-offset: var(--x-check-outline-offset);
43
+ display: flex;
44
+ flex-shrink: 0;
45
+
46
+ &::before {
47
+ inline-size: var(--x-check-icon-size);
48
+ block-size: var(--x-check-icon-size);
49
+ color: var(--x-check-icon-color);
50
+ mask: var(--x-check-icon);
51
+ transition: inherit;
52
+ content: "";
53
+ background-color: currentColor;
54
+ opacity: 0%;
55
+ transform: scale(0);
56
+ will-change: transform;
57
+ margin: auto;
58
+ }
59
+
60
+ &:where(:required) {
61
+ + *::after {
62
+ color: var(--x-check-required-color, var(--color-error));
63
+ content: " *";
64
+ }
65
+ }
66
+ }
67
+ }
@@ -1,4 +1,4 @@
1
- @import "default-props.css";
1
+ @import "props/default.css";
2
2
  @import "default.css";
3
3
  @import "interactive.css";
4
4
  @import "invalid.css";
@@ -0,0 +1,56 @@
1
+ .x-check {
2
+ --x-check-hover-border-color: var(--color-accent);
3
+ --x-check-hover-background-color: var(--color-accent);
4
+ --x-check-checked-background-color: var(--color-accent);
5
+ --x-check-focus-border-color: var(--color-accent);
6
+
7
+ :where(input) {
8
+ transition-property: var(--default-transition-property);
9
+ transition-timing-function: var(--transition-timing-function-in-out);
10
+ transition-duration: var(--default-transition-duration);
11
+
12
+ &:where(:hover, :focus-visible) {
13
+ --x-check-background-color: var(--x-check-hover-background-color);
14
+ --x-check-background-color-opacity: var(--x-check-hover-background-color-opacity, 10%);
15
+ --x-check-border-color: var(--x-check-hover-border-color);
16
+ --x-check-border-color-opacity: var(--x-check-hover-border-color-opacity, 75%);
17
+ }
18
+
19
+ &:focus {
20
+ --x-check-border-color: var(--x-check-focus-border-color);
21
+ --x-check-border-color-opacity: var(--x-check-focus-border-color-opacity, 75%);
22
+ --x-check-outline-color-opacity: var(--x-check-focus-outline-opacity, 20%);
23
+ --x-check-outline-offset: var(--x-check-focus-outline-offset);
24
+ }
25
+
26
+ &:disabled {
27
+ --x-check-background-color: var(--x-check-disabled-background-color, currentColor);
28
+ --x-check-background-color-mix: var(--x-check-disabled-background-color-mix, transparent);
29
+ --x-check-background-color-opacity: var(--x-check-disabled-background-color-opacity, 5%);
30
+ --x-check-border-color: var(--x-check-disabled-border-color, currentColor);
31
+ --x-check-border-color-mix: var(--x-check-disabled-border-color-mix, transparent);
32
+ --x-check-border-color-opacity: var(--x-check-disabled-border-color-opacity, 15%);
33
+
34
+ cursor: not-allowed;
35
+ }
36
+
37
+ &:where([type="checkbox"]):indeterminate {
38
+ --x-check-icon: var(--mask-indeterminate);
39
+ }
40
+
41
+ &:is(:checked, [type="checkbox"]:indeterminate) {
42
+ --x-check-background-color: var(--x-check-checked-background-color);
43
+ --x-check-background-color-opacity: 100%;
44
+ --x-check-border-color-opacity: 0%;
45
+
46
+ &:disabled {
47
+ opacity: var(--x-check-checked-disabled-opacity, 75%);
48
+ }
49
+
50
+ &::before {
51
+ opacity: 100%;
52
+ transform: scale(1);
53
+ }
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,9 @@
1
+ .x-check {
2
+ &.invalid, :user-invalid, .validated & :invalid {
3
+ --x-check-border-color: var(--x-check-invalid-border-color, var(--color-error));
4
+ --x-check-outline-color: var(--x-check-invalid-outline-color, var(--color-error));
5
+ --x-check-background-color: var(--x-check-invalid-background-color, var(--color-error));
6
+ --x-check-background-color-opacity: var(--x-check-invalid-background-color-opacity, 15%);
7
+ --x-check-border-color-opacity: var(--x-check-invalid-border-color-opacity, 100%);
8
+ }
9
+ }
@@ -0,0 +1,13 @@
1
+ :root, :host {
2
+ --x-check-size: 1.25rem;
3
+ --x-check-icon-size: 1.125rem;
4
+ --x-check-icon: var(--mask-check);
5
+ --x-check-gap: var(--spacing-md);
6
+ --x-check-font-size: var(--font-size-sm);
7
+ --x-check-line-height: calc(1em + 0.25rem);
8
+ --x-check-border-radius: var(--radius-md);
9
+ --x-check-border-width: 1px;
10
+ --x-check-background-color: currentColor;
11
+ --x-check-border-color: currentColor;
12
+ --x-check-outline-width: 2px;
13
+ }
@@ -1,4 +1,4 @@
1
- # [Color](https://winduum.dev/docs/ui/color.html)
1
+ # [Check](https://winduum.dev/docs/components/check.html)
2
2
 
3
3
  ## Installation
4
4
  ```shell
@@ -8,17 +8,16 @@ Learn more how to set up Winduum [here](https://winduum.dev/docs/).
8
8
  Include CSS either globally or to your component _([you can't use TailwindCSS layers in per-component CSS](https://tailwindcss.com/docs/adding-custom-styles#layers-and-per-component-css))_
9
9
 
10
10
  ```css
11
- @import "winduum/src/ui/color/index.css" layer(components);
11
+ @import "winduum/src/components/check/index.css" layer(components);
12
12
  ```
13
13
 
14
14
  or modular (you can use your own props or CSS)
15
15
 
16
16
  ```css
17
- @import "winduum/src/ui/color/default-props.css" layer(components);
18
- @import "winduum/src/ui/color/default.css" layer(components);
19
- @import "winduum/src/ui/color/interactive-props.css" layer(components);
20
- @import "winduum/src/ui/color/interactive.css" layer(components);
21
-
17
+ @import "winduum/src/components/check/props/default.css" layer(components);
18
+ @import "winduum/src/components/check/default.css" layer(components);
19
+ @import "winduum/src/components/check/interactive.css" layer(components);
20
+ @import "winduum/src/components/check/invalid.css" layer(components);
22
21
  ```
23
22
 
24
23
  ### Local imports
@@ -26,8 +25,8 @@ By default, imports are directly from `npm` so you can leverage updates.
26
25
  You can also copy and paste the code from this directory to your project and remap the imports to local.
27
26
 
28
27
  ```css
29
- @import "@/components/ui/color/assets/index.css" layer(components);
28
+ @import "@/components/check/assets/index.css" layer(components);
30
29
  ```
31
30
 
32
31
  ### Docs
33
- Visit [docs](https://winduum.dev/docs/ui/color.html) to learn more about usage examples.
32
+ Visit [docs](https://winduum.dev/docs/components/check.html) to learn more about usage examples.
@@ -0,0 +1,36 @@
1
+ .x-color {
2
+ --x-color-outline-color: var(--color-accent);
3
+
4
+ display: inline-flex;
5
+
6
+ :where(input) {
7
+ inline-size: var(--x-color-size);
8
+ block-size: var(--x-color-size);
9
+ border-radius: var(--x-color-border-radius);
10
+ outline:
11
+ var(--x-color-outline-width, 1px) solid
12
+ color-mix(
13
+ in var(--x-color-outline-color-space, srgb),
14
+ var(--x-color-outline-color) var(--x-color-outline-color-opacity, 0%),
15
+ var(--x-color-outline-color-mix, transparent)
16
+ );
17
+ outline-offset: var(--x-color-outline-offset);
18
+ display: inline-grid;
19
+
20
+ &::before, &::after {
21
+ border: 1px solid transparent;
22
+ border-radius: inherit;
23
+ grid-area: 1/-1;
24
+ content: "";
25
+ }
26
+
27
+ &::before {
28
+ background-color: var(--x-color-primary);
29
+ }
30
+
31
+ &::after {
32
+ background-color: var(--x-color-secondary);
33
+ clip-path: polygon(100% 0, 100% 100%, 0 100%);
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,3 @@
1
+ @import "props/default.css";
2
+ @import "default.css";
3
+ @import "interactive.css";
@@ -0,0 +1,36 @@
1
+ .x-color {
2
+ :where(input) {
3
+ transition-property: var(--default-transition-property);
4
+ transition-timing-function: var(--transition-timing-function-in-out);
5
+ transition-duration: var(--default-transition-duration);
6
+
7
+ &:disabled {
8
+ cursor: not-allowed;
9
+
10
+ &::before, &::after {
11
+ opacity: var(--x-color-disabled-opacity, 50%);
12
+ }
13
+ }
14
+
15
+ &:enabled {
16
+ &:hover {
17
+ --x-color-outline-color-opacity: var(--x-color-hover-outline-color-opacity);
18
+ --x-color-outline-offset: var(--x-color-hover-outline-offset);
19
+ }
20
+
21
+ &:focus-visible {
22
+ --x-color-outline-color-opacity: var(--x-color-focus-outline-color-opacity, 50%);
23
+ --x-color-outline-offset: var(--x-color-focus-outline-offset, 3px);
24
+ }
25
+
26
+ &:checked {
27
+ --x-color-outline-color-opacity: var(--x-color-checked-outline-color-opacity, 100%);
28
+ --x-color-outline-offset: var(--x-color-focus-outline-offset, 3px);
29
+
30
+ &:focus-visible {
31
+ outline-style: dashed;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,7 @@
1
+ :root, :host {
2
+ --x-color-primary: currentColor;
3
+ --x-color-secondary: transparent;
4
+ --x-color-size: 1.5rem;
5
+ --x-color-border-radius: var(--radius-full);
6
+ --x-color-outline-width: 1px;
7
+ }
@@ -1,4 +1,4 @@
1
- # [Title](https://winduum.dev/docs/ui/title.html)
1
+ # [Color](https://winduum.dev/docs/components/color.html)
2
2
 
3
3
  ## Installation
4
4
  ```shell
@@ -8,16 +8,15 @@ Learn more how to set up Winduum [here](https://winduum.dev/docs/).
8
8
  Include CSS either globally or to your component _([you can't use TailwindCSS layers in per-component CSS](https://tailwindcss.com/docs/adding-custom-styles#layers-and-per-component-css))_
9
9
 
10
10
  ```css
11
- @import "winduum/src/ui/title/index.css" layer(components);
11
+ @import "winduum/src/components/color/index.css" layer(components);
12
12
  ```
13
13
 
14
14
  or modular (you can use your own props or CSS)
15
15
 
16
16
  ```css
17
- @import "winduum/src/ui/title/default.css" layer(components);
18
- @import "winduum/src/ui/title/default-props.css" layer(components);
19
- @import "winduum/src/ui/title/sm.css" layer(components);
20
- @import "winduum/src/ui/title/lg.css" layer(components);
17
+ @import "winduum/src/components/color/props/default.css" layer(components);
18
+ @import "winduum/src/components/color/default.css" layer(components);
19
+ @import "winduum/src/components/color/interactive.css" layer(components);
21
20
 
22
21
  ```
23
22
 
@@ -26,8 +25,8 @@ By default, imports are directly from `npm` so you can leverage updates.
26
25
  You can also copy and paste the code from this directory to your project and remap the imports to local.
27
26
 
28
27
  ```css
29
- @import "@/components/ui/title/assets/index.css" layer(components);
28
+ @import "@/components/color/assets/index.css" layer(components);
30
29
  ```
31
30
 
32
31
  ### Docs
33
- Visit [docs](https://winduum.dev/docs/ui/title.html) to learn more about usage examples.
32
+ Visit [docs](https://winduum.dev/docs/components/color.html) to learn more about usage examples.
@@ -1,6 +1,6 @@
1
- .c-compare {
2
- --c-compare-position: 50%;
3
- --c-compare-clip-path: polygon(0% 0, var(--c-compare-position) 0%, var(--c-compare-position) 100%, 0 100%);
1
+ .x-compare {
2
+ --x-compare-position: 50%;
3
+ --x-compare-clip-path: polygon(0% 0, var(--x-compare-position) 0%, var(--x-compare-position) 100%, 0 100%);
4
4
 
5
5
  display: grid;
6
6
  overflow: hidden;
@@ -15,7 +15,7 @@
15
15
 
16
16
  &::before {
17
17
  background-color: var(--color-accent);
18
- inset-inline-start: var(--c-compare-position);
18
+ inset-inline-start: var(--x-compare-position);
19
19
  inline-size: 1px;
20
20
  content: "";
21
21
  }
@@ -23,18 +23,17 @@
23
23
  > :where(input) {
24
24
  pointer-events: auto;
25
25
  cursor: grab;
26
- opacity: 0;
26
+ opacity: 0%;
27
27
 
28
- &:is(:focus-visible, :active) {
29
- ~ .ui-btn {
30
- --tw-bg-mix: var(--ui-btn-hover-bg-mix, var(--color-dark));
31
- --tw-bg-opacity: 0.8;
32
- }
28
+ &:active ~ .x-button {
29
+ --x-button-background-color-mix: var(--x-button-active-background-color-mix, var(--color-dark));
30
+ --x-button-background-color-opacity: var(--x-button-active-background-color-opacity, 80%);
33
31
  }
34
32
 
35
- &:focus-visible ~ .ui-btn {
36
- --ui-btn-outline-offset: 2px;
37
- --tw-outline-opacity: 0.5;
33
+ &:focus-visible ~ .x-button {
34
+ --x-button-outline-color: var(--x-button-focus-outline-color, var(--color-accent));
35
+ --x-button-outline-offset: var(--x-button-focus-outline-offset, 2px);
36
+ --x-button-outline-color-opacity: var(--x-button-focus-outline-opacity, 50%);
38
37
  }
39
38
 
40
39
  &:active {
@@ -42,13 +41,13 @@
42
41
  }
43
42
  }
44
43
 
45
- > :where(.ui-btn) {
46
- inset-inline-start: var(--c-compare-position);
47
- margin-inline-start: calc(var(--ui-btn-width) / 2 * -1);
44
+ > :where(.x-button) {
45
+ inset-inline-start: var(--x-compare-position);
46
+ margin-inline-start: calc(var(--x-button-width) / 2 * -1);
48
47
  margin-block: auto;
49
48
  }
50
49
 
51
- > :where(.ui-image) {
50
+ > :where(.x-image) {
52
51
  display: grid;
53
52
  z-index: 0;
54
53
 
@@ -58,7 +57,7 @@
58
57
  grid-area: 1/1;
59
58
 
60
59
  &:first-child {
61
- clip-path: var(--c-compare-clip-path);
60
+ clip-path: var(--x-compare-clip-path);
62
61
  position: relative;
63
62
  }
64
63
  }
@@ -5,8 +5,8 @@
5
5
  */
6
6
  export const setPosition = ({ currentTarget }, options = {}) => {
7
7
  const { selector, positionProperty } = {
8
- selector: '.c-compare',
9
- positionProperty: '--c-compare-position',
8
+ selector: '.x-compare',
9
+ positionProperty: '--x-compare-position',
10
10
  ...options
11
11
  }
12
12
 
@@ -0,0 +1,24 @@
1
+ .x-control {
2
+ > :where(input) {
3
+ &::-webkit-color-swatch-wrapper {
4
+ inline-size: var(--x-control-color-swatch-width);
5
+ block-size: var(--x-control-color-swatch-height);
6
+ padding: 0;
7
+ }
8
+
9
+ &::-moz-color-swatch {
10
+ inline-size: var(--x-control-color-swatch-width);
11
+ block-size: var(--x-control-color-swatch-height);
12
+ border-radius: var(--x-control-color-swatch-border-radius);
13
+ margin: 0;
14
+ }
15
+
16
+ &::-webkit-color-swatch {
17
+ border-radius: var(--x-control-color-swatch-border-radius);
18
+ }
19
+
20
+ &[type="color"] ~ label {
21
+ margin-inline-start: calc(var(--x-control-padding-inline) + var(--x-control-color-swatch-width));
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,74 @@
1
+ .x-control {
2
+ display: grid;
3
+ block-size: var(--x-control-height);
4
+ font-family: var(--x-control-font-family);
5
+ font-weight: var(--x-control-font-weight);
6
+ font-size: var(--x-control-font-size);
7
+ letter-spacing: var(--x-control-letter-spacing);
8
+ color: var(--x-control-color);
9
+ border-radius: var(--x-control-border-radius);
10
+ background-color:
11
+ color-mix(
12
+ in var(--x-control-background-color-space, srgb),
13
+ var(--x-control-background-color) var(--x-control-background-color-opacity, 100%),
14
+ var(--x-control-background-color-mix, transparent)
15
+ );
16
+ border:
17
+ var(--x-control-border-width) solid
18
+ color-mix(
19
+ in var(--x-control-border-color-space, srgb),
20
+ var(--x-control-border-color) var(--x-control-border-color-opacity, 15%),
21
+ var(--x-control-border-color-mix, transparent)
22
+ );
23
+ outline:
24
+ var(--x-control-outline-width) solid
25
+ color-mix(
26
+ in var(--x-control-outline-color-space, srgb),
27
+ var(--x-control-outline-color, var(--color-accent)) var(--x-control-outline-color-opacity, 0%),
28
+ var(--x-control-outline-color-mix, transparent)
29
+ );
30
+ outline-offset: var(--x-control-outline-offset);
31
+ grid-template:
32
+ [x-control-start] calc(var(--x-control-padding-block) - var(--x-control-border-width))
33
+ [x-control-padding] 1fr
34
+ calc(var(--x-control-padding-block) - var(--x-control-border-width)) [x-control-end] /
35
+ [x-control-start] var(--x-control-padding-inline)
36
+ [x-control-padding] 1fr
37
+ var(--x-control-padding-inline) [x-control-end];
38
+
39
+ &:has(textarea) {
40
+ height: auto;
41
+ }
42
+
43
+ > :where(*) {
44
+ grid-area: x-control-padding;
45
+ align-self: center;
46
+ }
47
+
48
+ > :where(input, textarea, select) {
49
+ padding-block: var(--x-control-padding-block);
50
+ padding-inline: calc(var(--x-control-padding-inline) + var(--x-control-padding-inline-start, 0px)) calc(var(--x-control-padding-inline) + var(--x-control-padding-inline-end, 0px));
51
+ grid-area: x-control;
52
+ text-overflow: ellipsis;
53
+ overflow: clip;
54
+ align-self: stretch;
55
+ align-items: center;
56
+ border-radius: inherit;
57
+
58
+ &:disabled {
59
+ cursor: not-allowed;
60
+ }
61
+ }
62
+
63
+ > :where(input, textarea) {
64
+ &::placeholder {
65
+ color: var(--x-control-placeholder-color);
66
+ opacity: var(--x-control-placeholder-opacity);
67
+ }
68
+ }
69
+
70
+ > :where(textarea) {
71
+ min-block-size: var(--x-control-height-textarea);
72
+ resize: vertical;
73
+ }
74
+ }
@@ -0,0 +1,27 @@
1
+ .x-control:where(:has([type="file"])) {
2
+ overflow: clip;
3
+
4
+ > :where([type="file"]) {
5
+ &::file-selector-button {
6
+ all: unset;
7
+ background-color:
8
+ color-mix(
9
+ in var(--x-control-file-background-color-space, srgb),
10
+ var(--x-control-file-background-color, currentColor) var(--x-control-file-background-color-opacity, 15%),
11
+ var(--x-control-file-background-color-mix, transparent)
12
+ );
13
+ block-size: calc(var(--x-control-height) - var(--x-control-border-width) * 2);
14
+ padding-inline: var(--x-control-padding-inline);
15
+ margin-inline: calc(var(--x-control-padding-inline) * -1) var(--x-control-padding-inline);
16
+ margin-block-start: calc(var(--x-control-padding-block) * -1);
17
+ border-start-end-radius: var(--x-control-border-radius);
18
+ border-end-end-radius: var(--x-control-border-radius);
19
+ transition: var(--transition-background);
20
+ cursor: pointer;
21
+ }
22
+
23
+ &:is(:hover, :focus) {
24
+ --x-control-file-background-color-opacity: 20%;
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,13 @@
1
+ .x-control:where(:has(:not([type="color"]) ~ label)) {
2
+ --x-control-label-focus-opacity: 50%;
3
+ --x-control-placeholder-color: transparent;
4
+
5
+ > :where(input, textarea, select) {
6
+ &:is(:focus, :not(:placeholder-shown)) {
7
+ ~ label {
8
+ transform: translateY(calc(var(--x-control-label-translate-y) * -1)) scale(var(--x-control-label-scale));
9
+ opacity: var(--x-control-label-focus-opacity);
10
+ }
11
+ }
12
+ }
13
+ }