@swiftwc/ui 0.0.0-dev.111 → 0.0.0-dev.112

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.
@@ -39,6 +39,7 @@ export class TabView extends HTMLElement {
39
39
  }
40
40
  get moreTab() {
41
41
  return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
42
+ // return this.querySelector<NavigationStack>(':scope>navigation-stack:has(> navigation-stack)') ?? this.querySelector<NavigationStack>(':scope>navigation-stack:has(> navigation-split-view)')
42
43
  }
43
44
  connectedCallback() {
44
45
  debug(`${_a.name} ⚡️ connect`);
@@ -95,9 +96,9 @@ export class TabView extends HTMLElement {
95
96
  }));
96
97
  }
97
98
  };
98
- #handleAdaptableTabBarPlacementChange = (evt) => {
99
- debug(`${_a.name} ⚡️ ${evt?.type}`);
100
- if ('bottom-bar' !== evt.detail.oldValue)
99
+ #handleAdaptableTabBarPlacementChange = ({ type, detail }) => {
100
+ debug(`${_a.name} ⚡️ ${type}`);
101
+ if ('bottom-bar' !== detail.oldValue)
101
102
  return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
102
103
  const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
103
104
  if (innerSelection) {
@@ -151,12 +152,12 @@ export class TabView extends HTMLElement {
151
152
  ns.hidden = false; // triggers
152
153
  }
153
154
  }
154
- #addAnimations = (evt) => {
155
+ #addAnimations = ({ detail }) => {
155
156
  this.setAttribute('js-aftertabreveal', '');
156
157
  // const ms = cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`)
157
158
  this.#afterTabRevealDelay.next(() => {
158
159
  this.removeAttribute('js-aftertabreveal');
159
- }, evt.detail.ms);
160
+ }, detail.ms);
160
161
  };
161
162
  #handleSelectionChange = (evt) => {
162
163
  this.#triggerToggleEvent(evt);
@@ -302,12 +302,8 @@
302
302
  --insetform-item-border-radius: 1rem;
303
303
  --list-item-padding-inline-start: 1rem;
304
304
  --list-item-padding-inline-end: 1rem;
305
- --insetgroupedlist-background-color: var(--background);
306
- --insetgroupedlist-item-background-color: var(--quaternaryGroupedBackground);
307
305
  --form-item-padding-inline-start: 1rem;
308
306
  --form-item-padding-inline-end: 1rem;
309
- --insetgroupedform-background-color: var(--background);
310
- --insetgroupedform-item-background-color: var(--quaternaryGroupedBackground);
311
307
  --toggle-inline-size: 3.4rem;
312
308
  --toggle-block-size: 1.3rem;
313
309
  --control-clear-glass-bg: var(--white);
@@ -6101,13 +6097,11 @@
6101
6097
  }
6102
6098
  }
