winduum 1.2.1 → 2.0.0-next.2
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.
- package/package.json +15 -15
- package/plugin/index.js +73 -22
- package/plugin/utilities/common.js +4 -4
- package/plugin/utilities/dot.js +2 -3
- package/src/base/breakpoints.css +10 -10
- package/src/base/config/font.css +22 -9
- package/src/base/config/rounded.css +12 -12
- package/src/base/config/transition.css +14 -14
- package/src/base/config/z.css +5 -5
- package/src/base/config.css +0 -1
- package/src/base/defaults.css +9 -11
- package/src/base/keyframes.css +13 -1
- package/src/base/reset.css +2 -7
- package/src/base/theme/dark-rgb.css +1 -1
- package/src/base/theme/dark.css +1 -1
- package/src/base/theme/default-rgb.css +6 -6
- package/src/base/theme/default.css +6 -6
- package/src/components/badge/bordered.css +6 -0
- package/src/components/badge/circle.css +5 -0
- package/src/components/badge/default.css +42 -0
- package/src/{ui → components}/badge/index.css +1 -1
- package/src/components/badge/lg.css +3 -0
- package/src/components/badge/muted.css +4 -0
- package/src/components/badge/props/default.css +9 -0
- package/src/components/badge/readme.md +37 -0
- package/src/components/badge/sm.css +4 -0
- package/src/components/badge/square.css +4 -0
- package/src/components/breadcrumb/default.css +7 -7
- package/src/components/breadcrumb/index.css +1 -1
- package/src/components/breadcrumb/props/default.css +5 -0
- package/src/components/breadcrumb/readme.md +1 -1
- package/src/components/button/bordered.css +19 -0
- package/src/components/button/circle.css +6 -0
- package/src/components/button/default.css +63 -0
- package/src/components/button/fill.css +6 -0
- package/src/components/button/ghosted.css +14 -0
- package/src/{ui/btn → components/button}/index.css +2 -7
- package/src/components/button/interactive.css +56 -0
- package/src/components/button/lg.css +4 -0
- package/src/components/button/muted.css +14 -0
- package/src/components/button/props/default.css +11 -0
- package/src/components/button/props/interactive.css +9 -0
- package/src/components/button/raised.css +6 -0
- package/src/components/button/readme.md +46 -0
- package/src/components/button/sm.css +4 -0
- package/src/components/button/square.css +5 -0
- package/src/components/card/default.css +4 -6
- package/src/components/card/index.css +1 -1
- package/src/components/card/props/default.css +6 -0
- package/src/components/card/readme.md +1 -1
- package/src/components/carousel/content.css +2 -2
- package/src/components/carousel/default.css +1 -1
- package/src/components/check/default.css +67 -0
- package/src/{ui/switch → components/check}/index.css +1 -1
- package/src/components/check/interactive.css +56 -0
- package/src/components/check/invalid.css +9 -0
- package/src/components/check/props/default.css +13 -0
- package/src/{ui/color → components/check}/readme.md +8 -9
- package/src/components/color/default.css +36 -0
- package/src/components/color/index.css +3 -0
- package/src/components/color/interactive.css +36 -0
- package/src/components/color/props/default.css +7 -0
- package/src/{ui/title → components/color}/readme.md +7 -8
- package/src/components/compare/default.css +17 -18
- package/src/components/compare/index.js +2 -2
- package/src/components/control/color.css +24 -0
- package/src/components/control/default.css +74 -0
- package/src/components/control/file.css +27 -0
- package/src/components/control/floating-interactive.css +13 -0
- package/src/components/control/floating.css +36 -0
- package/src/components/control/icon.css +32 -0
- package/src/{ui → components}/control/index.css +5 -6
- package/src/components/control/interactive.css +19 -0
- package/src/components/control/invalid.css +10 -0
- package/src/components/control/props/color.css +5 -0
- package/src/components/control/props/default.css +16 -0
- package/src/components/control/props/floating.css +4 -0
- package/src/components/control/props/icon.css +4 -0
- package/src/components/control/props/select.css +4 -0
- package/src/components/control/readme.md +43 -0
- package/src/{ui → components}/control/select-multiple.css +2 -2
- package/src/components/control/select.css +23 -0
- package/src/components/dialog/content.css +7 -7
- package/src/components/dialog/default.css +15 -13
- package/src/components/dialog/index.css +2 -2
- package/src/components/dialog/index.d.ts +3 -18
- package/src/components/dialog/index.js +21 -80
- package/src/components/dialog/props/content.css +5 -0
- package/src/components/dialog/props/default.css +6 -0
- package/src/components/dialog/readme.md +2 -2
- package/src/components/drawer/content.css +4 -4
- package/src/components/drawer/default.css +8 -5
- package/src/components/drawer/index.css +2 -2
- package/src/components/drawer/index.js +3 -3
- package/src/components/drawer/props/content.css +7 -0
- package/src/components/drawer/props/default.css +3 -0
- package/src/components/drawer/readme.md +2 -2
- package/src/components/field/default.css +6 -6
- package/src/components/form/index.js +5 -5
- package/src/components/group/default.css +42 -0
- package/src/{ui → components}/group/readme.md +6 -6
- package/src/{ui → components}/group/vertical.css +2 -2
- package/src/components/heading/default.css +8 -0
- package/src/{ui → components}/heading/index.css +1 -1
- package/src/components/heading/lg.css +3 -0
- package/src/components/heading/props/default.css +6 -0
- package/src/{ui/check → components/heading}/readme.md +8 -9
- package/src/components/heading/sm.css +3 -0
- package/src/{ui → components}/image/avatar.css +3 -3
- package/src/{ui → components}/image/default.css +1 -1
- package/src/{ui/notice → components/image}/readme.md +6 -6
- package/src/components/index.css +18 -0
- package/src/components/info/default.css +8 -0
- package/src/components/info/index.css +2 -0
- package/src/components/info/props/default.css +4 -0
- package/src/{ui/rating → components/info}/readme.md +6 -7
- package/src/components/label/default.css +8 -0
- package/src/components/label/index.css +2 -0
- package/src/components/label/props/default.css +4 -0
- package/src/{ui → components}/label/readme.md +6 -6
- package/src/components/link/default.css +8 -0
- package/src/components/link/index.css +3 -0
- package/src/components/link/interactive.css +9 -0
- package/src/components/link/props/default.css +4 -0
- package/src/{ui → components}/link/readme.md +7 -7
- package/src/components/notice/default.css +21 -0
- package/src/components/notice/index.css +2 -0
- package/src/components/notice/props/default.css +8 -0
- package/src/{ui/image → components/notice}/readme.md +6 -6
- package/src/components/pagination/default.css +2 -2
- package/src/components/popover/content.css +16 -17
- package/src/components/popover/default.css +1 -1
- package/src/components/popover/index.css +1 -1
- package/src/components/popover/props/content.css +8 -0
- package/src/components/popover/readme.md +1 -1
- package/src/components/progress/default.css +46 -0
- package/src/{ui → components}/progress/index.css +1 -1
- package/src/components/progress/lg.css +3 -0
- package/src/{ui → components}/progress/meter.css +7 -7
- package/src/components/progress/props/default.css +6 -0
- package/src/components/progress/readme.md +33 -0
- package/src/components/progress/sm.css +3 -0
- package/src/components/range/default.css +99 -0
- package/src/{ui → components}/range/index.css +1 -1
- package/src/{ui → components}/range/index.js +2 -2
- package/src/components/range/multi.css +22 -0
- package/src/components/range/props/default.css +9 -0
- package/src/{ui → components}/range/readme.md +8 -8
- package/src/{ui → components}/range/vertical.css +3 -3
- package/src/{ui → components}/rating/default.css +11 -11
- package/src/{ui → components}/rating/index.css +1 -1
- package/src/components/rating/invalid.css +5 -0
- package/src/components/rating/props/default.css +8 -0
- package/src/components/rating/readme.md +31 -0
- package/src/components/switch/default.css +43 -0
- package/src/{ui/check → components/switch}/index.css +1 -2
- package/src/components/switch/interactive.css +43 -0
- package/src/components/switch/invalid.css +6 -0
- package/src/components/switch/props/default.css +17 -0
- package/src/{ui/progress → components/switch}/readme.md +8 -9
- package/src/components/table/default.css +11 -11
- package/src/components/table/index.css +1 -2
- package/src/components/table/interactive.css +14 -14
- package/src/components/table/props/default.css +8 -0
- package/src/components/table/readme.md +1 -2
- package/src/components/tabs/default.css +6 -6
- package/src/components/text/default.css +223 -0
- package/src/components/text/index.css +2 -0
- package/src/components/text/props/default.css +9 -0
- package/src/{ui/info → components/text}/readme.md +6 -6
- package/src/components/title/default.css +8 -0
- package/src/{ui → components}/title/index.css +1 -1
- package/src/components/title/lg.css +3 -0
- package/src/components/title/props/default.css +5 -0
- package/src/{ui/heading → components/title}/readme.md +9 -8
- package/src/components/title/sm.css +3 -0
- package/src/components/toast/content.css +16 -15
- package/src/components/toast/default.css +8 -8
- package/src/components/toast/index.css +2 -2
- package/src/components/toast/props/content.css +7 -0
- package/src/components/toast/props/default.css +4 -0
- package/src/components/toast/readme.md +2 -2
- package/src/components/toaster/default.css +4 -4
- package/src/components/toaster/index.css +1 -1
- package/src/components/toaster/index.js +8 -8
- package/src/components/toaster/props/default.css +4 -0
- package/src/components/toaster/readme.md +1 -1
- package/src/components/tooltip/default.css +15 -15
- package/src/components/tooltip/index.css +1 -1
- package/src/components/tooltip/props/default.css +12 -0
- package/src/components/tooltip/readme.md +2 -2
- package/src/main.css +0 -1
- package/src/utilities/common.css +2 -6
- package/src/utilities/container/default.css +3 -4
- package/src/utilities/container/index.css +1 -1
- package/src/utilities/divider.css +13 -4
- package/src/utilities/ripple/index.css +9 -6
- package/src/utilities/skeleton/default.css +8 -1
- package/src/utilities/skeleton/index.css +1 -1
- package/src/utilities/skeleton/props/default.css +5 -0
- package/src/utilities/swap/default.css +6 -6
- package/src/utilities/underline.css +3 -3
- package/types/index.d.ts +4 -19
- package/types/index.d.ts.map +3 -8
- package/plugin/utilities/flex.js +0 -12
- package/src/base/config/text.css +0 -15
- package/src/components/breadcrumb/default-props.css +0 -5
- package/src/components/card/default-props.css +0 -4
- package/src/components/dialog/content-props.css +0 -5
- package/src/components/dialog/default-props.css +0 -6
- package/src/components/drawer/content-props.css +0 -6
- package/src/components/drawer/default-props.css +0 -3
- package/src/components/popover/content-props.css +0 -8
- package/src/components/table/default-props.css +0 -8
- package/src/components/table/interactive-props.css +0 -4
- package/src/components/toast/content-props.css +0 -7
- package/src/components/toast/default-props.css +0 -4
- package/src/components/toaster/default-props.css +0 -4
- package/src/components/tooltip/default-props.css +0 -12
- package/src/ui/badge/bordered.css +0 -16
- package/src/ui/badge/circle.css +0 -5
- package/src/ui/badge/default-props.css +0 -8
- package/src/ui/badge/default.css +0 -26
- package/src/ui/badge/lg.css +0 -3
- package/src/ui/badge/muted.css +0 -4
- package/src/ui/badge/readme.md +0 -37
- package/src/ui/badge/sm.css +0 -4
- package/src/ui/badge/square.css +0 -4
- package/src/ui/btn/bordered.css +0 -21
- package/src/ui/btn/circle.css +0 -6
- package/src/ui/btn/default-props.css +0 -10
- package/src/ui/btn/default.css +0 -49
- package/src/ui/btn/fill.css +0 -6
- package/src/ui/btn/ghosted.css +0 -9
- package/src/ui/btn/gradient-bordered.css +0 -24
- package/src/ui/btn/gradient.css +0 -10
- package/src/ui/btn/interactive-props.css +0 -9
- package/src/ui/btn/interactive.css +0 -53
- package/src/ui/btn/lg.css +0 -4
- package/src/ui/btn/loading-props.css +0 -4
- package/src/ui/btn/loading.css +0 -24
- package/src/ui/btn/muted.css +0 -9
- package/src/ui/btn/raised.css +0 -7
- package/src/ui/btn/readme.md +0 -51
- package/src/ui/btn/sm.css +0 -4
- package/src/ui/btn/square.css +0 -5
- package/src/ui/btn/wide.css +0 -3
- package/src/ui/check/default-props.css +0 -13
- package/src/ui/check/default.css +0 -74
- package/src/ui/check/interactive-props.css +0 -3
- package/src/ui/check/interactive.css +0 -50
- package/src/ui/check/invalid.css +0 -8
- package/src/ui/color/default-props.css +0 -11
- package/src/ui/color/default.css +0 -48
- package/src/ui/color/index.css +0 -4
- package/src/ui/color/interactive-props.css +0 -3
- package/src/ui/color/interactive.css +0 -30
- package/src/ui/control/color-props.css +0 -5
- package/src/ui/control/color.css +0 -24
- package/src/ui/control/default-props.css +0 -16
- package/src/ui/control/default.css +0 -77
- package/src/ui/control/file.css +0 -25
- package/src/ui/control/floating-interactive.css +0 -13
- package/src/ui/control/floating-props.css +0 -4
- package/src/ui/control/floating.css +0 -36
- package/src/ui/control/icon-props.css +0 -4
- package/src/ui/control/icon.css +0 -32
- package/src/ui/control/interactive-props.css +0 -3
- package/src/ui/control/interactive.css +0 -19
- package/src/ui/control/invalid.css +0 -10
- package/src/ui/control/readme.md +0 -44
- package/src/ui/control/select-props.css +0 -4
- package/src/ui/control/select.css +0 -23
- package/src/ui/group/default.css +0 -42
- package/src/ui/heading/default-props.css +0 -6
- package/src/ui/heading/default.css +0 -8
- package/src/ui/heading/lg.css +0 -3
- package/src/ui/heading/sm.css +0 -3
- package/src/ui/index.css +0 -18
- package/src/ui/info/default-props.css +0 -4
- package/src/ui/info/default.css +0 -8
- package/src/ui/info/index.css +0 -2
- package/src/ui/label/default-props.css +0 -4
- package/src/ui/label/default.css +0 -8
- package/src/ui/label/index.css +0 -2
- package/src/ui/link/default-props.css +0 -4
- package/src/ui/link/default.css +0 -8
- package/src/ui/link/index.css +0 -4
- package/src/ui/link/interactive-props.css +0 -5
- package/src/ui/link/interactive.css +0 -16
- package/src/ui/notice/default-props.css +0 -8
- package/src/ui/notice/default.css +0 -25
- package/src/ui/notice/index.css +0 -2
- package/src/ui/progress/default-props.css +0 -4
- package/src/ui/progress/default.css +0 -47
- package/src/ui/progress/lg.css +0 -3
- package/src/ui/progress/sm.css +0 -3
- package/src/ui/range/default-props.css +0 -10
- package/src/ui/range/default.css +0 -101
- package/src/ui/range/multi.css +0 -22
- package/src/ui/rating/default-props.css +0 -5
- package/src/ui/rating/invalid.css +0 -5
- package/src/ui/switch/default-props.css +0 -17
- package/src/ui/switch/default.css +0 -46
- package/src/ui/switch/interactive-props.css +0 -3
- package/src/ui/switch/interactive.css +0 -39
- package/src/ui/switch/invalid.css +0 -6
- package/src/ui/switch/readme.md +0 -32
- package/src/ui/text/default-props.css +0 -9
- package/src/ui/text/default.css +0 -193
- package/src/ui/text/index.css +0 -2
- package/src/ui/text/readme.md +0 -30
- package/src/ui/title/default-props.css +0 -5
- package/src/ui/title/default.css +0 -8
- package/src/ui/title/lg.css +0 -3
- package/src/ui/title/sm.css +0 -3
- package/src/utilities/skeleton/default-props.css +0 -5
- /package/src/{ui → components}/group/index.css +0 -0
- /package/src/{ui → components}/image/index.css +0 -0
- /package/src/{ui → components}/range/index.d.ts +0 -0
- /package/src/utilities/container/{default-props.css → props/default.css} +0 -0
|
@@ -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/
|
|
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/
|
|
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/
|
|
18
|
-
@import "winduum/src/
|
|
19
|
-
@import "winduum/src/
|
|
20
|
-
@import "winduum/src/
|
|
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/
|
|
28
|
+
@import "@/components/range/assets/index.css" layer(components);
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### Docs
|
|
32
|
-
Visit [docs](https://winduum.dev/docs/
|
|
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
|
-
.
|
|
2
|
-
min-inline-size: var(--
|
|
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
|
-
.
|
|
1
|
+
.x-rating {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
|
5
5
|
:where(input) {
|
|
6
|
-
|
|
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(--
|
|
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(--
|
|
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:
|
|
27
|
+
opacity: 100%;
|
|
28
28
|
|
|
29
29
|
&:where(:checked ~ input) {
|
|
30
|
-
opacity: var(--
|
|
30
|
+
opacity: var(--x-rating-opacity);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&:hover input {
|
|
35
|
-
opacity:
|
|
35
|
+
opacity: 100%;
|
|
36
36
|
|
|
37
37
|
&:hover ~ input {
|
|
38
|
-
opacity: var(--
|
|
38
|
+
opacity: var(--x-rating-opacity);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.x-switch {
|
|
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
|
+
&:where(:required) {
|
|
8
|
+
& + *::after {
|
|
9
|
+
color: var(--x-switch-required-color, var(--color-error));
|
|
10
|
+
content: " *";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:enabled:focus {
|
|
15
|
+
--x-switch-outline-offset: var(--x-switch-focus-outline-offset);
|
|
16
|
+
--x-switch-outline-color-opacity: var(--x-switch-focus-outline-color-opacity, 40%);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:disabled {
|
|
20
|
+
--x-switch-background-color: var(--x-switch-disabled-background-color, currentColor);
|
|
21
|
+
--x-switch-background-color-opacity: var(--x-switch-disabled-background-color-opacity, 15%);
|
|
22
|
+
--x-switch-outline-color: var(--x-switch-disabled-outline-color, currentColor);
|
|
23
|
+
--x-switch-outline-color-opacity: var(--x-check-disabled-outline-color-opacity, 5%);
|
|
24
|
+
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:checked {
|
|
29
|
+
--x-switch-outline-color: var(--color-accent);
|
|
30
|
+
--x-switch-background-color: var(--color-accent);
|
|
31
|
+
|
|
32
|
+
&::before {
|
|
33
|
+
margin-inline-start: calc(100% - var(--x-switch-icon-size));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:indeterminate {
|
|
38
|
+
&::before {
|
|
39
|
+
margin-inline-start: calc(50% - var(--x-switch-icon-size) / 2);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
:root, :host {
|
|
2
|
+
--x-switch-inline-size: 3rem;
|
|
3
|
+
--x-switch-block-size: 1.5rem;
|
|
4
|
+
--x-switch-icon-size: 1.125rem;
|
|
5
|
+
--x-switch-font-weight: var(--font-weight-normal);
|
|
6
|
+
--x-switch-font-size: var(--font-size-sm);
|
|
7
|
+
--x-switch-line-height: calc(1em + 0.25rem);
|
|
8
|
+
--x-switch-gap: 0.75rem;
|
|
9
|
+
--x-switch-border-radius: var(--radius-full);
|
|
10
|
+
--x-switch-background-color: currentColor;
|
|
11
|
+
--x-switch-outline-width: 2px;
|
|
12
|
+
--x-switch-outline-color: currentColor;
|
|
13
|
+
|
|
14
|
+
&.dark {
|
|
15
|
+
--x-switch-background-color: var(--color-body-tertiary);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [Switch](https://winduum.dev/docs/components/switch.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/
|
|
11
|
+
@import "winduum/src/components/switch/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/
|
|
18
|
-
@import "winduum/src/
|
|
19
|
-
@import "winduum/src/
|
|
20
|
-
@import "winduum/src/
|
|
21
|
-
@import "winduum/src/ui/progress/lg.css" layer(components);
|
|
17
|
+
@import "winduum/src/components/switch/props/default.css" layer(components);
|
|
18
|
+
@import "winduum/src/components/switch/default.css" layer(components);
|
|
19
|
+
@import "winduum/src/components/switch/interactive.css" layer(components);
|
|
20
|
+
@import "winduum/src/components/switch/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/
|
|
28
|
+
@import "@/components/switch/assets/index.css" layer(components);
|
|
30
29
|
```
|
|
31
30
|
|
|
32
31
|
### Docs
|
|
33
|
-
Visit [docs](https://winduum.dev/docs/
|
|
32
|
+
Visit [docs](https://winduum.dev/docs/components/switch.html) to learn more about usage examples.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
.x-table {
|
|
2
|
+
border-radius: var(--x-table-border-radius);
|
|
3
|
+
background-color: var(--x-table-background-color, var(--color-body-primary));
|
|
4
|
+
max-inline-size: 100%;
|
|
5
5
|
overflow: auto;
|
|
6
6
|
|
|
7
7
|
:where(table) {
|
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
:where(thead tr:not(:first-child), tbody tr, tfoot tr) {
|
|
14
|
-
border-block-start: var(--
|
|
14
|
+
border-block-start: var(--x-table-cell-border-block-width) solid var(--x-table-border-color, var(--color-body-tertiary));
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:where(td, th) {
|
|
18
|
-
padding: var(--
|
|
19
|
-
|
|
20
|
-
border-color: var(--color-body-tertiary);
|
|
21
|
-
border-inline-width: var(--
|
|
18
|
+
padding: var(--x-table-cell-spacing-y) var(--x-table-cell-spacing-x);
|
|
19
|
+
block-size: var(--x-table-cell-block-size);
|
|
20
|
+
border-color: var(--x-table-border-color, var(--color-body-tertiary));
|
|
21
|
+
border-inline-width: var(--x-table-cell-border-inline-width, 0);
|
|
22
22
|
|
|
23
23
|
&:first-child {
|
|
24
|
-
padding-inline-start: var(--
|
|
24
|
+
padding-inline-start: var(--x-table-padding-inline);
|
|
25
25
|
border-inline-start: 0;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
&:last-child {
|
|
29
|
-
padding-inline-end: var(--
|
|
29
|
+
padding-inline-end: var(--x-table-padding-inline);
|
|
30
30
|
border-inline-end: 0;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
.
|
|
2
|
-
--c-table-outline-accent-color: var(--color-accent);
|
|
3
|
-
|
|
1
|
+
.x-table {
|
|
4
2
|
:where(tbody:first-child, tfoot:first-child) {
|
|
5
3
|
:where(tr:first-child) {
|
|
6
4
|
&, :where(th,td):where(:first-child) {
|
|
7
|
-
border-start-start-radius: var(--
|
|
5
|
+
border-start-start-radius: var(--x-table-border-radius);
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
&, :where(th,td):where(:last-child) {
|
|
11
|
-
border-start-end-radius: var(--
|
|
9
|
+
border-start-end-radius: var(--x-table-border-radius);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -16,26 +14,28 @@
|
|
|
16
14
|
:where(tbody:last-child, tfoot:last-child) {
|
|
17
15
|
:where(tr:last-child) {
|
|
18
16
|
&, :where(th,td):where(:first-child) {
|
|
19
|
-
border-end-start-radius: var(--
|
|
17
|
+
border-end-start-radius: var(--x-table-border-radius);
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
&, :where(th,td):where(:last-child) {
|
|
23
|
-
border-end-end-radius: var(--
|
|
21
|
+
border-end-end-radius: var(--x-table-border-radius);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
:where(tr, th, td):where([tabindex="0"]), :where(.outline) {
|
|
29
27
|
transition: var(--transition-all);
|
|
30
|
-
outline: var(--
|
|
31
|
-
outline-offset: calc(var(--
|
|
28
|
+
outline: var(--x-table-outline-width, 1px) solid transparent;
|
|
29
|
+
outline-offset: calc(var(--x-table-outline-width, 1px) * -1);
|
|
32
30
|
|
|
33
31
|
&:is(:hover, :focus-visible, .active) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
background-color:
|
|
33
|
+
color-mix(
|
|
34
|
+
in var(--x-table-outline-background-color-space, srgb),
|
|
35
|
+
var(--x-table-outline-accent-color, var(--color-accent)) var(--x-table-outline-background-color-opacity, 5%),
|
|
36
|
+
var(--x-table-outline-background-color-mix, transparent)
|
|
37
|
+
);
|
|
38
|
+
outline-color: var(--x-table-outline-accent-color, var(--color-accent));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -14,10 +14,9 @@ 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/table/props/default.css";
|
|
17
18
|
@import "winduum/src/components/table/default.css";
|
|
18
|
-
@import "winduum/src/components/table/default-props.css";
|
|
19
19
|
@import "winduum/src/components/table/interactive.css";
|
|
20
|
-
@import "winduum/src/components/table/interactive-props.css";
|
|
21
20
|
```
|
|
22
21
|
|
|
23
22
|
### Local imports
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.
|
|
2
|
-
background-color: var(--color-body-secondary);
|
|
1
|
+
.x-tabs {
|
|
2
|
+
background-color: var(--x-tabs-background-color, var(--color-body-secondary));
|
|
3
|
+
gap: var(--x-tabs-gap, var(--spacing-xs));
|
|
4
|
+
padding: var(--x-tabs-padding, var(--spacing-xs));
|
|
5
|
+
border-radius: var(--x-tabs-border-radius, var(--radius));
|
|
3
6
|
display: flex;
|
|
4
|
-
|
|
5
|
-
padding: var(--spacing-xs);
|
|
6
|
-
border-radius: var(--rounded);
|
|
7
|
-
width: max-content;
|
|
7
|
+
inline-size: max-content;
|
|
8
8
|
}
|