winduum 2.2.28 → 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.
Files changed (69) hide show
  1. package/package.json +19 -12
  2. package/src/base/defaults.css +3 -0
  3. package/src/base/reset.css +4 -0
  4. package/src/common.d.ts +4 -0
  5. package/src/common.js +9 -1
  6. package/src/components/carousel/content.css +1 -0
  7. package/src/components/carousel/index.d.ts +14 -35
  8. package/src/components/carousel/index.js +75 -194
  9. package/src/components/check/props/default.css +1 -1
  10. package/src/components/control/props/select-picker.css +4 -4
  11. package/src/components/control/props/select.css +2 -2
  12. package/src/components/control/tel-country-code.css +24 -0
  13. package/src/components/details/default.css +14 -0
  14. package/src/components/details/index.css +1 -0
  15. package/src/components/details/index.d.ts +2 -6
  16. package/src/components/details/index.js +7 -72
  17. package/src/components/details/readme.md +2 -5
  18. package/src/components/dialog/content.css +8 -2
  19. package/src/components/dialog/default.css +16 -2
  20. package/src/components/dialog/drawer.css +20 -0
  21. package/src/components/dialog/index.css +1 -0
  22. package/src/components/dialog/index.js +8 -79
  23. package/src/components/dialog/readme.md +1 -5
  24. package/src/components/drawer/content.css +2 -1
  25. package/src/components/drawer/default.css +13 -31
  26. package/src/components/drawer/index.css +3 -0
  27. package/src/components/drawer/index.d.ts +8 -15
  28. package/src/components/drawer/index.js +67 -50
  29. package/src/components/drawer/keyframes/default.css +9 -0
  30. package/src/components/drawer/noscript.css +32 -0
  31. package/src/components/drawer/nosnap.css +32 -0
  32. package/src/components/drawer/props/content.css +2 -2
  33. package/src/components/drawer/props/default.css +6 -0
  34. package/src/components/drawer/scroller.css +32 -0
  35. package/src/components/form/index.d.ts +5 -12
  36. package/src/components/form/index.js +35 -70
  37. package/src/components/heading/lg.css +1 -1
  38. package/src/components/heading/props/default.css +1 -1
  39. package/src/components/heading/sm.css +1 -1
  40. package/src/components/index.css +1 -0
  41. package/src/components/label/props/default.css +3 -2
  42. package/src/components/popover/content.css +7 -94
  43. package/src/components/popover/default.css +16 -3
  44. package/src/components/popover/index.css +2 -0
  45. package/src/components/popover/index.d.ts +14 -18
  46. package/src/components/popover/index.js +40 -80
  47. package/src/components/popover/props/content.css +1 -2
  48. package/src/components/popover/props/default.css +4 -0
  49. package/src/components/popover/readme.md +1 -2
  50. package/src/components/popover/tooltip.css +11 -0
  51. package/src/components/tabs/index.d.ts +2 -2
  52. package/src/components/text/content.css +241 -0
  53. package/src/components/text/default.css +0 -238
  54. package/src/components/text/index.css +2 -0
  55. package/src/components/text/props/content.css +9 -0
  56. package/src/components/text/props/default.css +1 -7
  57. package/src/components/toast/default.css +6 -0
  58. package/src/components/toast/index.js +2 -1
  59. package/src/components/toaster/index.d.ts +1 -0
  60. package/src/components/toaster/index.js +18 -0
  61. package/src/components/tooltip/default.css +8 -8
  62. package/src/polyfill.js +13 -0
  63. package/src/supports.js +15 -0
  64. package/src/utilities/container/props/default.css +3 -3
  65. package/tailwindcss/utilities/animation-trigger-fallback.css +18 -0
  66. package/tailwindcss/utilities/index.css +1 -0
  67. package/tailwindcss/utilities/position.css +203 -0
  68. package/types/index.d.ts +20 -58
  69. package/src/components/dialog/index.d.ts +0 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "2.2.28",
3
+ "version": "3.0.0-next.10",
4
4
  "type": "module",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "plugin/index.cjs",