6103
6099
  @layer sw-utils {
6104
- @media (pointer: coarse) {
6105
- :where([background-style=grouped]) {
6106
- --background: var(--groupedBackground);
6107
- --secondaryBackground: var(--secondaryGroupedBackground);
6108
- --tertiaryBackground: var(--tertiaryGroupedBackground);
6109
- --face: var(--background);
6110
- }
6100
+ :where([background-style=initial]) {
6101
+ --background: initial;
6102
+ --secondaryBackground: initial;
6103
+ --tertiaryBackground: initial;
6104
+ --face: var(--background);
6111
6105
  }
6112
6106
  :where([foreground=primary]) {
6113
6107
  color: var(--primary);
@@ -9185,7 +9179,6 @@
9185
9179
  margin-block: 5rem;
9186
9180
  }
9187
9181
  }
9188
- @layer sw-utils {}
9189
9182
  @layer sw-utils {
9190
9183
  :where(list-view[background=system-background],
9191
9184
  [is=form-view][background=system-background]) {
@@ -10568,19 +10561,50 @@
10568
10561
  --face: var(--background);
10569
10562
  --text: var(--primary);
10570
10563
  }
10571
- /* :where([is='sheet-view'], [is='full-screen'], [is='confirmation-dialog'], [is='alert-dialog']) {
10572
- // modify background/secondarybg/tertiarybg etc for ELEVATED STYLES!!
10573
- // ANCHOR: level 1
10574
- --face: var(--background); // IMPORTANT: redeclare references scope or it WONT pick up!
10575
- // --face2: var(--secondaryBackground); // IMPORTANT: redeclare references scope or it WONT pick up!
10576
- // --face3: var(--tertiaryBackground); // IMPORTANT: redeclare references scope or it WONT pick up!
10577
-
10578
- // FIXME: feat-sheet 1/3
10579
- --background: var(--secondaryBackground); //light-dark(var(--secondary-bg), var(--secondary-bg-dark));
10580
- // --face: light-dark(var(--secondary-bg), var(--secondary-bg-dark));
10581
-
10582
- // --text: light-dark(var(--secondary-text), var(--secondary-text-dark));
10583
- } */
10564
+ :where([is=sheet-view], [is=full-screen], [is=confirmation-dialog], [is=alert-dialog]) {
10565
+ --face: var(--background);
10566
+ --background: var(--secondaryBackground);
10567
+ }
10568
+ :where([is=sheet-view]:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10569
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10570
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10571
+ [is=full-screen]:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10572
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10573
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10574
+ [is=confirmation-dialog]:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10575
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10576
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10577
+ [is=alert-dialog]:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10578
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10579
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10580
+ body-view:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10581
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10582
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10583
+ navigation-split-view:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10584
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10585
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10586
+ navigation-split-view > [is=sidebar-view]:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10587
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10588
+ > scroll-view table-view[table-style=inset]:not([slot], [background])),
10589
+ navigation-stack:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10590
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10591
+ > scroll-view table-view[table-style=inset]:not([slot], [background]))) {
10592
+ --background: var(--groupedBackground);
10593
+ --secondaryBackground: var(--secondaryGroupedBackground);
10594
+ --tertiaryBackground: var(--tertiaryGroupedBackground);
10595
+ --face: var(--background);
10596
+ }
10597
+ :where(navigation-stack > navigation-stack:not(:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10598
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10599
+ > scroll-view table-view[table-style=inset]:not([slot], [background]))),
10600
+ navigation-stack > navigation-split-view:not(:has(> scroll-view list-view[list-style=inset-grouped]:not([slot], [background]),
10601
+ > scroll-view [is=form-view][form-style=inset-grouped]:not([slot], [background]),
10602
+ > scroll-view table-view[table-style=inset]:not([slot], [background])))) {
10603
+ --background: initial;
10604
+ --secondaryBackground: initial;
10605
+ --tertiaryBackground: initial;
10606
+ --face: var(--background);
10607
+ }
10584
10608
  @media (min-width: 43rem) {
10585
10609
  :where(navigation-split-view > [is=sidebar-view]) {
10586
10610
  --face: light-dark(var(--liquid-glass-bg), var(--liquid-glass-bg-dark));
package/html-data/en.json CHANGED
@@ -1070,6 +1070,11 @@
1070
1070
  "name": "frame:max-width",
1071
1071
  "description": "Sets max-inline-size",
1072
1072
  "valueSet": "FrameInlineLength"
1073
+ },
1074
+ {
1075
+ "name": "background-style",
1076
+ "description": "Overrides the context-aware styles for background colors",
1077
+ "valueSet": "BackgroundStyle"
1073
1078
  }
1074
1079
  ],
1075
1080
  "valueSets": [
@@ -2615,6 +2620,15 @@
2615
2620
  "description": "100cqi"
2616
2621
  }
2617
2622
  ]
2623
+ },
2624
+ {
2625
+ "name": "BackgroundStyle",
2626
+ "values": [
2627
+ {
2628
+ "name": "initial",
2629
+ "description": "Reverts any background styles applied to this element, usually by context-aware rules like for example the inset-grouped-list styling applied to all descendants of current view"
2630
+ }
2631
+ ]
2618
2632
  }
2619
2633
  ]
2620
2634
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.111",
3
+ "version": "0.0.0-dev.112",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/scss/_utils.scss CHANGED
@@ -6,6 +6,6 @@
6
6
 
7
7
  @forward 'utils/spacing';
8
8
 
9
- @forward 'utils/scroll-view';
9
+ // @forward 'utils/scroll-view';
10
10
 
