winduum 3.0.0-next.1 → 3.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.
- package/dist/main.css +1 -1
- package/dist/tailwind.css +2 -1
- package/package.json +28 -19
- package/src/base/defaults.css +3 -0
- package/src/base/keyframes.css +32 -0
- package/src/common.d.ts +4 -0
- package/src/components/carousel/content.css +1 -0
- package/src/components/carousel/index.d.ts +14 -35
- package/src/components/carousel/index.js +75 -194
- package/src/components/check/props/default.css +1 -1
- package/src/components/control/props/select-picker.css +4 -4
- package/src/components/control/props/select.css +2 -2
- package/src/components/control/tel-country-code.css +24 -0
- package/src/components/details/index.d.ts +5 -0
- package/src/components/details/index.js +13 -0
- package/src/components/details/readme.md +2 -5
- package/src/components/dialog/content.css +0 -1
- package/src/components/dialog/drawer.css +20 -0
- package/src/components/dialog/index.css +1 -0
- package/src/components/dialog/index.js +4 -0
- package/src/components/drawer/content.css +2 -1
- package/src/components/drawer/default.css +13 -31
- package/src/components/drawer/index.css +3 -0
- package/src/components/drawer/index.d.ts +8 -15
- package/src/components/drawer/index.js +67 -50
- package/src/components/drawer/keyframes/default.css +9 -0
- package/src/components/drawer/noscript.css +32 -0
- package/src/components/drawer/nosnap.css +32 -0
- package/src/components/drawer/props/content.css +2 -2
- package/src/components/drawer/props/default.css +6 -0
- package/src/components/drawer/scroller.css +32 -0
- package/src/components/form/index.d.ts +5 -12
- package/src/components/form/index.js +35 -70
- package/src/components/heading/lg.css +1 -1
- package/src/components/heading/props/default.css +1 -1
- package/src/components/heading/sm.css +1 -1
- package/src/components/label/props/default.css +3 -2
- package/src/components/popover/content.css +2 -0
- package/src/components/popover/default.css +1 -1
- package/src/components/popover/index.css +1 -0
- package/src/components/popover/tooltip.css +11 -0
- package/src/components/tabs/index.d.ts +2 -2
- package/src/components/text/content.css +241 -0
- package/src/components/text/default.css +0 -238
- package/src/components/text/index.css +2 -0
- package/src/components/text/props/content.css +9 -0
- package/src/components/text/props/default.css +1 -7
- package/src/components/toast/default.css +6 -0
- package/src/components/toast/index.js +2 -1
- package/src/components/toaster/index.d.ts +1 -0
- package/src/components/toaster/index.js +18 -0
- package/src/polyfill.js +13 -0
- package/src/polyfills/timelineTrigger.js +54 -0
- package/src/supports.js +24 -0
- package/src/utilities/container/props/default.css +3 -3
- package/tailwindcss/theme/config/radius.css +9 -1
- package/tailwindcss/utilities/animation-timeline.css +51 -0
- package/tailwindcss/utilities/animation-trigger-fallback.css +18 -0
- package/tailwindcss/utilities/animation-trigger.css +33 -0
- package/tailwindcss/utilities/animation.css +88 -0
- package/tailwindcss/utilities/grid-area.css +7 -0
- package/tailwindcss/utilities/index.css +3 -0
- package/tailwindcss/utilities/position.css +24 -0
- package/tailwindcss/variants/index.css +2 -1
- package/tailwindcss/variants/scroll-state.css +245 -0
- package/types/index.d.ts +13 -12
- package/types/index.d.ts.map +21 -3
|
@@ -1,85 +1,102 @@
|
|
|
1
|
+
import { supportsScrollInitialTarget } from '../../supports.js'
|
|
1
2
|
import { nextRepaint } from '../../common.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
6
|
-
* @param {'top' | 'left'} direction
|
|
7
|
-
* @returns void
|
|
5
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
6
|
+
* @returns boolean
|
|
8
7
|
*/
|
|
9
|
-
export const
|
|
10
|
-
|
|
8
|
+
export const isVerticalDrawer = (placement) => {
|
|
9
|
+
return ['top', 'bottom'].includes(placement)
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* @param {HTMLElement | Element} element
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
14
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
15
|
+
* @param {boolean} reverse
|
|
16
|
+
* @param {'auto' | 'instant'} behavior
|
|
17
17
|
* @returns void
|
|
18
18
|
*/
|
|
19
|
-
export const
|
|
20
|
-
|
|
19
|
+
export const scrollDrawer = (element, placement, reverse = false, behavior = 'auto') => {
|
|
20
|
+
const [direction, distance, closedDistance] = drawerProperties(element, placement)
|
|
21
|
+
|
|
22
|
+
element.scroll({ [direction]: reverse ? closedDistance : distance, behavior })
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* @param {HTMLElement | Element} element
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {'top' | 'left'} direction
|
|
27
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
27
28
|
* @returns void
|
|
28
29
|
*/
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
export const showDrawer = async (element, placement) => {
|
|
31
|
+
if (!supportsScrollInitialTarget) {
|
|
32
|
+
scrollDrawer(element, placement, true, 'instant')
|
|
33
|
+
await nextRepaint()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
scrollDrawer(element, placement)
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/**
|
|
35
40
|
* @param {HTMLElement | Element} element
|
|
36
|
-
* @param {'
|
|
37
|
-
* @param {string} snapClass
|
|
41
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
38
42
|
* @returns void
|
|
39
43
|
*/
|
|
40
|
-
export const
|
|
41
|
-
element
|
|
42
|
-
element.inert = state === 'close'
|
|
43
|
-
element.dispatchEvent(new CustomEvent(`x-drawer:${state}`))
|
|
44
|
+
export const closeDrawer = (element, placement) => {
|
|
45
|
+
scrollDrawer(element, placement, true)
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
49
|
-
* @
|
|
49
|
+
* @param {HTMLElement | Element} element
|
|
50
|
+
* @param {HTMLElement | Element} contentElement
|
|
51
|
+
* @param {AbortSignal} signal
|
|
52
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
53
|
+
* @returns void
|
|
50
54
|
*/
|
|
51
|
-
export const
|
|
52
|
-
|
|
55
|
+
export const drawerEvents = (element, contentElement, placement, signal) => {
|
|
56
|
+
element.addEventListener('cancel', (event) => {
|
|
57
|
+
const scroller = element.firstElementChild
|
|
58
|
+
|
|
59
|
+
if (scroller.scrollHeight > 0 || scroller.scrollWidth > 0) event.preventDefault()
|
|
60
|
+
|
|
61
|
+
closeDrawer(scroller, placement)
|
|
62
|
+
}, { signal })
|
|
63
|
+
|
|
64
|
+
element.addEventListener('click', ({ target }) => {
|
|
65
|
+
if (!contentElement.contains(target) && !contentElement.isEqualNode(target))
|
|
66
|
+
closeDrawer(element.firstElementChild, placement)
|
|
67
|
+
}, { signal })
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
/**
|
|
56
71
|
* @param {HTMLDialogElement | Element} element
|
|
57
|
-
* @param {
|
|
58
|
-
* @returns
|
|
72
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
73
|
+
* @returns IntersectionObserver
|
|
59
74
|
*/
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
opacityProperty: '--background-color-opacity',
|
|
64
|
-
opacityRatio: 1,
|
|
65
|
-
scrollOpen: 0,
|
|
66
|
-
scrollClose: element.scrollWidth - element.clientWidth,
|
|
67
|
-
scrollSize: element.scrollWidth - element.clientWidth,
|
|
68
|
-
scrollDirection: element.scrollLeft,
|
|
69
|
-
...options,
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
element.style.setProperty(
|
|
73
|
-
options.opacityProperty,
|
|
74
|
-
`${Math.min(Math.abs((options.scrollDirection / options.scrollSize) - options.opacityRatio), 1)}`,
|
|
75
|
+
export const drawerObserver = (element, placement) => {
|
|
76
|
+
const visibleThreshold = 1 / (
|
|
77
|
+
isVerticalDrawer(placement) ? window.innerHeight : window.innerWidth
|
|
75
78
|
)
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
+
return new IntersectionObserver((entries) => {
|
|
81
|
+
if (entries.at(-1).intersectionRatio < visibleThreshold) element.close()
|
|
82
|
+
}, {
|
|
83
|
+
root: element,
|
|
84
|
+
threshold: [visibleThreshold, 1],
|
|
85
|
+
})
|
|
86
|
+
}
|
|
80
87
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @param {HTMLElement | Element} element
|
|
90
|
+
* @param {'left' | 'right' | 'top' | 'bottom'} placement
|
|
91
|
+
* @returns {['top' | 'left', number, number]}
|
|
92
|
+
*/
|
|
93
|
+
export const drawerProperties = (element, placement) => {
|
|
94
|
+
const [openedDistance, closedDistance] = {
|
|
95
|
+
left: [0, element.offsetWidth],
|
|
96
|
+
right: [element.offsetWidth, 0],
|
|
97
|
+
top: [0, element.offsetHeight],
|
|
98
|
+
bottom: [element.offsetHeight, 0],
|
|
99
|
+
}[placement]
|
|
100
|
+
|
|
101
|
+
return [isVerticalDrawer(placement) ? 'top' : 'left', openedDistance, closedDistance]
|
|
85
102
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.x-drawer {
|
|
2
|
+
@media (scripting: none) {
|
|
3
|
+
--x-drawer-backdrop-opacity: 1;
|
|
4
|
+
|
|
5
|
+
width: fit-content;
|
|
6
|
+
height: fit-content;
|
|
7
|
+
transition-property: var(--default-transition-property);
|
|
8
|
+
transition-timing-function: var(--ease-in-out);
|
|
9
|
+
transition-duration: var(--default-transition-duration);
|
|
10
|
+
transition-behavior: allow-discrete;
|
|
11
|
+
|
|
12
|
+
&::backdrop {
|
|
13
|
+
transition: inherit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:not([open]) {
|
|
17
|
+
&::backdrop {
|
|
18
|
+
opacity: 0%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@starting-style {
|
|
23
|
+
&[open] {
|
|
24
|
+
opacity: 0%;
|
|
25
|
+
|
|
26
|
+
&::backdrop {
|
|
27
|
+
opacity: 0%;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.x-drawer {
|
|
2
|
+
&:where(.no-snap) {
|
|
3
|
+
--x-drawer-backdrop-opacity: 1;
|
|
4
|
+
|
|
5
|
+
width: fit-content;
|
|
6
|
+
height: fit-content;
|
|
7
|
+
transition-property: var(--default-transition-property);
|
|
8
|
+
transition-timing-function: var(--ease-in-out);
|
|
9
|
+
transition-duration: var(--default-transition-duration);
|
|
10
|
+
transition-behavior: allow-discrete;
|
|
11
|
+
|
|
12
|
+
&::backdrop {
|
|
13
|
+
transition: inherit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:not([open]) {
|
|
17
|
+
&::backdrop {
|
|
18
|
+
opacity: 0%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@starting-style {
|
|
23
|
+
&[open] {
|
|
24
|
+
opacity: 0%;
|
|
25
|
+
|
|
26
|
+
&::backdrop {
|
|
27
|
+
opacity: 0%;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
--x-drawer-content-background-color: var(--color-body-primary);
|
|
4
4
|
--x-drawer-content-padding-block: 2rem;
|
|
5
5
|
--x-drawer-content-padding-inline: 1.5rem;
|
|
6
|
-
--x-drawer-content-inline-size:
|
|
7
|
-
--x-drawer-content-block-size:
|
|
6
|
+
--x-drawer-content-inline-size: 50dvw;
|
|
7
|
+
--x-drawer-content-block-size: 100dvh;
|
|
8
8
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.x-drawer-scroller {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: inherit;
|
|
4
|
+
height: inherit;
|
|
5
|
+
overflow: auto clip;
|
|
6
|
+
scrollbar-width: none;
|
|
7
|
+
scroll-behavior: smooth;
|
|
8
|
+
-webkit-overflow-scrolling: touch;
|
|
9
|
+
overscroll-behavior: none;
|
|
10
|
+
scroll-snap-type: x mandatory;
|
|
11
|
+
scroll-timeline: --x-drawer-backdrop x;
|
|
12
|
+
|
|
13
|
+
&::-webkit-scrollbar {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&::after {
|
|
18
|
+
content: "";
|
|
19
|
+
min-inline-size: 100dvw;
|
|
20
|
+
scroll-snap-align: end;
|
|
21
|
+
scroll-initial-target: nearest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:where(.snap-y) {
|
|
25
|
+
overflow: clip auto;
|
|
26
|
+
scroll-timeline: --x-drawer-backdrop y;
|
|
27
|
+
|
|
28
|
+
&::after {
|
|
29
|
+
min-block-size: 100dvh;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface ValidateFormOptions {
|
|
2
|
-
|
|
2
|
+
validateSelector?: string
|
|
3
3
|
validateOptions?: ValidateFieldOptions
|
|
4
4
|
validateField?: typeof validateField
|
|
5
5
|
scrollOptions?: ScrollIntoViewOptions
|
|
@@ -7,23 +7,16 @@ export interface ValidateFormOptions {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface ValidateFieldOptions {
|
|
10
|
-
validate?: boolean
|
|
11
10
|
validationMessage?: string
|
|
12
11
|
selector?: string
|
|
13
|
-
ignoreMatch?: RegExp
|
|
14
12
|
validitySelector?: string
|
|
15
|
-
infoParentSelector?: string
|
|
16
|
-
infoSelector?: string
|
|
17
13
|
infoContent?: string
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
validAttribute?: string
|
|
14
|
+
iconParentSelector?: string
|
|
15
|
+
iconSelector?: string
|
|
16
|
+
iconContent?: string
|
|
22
17
|
validIcon?: string | null
|
|
23
|
-
invalidAttribute?: string
|
|
24
18
|
invalidIcon?: string
|
|
25
|
-
activeAttribute?: string
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
export function validateForm(event: Event | SubmitEvent, options?: ValidateFormOptions): void
|
|
29
|
-
export function validateField(element: HTMLElement
|
|
22
|
+
export function validateField(element: HTMLElement, options?: ValidateFieldOptions): void
|
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {
|
|
2
|
+
* @param {SubmitEvent & { target: HTMLFormElement }} event
|
|
3
3
|
* @param {import("./").ValidateFormOptions} options
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
6
|
export const validateForm = (event, options = {}) => {
|
|
7
7
|
options = {
|
|
8
|
-
|
|
9
|
-
validateOptions: {
|
|
10
|
-
validate: true,
|
|
11
|
-
},
|
|
8
|
+
validateSelector: '.x-field',
|
|
9
|
+
validateOptions: {},
|
|
12
10
|
validateField,
|
|
13
11
|
submitterLoadingAttribute: 'data-loading',
|
|
14
12
|
scrollOptions: { behavior: 'smooth', block: 'center' },
|
|
15
13
|
...options,
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
event.stopImmediatePropagation()
|
|
16
|
+
if (!event.target.checkValidity()) {
|
|
17
|
+
event.preventDefault()
|
|
18
|
+
event.stopImmediatePropagation()
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
20
|
+
event.target.querySelector(':invalid').scrollIntoView(options.scrollOptions)
|
|
21
|
+
event.target.querySelector(':invalid').focus()
|
|
22
|
+
}
|
|
23
|
+
else if (options.submitterLoadingAttribute) {
|
|
24
|
+
event?.submitter?.setAttribute(options.submitterLoadingAttribute, '')
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
event.target.querySelectorAll(options.
|
|
27
|
+
event.target.querySelectorAll(options.validateSelector).forEach((element) => {
|
|
32
28
|
options.validateField(element, options.validateOptions)
|
|
33
29
|
})
|
|
34
30
|
}
|
|
@@ -40,73 +36,42 @@ export const validateForm = (event, options = {}) => {
|
|
|
40
36
|
*/
|
|
41
37
|
export const validateField = (element, options = {}) => {
|
|
42
38
|
options = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
infoContent: '<div class="x-info text-error validity"></div>',
|
|
50
|
-
endParentSelector: '.x-control',
|
|
51
|
-
endSelector: '.ms-auto',
|
|
52
|
-
endContent: '<div class="ms-auto"></div>',
|
|
53
|
-
validAttribute: 'data-valid',
|
|
39
|
+
selector: ':is(input:not([type="hidden"]), textarea, select):not([readonly], [data-novalidate])',
|
|
40
|
+
validitySelector: '[data-validity]',
|
|
41
|
+
infoContent: '<div class="x-info text-error" data-validity></div>',
|
|
42
|
+
iconParentSelector: '.x-control',
|
|
43
|
+
iconSelector: '.ms-auto',
|
|
44
|
+
iconContent: '<div class="ms-auto"></div>',
|
|
54
45
|
validIcon: null,
|
|
55
|
-
|
|
56
|
-
invalidIcon: '<svg class="text-error validity" aria-hidden="true"><use href="#icon-exclamation-circle"></use></svg>',
|
|
57
|
-
activeAttribute: 'data-active',
|
|
46
|
+
invalidIcon: '<svg class="text-error" data-validity aria-hidden="true"><use href="#heroicons-outline/exclamation-circle"></use></svg>',
|
|
58
47
|
...options,
|
|
59
48
|
}
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const validationElement = element.querySelector(options.selector)
|
|
64
|
-
const validationMessage = options.validationMessage ?? validationElement.dataset.validationMessage ?? validationElement.validationMessage
|
|
65
|
-
const infoParentElement = validationElement?.closest(options.infoParentSelector)
|
|
66
|
-
const endParentElement = validationElement.closest(options.endParentSelector)
|
|
67
|
-
const infoSelector = options.infoSelector + options.validitySelector
|
|
68
|
-
const endSelector = `${options.endSelector} ${options.validitySelector}`
|
|
69
|
-
|
|
70
|
-
const insertIcon = (icon) => {
|
|
71
|
-
if (!endParentElement || !icon) return
|
|
72
|
-
|
|
73
|
-
if (!element?.querySelector(options.endSelector)) {
|
|
74
|
-
element?.insertAdjacentHTML('beforeend', options.endContent)
|
|
75
|
-
}
|
|
50
|
+
const validationElements = [...element.querySelectorAll(options.selector)]
|
|
76
51
|
|
|
77
|
-
|
|
78
|
-
}
|
|
52
|
+
if (!validationElements.length) return
|
|
79
53
|
|
|
80
|
-
|
|
81
|
-
element.setAttribute(options.activeAttribute, '')
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
element.removeAttribute(options.activeAttribute)
|
|
85
|
-
}
|
|
54
|
+
element.querySelectorAll(options.validitySelector).forEach(el => el.remove())
|
|
86
55
|
|
|
87
|
-
|
|
88
|
-
element?.removeAttribute(options.validAttribute)
|
|
89
|
-
element?.removeAttribute(options.invalidAttribute)
|
|
56
|
+
const invalidElements = validationElements.filter(validationElement => !validationElement.checkValidity())
|
|
90
57
|
|
|
91
|
-
|
|
92
|
-
|
|
58
|
+
validationElements.forEach((validationElement) => {
|
|
59
|
+
const icon = invalidElements.includes(validationElement) ? options.invalidIcon : options.validIcon
|
|
60
|
+
const iconParentElement = validationElement.closest(options.iconParentSelector)
|
|
93
61
|
|
|
94
|
-
if (
|
|
95
|
-
element.setAttribute(options.validAttribute, '')
|
|
62
|
+
if (!iconParentElement || !icon) return
|
|
96
63
|
|
|
97
|
-
|
|
64
|
+
if (!iconParentElement.querySelector(options.iconSelector)) {
|
|
65
|
+
iconParentElement.insertAdjacentHTML('beforeend', options.iconContent)
|
|
98
66
|
}
|
|
99
|
-
else {
|
|
100
|
-
element.setAttribute(options.invalidAttribute, '')
|
|
101
67
|
|
|
102
|
-
|
|
68
|
+
iconParentElement.querySelector(options.iconSelector).insertAdjacentHTML('afterbegin', icon)
|
|
69
|
+
})
|
|
103
70
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
}
|
|
71
|
+
if (!invalidElements.length) return
|
|
72
|
+
|
|
73
|
+
element.insertAdjacentHTML('beforeend', options.infoContent)
|
|
74
|
+
element.lastElementChild.textContent = options.validationMessage ?? invalidElements[0].dataset.validationMessage ?? invalidElements[0].validationMessage
|
|
110
75
|
}
|
|
111
76
|
|
|
112
77
|
export default {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
background-color: var(--x-popover-content-background-color);
|
|
3
3
|
border-radius: var(--x-popover-content-border-radius);
|
|
4
4
|
padding: var(--x-popover-content-padding-block) var(--x-popover-content-padding-inline);
|
|
5
|
+
color: var(--x-popover-content-color);
|
|
6
|
+
font-size: var(--x-popover-font-size);
|
|
5
7
|
transition: inherit;
|
|
6
8
|
will-change: transform;
|
|
7
9
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.x-popover {
|
|
2
|
+
&:is(.tooltip) {
|
|
3
|
+
--x-popover-content-background-color: var(--color-main);
|
|
4
|
+
--x-popover-content-color: var(--color-main-foreground);
|
|
5
|
+
--x-popover-content-border-radius: var(--radius-md);
|
|
6
|
+
--x-popover-content-padding-block: calc(var(--spacing) * 1);
|
|
7
|
+
--x-popover-content-padding-inline: calc(var(--spacing) * 2);
|
|
8
|
+
--x-popover-font-size: var(--text-sm);
|
|
9
|
+
--x-popover-content-starting-scale: 0.75;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface ToggleTabOptions {
|
|
2
|
-
tabElements?: NodeListOf<Element>
|
|
3
|
-
tabPanelElements?: NodeListOf<Element>
|
|
2
|
+
tabElements?: NodeListOf<Element> | Element[]
|
|
3
|
+
tabPanelElements?: NodeListOf<Element> | Element[]
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export function toggleTab(element: HTMLElement | Element, options?: ToggleTabOptions): void
|