@swiftwc/ui 0.0.0-dev.25 → 0.0.0-dev.26

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.
@@ -25,5 +25,5 @@ export declare const confirmationDialog: (trigger: HTMLElement, title: string, a
25
25
  }[], options?: {
26
26
  controller?: AbortController;
27
27
  titleVisibility?: boolean;
28
- }) => Promise<any>;
28
+ }) => Promise<unknown>;
29
29
  export { I18n, lifecycleObserver, NavigationPath, Snapshot };
@@ -368,7 +368,7 @@ export const confirmationDialog = async (trigger, title, actions, options) => {
368
368
  if (action?.role)
369
369
  btn.setAttribute('role', action.role);
370
370
  if (action.label || action.image) {
371
- const label = $(`<label-view title="${action.label}"></label-view>`, '>1');
371
+ const label = $(`<label-view></label-view>`, '>1');
372
372
  if (action.label)
373
373
  label.setAttribute('title', action.label);
374
374
  if (action.image)
@@ -377,7 +377,7 @@ export const confirmationDialog = async (trigger, title, actions, options) => {
377
377
  }
378
378
  dialog.insertAdjacentElement('beforeend', btn);
379
379
  }
380
- trigger.closest('body-view')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
380
+ trigger.closest('body-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
381
381
  const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
382
382
  off();
383
383
  resolve(evt.detail.returnValue);
@@ -2369,7 +2369,7 @@
2369
2369
  }
2370
2370
  }