11
11
  @forward 'utils/background';
@@ -133,33 +133,6 @@
133
133
  }
134
134
  }
135
135
 
136
- // label {
137
- // // remove this
138
- // display: inline-grid;
139
- // position: relative;
140
- // // min-height: var(--toolbar-cell-min-size);
141
- // // min-width: var(--toolbar-cell-min-size);
142
- // // container-type: inline-size;
143
-
144
- // grid-template-columns: minmax(0, 1fr);
145
- // grid-template-rows: minmax(0, 1fr);
146
-
147
- // place-content: center;
148
- // place-items: center;
149
- // // line-height: 1;
150
-
151
- // > svg {
152
- // display: inline-grid;
153
- // width: 2rem;
154
- // height: 2rem;
155
- // }
156
-
157
- // > i {
158
- // display: inline-grid;
159
- // font-size: 2rem;
160
- // }
161
- // }
162
-
163
136
  $CONFIG: (
164
137
  vt-fwd-class-name: vars.$vt-fwd-class-name,
165
138
 
@@ -377,8 +377,8 @@
377
377
  --#{$v}-item-padding-inline-start: 1rem;
378
378
  --#{$v}-item-padding-inline-end: 1rem;
379
379
 
380
- --insetgrouped#{$v}-background-color: var(--background);
381
- --insetgrouped#{$v}-item-background-color: var(--quaternaryGroupedBackground);
380
+ // --insetgrouped#{$v}-background-color: var(--background);
381
+ // --insetgrouped#{$v}-item-background-color: var(--quaternaryGroupedBackground);
382
382
  }
383
383
 
384
384
  --toggle-inline-size: 3.4rem;
@@ -621,8 +621,7 @@ $colors: map.merge(
621
621
  // --canvastext: light-dark(var(--primary-label), var(--primary-label-dark));
622
622
  // }
623
623
 
624
- // NOTE: NO color diffs for dialogs/popups
625
- /* :where([is='sheet-view'], [is='full-screen'], [is='confirmation-dialog'], [is='alert-dialog']) {
624
+ :where([is='sheet-view'], [is='full-screen'], [is='confirmation-dialog'], [is='alert-dialog']) {
626
625
  // modify background/secondarybg/tertiarybg etc for ELEVATED STYLES!!
627
626
  // ANCHOR: level 1
628
627
  --face: var(--background); // IMPORTANT: redeclare references scope or it WONT pick up!
@@ -634,7 +633,52 @@ $colors: map.merge(
634
633
  // --face: light-dark(var(--secondary-bg), var(--secondary-bg-dark));
635
634
 
636
635
  // --text: light-dark(var(--secondary-text), var(--secondary-text-dark));
637
- } */
636
+ }
637
+
638
+ [is='sheet-view'],
639
+ [is='full-screen'],
640
+ [is='confirmation-dialog'],
641
+ [is='alert-dialog'],
642
+ body-view,
643
+ navigation-split-view,
644
+ navigation-split-view > [is='sidebar-view'],
645
+ navigation-stack {
646
+ // @media (pointer: coarse) {
647
+ :where(
648
+ &:has(
649
+ > scroll-view list-view[list-style='inset-grouped']:not([slot], [background]),
650
+ > scroll-view [is='form-view'][form-style='inset-grouped']:not([slot], [background]),
651
+ > scroll-view table-view[table-style='inset']:not([slot], [background])
652
+ )
653
+ ) {
654
+ --background: var(--groupedBackground);
655
+ --secondaryBackground: var(--secondaryGroupedBackground);
656
+ --tertiaryBackground: var(--tertiaryGroupedBackground);
657
+
658
+ --face: var(--background);
659
+ }
660
+ // }
661
+ }
662
+
663
+ // revert above!
664
+ navigation-stack > navigation-stack,
665
+ navigation-stack > navigation-split-view {
666
+ :where(
667
+ &:not(
668
+ :has(
669
+ > scroll-view list-view[list-style='inset-grouped']:not([slot], [background]),
670
+ > scroll-view [is='form-view'][form-style='inset-grouped']:not([slot], [background]),
671
+ > scroll-view table-view[table-style='inset']:not([slot], [background])
672
+ )
673
+ )
674
+ ) {
675
+ --background: initial;
676
+ --secondaryBackground: initial;
677
+ --tertiaryBackground: initial;
678
+
679
+ --face: var(--background);
680
+ }
681
+ }
638
682
 
