winduum 2.0.0-next.2 → 2.0.0-next.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "2.0.0-next.2",
3
+ "version": "2.0.0-next.4",
4
4
  "type": "module",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "plugin/index.cjs",
@@ -37,7 +37,7 @@
37
37
  :where(hr) {
38
38
  background-color: color-mix(in var(--default-color-space), currentColor 100%, transparent);
39
39
  block-size: 1px;
40
- width: 100%;
40
+ inline-size: 100%;
41
41
  }
42
42
 
43
43
  :where(code) {
@@ -44,8 +44,8 @@
44
44
  flex-shrink: 0;
45
45
 
46
46
  &::before {
47
- width: var(--x-check-icon-size);
48
- height: var(--x-check-icon-size);
47
+ inline-size: var(--x-check-icon-size);
48
+ block-size: var(--x-check-icon-size);
49
49
  color: var(--x-check-icon-color);
50
50
  mask: var(--x-check-icon);
51
51
  transition: inherit;
@@ -6,7 +6,7 @@
6
6
  transition: var(--transition-transform), var(--transition-opacity);
7
7
  margin: auto;
8
8
 
9
- :where(dialog:not(.open)) & {
9
+ :where(dialog[data-closed]) & {
10
10
  transform: translateY(-2rem);
11
11
  opacity: 0%;
12
12
  }
@@ -11,7 +11,7 @@
11
11
  display: flex;
12
12
  position: fixed;
13
13
  inset: 0;
14
- overflow: hidden;
14
+ overflow: auto;
15
15
  overscroll-behavior: contain;
16
16
  -webkit-overflow-scrolling: touch;
17
17
 
@@ -19,7 +19,11 @@
19
19
  display: none;
20
20
  }
21
21
 
22
- &:not(.open) {
22
+ &:not([data-open]) {
23
+ overflow: hidden;
24
+ }
25
+
26
+ &[data-closed] {
23
27
  background-color: transparent;
24
28
  }
25
29
  }
@@ -1,8 +1,8 @@
1
1
  export interface DefaultOptions {
2
2
  remove?: boolean | null
3
3
  closable?: boolean | null
4
- openClass?: string
5
- overflowClass?: string
4
+ openAttribute?: string
5
+ closedAttribute?: string
6
6
  scrollbarWidthProperty?: string
7
7
  }
8
8
 
@@ -4,9 +4,10 @@ import { animationsFinished } from '../../common.js'
4
4
  * @type {import("./").DefaultOptions}
5
5
  */
6
6
  export const defaultOptions = {
7
- openClass: 'open',
8
- overflowClass: 'overflow-auto',
7
+ closedAttribute: 'data-closed',
8
+ openAttribute: 'data-open',
9
9
  scrollbarWidthProperty: '--default-scrollbar-width',
10
+ closable: true,
10
11
  remove: false
11
12
  }
12
13
 
@@ -18,7 +19,6 @@ export const defaultOptions = {
18
19
  */
19
20
  export const showDialog = async (element, options = {}) => {
20
21
  options = {
21
- closable: true,
22
22
  ...defaultOptions,
23
23
  ...options
24
24
  }
@@ -40,14 +40,15 @@ export const showDialog = async (element, options = {}) => {
40
40
  element._dialogHasEvents = true
41
41
  }
42
42
 
43
- window.HTMLDialogElement
44
- ? element.showModal()
45
- : element.setAttribute('open', '')
43
+ element.setAttribute(options.closedAttribute, '')
46
44
 
45
+ element.showModal()
47
46
  element.scroll(0, 0)
48
- element.classList.add(options.openClass)
47
+
48
+ element.removeAttribute(options.closedAttribute)
49
49
  await animationsFinished(element.lastElementChild)
50
- element.classList.add(options.overflowClass)
50
+ element.setAttribute(options.openAttribute, '')
51
+
51
52
  element.dispatchEvent(new CustomEvent('x-dialog:show'))
52
53
  }
53
54
 
@@ -63,13 +64,12 @@ export const closeDialog = async (element, options = {}) => {
63
64
  ...options
64
65
  }
65
66
 
66
- element.classList.remove(options.overflowClass, options.openClass)
67
+ element.removeAttribute(options.openAttribute)
68
+ element.setAttribute(options.closedAttribute, '')
67
69
 
68
70
  await animationsFinished(element.lastElementChild)
69
71
 
70
- window.HTMLDialogElement
71
- ? element.close()
72
- : element.removeAttribute('open')
72
+ element.close()
73
73
 
74
74
  element.dispatchEvent(new CustomEvent('x-dialog:close'))
75
75
  options.remove && element.remove()
@@ -20,7 +20,7 @@
20
20
 
21
21
  &::after {
22
22
  content: "";
23
- min-width: 100vw;
23
+ min-inline-size: 100vw;
24
24
  scroll-snap-align: end;
25
25
  }
26
26
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  &:has(.x-control) {
6
6
  > :where(.x-button) {
7
- min-width: var(--x-control-height);
7
+ min-inline-size: var(--x-control-height);
8
8
  height: auto;
9
9
  }
10
10
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  > :where(img, video, iframe, object, svg) {
15
15
  border-radius: inherit;
16
- min-width: 100%;
16
+ min-inline-size: 100%;
17
17
  height: auto;
18
18
  object-fit: contain;
19
19
  }
@@ -10,7 +10,7 @@
10
10
  translate(var(--tw-translate-x), var(--tw-translate-y))
11
11
  scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
12
12
  will-change: transform;
13
- width: max-content;
13
+ inline-size: max-content;
14
14
  position: absolute;
15
15
 
16
16
  &:where(.bottom), & {
@@ -38,8 +38,8 @@
38
38
  }
39
39
 
40
40
  &::-webkit-slider-thumb {
41
- width: var(--x-range-thumb-size);
42
- height: var(--x-range-thumb-size);
41
+ inline-size: var(--x-range-thumb-size);
42
+ block-size: var(--x-range-thumb-size);
43
43
  background-color: var(--x-range-thumb-background-color);
44
44
  border-radius: var(--radius-full);
45
45
  border: var(--x-range-thumb-border-width) solid var(--x-range-thumb-border-color);
@@ -63,8 +63,8 @@
63
63
  }
64
64
 
65
65
  &::-moz-range-thumb {
66
- width: var(--x-range-thumb-size);
67
- height: var(--x-range-thumb-size);
66
+ inline-size: var(--x-range-thumb-size);
67
+ block-size: var(--x-range-thumb-size);
68
68
  background-color: var(--x-range-thumb-background-color);
69
69
  border-radius: var(--radius-full);
70
70
  border: var(--x-range-thumb-border-width) solid var(--x-range-thumb-border-color);
@@ -170,8 +170,8 @@
170
170
  list-style-type: "";
171
171
 
172
172
  &::before {
173
- width: var(--x-text-list-marker-size);
174
- height: var(--x-text-list-marker-size);
173
+ inline-size: var(--x-text-list-marker-size);
174
+ block-size: var(--x-text-list-marker-size);
175
175
  inset-inline-start: var(--x-text-list-marker-inset-inline-start, -0.75em);
176
176
  inset-block-start: var(--x-text-list-marker-inset-block-start, 0.5lh);
177
177
  border: