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
@@ -1,7 +1,7 @@
1
1
  import { FlipOptions, Middleware, OffsetOptions, Placement, ShiftOptions } from "@floating-ui/dom";
2
2
 
3
3
  export interface ShowPopoverOptions {
4
- visibleClass?: string
4
+ openAttribute?: string
5
5
  compute?: boolean
6
6
  placement?: Placement
7
7
  middleware?: Array<Middleware | null | undefined | false>
@@ -10,6 +10,10 @@ export interface ShowPopoverOptions {
10
10
  shift?: ShiftOptions
11
11
  }
12
12
 
13
+ export interface HidePopoverOptions {
14
+ openAttribute?: string
15
+ }
16
+
13
17
  export function showPopover(element: HTMLElement | Element, options?: ShowPopoverOptions): Promise<void>
14
18
  export function hidePopover(element: HTMLElement | Element): Promise<void>
15
19
  export function togglePopover(element: HTMLElement | Element, options?: ShowPopoverOptions): Promise<void>
@@ -1,4 +1,4 @@
1
- import { animationsFinished } from '../../common.js'
1
+ import { animationsFinished, nextRepaint } from '../../common.js'
2
2
 
3
3
  /**
4
4
  * @param {HTMLElement | Element} element
@@ -6,13 +6,11 @@ import { animationsFinished } from '../../common.js'
6
6
  * @param {import("./").ShowPopoverOptions} options
7
7
  * @returns Promise<void>
8
8
  */
9
- export const computePopover = async (element, popoverElement, options) => {
9
+ export const computePopover = async (element, popoverElement, options = {}) => {
10
10
  const { computePosition, flip, shift, offset } = await import('@floating-ui/dom')
11
11
 
12
12
  popoverElement.classList.remove(popoverElement._placement)
13
13
 
14
- popoverElement.style.minWidth = `${element.offsetWidth / 16}rem`
15
-
16
14
  await computePosition(element, popoverElement, {
17
15
  placement: options?.placement,
18
16
  middleware: options?.middleware ?? [offset(12 ?? options?.offset), flip(options?.flip), shift({ padding: 8, ...options?.shift })]
@@ -22,18 +20,19 @@ export const computePopover = async (element, popoverElement, options) => {
22
20
  })
23
21
 
24
22
  popoverElement._placement = placement
25
- popoverElement.classList.add(popoverElement._placement, options?.visibleClass ?? 'in')
23
+ popoverElement.classList.add(popoverElement._placement)
26
24
  })
27
25
  }
28
26
 
29
27
  /**
30
28
  * @param {HTMLElement | Element} element - The HTML content to insert into the dialog.
29
+ * @param {import("./").HidePopoverOptions} options
31
30
  * @returns Promise<void>
32
31
  */
33
- export const hidePopover = async (element) => {
32
+ export const hidePopover = async (element, options = { openAttribute: 'data-open' }) => {
34
33
  const popoverElement = document.getElementById(element.getAttribute('popovertarget'))
35
34
 
36
- popoverElement.classList.remove('in')
35
+ popoverElement.removeAttribute(options?.openAttribute)
37
36
  await animationsFinished(popoverElement)
38
37
  popoverElement._cleanup && popoverElement._cleanup()
39
38
  popoverElement.hidePopover && popoverElement.hidePopover()
@@ -48,7 +47,7 @@ export const hidePopover = async (element) => {
48
47
  */
49
48
  export const showPopover = async (element, options) => {
50
49
  options = {
51
- visibleClass: 'in',
50
+ openAttribute: 'data-open',
52
51
  compute: true,
53
52
  ...options
54
53
  }
@@ -64,8 +63,11 @@ export const showPopover = async (element, options) => {
64
63
 
65
64
  popoverElement.showPopover && popoverElement.showPopover()
66
65
 
66
+ await nextRepaint()
67
+
68
+ popoverElement.setAttribute(options?.openAttribute, '')
69
+
67
70
  if (!options.compute) {
68
- popoverElement.classList.add(options.visibleClass)
69
71
  return
70
72
  }
71
73
 
@@ -0,0 +1,8 @@
1
+ :root, :host {
2
+ --x-popover-content-background-color: var(--color-body-primary);
3
+ --x-popover-content-border-radius: var(--radius);
4
+ --x-popover-content-padding-block: var(--spacing-sm);
5
+ --x-popover-content-padding-inline: var(--spacing-sm);
6
+ --x-popover-content-scale-y: 0.75;
7
+ --x-popover-content-scale-x: 0.75;
8
+ }
@@ -14,8 +14,8 @@ Include CSS either globally or to your component _([you can't use TailwindCSS la
14
14
  or modular (you can use your own props or CSS)
15
15
 
16
16
  ```css
17
+ @import "winduum/src/components/popover/props/content.css" layer(components);
17
18
  @import "winduum/src/components/popover/default.css" layer(components);
18
- @import "winduum/src/components/popover/content-props.css" layer(components);
19
19
  @import "winduum/src/components/popover/content.css" layer(components);
20
20
  ```
21
21
 
@@ -0,0 +1,46 @@
1
+ .x-progress {
2
+ inline-size: var(--x-progress-inline-size, 100%);
3
+ block-size: var(--x-progress-block-size);
4
+ border-radius: var(--x-progress-border-radius);
5
+ background-color:
6
+ color-mix(
7
+ in var(--x-progress-background-color-space, srgb),
8
+ var(--x-progress-background-color, var(--color-accent)) var(--x-progress-background-color-opacity, 10%),
9
+ var(--x-progress-background-color-mix, var(--color-body))
10
+ );
11
+ position: relative;
12
+ overflow: clip;
13
+
14
+ &::-moz-progress-bar {
15
+ background-color: var(--x-progress-bar-background-color, var(--color-accent));
16
+ transition: all var(--x-progress-transition-duration) var(--transition-timing-function-in-out);
17
+ border-radius: inherit;
18
+ }
19
+
20
+ &::-webkit-progress-bar {
21
+ background-color: transparent;
22
+ border-radius: inherit;
23
+ }
24
+
25
+ &::-webkit-progress-inner-element {
26
+ border-radius: inherit;
27
+ }
28
+
29
+ &::-webkit-progress-value {
30
+ background-color: var(--x-progress-bar-background-color, var(--color-accent));
31
+ transition: all var(--default-transition-duration) var(--transition-timing-function-in-out);
32
+ border-radius: inherit;
33
+ }
34
+
35
+ &:indeterminate {
36
+ animation: var(--x-progress-indeterminate-transition-duration) var(--transition-timing-function-linear) infinite move-indeterminate;
37
+ background-image: linear-gradient(to right, var(--color-accent) 33.33%, transparent 0%);
38
+ background-position: top left;
39
+ background-repeat: no-repeat;
40
+ background-size: 150%;
41
+
42
+ &::-moz-progress-bar {
43
+ background-color: transparent;
44
+ }
45
+ }
46
+ }
@@ -1,4 +1,4 @@
1
- @import "default-props.css";
1
+ @import "props/default.css";
2
2
  @import "default.css";
3
3
  @import "meter.css";
4
4
  @import "sm.css";
@@ -0,0 +1,3 @@
1
+ .x-progress:is(.lg) {
2
+ --x-progress-block-size: 1.5rem;
3
+ }
@@ -1,4 +1,4 @@
1
- .ui-progress {
1
+ .x-progress {
2
2
  &::-webkit-meter-bar {
3
3
  border: 0;
4
4
  background: transparent;
@@ -12,32 +12,32 @@
12
12
  }
13
13
 
14
14
  &::-webkit-meter-optimum-value {
15
- background: var(--color-success);
15
+ background: var(--x-progress-meter-success-background, var(--color-success));
16
16
  border-radius: inherit;
17
17
  }
18
18
 
19
19
  &::-webkit-meter-suboptimum-value {
20
- background: var(--color-warning);
20
+ background: var(--x-progress-meter-warning-background, var(--color-warning));
21
21
  border-radius: inherit;
22
22
  }
23
23
 
24
24
  &::-webkit-meter-even-less-good-value {
25
- background: var(--color-error);
25
+ background: var(--x-progress-meter-error-background, var(--color-error));
26
26
  border-radius: inherit;
27
27
  }
28
28
 
29
29
  &:-moz-meter-optimum::-moz-meter-bar {
30
- background: var(--color-success);
30
+ background: var(--x-progress-meter-success-background, var(--color-success));
31
31
  border-radius: inherit;
32
32
  }
33
33
 
34
34
  &:-moz-meter-sub-optimum::-moz-meter-bar {
35
- background: var(--color-warning);
35
+ background: var(--x-progress-meter-warning-background, var(--color-warning));
36
36
  border-radius: inherit;
37
37
  }
38
38
 
39
39
  &:-moz-meter-sub-sub-optimum::-moz-meter-bar {
40
- background: var(--color-error);
40
+ background: var(--x-progress-meter-error-background, var(--color-error));
41
41
  border-radius: inherit;
42
42
  }
43
43
  }
@@ -0,0 +1,6 @@
1
+ :root, :host {
2
+ --x-progress-block-size: 1rem;
3
+ --x-progress-border-radius: var(--radius-full);
4
+ --x-progress-transition-duration: 0.3s;
5
+ --x-progress-indeterminate-transition-duration: 1s;
6
+ }
@@ -0,0 +1,33 @@
1
+ # [Progress](https://winduum.dev/docs/components/progress.html)
2
+
3
+ ## Installation
4
+ ```shell
5
+ npm i winduum
6
+ ```
7
+ Learn more how to set up Winduum [here](https://winduum.dev/docs/).
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
+
10
+ ```css
11
+ @import "winduum/src/components/progress/index.css" layer(components);
12
+ ```
13
+
14
+ or modular (you can use your own props or CSS)
15
+
16
+ ```css
17
+ @import "winduum/src/components/progress/props/default.css" layer(components);
18
+ @import "winduum/src/components/progress/default.css" layer(components);
19
+ @import "winduum/src/components/progress/meter.css" layer(components);
20
+ @import "winduum/src/components/progress/sm.css" layer(components);
21
+ @import "winduum/src/components/progress/lg.css" layer(components);
22
+ ```
23
+
24
+ ### Local imports
25
+ By default, imports are directly from `npm` so you can leverage updates.
26
+ You can also copy and paste the code from this directory to your project and remap the imports to local.
27
+
28
+ ```css
29
+ @import "@/components/progress/assets/index.css" layer(components);
30
+ ```
31
+
32
+ ### Docs
33
+ Visit [docs](https://winduum.dev/docs/components/progress.html) to learn more about usage examples.
@@ -0,0 +1,3 @@
1
+ .x-progress:is(.sm) {
2
+ --x-progress-block-size: 0.5rem;
3
+ }
@@ -0,0 +1,99 @@
1
+ .x-range {
2
+ --x-range-thumb-background-color: var(--color-accent);
3
+ --x-range-thumb-border-color: var(--x-range-thumb-background-color);
4
+ --x-range-track-background-color: var(--color-accent);
5
+ --x-range-track-background:
6
+ linear-gradient(
7
+ to right,
8
+ var(--x-range-track-background-color) 0%,
9
+ var(--x-range-track-background-color) var(--x-range-track-start),
10
+ transparent var(--x-range-track-start),
11
+ transparent var(--x-range-track-end)
12
+ );
13
+
14
+ min-block-size: var(--x-range-thumb-size);
15
+ display: grid;
16
+
17
+ :where(input) {
18
+ block-size: var(--x-range-track-block-size);
19
+ background-color:
20
+ color-mix(
21
+ in var(--x-range-background-color-space, srgb),
22
+ var(--x-range-background-color, var(--color-accent)) var(--x-range-background-color-opacity, 10%),
23
+ var(--x-range-background-color-mix, var(--color-body))
24
+ );
25
+ position: relative;
26
+ grid-area: 1/1;
27
+
28
+ &::-webkit-slider-runnable-track {
29
+ block-size: var(--x-range-track-block-size);
30
+ border-radius: var(--x-range-track-border-radius, var(--radius-full));
31
+ background: var(--x-range-track-background);
32
+ }
33
+
34
+ &::-moz-range-track {
35
+ block-size: var(--x-range-track-block-size);
36
+ border-radius: var(--radius-full);
37
+ background: var(--x-range-track-background);
38
+ }
39
+
40
+ &::-webkit-slider-thumb {
41
+ inline-size: var(--x-range-thumb-size);
42
+ block-size: var(--x-range-thumb-size);
43
+ background-color: var(--x-range-thumb-background-color);
44
+ border-radius: var(--radius-full);
45
+ border: var(--x-range-thumb-border-width) solid var(--x-range-thumb-border-color);
46
+ outline:
47
+ var(--x-range-thumb-outline-width) solid
48
+ color-mix(
49
+ in var(--x-range-thumb-outline-color-space, srgb),
50
+ var(--x-range-thumb-outline-color, var(--x-range-thumb-background-color)) var(--x-range-thumb-outline-color-opacity, 0%),
51
+ var(--x-range-thumb-outline-color-mix, transparent)
52
+ );
53
+ margin-block-start: calc((var(--x-range-thumb-size) - var(--x-range-track-block-size)) / 2 * -1);
54
+ transition: outline-color var(--default-transition-duration), outline-offset var(--default-transition-duration);
55
+ cursor: var(--x-range-thumb-cursor, grab);
56
+ appearance: none;
57
+ pointer-events: auto;
58
+
59
+ &:active {
60
+ --x-range-thumb-cursor: grabbing;
61
+ --x-range-thumb-outline-color-opacity: var(--x-range-thumb-focus-outline-opacity);
62
+ }
63
+ }
64
+
65
+ &::-moz-range-thumb {
66
+ inline-size: var(--x-range-thumb-size);
67
+ block-size: var(--x-range-thumb-size);
68
+ background-color: var(--x-range-thumb-background-color);
69
+ border-radius: var(--radius-full);
70
+ border: var(--x-range-thumb-border-width) solid var(--x-range-thumb-border-color);
71
+ outline:
72
+ var(--x-range-thumb-outline-width) solid
73
+ color-mix(
74
+ in var(--x-range-thumb-outline-color-space, srgb),
75
+ var(--x-range-thumb-outline-color, var(--x-range-thumb-background-color)) var(--x-range-thumb-outline-color-opacity, 0%),
76
+ var(--x-range-thumb-outline-color-mix, transparent)
77
+ );
78
+ transition: outline-color var(--default-transition-duration), outline-offset var(--default-transition-duration);
79
+ cursor: var(--x-range-thumb-cursor, grab);
80
+ appearance: none;
81
+ pointer-events: auto;
82
+
83
+ &:active {
84
+ --x-range-thumb-cursor: grabbing;
85
+ --x-range-thumb-outline-color-opacity: var(--x-range-thumb-focus-outline-opacity);
86
+ }
87
+ }
88
+
89
+ &:focus-visible {
90
+ &::-webkit-slider-thumb {
91
+ --x-range-thumb-outline-color-opacity: var(--x-range-thumb-focus-outline-opacity);
92
+ }
93
+
94
+ &::-moz-range-thumb {
95
+ --x-range-thumb-outline-color-opacity: var(--x-range-thumb-focus-outline-opacity);
96
+ }
97
+ }
98
+ }
99
+ }
@@ -1,4 +1,4 @@
1
+ @import "props/default.css";
1
2
  @import "default.css";
2
- @import "default-props.css";
3
3
  @import "multi.css";
4
4
  @import "vertical.css";
@@ -4,7 +4,7 @@
4
4
  * @returns void
5
5
  */
6
6
  export const setTrackProperty = ({ element, value, max }, track = 'start') => {
7
- element.style.setProperty('--ui-range-track-' + track, `${((value) / max * 100).toString()}%`)
7
+ element.style.setProperty('--x-range-track-' + track, `${((value) / max * 100).toString()}%`)
8
8
  }
9
9
 
10
10
  /**
@@ -14,7 +14,7 @@ export const setTrackProperty = ({ element, value, max }, track = 'start') => {
14
14
  */
15
15
  export const setValue = (element, options = {}) => {
16
16
  const { selector, track } = {
17
- selector: '.ui-range',
17
+ selector: '.x-range',
18
18
  track: 'start',
19
19
  ...options
20
20
  }
@@ -0,0 +1,22 @@
1
+ .x-range {
2
+ :where(input) {
3
+ &:not(:only-of-type) {
4
+ --x-range-track-background:
5
+ linear-gradient(
6
+ to right,
7
+ transparent 0%,
8
+ transparent var(--x-range-track-start),
9
+ var(--x-range-track-background-color) var(--x-range-track-start),
10
+ var(--x-range-track-background-color) var(--x-range-track-end),
11
+ transparent var(--x-range-track-end),
12
+ transparent 100%
13
+ );
14
+
15
+ pointer-events: none;
16
+
17
+ ~ input {
18
+ background: transparent;
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,9 @@
1
+ :root, :host {
2
+ --x-range-track-block-size: 0.375rem;
3
+ --x-range-thumb-size: 1.125rem;
4
+ --x-range-thumb-border-width: 0;
5
+ --x-range-thumb-outline-width: 2px;
6
+ --x-range-thumb-focus-outline-opacity: 50%;
7
+ --x-range-track-start: 0%;
8
+ --x-range-track-end: 100%;
9
+ }
@@ -1,4 +1,4 @@
1
- # [Range](https://winduum.dev/docs/ui/range.html)
1
+ # [Range](https://winduum.dev/docs/components/range.html)
2
2
 
3
3
  ## Installation
4
4
  ```shell
@@ -8,16 +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/range/index.css" layer(components);
11
+ @import "winduum/src/components/range/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/range/default.css" layer(components);
18
- @import "winduum/src/ui/range/default-props.css" layer(components);
19
- @import "winduum/src/ui/range/multi.css" layer(components);
20
- @import "winduum/src/ui/range/vertical.css" layer(components);
17
+ @import "winduum/src/components/range/default.css" layer(components);
18
+ @import "winduum/src/components/range/default-props.css" layer(components);
19
+ @import "winduum/src/components/range/multi.css" layer(components);
20
+ @import "winduum/src/components/range/vertical.css" layer(components);
21
21
  ```
22
22
 
23
23
  ### Local imports
@@ -25,8 +25,8 @@ By default, imports are directly from `npm` so you can leverage updates.
25
25
  You can also copy and paste the code from this directory to your project and remap the imports to local.
26
26
 
27
27
  ```css
28
- @import "@/components/ui/range/assets/index.css" layer(components);
28
+ @import "@/components/range/assets/index.css" layer(components);
29
29
  ```
30
30
 
31
31
  ### Docs
32
- Visit [docs](https://winduum.dev/docs/ui/range.html) to learn more about Javascript API and see usage examples.
32
+ Visit [docs](https://winduum.dev/docs/components/range.html) to learn more about Javascript API and see usage examples.
@@ -1,11 +1,11 @@
1
- .ui-range:where(.vertical) {
2
- min-inline-size: var(--ui-range-thumb-size);
1
+ .x-range:where(.vertical) {
2
+ min-inline-size: var(--x-range-thumb-size);
3
3
  container-type: size;
4
4
 
5
5
  :where(input) {
6
6
  transform: rotate(-90deg);
7
7
  width: 100cqh;
8
- inset-block-start: 50%;
8
+ inset-block-start: calc(50% - 50cqw / 2);
9
9
  inset-inline-start: calc(50% * -1 + 50cqw);
10
10
  }
11
11
  }
@@ -1,41 +1,41 @@
1
- .ui-rating {
1
+ .x-rating {
2
2
  display: flex;
3
3
  align-items: center;
4
4
 
5
5
  :where(input) {
6
- color: var(--ui-rating-color);
6
+ inline-size: var(--x-rating-inline-size);
7
+ block-size: var(--x-rating-block-size);
8
+ color: var(--x-rating-color);
9
+ opacity: var(--x-rating-opacity);
7
10
  transition: var(--transition-opacity);
8
- opacity: var(--c-rating-opacity);
9
11
  display: grid;
10
12
  box-sizing: content-box;
11
- width: 1.25rem;
12
- height: 1.25rem;
13
13
 
14
14
  &:not(:last-child) {
15
- border-inline-end-width: var(--c-rating-gap);
15
+ border-inline-end-width: var(--x-rating-gap);
16
16
  border-inline-color: transparent;
17
17
  }
18
18
 
19
19
  &::before {
20
- mask: var(--mask-star);
20
+ mask: var(--x-rating-icon);
21
21
  background-color: currentColor;
22
22
  content: "";
23
23
  }
24
24
  }
25
25
 
26
26
  &:has(:checked) input {
27
- opacity: 1;
27
+ opacity: 100%;
28
28
 
29
29
  &:where(:checked ~ input) {
30
- opacity: var(--c-rating-opacity);
30
+ opacity: var(--x-rating-opacity);
31
31
  }
32
32
  }
33
33
 
34
34
  &:hover input {
35
- opacity: 1;
35
+ opacity: 100%;
36
36
 
37
37
  &:hover ~ input {
38
- opacity: var(--c-rating-opacity);
38
+ opacity: var(--x-rating-opacity);
39
39
  }
40
40
  }
41
41
  }
@@ -1,3 +1,3 @@
1
- @import "default-props.css";
1
+ @import "props/default.css";
2
2
  @import "default.css";
3
3
  @import "invalid.css";
@@ -0,0 +1,5 @@
1
+ .x-rating {
2
+ &.invalid, :user-invalid, .validated & :invalid {
3
+ --x-rating-color: var(--x-rating-invalid-color, var(--color-error));
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ :root, :host {
2
+ --x-rating-inline-size: 1.25rem;
3
+ --x-rating-block-size: 1.25rem;
4
+ --x-rating-color: var(--color-accent);
5
+ --x-rating-gap: 0.25rem;
6
+ --x-rating-opacity: 0.2;
7
+ --x-rating-icon: var(--mask-star);
8
+ }
@@ -0,0 +1,31 @@
1
+ # [Rating](https://winduum.dev/docs/components/rating.html)
2
+
3
+ ## Installation
4
+ ```shell
5
+ npm i winduum
6
+ ```
7
+ Learn more how to set up Winduum [here](https://winduum.dev/docs/).
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
+
10
+ ```css
11
+ @import "winduum/src/components/rating/index.css" layer(components);
12
+ ```
13
+
14
+ or modular (you can use your own props or CSS)
15
+
16
+ ```css
17
+ @import "winduum/src/components/rating/props/default.css";
18
+ @import "winduum/src/components/rating/default.css";
19
+ @import "winduum/src/components/rating/invalid.css";
20
+ ```
21
+
22
+ ### Local imports
23
+ By default, imports are directly from `npm` so you can leverage updates.
24
+ You can also copy and paste the code from this directory to your project and remap the imports to local.
25
+
26
+ ```css
27
+ @import "@/components/rating/assets/index.css" layer(components);
28
+ ```
29
+
30
+ ### Docs
31
+ Visit [docs](https://winduum.dev/docs/components/rating.html) to learn more about usage examples.
@@ -0,0 +1,43 @@
1
+ .x-switch {
2
+ font-weight: var(--x-switch-font-weight);
3
+ font-size: var(--x-switch-font-size);
4
+ line-height: var(--x-switch-line-height);
5
+ letter-spacing: var(--x-switch-letter-spacing);
6
+ gap: var(--x-switch-gap);
7
+ display: inline-flex;
8
+ text-wrap: pretty;
9
+
10
+ :where(input) {
11
+ inline-size: var(--x-switch-inline-size);
12
+ block-size: var(--x-switch-block-size);
13
+ padding: calc((var(--x-switch-block-size) - var(--x-switch-icon-size)) / 2);
14
+ border-radius: var(--x-switch-border-radius);
15
+ background-color:
16
+ color-mix(
17
+ in var(--x-switch-background-color-space, srgb),
18
+ var(--x-switch-background-color) var(--x-switch-background-color-opacity, 100%),
19
+ var(--x-switch-background-color-mix, transparent)
20
+ );
21
+ outline:
22
+ var(--x-switch-outline-width) solid
23
+ color-mix(
24
+ in var(--x-switch-outline-color-space, srgb),
25
+ var(--x-switch-outline-color) var(--x-switch-outline-color-opacity, 0%),
26
+ var(--x-switch-outline-color-mix, transparent)
27
+ );
28
+ outline-offset: var(--x-switch-outline-offset);
29
+ display: flex;
30
+ position: relative;
31
+ flex-shrink: 0;
32
+
33
+ &::before {
34
+ inline-size: var(--x-switch-icon-size);
35
+ block-size: var(--x-switch-icon-size);
36
+ background-color: var(--color-light);
37
+ transition: var(--transition-all);
38
+ border-radius: inherit;
39
+ margin-block: auto;
40
+ content: "";
41
+ }
42
+ }
43
+ }
@@ -1,5 +1,4 @@
1
- @import "default-props.css";
1
+ @import "props/default.css";
2
2
  @import "default.css";
3
- @import "interactive-props.css";
4
3
  @import "interactive.css";
5
4
  @import "invalid.css";