@swiftwc/ui 0.0.0-dev.32 → 0.0.0-dev.33
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/generated/css/index.css
CHANGED
|
@@ -1710,10 +1710,9 @@
|
|
|
1710
1710
|
color: var(--text, );
|
|
1711
1711
|
touch-action: none;
|
|
1712
1712
|
position: fixed;
|
|
1713
|
-
inline-size:
|
|
1713
|
+
inline-size: max-content;
|
|
1714
1714
|
block-size: fit-content;
|
|
1715
1715
|
height: auto;
|
|
1716
|
-
min-inline-size: var(--confirmation--dialog-min-inline-size, );
|
|
1717
1716
|
max-inline-size: var(--confirmation--dialog-max-inline-size, );
|
|
1718
1717
|
max-block-size: var(--confirmation--dialog-max-block-size, );
|
|
1719
1718
|
margin-block: var(--confirmation--dialog-margin-block, );
|
|
@@ -1731,7 +1730,6 @@
|
|
|
1731
1730
|
--confirmation--dialog-scale: scale(0);
|
|
1732
1731
|
}
|
|
1733
1732
|
:where([is=confirmation-dialog][open]) {
|
|
1734
|
-
--confirmation--dialog-min-inline-size: min(20rem, 80svw);
|
|
1735
1733
|
--confirmation--dialog-max-inline-size: min(20rem, 80vw);
|
|
1736
1734
|
--confirmation--dialog-max-block-size: 80vh;
|
|
1737
1735
|
--confirmation--dialog-margin-block: max(env(safe-area-inset-top), var(--menu-spacing)) max(env(safe-area-inset-bottom), var(--menu-spacing));
|
|
@@ -1744,7 +1742,6 @@
|
|
|
1744
1742
|
}
|
|
1745
1743
|
}
|
|
1746
1744
|
:where([is=confirmation-dialog][closing]) {
|
|
1747
|
-
--confirmation--dialog-min-inline-size: anchor-size();
|
|
1748
1745
|
--confirmation--dialog-max-inline-size: anchor-size();
|
|
1749
1746
|
--confirmation--dialog-max-block-size: anchor-size();
|
|
1750
1747
|
--confirmation--dialog-scale: scale(0);
|
|
@@ -3,7 +3,8 @@ import { Snapshot } from '../../snapshot';
|
|
|
3
3
|
import { CleanupRegistry } from '../class/cleanup-registry';
|
|
4
4
|
import { default as $ } from './cash';
|
|
5
5
|
import onoff from './onoff';
|
|
6
|
-
|
|
6
|
+
const observing = new WeakMap();
|
|
7
|
+
function ensurePlaceholder(el, role, titleKey) {
|
|
7
8
|
// if (!el.isConnected) return
|
|
8
9
|
// self.requestAnimationFrame(() => {
|
|
9
10
|
// if (!el.isConnected) return
|
|
@@ -49,9 +50,13 @@ function renderPlaceholder(el, role, titleKey) {
|
|
|
49
50
|
}
|
|
50
51
|
export default function (target, role, titleKey) {
|
|
51
52
|
const overiderTitle = typeof titleKey === 'string' && titleKey in I18n.t('ButtonRole') ? titleKey : undefined;
|
|
52
|
-
|
|
53
|
+
ensurePlaceholder(target, role, overiderTitle);
|
|
54
|
+
if (observing.has(target))
|
|
55
|
+
observing.get(target)?.disconnect();
|
|
53
56
|
CleanupRegistry.unregister(target, 'i18n');
|
|
54
|
-
CleanupRegistry.register(target, onoff('localechange', () =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
CleanupRegistry.register(target, onoff('localechange', () => ensurePlaceholder(target, role, overiderTitle), I18n.on).on(), 'i18n');
|
|
58
|
+
observing.set(target, new MutationObserver(() => ensurePlaceholder(target, role, overiderTitle)));
|
|
59
|
+
observing.get(target)?.observe(target, {
|
|
60
|
+
childList: true,
|
|
61
|
+
});
|
|
57
62
|
}
|
package/package.json
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
position: fixed;
|
|
14
14
|
|
|
15
|
-
inline-size:
|
|
15
|
+
inline-size: max-content;
|
|
16
16
|
block-size: fit-content;
|
|
17
17
|
height: auto; // safari
|
|
18
18
|
|
|
19
|
-
min-inline-size: var(--confirmation--dialog-min-inline-size,);
|
|
19
|
+
// min-inline-size: var(--confirmation--dialog-min-inline-size,);
|
|
20
20
|
|
|
21
21
|
max-inline-size: var(--confirmation--dialog-max-inline-size,);
|
|
22
22
|
max-block-size: var(--confirmation--dialog-max-block-size,);
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
margin-inline: var(--confirmation--dialog-margin-inline,);
|
|
26
26
|
|
|
27
27
|
transform: var(--confirmation--dialog-scale,);
|
|
28
|
+
// transform-origin: top left;
|
|
28
29
|
|
|
29
30
|
position-anchor: --confirmation-dialog; // overriden
|
|
30
31
|
position-area: center;
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
|
|
46
47
|
&[open] {
|
|
47
48
|
:where(&) {
|
|
48
|
-
--confirmation--dialog-min-inline-size: min(20rem, 80svw);
|
|
49
|
+
// --confirmation--dialog-min-inline-size: min(20rem, 80svw);
|
|
49
50
|
|
|
50
51
|
--confirmation--dialog-max-inline-size: min(20rem, 80vw);
|
|
51
52
|
--confirmation--dialog-max-block-size: 80vh;
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
|
|
64
65
|
&[closing] {
|
|
65
66
|
:where(&) {
|
|
66
|
-
--confirmation--dialog-min-inline-size: anchor-size();
|
|
67
|
+
// --confirmation--dialog-min-inline-size: anchor-size();
|
|
67
68
|
|
|
68
69
|
--confirmation--dialog-max-inline-size: anchor-size();
|
|
69
70
|
--confirmation--dialog-max-block-size: anchor-size();
|
|
@@ -71,47 +72,5 @@
|
|
|
71
72
|
--confirmation--dialog-scale: scale(0);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
// SECTION: componentize
|
|
76
|
-
// > button {
|
|
77
|
-
// :where(&) {
|
|
78
|
-
// @include mixins.componentize(dialogbtn);
|
|
79
|
-
// }
|
|
80
|
-
// }
|
|
81
|
-
|
|
82
|
-
// :where(&) {
|
|
83
|
-
// --dialogbtnpadistart: 0.6rem;
|
|
84
|
-
// --dialogbtnpadiend: 0.6rem;
|
|
85
|
-
// --dialogbtnpadbstart: 0.6rem;
|
|
86
|
-
// --dialogbtnpadbend: 0.6rem;
|
|
87
|
-
// --dialogbtnradiustl: 1rem;
|
|
88
|
-
// --dialogbtnradiustr: 1rem;
|
|
89
|
-
// --dialogbtnradiusbl: 1rem;
|
|
90
|
-
// --dialogbtnradiusbr: 1rem;
|
|
91
|
-
// }
|
|
92
75
|
}
|
|
93
76
|
}
|
|
94
|
-
|
|
95
|
-
// @layer #{vars.$colors-layer} {
|
|
96
|
-
// // SECTION: componentize
|
|
97
|
-
// [is='confirmation-dialog'] {
|
|
98
|
-
// > button {
|
|
99
|
-
// @include mixins.add-focus-visible-state {
|
|
100
|
-
// --dialogbtnface: var(--dialogbtnhighlightface,);
|
|
101
|
-
// --dialogbtntext: var(--dialogbtnhighlighttext,);
|
|
102
|
-
// }
|
|
103
|
-
// }
|
|
104
|
-
// }
|
|
105
|
-
// }
|
|
106
|
-
|
|
107
|
-
// @layer #{vars.$ui-layer} {
|
|
108
|
-
// // SECTION: componentize
|
|
109
|
-
// [is='confirmation-dialog'] {
|
|
110
|
-
// > button {
|
|
111
|
-
// @include mixins.add-active-state {
|
|
112
|
-
// --dialogbtnface: var(--dialogbtnactiveface,);
|
|
113
|
-
// --dialogbtntext: var(--dialogbtnactivetext,);
|
|
114
|
-
// }
|
|
115
|
-
// }
|
|
116
|
-
// }
|
|
117
|
-
// }
|
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
@media (prefers-reduced-motion: no-preference) {
|
|
6
6
|
[is='confirmation-dialog'] {
|
|
7
7
|
:where(&) {
|
|
8
|
+
// transition:
|
|
9
|
+
// inset var(--menu-animation-duration) allow-discrete ease-out,
|
|
10
|
+
// width var(--menu-animation-duration) allow-discrete ease-out,
|
|
11
|
+
// height var(--menu-animation-duration) allow-discrete ease-out,
|
|
12
|
+
// block-size var(--menu-animation-duration) allow-discrete ease-out,
|
|
13
|
+
// inline-size var(--menu-animation-duration) allow-discrete ease-out,
|
|
14
|
+
// display var(--menu-animation-duration) allow-discrete ease-out,
|
|
15
|
+
// overlay var(--menu-animation-duration) allow-discrete ease-out,
|
|
16
|
+
// transform var(--menu-animation-duration) allow-discrete ease-out;
|
|
8
17
|
transition: all var(--touchglass-transition-duration) allow-discrete ease-out;
|
|
9
18
|
// will-change: block-size, inline-size, transform, overlay, display;
|
|
10
19
|
}
|