winduum 2.0.0-next.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +23 -17
- package/plugin/index.cjs +80 -110
- package/plugin/index.d.ts +9 -9
- package/plugin/index.js +46 -94
- package/plugin/utilities/common.js +44 -5
- package/src/base/defaults.css +6 -12
- package/src/base/index.css +1 -4
- package/src/base/keyframes.css +0 -17
- package/src/base/reset.css +0 -1
- package/src/base/transitions.css +15 -0
- package/src/common.js +1 -1
- package/src/components/badge/circle.css +1 -1
- package/src/components/badge/default.css +2 -2
- package/src/components/badge/lg.css +1 -1
- package/src/components/badge/props/default.css +2 -2
- package/src/components/badge/sm.css +1 -1
- package/src/components/badge/square.css +1 -1
- package/src/components/breadcrumb/props/default.css +1 -1
- package/src/components/button/bordered.css +1 -4
- package/src/components/button/circle.css +1 -1
- package/src/components/button/default.css +2 -2
- package/src/components/button/index.css +1 -0
- package/src/components/button/interactive.css +15 -13
- package/src/components/button/lg.css +1 -1
- package/src/components/button/props/default.css +2 -2
- package/src/components/button/sm.css +1 -1
- package/src/components/button/spinner.css +9 -0
- package/src/components/button/square.css +1 -1
- package/src/components/card/props/default.css +2 -2
- package/src/components/carousel/index.d.ts +3 -3
- package/src/components/carousel/index.js +18 -16
- package/src/components/check/invalid.css +1 -1
- package/src/components/check/props/default.css +1 -1
- package/src/components/color/interactive.css +1 -1
- package/src/components/color/props/default.css +0 -1
- package/src/components/compare/default.css +3 -3
- package/src/components/compare/index.d.ts +3 -3
- package/src/components/compare/index.js +10 -9
- package/src/components/control/color.css +5 -5
- package/src/components/control/default.css +3 -3
- package/src/components/control/file.css +1 -1
- package/src/components/control/invalid.css +1 -1
- package/src/components/control/props/color.css +2 -2
- package/src/components/control/props/default.css +3 -3
- package/src/components/control/select-multiple.css +1 -1
- package/src/components/details/index.js +2 -2
- package/src/components/dialog/index.d.ts +2 -0
- package/src/components/dialog/index.js +8 -6
- package/src/components/drawer/default.css +6 -5
- package/src/components/drawer/index.d.ts +2 -1
- package/src/components/drawer/index.js +15 -1
- package/src/components/drawer/props/content.css +1 -1
- package/src/components/field/default.css +2 -2
- package/src/components/form/index.d.ts +5 -4
- package/src/components/form/index.js +15 -13
- package/src/components/group/default.css +1 -1
- package/src/components/pagination/default.css +1 -1
- package/src/components/popover/content.css +7 -11
- package/src/components/popover/index.d.ts +6 -1
- package/src/components/popover/index.js +12 -10
- package/src/components/popover/props/content.css +2 -2
- package/src/components/progress/default.css +3 -3
- package/src/components/progress/index.css +1 -0
- package/src/components/progress/keyframes/default.css +9 -0
- package/src/components/progress/props/default.css +0 -2
- package/src/components/range/index.d.ts +1 -0
- package/src/components/range/index.js +5 -4
- package/src/components/rating/default.css +8 -0
- package/src/components/rating/invalid.css +1 -1
- package/src/components/rating/props/default.css +0 -1
- package/src/components/switch/invalid.css +1 -1
- package/src/components/tabs/list.css +2 -2
- package/src/components/text/props/default.css +1 -1
- package/src/components/toast/content.css +0 -5
- package/src/components/toast/default.css +3 -3
- package/src/components/toast/index.d.ts +14 -0
- package/src/components/toast/index.js +51 -0
- package/src/components/toast/props/content.css +3 -3
- package/src/components/toaster/default.css +4 -0
- package/src/components/toaster/index.d.ts +1 -25
- package/src/components/toaster/index.js +1 -103
- package/src/components/toaster/props/default.css +2 -2
- package/src/components/tooltip/props/default.css +4 -4
- package/src/main.css +3 -0
- package/src/tailwind.css +4 -2
- package/src/test.css +9 -0
- package/src/{base → theme}/config/font.css +17 -1
- package/src/theme/config/index.css +6 -0
- package/src/theme/config/spacing.css +37 -0
- package/src/{base → theme}/config/transition.css +5 -1
- package/src/theme/index.css +4 -0
- package/src/utilities/animation.css +4 -0
- package/src/utilities/container/default.css +2 -2
- package/src/utilities/container/props/default.css +2 -2
- package/src/utilities/divider.css +1 -1
- package/src/utilities/dot.css +10 -0
- package/src/utilities/index.css +2 -1
- package/src/utilities/ripple/default.css +15 -0
- package/src/utilities/ripple/index.css +2 -15
- package/src/utilities/ripple/index.d.ts +7 -1
- package/src/utilities/ripple/index.js +13 -13
- package/src/utilities/ripple/keyframes/default.css +6 -0
- package/src/utilities/spinner/circle.css +5 -0
- package/src/utilities/spinner/default.css +16 -0
- package/src/utilities/spinner/index.css +4 -0
- package/src/utilities/spinner/keyframes/ring.css +13 -0
- package/src/utilities/spinner/ring.css +15 -0
- package/src/utilities/view-transition.css +3 -0
- package/tailwind.config.js +6 -5
- package/tailwindcss/base/defaults.css +9 -0
- package/tailwindcss/index.css +4 -0
- package/tailwindcss/theme/config/breakpoint.css +12 -0
- package/tailwindcss/theme/config/font.css +13 -0
- package/tailwindcss/theme/config/index.css +6 -0
- package/tailwindcss/theme/config/mask.css +8 -0
- package/tailwindcss/theme/config/radius.css +9 -0
- package/tailwindcss/theme/config/transition.css +20 -0
- package/tailwindcss/theme/config/z.css +7 -0
- package/tailwindcss/theme/default.css +26 -0
- package/tailwindcss/theme/index.css +2 -0
- package/tailwindcss/utilities/animation.css +0 -0
- package/tailwindcss/utilities/divide-gap.css +0 -0
- package/types/index.d.ts +50 -39
- package/types/index.d.ts.map +7 -5
- package/dist/assets/index-xIgNpv_7.css +0 -1
- package/dist/index.html +0 -16
- package/dist/main-rgb.css +0 -1
- package/src/base/config/spacing.css +0 -15
- package/src/base/config.css +0 -6
- package/src/base/tailwind.css +0 -3
- package/src/utilities/common.css +0 -8
- /package/src/{base → theme}/config/mask.css +0 -0
- /package/src/{base/config/rounded.css → theme/config/radius.css} +0 -0
- /package/src/{base → theme}/config/z.css +0 -0
- /package/src/{base/theme → theme}/dark-rgb.css +0 -0
- /package/src/{base/theme → theme}/dark.css +0 -0
- /package/src/{base/theme → theme}/default-p3.css +0 -0
- /package/src/{base/theme → theme}/default-rgb.css +0 -0
- /package/src/{base/theme → theme}/default.css +0 -0
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
export interface ShowToastOptions {
|
|
2
|
-
visibleClass?: string
|
|
3
|
-
autoHide?: number | null
|
|
4
|
-
heightProperty?: string
|
|
5
|
-
close?: CloseToastOptions
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
export interface CloseToastOptions {
|
|
9
|
-
|
|
2
|
+
closedAttribute?: string
|
|
10
3
|
heightProperty?: string
|
|
11
4
|
}
|
|
12
5
|
|
|
13
|
-
export interface InsertToasterOptions {
|
|
14
|
-
classes?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface InsertToastOptions {
|
|
18
|
-
classes?: string
|
|
19
|
-
title?: string
|
|
20
|
-
text?: string
|
|
21
|
-
start?: string
|
|
22
|
-
end?: string
|
|
23
|
-
show?: ShowToastOptions
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function closeToast(element: HTMLElement, options?: CloseToastOptions): Promise<void>
|
|
27
|
-
export function showToast(element: HTMLElement, options?: ShowToastOptions): Promise<void>
|
|
28
|
-
export function insertToaster(element: HTMLElement, options?: InsertToasterOptions): Promise<void>
|
|
29
|
-
export function insertToast(element: HTMLElement, options?: InsertToastOptions): Promise<void>
|
|
30
6
|
export function closeToaster(element: HTMLElement, options?: CloseToastOptions): Promise<void>
|
|
@@ -1,106 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @param {HTMLElement} element
|
|
5
|
-
* @param {import('./index').CloseToastOptions} options
|
|
6
|
-
* @returns Promise<void>
|
|
7
|
-
*/
|
|
8
|
-
export const closeToast = async (element, options = {}) => {
|
|
9
|
-
options = {
|
|
10
|
-
hiddenClass: 'out',
|
|
11
|
-
heightProperty: '--x-toast-block-size',
|
|
12
|
-
...options
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const toaster = element.parentElement
|
|
16
|
-
|
|
17
|
-
element.style.setProperty(options.heightProperty, `${element.offsetHeight}px`)
|
|
18
|
-
|
|
19
|
-
await nextRepaint()
|
|
20
|
-
|
|
21
|
-
element.classList.add(options.hiddenClass)
|
|
22
|
-
|
|
23
|
-
await animationsFinished(element)
|
|
24
|
-
|
|
25
|
-
element.remove()
|
|
26
|
-
|
|
27
|
-
if (toaster.children.length < 1) toaster.remove()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param {HTMLElement} element
|
|
32
|
-
* @param {import('./').ShowToastOptions} options
|
|
33
|
-
* @returns Promise<void>
|
|
34
|
-
*/
|
|
35
|
-
export const showToast = async (element, options = {}) => {
|
|
36
|
-
options = {
|
|
37
|
-
visibleClass: 'in',
|
|
38
|
-
autoHide: null,
|
|
39
|
-
heightProperty: '--x-toast-block-size',
|
|
40
|
-
close: {},
|
|
41
|
-
...options
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
element.style.setProperty(options.heightProperty, `${element.offsetHeight}px`)
|
|
45
|
-
element.style.height = '0'
|
|
46
|
-
|
|
47
|
-
await animationsFinished(element)
|
|
48
|
-
|
|
49
|
-
element.style.height = ''
|
|
50
|
-
element.classList.add(options.visibleClass)
|
|
51
|
-
|
|
52
|
-
if (options.autoHide) {
|
|
53
|
-
setTimeout(() => closeToast(element, options.close), options.autoHide * ((element.parentElement.children.length + 1) / 2))
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @param {HTMLElement} element
|
|
59
|
-
* @param {import('./').InsertToasterOptions} options
|
|
60
|
-
* @returns Promise<void>
|
|
61
|
-
*/
|
|
62
|
-
export const insertToaster = async (element, options = {}) => {
|
|
63
|
-
options = {
|
|
64
|
-
classes: '',
|
|
65
|
-
...options
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (!document.querySelector('.x-toaster')) {
|
|
69
|
-
element.insertAdjacentHTML('beforeend', `<ol class="x-toaster ${options.classes}"></ol>`)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @param {HTMLElement} element
|
|
75
|
-
* @param {import('./').InsertToastOptions} options
|
|
76
|
-
* @returns Promise<void>
|
|
77
|
-
*/
|
|
78
|
-
export const insertToast = async (element, options = {}) => {
|
|
79
|
-
options = {
|
|
80
|
-
classes: '',
|
|
81
|
-
title: '',
|
|
82
|
-
text: '',
|
|
83
|
-
start: '',
|
|
84
|
-
end: '',
|
|
85
|
-
show: {},
|
|
86
|
-
...options
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
element.insertAdjacentHTML('beforeend', `
|
|
90
|
-
<li class="x-toast ${options.classes}" role="status" aria-live="assertive" aria-atomic="true">
|
|
91
|
-
<div class="x-toast-content">
|
|
92
|
-
${options.start}
|
|
93
|
-
<div class="flex-col">
|
|
94
|
-
<div class="x-title">${options.title}</div>
|
|
95
|
-
<div class="x-text">${options.text}</div>
|
|
96
|
-
</div>
|
|
97
|
-
${options.end}
|
|
98
|
-
</div>
|
|
99
|
-
</li>
|
|
100
|
-
`)
|
|
101
|
-
|
|
102
|
-
await showToast(element.children[element.children.length - 1], options.show)
|
|
103
|
-
}
|
|
1
|
+
import { closeToast } from '../toast/index.js'
|
|
104
2
|
|
|
105
3
|
/**
|
|
106
4
|
* @param {HTMLElement} element
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
--x-tooltip-color: var(--color-main-foreground);
|
|
4
4
|
--x-tooltip-border-radius: var(--radius-md);
|
|
5
5
|
--x-tooltip-font-size: var(--font-size-sm);
|
|
6
|
-
--x-tooltip-padding-block: var(--spacing-
|
|
7
|
-
--x-tooltip-padding-inline: var(--spacing-
|
|
8
|
-
--x-tooltip-margin-block: var(--spacing-
|
|
9
|
-
--x-tooltip-margin-inline: var(--spacing-
|
|
6
|
+
--x-tooltip-padding-block: var(--spacing-1);
|
|
7
|
+
--x-tooltip-padding-inline: var(--spacing-2);
|
|
8
|
+
--x-tooltip-margin-block: var(--spacing-1);
|
|
9
|
+
--x-tooltip-margin-inline: var(--spacing-1);
|
|
10
10
|
--x-tooltip-scale-x: 0.75;
|
|
11
11
|
--x-tooltip-scale-y: 0.75;
|
|
12
12
|
}
|
package/src/main.css
CHANGED
package/src/tailwind.css
CHANGED
package/src/test.css
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import "theme/index.css";
|
|
2
|
+
@import "../tailwindcss/base/defaults.css";
|
|
3
|
+
@import "tailwindcss/base.css";
|
|
4
|
+
@import "base/index.css";
|
|
5
|
+
@import "components/index.css" layer(components);
|
|
6
|
+
@import "utilities/index.css" layer(components);
|
|
7
|
+
@import "tailwindcss/components.css";
|
|
8
|
+
@import "tailwindcss/utilities.css";
|
|
9
|
+
@import "tailwindcss/variants.css";
|
|
@@ -2,23 +2,39 @@
|
|
|
2
2
|
--default-font-family: ui-sans-serif, system-ui, -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
3
3
|
--font-family-primary: var(--default-font-family);
|
|
4
4
|
--font-family-secondary: var(--default-font-family);
|
|
5
|
+
--font-weight-black: 900;
|
|
6
|
+
--font-weight-extrabold: 800;
|
|
5
7
|
--font-weight-bold: 700;
|
|
6
8
|
--font-weight-semibold: 600;
|
|
7
9
|
--font-weight-medium: 500;
|
|
8
10
|
--font-weight-normal: 400;
|
|
9
11
|
--font-weight-light: 300;
|
|
10
|
-
--font-weight-
|
|
12
|
+
--font-weight-extralight: 200;
|
|
13
|
+
--font-weight-thin: 100;
|
|
11
14
|
--font-size-xs: 0.75rem;
|
|
15
|
+
--font-size-xs--line-height: 1rem;
|
|
12
16
|
--font-size-sm: 0.875rem;
|
|
17
|
+
--font-size-sm--line-height: 1.25rem;
|
|
13
18
|
--font-size-base: 1rem;
|
|
19
|
+
--font-size-base--line-height: 1.5rem;
|
|
14
20
|
--font-size-lg: 1.125rem;
|
|
21
|
+
--font-size-lg--line-height: 1.75rem;
|
|
15
22
|
--font-size-xl: 1.25rem;
|
|
23
|
+
--font-size-xl--line-height: 1.75rem;
|
|
16
24
|
--font-size-2xl: 1.5rem;
|
|
25
|
+
--font-size-2xl--line-height: 2rem;
|
|
17
26
|
--font-size-3xl: 1.875rem;
|
|
27
|
+
--font-size-3xl--line-height: 2.25rem;
|
|
18
28
|
--font-size-4xl: 2.25rem;
|
|
29
|
+
--font-size-4xl--line-height: 2.5rem;
|
|
19
30
|
--font-size-5xl: 3rem;
|
|
31
|
+
--font-size-5xl--line-height: 1;
|
|
20
32
|
--font-size-6xl: 3.75rem;
|
|
33
|
+
--font-size-6xl--line-height: 1;
|
|
21
34
|
--font-size-7xl: 4.5rem;
|
|
35
|
+
--font-size-7xl--line-height: 1;
|
|
22
36
|
--font-size-8xl: 6rem;
|
|
37
|
+
--font-size-8xl--line-height: 1;
|
|
23
38
|
--font-size-9xl: 8rem;
|
|
39
|
+
--font-size-9xl--line-height: 1;
|
|
24
40
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:root, :host {
|
|
2
|
+
--spacing-px: 1px;
|
|
3
|
+
--spacing-0: 0px;
|
|
4
|
+
--spacing-0_5: 0.125rem;
|
|
5
|
+
--spacing-1: 0.25rem;
|
|
6
|
+
--spacing-1_5: 0.375rem;
|
|
7
|
+
--spacing-2: 0.5rem;
|
|
8
|
+
--spacing-2_5: 0.625rem;
|
|
9
|
+
--spacing-3: 0.75rem;
|
|
10
|
+
--spacing-3_5: 0.875rem;
|
|
11
|
+
--spacing-4: 1rem;
|
|
12
|
+
--spacing-5: 1.25rem;
|
|
13
|
+
--spacing-6: 1.5rem;
|
|
14
|
+
--spacing-7: 1.75rem;
|
|
15
|
+
--spacing-8: 2rem;
|
|
16
|
+
--spacing-9: 2.25rem;
|
|
17
|
+
--spacing-10: 2.5rem;
|
|
18
|
+
--spacing-11: 2.75rem;
|
|
19
|
+
--spacing-12: 3rem;
|
|
20
|
+
--spacing-14: 3.5rem;
|
|
21
|
+
--spacing-16: 4rem;
|
|
22
|
+
--spacing-20: 5rem;
|
|
23
|
+
--spacing-24: 6rem;
|
|
24
|
+
--spacing-28: 7rem;
|
|
25
|
+
--spacing-32: 8rem;
|
|
26
|
+
--spacing-36: 9rem;
|
|
27
|
+
--spacing-40: 10rem;
|
|
28
|
+
--spacing-44: 11rem;
|
|
29
|
+
--spacing-48: 12rem;
|
|
30
|
+
--spacing-52: 13rem;
|
|
31
|
+
--spacing-56: 14rem;
|
|
32
|
+
--spacing-60: 15rem;
|
|
33
|
+
--spacing-64: 16rem;
|
|
34
|
+
--spacing-72: 18rem;
|
|
35
|
+
--spacing-80: 20rem;
|
|
36
|
+
--spacing-96: 24rem;
|
|
37
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:root, :host {
|
|
2
2
|
--default-transition-duration: 150ms;
|
|
3
|
-
--default-transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, outline-color, outline-offset, visibility;
|
|
3
|
+
--default-transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, outline-color, outline-offset, visibility, display, overlay;
|
|
4
4
|
--transition-timing-function-linear: linear;
|
|
5
5
|
--transition-timing-function-in: cubic-bezier(0.4, 0, 1, 1);
|
|
6
6
|
--transition-timing-function-out: cubic-bezier(0, 0, 0.2, 1);
|
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
--transition-transform: transform var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
13
13
|
--transition-border: border-color var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
14
14
|
--transition-shadow: box-shadow var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
15
|
+
--transition-display: display var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
16
|
+
--transition-overlay: overlay var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
17
|
+
--view-transition-main-duration: var(--default-transition-duration);
|
|
15
18
|
|
|
16
19
|
@media (prefers-reduced-motion) {
|
|
17
20
|
--default-transition-duration: 0;
|
|
21
|
+
--view-transition-main-duration: 0;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.grid-cols-container {
|
|
2
2
|
grid-template-columns:
|
|
3
3
|
[container-full-start] minmax(var(--container-padding), 1fr)
|
|
4
|
-
[container-
|
|
4
|
+
[container-breakout-start] minmax(0, calc((var(--container-breakout-width) - var(--container-width)) / 2))
|
|
5
5
|
[container-start] min(100% - (var(--container-padding) * 2), var(--container-width)) [container-end]
|
|
6
|
-
minmax(0, calc((var(--container-
|
|
6
|
+
minmax(0, calc((var(--container-breakout-width) - var(--container-width)) / 2)) [container-breakout-end]
|
|
7
7
|
minmax(var(--container-padding), 1fr) [container-full-end];
|
|
8
8
|
|
|
9
9
|
& > :where(*) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
:root, :host {
|
|
2
2
|
--container: min(100% - (var(--container-padding) * 2), var(--container-width));
|
|
3
|
-
--container-
|
|
3
|
+
--container-breakout: min(100% - (var(--container-padding) * 2), var(--container-breakout-width));
|
|
4
4
|
--container-width: 80rem;
|
|
5
|
-
--container-
|
|
5
|
+
--container-breakout-width: calc(var(--container-width) + 10rem);
|
|
6
6
|
--container-padding: 5vw;
|
|
7
7
|
--container-padding-calc: max(calc(50vw - (var(--container-width) / 2)), var(--container-padding));
|
|
8
8
|
}
|
package/src/utilities/index.css
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.ripple {
|
|
2
|
+
inline-size: var(--ripple-size, 2rem);
|
|
3
|
+
block-size: var(--ripple-size, 2rem);
|
|
4
|
+
background-color:
|
|
5
|
+
color-mix(
|
|
6
|
+
in var(--ripple-background-color-space, srgb),
|
|
7
|
+
var(--ripple-background-color, currentColor) var(--ripple-background-color-opacity, 40%),
|
|
8
|
+
var(--ripple-background-color-mix, transparent)
|
|
9
|
+
);
|
|
10
|
+
animation-duration: var(--ripple-animation-duration, 1s);
|
|
11
|
+
position: absolute;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
transform: scale(0);
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
block-size: var(--ripple-size, 2rem);
|
|
4
|
-
background-color:
|
|
5
|
-
color-mix(
|
|
6
|
-
in var(--ripple-background-color-space, srgb),
|
|
7
|
-
var(--ripple-background-color, currentColor) var(--ripple-background-color-opacity, 40%),
|
|
8
|
-
var(--ripple-background-color-mix, transparent)
|
|
9
|
-
);
|
|
10
|
-
animation-duration: var(--ripple-animation-duration, 1s);
|
|
11
|
-
position: absolute;
|
|
12
|
-
border-radius: 50%;
|
|
13
|
-
transform: scale(0);
|
|
14
|
-
pointer-events: none;
|
|
15
|
-
}
|
|
1
|
+
@import "keyframes/default.css";
|
|
2
|
+
@import "default.css";
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ShowRippleEvent {
|
|
2
|
+
currentTarget?: EventTarget | HTMLElement;
|
|
3
|
+
offsetX: number;
|
|
4
|
+
offsetY: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function showRipple(event: MouseEvent | ShowRippleEvent, rippleElement?: HTMLElement): void
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shows a ripple effect.
|
|
3
|
-
* @param {MouseEvent
|
|
4
|
-
* @param {HTMLElement}
|
|
3
|
+
* @param {MouseEvent | import("./").ShowRippleEvent} options
|
|
4
|
+
* @param {HTMLElement} rippleElement
|
|
5
5
|
* @returns void
|
|
6
6
|
*/
|
|
7
|
-
export const showRipple = ({ currentTarget, offsetX, offsetY },
|
|
8
|
-
if (!
|
|
9
|
-
currentTarget.insertAdjacentHTML('beforeend',
|
|
10
|
-
|
|
7
|
+
export const showRipple = ({ currentTarget, offsetX, offsetY }, rippleElement = currentTarget.querySelector('.ripple')) => {
|
|
8
|
+
if (!rippleElement) {
|
|
9
|
+
currentTarget.insertAdjacentHTML('beforeend', '<div class="ripple"></div>')
|
|
10
|
+
rippleElement = currentTarget.querySelector('.ripple')
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
rippleElement.classList.remove('animation-ripple')
|
|
14
14
|
|
|
15
|
-
if (
|
|
15
|
+
if (rippleElement.clientWidth === 0 && rippleElement.clientHeight === 0) {
|
|
16
16
|
const d = Math.max(currentTarget.offsetWidth, currentTarget.offsetHeight)
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
rippleElement.style.width = d + 'px'
|
|
19
|
+
rippleElement.style.height = d + 'px'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
rippleElement.style.top = offsetY - (rippleElement.clientHeight / 2) + 'px'
|
|
23
|
+
rippleElement.style.left = offsetX - (rippleElement.clientWidth / 2) + 'px'
|
|
24
|
+
rippleElement.classList.add('animation-ripple')
|
|
25
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.spinner {
|
|
2
|
+
inline-size: var(--spinner-inline-size, 1rem);
|
|
3
|
+
block-size: var(--spinner-block-size, 1rem);
|
|
4
|
+
border-radius: 50%;
|
|
5
|
+
|
|
6
|
+
border-width: var(--spinner-border-width, 2px);
|
|
7
|
+
border-color:
|
|
8
|
+
color-mix(in var(--default-color-space), currentColor var(--spinner-border-block-start-color-opacity, 100%), transparent)
|
|
9
|
+
color-mix(in var(--default-color-space), currentColor var(--spinner-border-inline-end-color-opacity, 100%), transparent)
|
|
10
|
+
color-mix(in var(--default-color-space), currentColor var(--spinner-border-block-end-color-opacity, 100%), transparent)
|
|
11
|
+
color-mix(in var(--default-color-space), currentColor var(--spinner-border-inline-start-color-opacity, 0%), transparent);
|
|
12
|
+
border-style: solid;
|
|
13
|
+
animation: linear var(--spinner-animation-duration, 1s) infinite spin;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.spinner-ring {
|
|
2
|
+
--spinner-animation-duration: 2s;
|
|
3
|
+
|
|
4
|
+
transform-origin: center;
|
|
5
|
+
border: 0;
|
|
6
|
+
|
|
7
|
+
circle {
|
|
8
|
+
stroke-dasharray: 1, 200;
|
|
9
|
+
stroke-dashoffset: 0;
|
|
10
|
+
stroke-linecap: round;
|
|
11
|
+
animation: spinner-ring-stretch calc(var(--spinner-animation-duration) * 0.75) ease-in-out infinite;
|
|
12
|
+
fill: none;
|
|
13
|
+
stroke: currentColor;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/tailwind.config.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import winduum from './plugin/index.js'
|
|
2
2
|
import containerQueries from '@tailwindcss/container-queries'
|
|
3
|
-
import animate from 'tailwindcss-animate'
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
darkMode: 'class',
|
|
7
6
|
content: [
|
|
8
7
|
'./src/**/*.{js,html}',
|
|
9
|
-
'./playground/**/*.{js,html,vue}'
|
|
8
|
+
process.argv.includes('vite.config.prod.js') ? './playground/tailwind.html' : './playground/**/*.{js,html,vue}'
|
|
10
9
|
],
|
|
11
10
|
plugins: [
|
|
12
11
|
winduum({
|
|
@@ -14,7 +13,9 @@ export default {
|
|
|
14
13
|
rgb: false
|
|
15
14
|
}
|
|
16
15
|
}),
|
|
17
|
-
containerQueries
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
containerQueries
|
|
17
|
+
],
|
|
18
|
+
future: {
|
|
19
|
+
hoverOnlyWhenSupported: true
|
|
20
|
+
}
|
|
20
21
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
--breakpoint-xs: 22.5rem;
|
|
3
|
+
--breakpoint-sm: 26rem;
|
|
4
|
+
--breakpoint-md: 46.5rem;
|
|
5
|
+
--breakpoint-lg: 60rem;
|
|
6
|
+
--breakpoint-xl: 76rem;
|
|
7
|
+
--breakpoint-2xl: 82rem;
|
|
8
|
+
--breakpoint-3xl: 88rem;
|
|
9
|
+
--breakpoint-4xl: 100rem;
|
|
10
|
+
--breakpoint-xxl: 126rem;
|
|
11
|
+
--breakpoint-2xxl: 158rem;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
--font-family-primary: var(--default-font-family);
|
|
3
|
+
--font-family-secondary: var(--default-font-family);
|
|
4
|
+
--font-weight-black: 900;
|
|
5
|
+
--font-weight-extrabold: 800;
|
|
6
|
+
--font-weight-bold: 700;
|
|
7
|
+
--font-weight-semibold: 600;
|
|
8
|
+
--font-weight-medium: 500;
|
|
9
|
+
--font-weight-normal: 400;
|
|
10
|
+
--font-weight-light: 300;
|
|
11
|
+
--font-weight-extralight: 200;
|
|
12
|
+
--font-weight-thin: 100;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
--mask-check: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg>') no-repeat 50% 50% / contain;
|
|
3
|
+
--mask-radio: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 160c-53.019 0-96 42.981-96 96v0c0 53.019 42.981 96 96 96v0c53.019 0 96-42.981 96-96v0c0-53.019-42.981-96-96-96z"></path></svg>') no-repeat 50% 50% / contain;
|
|
4
|
+
--mask-angle-down: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor"><path d="M10.998 15.467c.491.71 1.513.71 2.004 0l3.767-5.453c.581-.843 0-2.013-1.002-2.014H8.234C7.232 8 6.65 9.17 7.231 10.014z" /></svg>') no-repeat 50% 50% / contain;
|
|
5
|
+
--mask-chevron-right: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" /></svg>') no-repeat 50% 50% / contain;
|
|
6
|
+
--mask-indeterminate: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" stroke-width="2.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14" /></svg>') no-repeat 50% 50% / contain;
|
|
7
|
+
--mask-star: url('data:image/svg+xml, <svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>') no-repeat 50% 50% / contain;
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
--default-transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter, outline-color, outline-offset, visibility, display, overlay;
|
|
3
|
+
--transition-all: all var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
4
|
+
--transition-color: color var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
5
|
+
--transition-background: background var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
6
|
+
--transition-opacity: opacity var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
7
|
+
--transition-transform: transform var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
8
|
+
--transition-border: border-color var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
9
|
+
--transition-shadow: box-shadow var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
10
|
+
--transition-display: display var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
11
|
+
--transition-overlay: overlay var(--default-transition-duration) var(--transition-timing-function-in-out);
|
|
12
|
+
--view-transition-main-duration: var(--default-transition-duration);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (prefers-reduced-motion) {
|
|
16
|
+
:root, :host {
|
|
17
|
+
--default-transition-duration: 0;
|
|
18
|
+
--view-transition-main-duration: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|