639
683
  :where(navigation-split-view > [is='sidebar-view']) {
640
684
  // --canvas: light-dark(oklch(var(--primary-bg)), var(--primary-bg-dark));
@@ -116,18 +116,6 @@
116
116
  }
117
117
  }
118
118
  }
119
-
120
- // &:has(list-view[list-style='inset-grouped']:not([background]), [is='form-view'][form-style='inset-grouped']:not([background])) {
121
- // :where(&) {
122
- // outline: red solid 4px;
123
-
124
- // // --background: var(--groupedBackground);
125
- // // --secondaryBackground: var(--secondaryGroupedBackground);
126
- // // --tertiaryBackground: var(--tertiaryGroupedBackground);
127
-
128
- // // --face: var(--background);
129
- // }
130
- // }
131
119
  }
132
120
  }
133
121
 
@@ -2,29 +2,51 @@
2
2
  @use '../maps';
3
3
 
4
4
  @layer #{vars.$utils-layer} {
5
- [background-style='grouped'] {
6
- @media (pointer: coarse) {
7
- :where(&) {
8
- // --face: var(--groupedBackground);
9
- --background: var(--groupedBackground);
10
- --secondaryBackground: var(--secondaryGroupedBackground);
11
- --tertiaryBackground: var(--tertiaryGroupedBackground);
12
-
13
- --face: var(--background);
14
- // --face2: var(--secondaryBackground);
15
- // --face3: var(--tertiaryBackground);
16
- }
5
+ // [background-style='grouped'] {
6
+ // // @media (pointer: coarse) {
7
+ // :where(&) {
8
+ // // --face: var(--groupedBackground);
9
+ // --background: var(--groupedBackground);
10
+ // --secondaryBackground: var(--secondaryGroupedBackground);
11
+ // --tertiaryBackground: var(--tertiaryGroupedBackground);
12
+
13
+ // --face: var(--background);
14
+ // // --face2: var(--secondaryBackground);
15
+ // // --face3: var(--tertiaryBackground);
16
+ // }
17
+
18
+ // // FIXME: feat-sheet 2/3
19
+ // [is='sheet-view'] &,
20
+ // [is='full-screen'] &,
21
+ // [is='confirmation-dialog'] &,
22
+ // [is='alert-dialog'] & {
23
+ // :where(&) {
24
+ // // --background: var(--secondaryGroupedBackground);
25
+ // // --secondaryBackground: var(--tertiaryGroupedBackground);
26
+ // // --tertiaryBackground: var(--quaternaryGroupedBackground);
27
+ // }
28
+ // }
29
+ // // }
30
+ // }
31
+ [background-style='initial'] {
32
+ :where(&) {
33
+ --background: initial;
34
+ --secondaryBackground: initial;
35
+ --tertiaryBackground: initial;
17
36
 
18
- // FIXME: feat-sheet 2/3
19
- [is='sheet-view'] &,
20
- [is='full-screen'] &,
21
- [is='confirmation-dialog'] &,
22
- [is='alert-dialog'] & {
23
- :where(&) {
24
- // --background: var(--secondaryGroupedBackground);
25
- // --secondaryBackground: var(--tertiaryGroupedBackground);
26
- // --tertiaryBackground: var(--quaternaryGroupedBackground);
27
- }
37
+ --face: var(--background);
38
+ // --face2: var(--secondaryBackground);
39
+ // --face3: var(--tertiaryBackground);
40
+ }
41
+
42
+ [is='sheet-view'] &,
43
+ [is='full-screen'] &,
44
+ [is='confirmation-dialog'] &,
45
+ [is='alert-dialog'] & {
46
+ :where(&) {
47
+ // --background: var(--secondaryGroupedBackground);
48
+ // --secondaryBackground: var(--tertiaryGroupedBackground);
49
+ // --tertiaryBackground: var(--quaternaryGroupedBackground);
28
50
  }
29
51
  }
30
52
  }