@adia-ai/web-components 0.0.22 → 0.0.24

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.
@@ -14,6 +14,19 @@
14
14
  }
15
15
  }
16
16
 
17
+ /* Safari 17.x bug: `:scope:hover` inside `@scope` doesn't match the scope
18
+ root. Plain selector outside the @scope works. `:focus-visible` matches
19
+ correctly inside @scope, so the combined `:hover, :focus-visible` rules
20
+ are split — `:hover` moves out, `:focus-visible` stays. See
21
+ docs/BROWSER-COMPAT.md §3a. */
22
+ action-item-ui:hover {
23
+ background: var(--action-item-bg-hover);
24
+ color: var(--action-item-fg-hover);
25
+ }
26
+ action-item-ui:hover [slot="icon"] {
27
+ color: var(--action-item-icon-fg-hover);
28
+ }
29
+
17
30
  @scope (action-item-ui) {
18
31
  :where(:scope) {
19
32
  /* Reuse menu-item visual language for consistency */
@@ -59,12 +72,9 @@
59
72
  color var(--action-item-duration) var(--action-item-easing);
60
73
  }
61
74
 
62
- :scope:hover,
63
75
  :scope:focus-visible {
64
76
  background: var(--action-item-bg-hover);
65
77
  color: var(--action-item-fg-hover);
66
- }
67
- :scope:focus-visible {
68
78
  box-shadow: var(--action-item-focus-ring);
69
79
  }
70
80
 
@@ -75,7 +85,6 @@
75
85
  color: var(--action-item-icon-fg);
76
86
  transition: color var(--action-item-duration) var(--action-item-easing);
77
87
  }
78
- :scope:hover [slot="icon"],
79
88
  :scope:focus-visible [slot="icon"] {
80
89
  color: var(--action-item-icon-fg-hover);
81
90
  }
@@ -74,6 +74,14 @@
74
74
  AVATAR-GROUP-N — Overlapping avatar stack with +N overflow
75
75
  ═══════════════════════════════════════════════════════════════ */
76
76
 