@@ -23,24 +23,29 @@
23
23
  "@floating-ui/dom": "^1.7.6",
24
24
  "@stylistic/eslint-plugin": "^5.10.0",
25
25
  "@stylistic/stylelint-config": "^5.0.0",
26
- "@tailwindcss/vite": "^4.3.0",
26
+ "@tailwindcss/vite": "^4.3.2",
27
27
  "@vitejs/plugin-vue": "^6.0.7",
28
- "autoprefixer": "^10.5.0",
29
- "dts-buddy": "^0.8.0",
30
- "eslint": "^10.4.0",
28
+ "@webreflection/custom-elements-builtin": "^0.4.1",
29
+ "autoprefixer": "^10.5.2",
30
+ "dts-buddy": "^0.8.2",
31
+ "eslint": "^10.6.0",
31
32
  "fast-glob": "^3.3.3",
32
- "globals": "^17.6.0",
33
- "postcss": "^8.5.15",
33
+ "globals": "^17.7.0",
34
+ "interestfor": "^1.0.8",
35
+ "invokers-polyfill": "^1.0.3",
36
+ "postcss": "^8.5.16",
34
37
  "postcss-custom-media": "^12.0.1",
35
38
  "postcss-import": "^16.1.1",
36
39
  "postcss-nesting": "^14.0.0",
40
+ "scrollsnap-events": "^0.1.1",
37
41
  "slide-element": "^2.3.1",
38
- "stylelint": "^17.12.0",
42
+ "stylelint": "^17.14.0",
39
43
  "stylelint-config-standard": "^40.0.0",
40
- "tailwindcss": "^4.3.0",
44
+ "tailwindcss": "^4.3.2",
41
45
  "typescript": "^6",
42
- "vite": "^8.0.14",
43
- "vue": "^3.5.34"
46
+ "vite": "^8.1.3",
47
+ "vue": "^3.5.39",
48
+ "webuum": "^0.2.1"
44
49
  },
45
50
  "files": [
46
51
  "index.js",
@@ -62,6 +67,9 @@
62
67
  "types": "./types/index.d.ts",
63
68
  "default": "./src/supports.js"
64
69
  },
70
+ "./polyfill": {
71
+ "default": "./src/polyfill.js"
72
+ },
65
73
  "./src/*": "./src/*",
66
74
  "./tailwindcss/*": "./tailwindcss/*",
67
75
  "./dist/*": "./dist/*",
@@ -79,7 +87,6 @@
79
87
  "default": "./src/components/details/index.js"
80
88
  },
81
89
  "./src/components/dialog": {
82
- "types": "./src/components/dialog/index.d.ts",
83
90
  "default": "./src/components/dialog/index.js"
84
91
  },
85
92
  "./src/components/drawer": {
@@ -53,12 +53,14 @@
53
53
  }
54
54
 
55
55
  :where(html) {
56
+ scroll-padding-top: var(--scroll-padding-top);
56
57
  color-scheme: var(--default-color-scheme);
57
58
  font-family: var(--font-primary);
58
59
  font-weight: var(--font-weight-normal);
59
60
  block-size: 100%;
60
61
  line-height: 1.5;
61
62
  text-size-adjust: 100%;
63
+ container-type: scroll-state;
62
64
 
63
65
  @media (prefers-reduced-motion: no-preference) {
64
66
  scroll-behavior: smooth;
@@ -73,6 +75,7 @@
73
75
  display: flex;
74
76
  flex-direction: column;
75
77
  overflow-x: clip;
78
+ container-type: inline-size;
76
79
  }
77
80
 
78
81
  [hidden] {
@@ -48,6 +48,10 @@
48
48
  display: revert;
49
49
  }
50
50
 
51
+ :where([popover]) {
52
+ position-anchor: auto;
53
+ }
54
+
51
55
  /* Revert table vertical-align */
52
56
  :where(tr, th, td),
53
57
  :where(thead, tbody, tfoot) {
package/src/common.d.ts CHANGED
@@ -1,2 +1,6 @@
1
1
  export function nextRepaint(): Promise<void>;
2
2
  export function animationsFinished(element: HTMLElement): Promise<any>;
3
+ export const supportsAnchor: boolean;
4
+ export const supportsAnchoredContainer: boolean;
5
+ export const supportsAnchor: boolean;
6
+ export const supportsAnchoredContainer: boolean;
package/src/common.js CHANGED
@@ -8,4 +8,12 @@ export const nextRepaint = () => {
8
8
  })
9
9
  }