2371
2371
  @layer sw-colors {
2372
- [is=bordered-prominent-button] {
2372
+ [is=glass-prominent-button] {
2373
2373
  --secondary: var(--btntext);
2374
2374
  --blue: var(--btntext);
2375
2375
  }
@@ -7794,6 +7794,10 @@
7794
7794
  --toolbaritemhighlighttext: light-dark(oklch(from var(--accentColor) clamp(0, (0.7 - l) * 999, 1) none none), oklch(from var(--accentColor) clamp(0, (0.7 - l) * 999, 1) none none));
7795
7795
  --toolbaritemactiveface: light-dark(oklch(from var(--accentColor) min(calc(l * 1.2), 1) min(calc(c * 1.1), c) h), oklch(from var(--accentColor) min(calc(l * 1.2), 1) min(calc(c * 1.1), c) h));
7796
7796
  --toolbaritemactivetext: light-dark(oklch(from var(--accentColor) clamp(0, (0.7 - l) * 999, 1) none none), oklch(from var(--accentColor) clamp(0, (0.7 - l) * 999, 1) none none));
7797
+ --secondary: var(--btntext);
7798
+ --blue: var(--btntext);
7799
+ --accentColorEffective: var(--btntext);
7800
+ --accentColor: var(--btntext);
7797
7801
  }
7798
7802
  :where(sidebar-toggle) {
7799
7803
  --toolbaritemhighlightface: light-dark(var(--toolbar-cell-focus-bg), var(--toolbar-cell-focus-bg-dark));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.25",
3
+ "version": "0.0.0-dev.26",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -523,6 +523,12 @@ $colors: map.merge(
523
523
  // --toolbaritemactivetext: oklch(from var(--accentColor) clamp(0, (0.7 - l) * 999, 1) none none);
524
524
 
525
525
  @include mixins.wire-tinted-glass(toolbaritem);
526
+
527
+ --secondary: var(--btntext);
528
+ --blue: var(--btntext);
529
+
530
+ --accentColorEffective: var(--btntext);
531
+ --accentColor: var(--btntext);
526
532
  }
527
533
  }
528
534
 
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  @layer #{vars.$colors-layer} {
44
- [is='bordered-prominent-button'] {
44
+ [is='glass-prominent-button'] {
45
45
  --secondary: var(--btntext);
46
46
  --blue: var(--btntext);
47
47
  }
@@ -40,10 +40,9 @@
40
40
  :where(&:has([disabled])) {
41
41
  pointer-events: none;
42
42
  }
43
- }
44
43
 
45
- // NOTE: MUST be right-after the above `all: unset` in this SAME page!
46
- tool-bar-item {
44
+ // NOTE: MUST be right-after the above `all: unset` in this SAME page!
45
+
47
46
  :where(& > button),
48
47
  :where(& > picker-view > menu-view)::part(menu-summary),
49
48
  :where(& > menu-view)::part(menu-summary) {
@@ -54,6 +53,18 @@
54
53
 
55
54
  > button {
56
55
  @include mixins.takeover-button-slots;
56
+
57
+ // [tint] &,
58
+ // &[tint] {
59
+ // :where(&) {
60
+ // // NOTE: Make everything inside prominent buttons white
61
+ // --secondary: var(--btntext);
62
+ // --blue: var(--btntext);
63
+
64
+ // --accentColorEffective: var(--btntext);
65
+ // --accentColor: var(--btntext);
66
+ // }
67
+ // }
57
68
  }
58
69
 
59
70
  // NOTE: add paddings to labels w/ text in toolbar items
@@ -75,86 +86,9 @@
75
86
  // }
76
87
  // }
77
88
  }
78
-
79
- // tool-bar-item[slot],
80
- // tool-bar-item-group {
81
- // @media (prefers-reduced-motion: no-preference) {
82
- // transition:
83
- // display var(--menu-animation-duration) allow-discrete ease-out,
84
- // overlay var(--menu-animation-duration) allow-discrete ease-out,
85
- // transform var(--menu-animation-duration) allow-discrete ease-out;
86
- // will-change: transform, overlay, display;
87
- // }
88
- // }
89
-
90
- // tool-bar-item {
91
- // min-height: var(--toolbar-cell-min-size);
92
- // min-width: var(--toolbar-cell-min-size);
93
- // }
94
89
  }
95
90
 
96
- // @layer #{vars.$colors-layer} {
97
- // sidebar-toggle > button,
98
- // tool-bar-item > button,
99
- // tool-bar-item > input,
100
- // [is='tab-item'],
101
- // // list-view > button,
102
- // menu-view > button,
103
- // [is='disclosure-group'] > button,
104
- // [is='disclosure-group'] > summary {
105
- // &:not(:disabled):not([readonly]) {
106
- // :where(&) {
107
- // @include mixins.add-focus-visible-state {
108
- // --toolbaritemface: light-dark(var(--toolbar-cell-focus-bg), var(--toolbar-cell-focus-bg-dark));
109
- // }
110
- // }
111
- // }
112
- // }
113
-
114
- // menu-view {
115
- // @include mixins.add-focus-visible-state('::part(menu-summary)') {
116
- // --toolbaritemface: var(--toolbaritemhighlightface,); //light-dark(var(--toolbar-cell-focus-bg), var(--toolbar-cell-focus-bg-dark));
117
- // }
118
- // @include mixins.add-hover-state('::part(menu-summary)') {
119
- // --toolbaritemface: var(--toolbaritemhighlightface,); //light-dark(var(--toolbar-cell-focus-bg), var(--toolbar-cell-focus-bg-dark));
120
- // }
121
- // }
122
-
123
- // list-view > button,
124
- // [is='form-view'] > button {
125
- // &:not(:disabled):not([readonly]) {
126
- // :where(&) {
127
- // --toolbaritempadistart: 0.3rem;
128
- // --toolbaritempadbstart: 0.3rem;
129
- // }
130
- // }
131
- // }
132
- // }
133
-
134
91
  @layer #{vars.$ui-layer} {
135
- // sidebar-toggle > button,
136
- // tool-bar-item > button,
137
- // tool-bar-item > input,
138
- // [is='tab-item'],
139
- // // list-view > button,
140
- // menu-view > button,
141
- // [is='disclosure-group'] > summary,
142
- // [is='disclosure-group'] > button {
143
- // // &:not(:disabled):not([readonly]) {
144
- // // :where(&) {
145
- // @include mixins.add-active-state {
146
- // --toolbaritemface: light-dark(var(--toolbar-cell-active-bg), var(--toolbar-cell-active-bg-dark));
147
- // }
148
- // // }
149
- // // }
150
- // }
151
-
152
- // menu-view {
153
- // @include mixins.add-active-state('::part(menu-summary)') {
154
- // --toolbaritemface: var(--toolbaritemactiveface,); //light-dark(var(--toolbar-cell-active-bg), var(--toolbar-cell-active-bg-dark));
155
- // }
156
- // }
157
-
158
92
  :where(tool-bar-item[slot]:has(menu-view[open])),
159
93
  :where(tool-bar-item-group:has(> tool-bar-item menu-view[open])) {
160
94
  --toolbar-cell-scale: var(--menu-host-offscreen-transform);