77
+ /* Safari 17.x bug: `:scope:hover` inside `@scope` doesn't match the scope
78
+ root. Plain selector outside the @scope works. The two `:scope:hover`
79
+ rules combine into one rule list outside. See docs/BROWSER-COMPAT.md §3a. */
80
+ avatar-group-ui:hover > avatar-ui:not(:first-child),
81
+ avatar-group-ui:hover > [slot="overflow"] {
82
+ margin-inline-start: var(--avatar-group-spread);
83
+ }
84
+
77
85
  @scope (avatar-group-ui) {
78
86
  :where(:scope) {
79
87
  /* ── Layout ── */
@@ -123,11 +131,6 @@
123
131
  z-index: 99;
124
132
  }
125
133
 
126
- /* Group hover: spread apart */
127
- :scope:hover > avatar-ui:not(:first-child) {
128
- margin-inline-start: var(--avatar-group-spread);
129
- }
130
-
131
134
  /* Overflow counter */
132
135
  [slot="overflow"] {
133
136
  display: inline-flex;
@@ -147,10 +150,6 @@
147
150
  transition: margin var(--avatar-group-duration) var(--avatar-group-easing);
148
151
  }
149
152
 
150
- :scope:hover > [slot="overflow"] {
151
- margin-inline-start: var(--avatar-group-spread);
152
- }
153
-
154
153
  /* Size variants — adjust counter + overlap */
155
154
  :scope[size="xs"] { --avatar-group-counter-size: 1.25rem; --avatar-group-overlap: -0.3rem; }
156
155
  :scope[size="sm"] { --avatar-group-counter-size: 1.75rem; --avatar-group-overlap: -0.4rem; }
@@ -1,3 +1,30 @@
1
+ /* Safari 17.x bug: `:scope:state` and `:scope[attr]:state` inside `@scope`
2
+ don't match the scope root. Plain selectors outside the @scope work —
3
+ custom-property tokens still resolve via inheritance. Specificity
4
+ (0,1,1 / 0,2,1) is preserved. See docs/BROWSER-COMPAT.md §3a. */
5
+ button-ui:active { transform: scale(0.97); }
6
+
7
+ button-ui:not([disabled]):hover,
8
+ button-ui[variant="primary"]:not([disabled]):hover {
9
+ --button-bg: var(--button-bg-hover);
10
+ --button-fg: var(--button-fg-hover);
11
+ --button-border: var(--button-border-hover);
12
+ }
13
+ button-ui[variant="ghost"]:not([disabled]):hover {
14
+ --button-bg: var(--button-bg-ghost-hover);
15
+ --button-fg: var(--button-fg-ghost-hover);
16
+ --button-border: var(--button-border-ghost-hover);
17
+ }
18
+ button-ui[variant="outline"]:not([disabled]):hover {
19
+ --button-fg: var(--button-fg-hover);
20
+ --button-border: var(--button-border-hover);
21
+ }
22
+ button-ui[color="danger"]:not([disabled]):hover {
23
+ --button-bg: var(--button-bg-hover);
24
+ --button-fg: var(--button-fg-hover);
25
+ --button-border: var(--button-border-hover);
26
+ }
27
+
1
28
  @scope (button-ui) {
2
29
  :where(:scope) {
3
30
  --button-bg: var(--a-ui-bg);
@@ -93,7 +120,7 @@
93
120
  line-height: 1;
94
121
  }
95
122
 
96
- :scope:active { transform: scale(0.97); }
123
+ /* :scope:active moved outside @scope — see Safari 17.x bug note at top. */
97
124
  :scope:focus-visible { outline: none; box-shadow: var(--button-focus-ring); }
98
125
 
99
126
  /* ── Variants (rest state) ── */
@@ -136,30 +163,8 @@
136
163
  --button-fg: var(--a-warning-fg);
137
164
  }
138
165
 
139
- /* ── Hover (after variants so it wins on specificity via :hover) ── */
140
- :scope:not([disabled]):hover,
141
- :scope[variant="primary"]:not([disabled]):hover {
142
- --button-bg: var(--button-bg-hover);
143
- --button-fg: var(--button-fg-hover);
144
- --button-border: var(--button-border-hover);
145
- }
146
-
147
- :scope[variant="ghost"]:not([disabled]):hover {
148
- --button-bg: var(--button-bg-ghost-hover);
149
- --button-fg: var(--button-fg-ghost-hover);
150
- --button-border: var(--button-border-ghost-hover);
151
- }
152
-
153
- :scope[variant="outline"]:not([disabled]):hover {
154
- --button-fg: var(--button-fg-hover);
155
- --button-border: var(--button-border-hover);
156
- }
157
-
158
- :scope[color="danger"]:not([disabled]):hover {
159
- --button-bg: var(--button-bg-hover);
160
- --button-fg: var(--button-fg-hover);
161
- --button-border: var(--button-border-hover);
162
- }
166
+ /* Hover rules moved outside @scope see Safari 17.x bug note at
167
+ top of file. */
163
168
 
164
169
  /* Size is handled by the universal [size] attribute system
165
170
  which sets --a-size, --a-ui-px, --a-ui-size.
@@ -1,3 +1,35 @@
1
+ /* Safari 17.x bug: `:scope*:hover` and `:scope[dyn-attr]` inside `@scope`
2
+ don't match (Flavor A) or don't restyle on attribute removal (Flavor B).
3
+ For [checked] / [indeterminate], when JS toggles the attribute off,
4
+ Safari leaves the visual stuck — selectors moved out as plain
5
+ `tagname[attr]` rules. See docs/BROWSER-COMPAT.md §3a. */
6
+ check-ui:not([disabled]):hover [slot="box"] {
7
+ border-color: var(--check-border-hover);
8
+ background: var(--check-bg-hover);
9
+ }
10
+ check-ui[checked]:not([disabled]):hover [slot="box"],
11
+ check-ui[indeterminate]:not([disabled]):hover [slot="box"] {
12
+ background: var(--check-bg-checked-hover);
13
+ border-color: var(--check-bg-checked-hover);
14
+ }
15
+ check-ui[checked] [slot="box"],
16
+ check-ui[indeterminate] [slot="box"] {
17
+ background: var(--check-bg-checked);
18
+ border-color: var(--check-border-checked);
19
+ }
20
+ check-ui[checked] {
21
+ --_icon-w: calc(var(--check-size) * 0.3);
22
+ --_icon-h: calc(var(--check-size) * 0.55);
23
+ --_icon-border: solid var(--check-fg-checked);
24
+ --_icon-bw: 0 calc(var(--check-size) * 0.12) calc(var(--check-size) * 0.12) 0;
25
+ --_icon-transform: rotate(45deg) translate(-1px, -1px);
26
+ }
27
+ check-ui[indeterminate] {
28
+ --_dash-bg: var(--check-fg-checked);
29
+ --_icon-w: calc(var(--check-size) * 0.5);
30
+ --_icon-h: calc(var(--check-size) * 0.12);
31
+ }
32
+
1
33
  @scope (check-ui) {
2
34
  :where(:scope) {
3
35
  /* ── Tokens ── (size scales with universal [size] attribute via --a-toggle-size) */
@@ -83,38 +115,8 @@
83
115
  background: var(--_dash-bg);
84
116
  }
85
117
 
86
- :scope:not([disabled]):hover [slot="box"] {
87
- border-color: var(--check-border-hover);
88
- background: var(--check-bg-hover);
89
- }
90
-
91
- /* Checked — CSS border checkmark */
92
- :scope[checked] [slot="box"],
93
- :scope[indeterminate] [slot="box"] {
94
- background: var(--check-bg-checked);
95
- border-color: var(--check-border-checked);
96
- }
97
-
98
- :scope[checked] {
99
- --_icon-w: calc(var(--check-size) * 0.3);
100
- --_icon-h: calc(var(--check-size) * 0.55);
101
- --_icon-border: solid var(--check-fg-checked);
102
- --_icon-bw: 0 calc(var(--check-size) * 0.12) calc(var(--check-size) * 0.12) 0;
103
- --_icon-transform: rotate(45deg) translate(-1px, -1px);
104
- }
105
-
106
- /* Indeterminate — horizontal dash */
107
- :scope[indeterminate] {
108
- --_dash-bg: var(--check-fg-checked);
109
- --_icon-w: calc(var(--check-size) * 0.5);
110
- --_icon-h: calc(var(--check-size) * 0.12);
111
- }
112
-
113
- :scope[checked]:not([disabled]):hover [slot="box"],
114
- :scope[indeterminate]:not([disabled]):hover [slot="box"] {
115
- background: var(--check-bg-checked-hover);
116
- border-color: var(--check-bg-checked-hover);
117
- }
118
+ /* hover rules + [checked]/[indeterminate] state rules moved outside @scope —
119
+ see Safari 17.x bug note at top. */
118
120
 
119
121
  /* Label */
120
122
  :scope[label]::after { content: attr(label); }