10
10
 
11
- export const animationsFinished = async element => Promise.all(element.getAnimations().map(animation => animation.finished))
11
+ export const animationsFinished = async (element) => {
12
+ const animations = element?.getAnimations?.() || []
13
+ const results = await Promise.allSettled(animations.map(a => a.finished))
14
+
15
+ return results.filter(r => r.status === 'fulfilled').map(r => r.value)
16
+ }
17
+
18
+ export const supportsAnchor = CSS.supports('anchor-name', '--')
19
+ export const supportsAnchoredContainer = CSS.supports('container-type: anchored')
@@ -15,6 +15,7 @@
15
15
  & > :where(*) {
16
16
  flex: 0 0 auto;
17
17
  scroll-snap-align: start;
18
+ scroll-snap-stop: always;
18
19
 
19
20
  &:last-child {
20
21
  scroll-snap-align: end;
@@ -1,40 +1,19 @@
1
- export interface ObserveCarouselOptions {
2
- visibleAttribute?: string
3
- observerOptions?: {
4
- rootMargin?: string
5
- threshold?: number | number[]
6
- }
7
- }
8
-
9
- export interface PaginationCarouselOptions {
10
- element?: HTMLElement | Element
11
- itemContent?: string
12
- activeAttribute?: string
13
- }
14
-
15
- export interface ScrollCarouselOptions {
16
- observe?: ObserveCarouselOptions
17
- pagination?: PaginationCarouselOptions
18
- progressElement?: HTMLProgressElement | Element
19
- counterMinElement?: HTMLElement | Element
20
- counterMaxElement?: HTMLElement | Element
21
- }
1
+ export type CarouselPlacement = 'left' | 'right' | 'top' | 'bottom'
22
2
 
23
- export interface AutoplayCarouselOptions {
24
- delay?: number
25
- pauseElements?: HTMLElement[] | Element[]
3
+ export interface ScrollByOptions {
4
+ direction?: number
5
+ vertical?: boolean
6
+ ratio?: number
26
7
  }
27
8
 
28
- export interface DragCarouselOptions {
29
- activeAttribute?: string
9
+ export interface ToggleScrollStateOptions {
10
+ prevElement?: HTMLButtonElement | null
11
+ nextElement?: HTMLButtonElement | null
12
+ vertical?: boolean
30
13
  }
31
14
 
32
- export function scrollPrev(element: HTMLElement | Element): void
33
- export function scrollNext(element: HTMLElement | Element): void
34
- export function scrollTo(element: HTMLElement | Element, selected?: number): void
35
- export function getItemCount(element: HTMLElement | Element, scrollWidth?: number, mathFloor?: boolean): number
36
- export function observeCarousel(element: HTMLElement | Element, options?: ObserveCarouselOptions): void
37
- export function scrollCarousel(element: HTMLElement | Element, options?: ScrollCarouselOptions): void
38
- export function paginationCarousel(element: HTMLElement | Element, options?: PaginationCarouselOptions): void
39
- export function autoplayCarousel(element: HTMLElement | Element, options?: AutoplayCarouselOptions): void
40
- export function dragCarousel(element: HTMLElement | Element, options?: DragCarouselOptions): void
15
+ export function scrollBy(element: HTMLElement, options?: ScrollByOptions): void
16
+ export function toggleScrollState(element: HTMLElement, options?: ToggleScrollStateOptions): void
17
+ export function setCurrentAttribute(element: HTMLElement, index: number, attributeName?: string): void
18
+ export function setSnappedAttribute(element: HTMLElement, target: HTMLElement, markerGroupElement?: HTMLElement | null): void
19
+ export function scrollToMarker(element: HTMLElement, target: HTMLElement, markerGroupElement: HTMLElement, scrollIntoViewOptions?: ScrollIntoViewOptions): void
@@ -1,227 +1,108 @@
1
1
  /**
2
- * @param {HTMLElement | Element} element
3
- * @param {number} index
4
- * @returns void
5
- */
6
- export const scrollTo = (element, index = 0) => {
7
- const scrollPaddingLeft = parseInt(getComputedStyle(element).scrollPaddingLeft)
8
-
9
- element.scroll({ left: element?.children[index]?.offsetLeft - (isNaN(scrollPaddingLeft) ? 0 : scrollPaddingLeft) })
10
- }
11
-
12
- /**
13
- * @param {HTMLElement | Element & { _activeIndex: number }} element
14
- * @returns void
15
- */
16
- export const scrollPrev = (element) => {
17
- scrollTo(element, element._activeIndex - 1)
18
- }
19
-
20
- /**
21
- * @param {HTMLElement | Element & { _activeIndex: number }} element
2
+ * @param {HTMLElement} element
3
+ * @param {object} options
4
+ * @param {number} [options.direction=1]
5
+ * @param {boolean} [options.vertical=false]
6
+ * @param {number} [options.ratio=0.85]
22
7
  * @returns void
23
8
  */
24
- export const scrollNext = (element) => {
25
- scrollTo(element, element._activeIndex + 1)
26
- }
27
-
28
- /**
29
- * @param {HTMLElement | Element} element
30
- * @param {number} scrollWidth
31
- * @param {boolean} mathFloor
32
- * @returns number
33
- */
34
- export const getItemCount = (element, scrollWidth = element.scrollWidth - element.clientWidth, mathFloor = false) => {
35
- const gap = parseInt(getComputedStyle(element).rowGap)
36
- const mathRound = (value, floor) => floor ? Math.floor(value) : Math.ceil(value)
37
-
38
- return [...element.children].reduce((count, children) => {
39
- if (mathRound(scrollWidth / (children.offsetWidth + (isNaN(gap) ? 0 : gap)), mathFloor) > count) {
40
- return count + 1
41
- }
42
- else {
43
- return count
44
- }
45
- }, 0) + 1
46
- }
47
-
48
- /**
49
- * @param {HTMLElement | Element} element
50
- * @param {import("./").ObserveCarouselOptions} options
51
- * @returns IntersectionObserver
52
- */
53
- export const observeCarousel = (element, options = {}) => {
54
- options = {
55
- visibleAttribute: 'data-visible',
56
- observerOptions: {},
57
- ...options,
58
- }
59
-
60
- element._observer = new IntersectionObserver((entries) => {
61
- entries.forEach((entry) => {
62
- entry.target.toggleAttribute(options.visibleAttribute, entry.isIntersecting)
63
- })
64
-
65
- const activeElement = [...element.children].find(children => children.hasAttribute(options.visibleAttribute))
66
-
67
- if (activeElement) {
68
- element._activeIndex = [...element.children].indexOf(activeElement)
69
- }
70
- }, {
71
- root: element,
72
- threshold: 0.75,
73
- ...options.observerOptions,
9
+ export const scrollBy = (element, { direction = 1, vertical = false, ratio = 0.85 }) => {
10
+ const { distance, position } = vertical
11
+ ? {
12
+ distance: element.clientHeight * ratio,
13
+ position: 'top',
14
+ }
15
+ : {
16
+ distance: element.clientWidth * ratio,
17
+ position: 'left',
18
+ }
19
+
20
+ element.scrollBy({
21
+ [position]: (distance ?? element.clientWidth * ratio) * direction,
74
22
  })
75
-
76
- ;[...element.children].forEach(children => element._observer.observe(children))
77
-
78
- return element._observer
79
23
  }
80
24
 
81
25
  /**
82
- * @param {HTMLElement | Element} element
83
- * @param {import("./").ScrollCarouselOptions} options
26
+ * @param {HTMLElement} element
27
+ * @param {object} options
28
+ * @param {HTMLButtonElement | null} [options.prevElement]
29
+ * @param {HTMLButtonElement | null} [options.nextElement]
30
+ * @param {boolean} vertical
84
31
  * @returns void
85
32
  */
86
- export const scrollCarousel = (element, options = {}) => {
87
- options.pagination = {
88
- activeAttribute: 'data-active',
89
- ...options.pagination,
90
- }
91
-
92
- const activeItem = getItemCount(element, element.scrollLeft, element.scrollLeft < element._lastScrollLeft)
93
- const activeItemMax = getItemCount(element)
94
-
95
- if (options?.pagination?.element) {
96
- ;[...options.pagination.element.children].forEach(children => children.removeAttribute(options.pagination.activeAttribute))
97
-
98
- options.pagination.element.children[activeItem - 1]?.setAttribute(options.pagination.activeAttribute, '')
99
- }
100
-
101
- if (options.progressElement) {
102
- options.progressElement.value = activeItem / activeItemMax * 100
103
- }
104
-
105
- if (options.counterMinElement) {
106
- options.counterMinElement.innerHTML = `${activeItem}`
107
- }
108
-
109
- if (options.counterMaxElement) {
110
- options.counterMaxElement.innerHTML = `${activeItemMax}`
111
- }
112
-
113
- element._lastScrollLeft = element.scrollLeft <= 0 ? 0 : element.scrollLeft
33
+ export const toggleScrollState = (element, { prevElement, nextElement, vertical = false }) => {
34
+ const { scrollStart, scrollEnd, scrollNone } = vertical
35
+ ? {
36
+ scrollStart: element.scrollTop <= 0,
37
+ scrollEnd: element.scrollTop >= element.scrollHeight - element.clientHeight,
38
+ scrollNone: !(element.scrollHeight - element.clientHeight),
39
+ }
40
+ : {
41
+ scrollStart: element.scrollLeft <= 0,
42
+ scrollEnd: element.scrollLeft >= element.scrollWidth - element.clientWidth,
43
+ scrollNone: !(element.scrollWidth - element.clientWidth),
44
+ }
45
+
46
+ if (prevElement) prevElement.disabled = scrollStart
47
+ if (nextElement) nextElement.disabled = scrollEnd
48
+
49
+ element.toggleAttribute('data-scroll-start', scrollStart)
50
+ element.toggleAttribute('data-scroll-end', scrollEnd)
51
+ element.toggleAttribute('data-scroll-none', scrollNone)
114
52
  }
115
53
 
116
54
  /**
117
- * @param {HTMLElement | Element} element
118
- * @param {import("./").PaginationCarouselOptions} options
55
+ * @param {HTMLElement} element
56
+ * @param {number} index
57
+ * @param {string} [attributeName='data-current']
119
58
  * @returns void
120
59
  */
121
- export const paginationCarousel = (element, options = {}) => {
122
- options = {
123
- itemContent: '<div aria-hidden="true"></div>',
124
- activeAttribute: 'data-active',
125
- ...options,
126
- }
127
-
128
- if (!options.element) return
129
-
130
- options.element.insertAdjacentHTML('beforeend', [...Array(getItemCount(element))].map(
131
- () => options.itemContent,
132
- ).join(''))
133
-
134
- ;[...options.element.children].forEach((children, i) => {
135
- (i === 0) && children.setAttribute(options.activeAttribute, '')
136
- children.addEventListener('click', ({ currentTarget }) => {
137
- scrollTo(element, [...options.element.children].indexOf(currentTarget))
138
- })
139
- })
60
+ export const setCurrentAttribute = (element, index, attributeName = 'aria-current') => {
61
+ element.querySelector(`[${attributeName}]`)?.removeAttribute(attributeName)
62
+ element.children[index].setAttribute(attributeName, 'true')
140
63
  }
141
64
 
142
65
  /**
143
- * @param {HTMLElement | Element} element
144
- * @param {import("./").AutoplayCarouselOptions} options
66
+ * @param {HTMLElement & { _markerIndex?: number | null }} element
67
+ * @param {HTMLElement} target
68
+ * @param {HTMLElement | null} markerGroupElement
145
69
  * @returns void
146
70
  */
147
- export const autoplayCarousel = (element, options = {}) => {
148
- options = {
149
- delay: 4000,
150
- pauseElements: [],
151
- ...options,
152
- }
71
+ export const setSnappedAttribute = (element, target, markerGroupElement) => {
72
+ const snappedIndex = [...element.children].indexOf(target)
153
73
 
154
- let paused
74
+ setCurrentAttribute(element, snappedIndex, 'data-snapped')
155
75
 
156
- options.pauseElements.forEach((element) => {
157
- element?.addEventListener('mouseenter', () => (paused = true))
158
- element?.addEventListener('mouseleave', () => (paused = false))
159
- })
76
+ if (markerGroupElement) {
77
+ const markerTarget = markerGroupElement.querySelector(`[href="#${target.id}"]`)
78
+ const index = element._markerIndex ?? (markerTarget && [...markerGroupElement.children].indexOf(markerTarget)) ?? snappedIndex
160
79
 
161
- setInterval(() => {
162
- if (paused) return
80
+ setCurrentAttribute(markerGroupElement, index)
163
81
 
164
- if (element.scrollLeft < element.scrollWidth - element.clientWidth) {
165
- scrollNext(element)
166
- }
167
- else {
168
- scrollTo(element, 0)
169
- }
170
- }, options.delay)
82
+ element._markerIndex = null
83
+ }
171
84
  }
172
85
 
173
86
  /**
174
- * @param {HTMLElement | Element & { _activeIndex: number }} element
175
- * @param {import("./").DragCarouselOptions} options
87
+ * @param {HTMLElement & { _markerIndex?: number | null }} element
88
+ * @param {HTMLElement | HTMLLinkElement} target
89
+ * @param {HTMLElement} markerGroupElement
90
+ * @param {ScrollIntoViewOptions} scrollIntoViewOptions
176
91
  * @returns void
177
92
  */
178
- export const dragCarousel = (element, options = {}) => {
179
- options = {
180
- activeAttribute: 'data-grabbing',
181
- ...options,
182
- }
183
-
184
- if (!matchMedia('(hover: hover) and (pointer: fine)').matches) {
185
- return
186
- }
187
-
188
- let isDown
189
- let startX
190
- let scrollLeft
191
- let timeout
192
-
193
- const endGrabbing = () => {
194
- isDown = false
195
- element.removeAttribute(options.activeAttribute)
196
-
197
- scrollTo(element, element._activeIndex)
198
-
199
- clearTimeout(timeout)
200
-
201
- timeout = setTimeout(() => {
202
- element.style.scrollSnapType = ''
203
- }, 300)
204
- }
205
-
206
- element.addEventListener('mouseleave', endGrabbing)
207
-
208
- element.addEventListener('mouseup', endGrabbing)
209
-
210
- element.addEventListener('mousedown', ({ pageX }) => {
211
- isDown = true
212
- startX = pageX - element.offsetLeft
213
- scrollLeft = element.scrollLeft
214
- })
93
+ export const scrollToMarker = (element, target, markerGroupElement, scrollIntoViewOptions = {}) => {
94
+ const snappedTarget = document.getElementById(target.getAttribute('href').slice(1))
95
+ const markerTargetIndex = [...markerGroupElement.children].indexOf(target)
96
+ const index = snappedTarget ? [...element.children].indexOf(snappedTarget) : markerTargetIndex
215
97
 
216
- element.addEventListener('mousemove', (e) => {
217
- if (!isDown) return
218
- e.preventDefault()
98
+ element._markerIndex = markerTargetIndex
219
99
 
220
- const x = e.pageX - element.offsetLeft
100
+ setCurrentAttribute(markerGroupElement, markerTargetIndex)
221
101
 
222
- element.setAttribute(options.activeAttribute, '')
223
- element.style.scrollSnapType = 'unset'
224
- element.scroll({ left: scrollLeft - ((x - startX) * 1.25), behavior: 'instant' })
225
- element.ondragstart = e => e.preventDefault()
102
+ element.children[index]?.scrollIntoView({
103
+ inline: 'start',
104
+ block: 'nearest',
105
+ container: 'nearest',
106
+ ...scrollIntoViewOptions,
226
107
  })
227
108
  }
@@ -3,7 +3,7 @@
3
3
  --x-check-size: 1.25rem;
4
4
  --x-check-gap: calc(var(--spacing) * 3);
5
5
  --x-check-font-size: var(--text-sm);
6
- --x-check-line-height: calc(1em + 0.25rem);
6
+ --x-check-line-height: 1.25rem;
7
7
  --x-check-border-radius: var(--radius-md);
8
8
  --x-check-border-width: 1px;
9
9
  --x-check-background-color: currentcolor;
@@ -5,12 +5,12 @@
5
5
  --x-control-select-picker-border-color: currentcolor;
6
6
  --x-control-select-picker-background-color: var(--color-body-primary);
7
7
  --x-control-select-picker-margin-block: 0.375rem;
8
- --x-control-select-picker-padding-block: 0.375rem;
9
- --x-control-select-picker-padding-inline: 0.375rem;
8
+ --x-control-select-picker-padding-block: calc(var(--spacing) * 1);
9
+ --x-control-select-picker-padding-inline: calc(var(--spacing) * 1);
10
10
  --x-control-select-picker-gap: 0.25rem;
11
11
  --x-control-select-picker-scrollbar-color: currentcolor var(--color-body-primary);
12
- --x-control-select-option-padding-block: 0.75rem;
13
- --x-control-select-option-padding-inline: 0.75rem;
12
+ --x-control-select-option-padding-block: calc(var(--spacing) * 2.5);
13
+ --x-control-select-option-padding-inline: calc(var(--spacing) * 3);
14
14
  --x-control-select-option-border-radius: var(--radius-md);
15
15
  --x-control-select-option-hocus-background-color: var(--color-body-secondary);
16
16
  }
@@ -1,6 +1,6 @@
1
1
  :root,
2
2
  :host {
3
- --x-control-select-icon-size: 1.25rem;
4
- --x-control-select-icon-mask: 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>');
3
+ --x-control-select-icon-size: 1rem;
4
+ --x-control-select-icon-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.75" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /></svg>');
5
5
  --x-control-select-icon-margin-inline-end: -0.25rem;
6
6
  }
@@ -0,0 +1,24 @@
1
+ .x-control {
2
+ &:has([autocomplete="tel-country-code"]) {
3
+ :where(select) {
4
+ @media not (scripting: none) {
5
+ font-size: 0;
6
+ }
7
+
8
+ + :where(span) {
9
+ pointer-events: none;
10
+
11
+ @media (scripting: none) {
12
+ display: none;
13
+ }
14
+ }
15
+
16
+ :where(option) {
17
+ &::before {
18
+ content: attr(data-icon);
19
+ margin-inline-end: 0.5ch;
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,14 @@
1
+ .x-details {
2
+ &::details-content {
3
+ transition:
4
+ height var(--default-transition-duration) var(--default-transition-timing-function),
5
+ content-visibility var(--default-transition-duration) var(--default-transition-timing-function) allow-discrete;
6
+ height: 0;
7
+ overflow: clip;
8
+ interpolate-size: allow-keywords;
9
+ }
10
+
11
+ &[open]::details-content {
12
+ height: auto;
13
+ }
14
+ }
@@ -0,0 +1 @@
1
+ @import "./default.css";
@@ -1,9 +1,5 @@
1
- export interface DefaultOptions {
1
+ export interface ToggleDetailsOptions {
2
2
  selector?: string
3
- summarySelector?: string
4
3
  }
5
4
 
6
- export const defaultOptions: DefaultOptions
7
- export function showDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
8
- export function closeDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
9
- export function toggleDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
5
+ export function toggleDetails(element: HTMLInputElement, options?: ToggleDetailsOptions): void