@swiftwc/ui 0.0.0-dev.105 → 0.0.0-dev.107

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.
Files changed (79) hide show
  1. package/generated/client/index.js +6 -7
  2. package/generated/components/alert-dialog.js +9 -10
  3. package/generated/components/body-view.js +3 -3
  4. package/generated/components/bordered-button.js +4 -5
  5. package/generated/components/bordered-prominent-button.js +4 -5
  6. package/generated/components/borderless-button.js +4 -5
  7. package/generated/components/color-scheme.js +4 -4
  8. package/generated/components/confirmation-dialog.js +9 -10
  9. package/generated/components/content-unavailable.js +4 -5
  10. package/generated/components/date-picker.js +13 -14
  11. package/generated/components/detail-placeholder.js +4 -4
  12. package/generated/components/disclosure-group.js +5 -6
  13. package/generated/components/fine-tooltip.js +4 -5
  14. package/generated/components/form-view.js +3 -4
  15. package/generated/components/glass-button.js +4 -5
  16. package/generated/components/glass-prominent-button.js +4 -5
  17. package/generated/components/h-divider.js +4 -4
  18. package/generated/components/h-stack.js +3 -3
  19. package/generated/components/image-view.js +4 -5
  20. package/generated/components/label-view.js +4 -5
  21. package/generated/components/labeled-content.js +4 -5
  22. package/generated/components/list-view.d.ts +1 -0
  23. package/generated/components/list-view.js +4 -4
  24. package/generated/components/menu-view.js +10 -11
  25. package/generated/components/navigation-large-title.d.ts +0 -1
  26. package/generated/components/navigation-large-title.js +5 -7
  27. package/generated/components/navigation-split-view.js +4 -4
  28. package/generated/components/navigation-stack.js +4 -4
  29. package/generated/components/navigation-title.js +4 -4
  30. package/generated/components/picker-view.js +31 -32
  31. package/generated/components/plain-button.js +3 -4
  32. package/generated/components/progress-view.js +6 -7
  33. package/generated/components/screen-view.js +2 -2
  34. package/generated/components/scroll-view-proxy.js +3 -3
  35. package/generated/components/scroll-view.js +9 -10
  36. package/generated/components/search-view.js +4 -5
  37. package/generated/components/section-view.js +4 -5
  38. package/generated/components/sheet-view.js +6 -7
  39. package/generated/components/sidebar-toggle.js +5 -6
  40. package/generated/components/sidebar-view.js +2 -3
  41. package/generated/components/sticky-container.js +3 -4
  42. package/generated/components/tab-bar.js +4 -5
  43. package/generated/components/tab-item.js +8 -9
  44. package/generated/components/tab-view.js +7 -8
  45. package/generated/components/table-view.js +6 -7
  46. package/generated/components/text-field.js +10 -11
  47. package/generated/components/text-view.js +4 -4
  48. package/generated/components/toggle-view.js +21 -15
  49. package/generated/components/tool-bar-item-group.js +3 -3
  50. package/generated/components/tool-bar-item.js +4 -5
  51. package/generated/components/tool-bar.js +4 -5
  52. package/generated/components/v-divider.js +4 -4
  53. package/generated/components/v-keyboard.js +5 -6
  54. package/generated/components/v-stack.js +3 -3
  55. package/generated/css/index.css +76 -11
  56. package/generated/internal/class/css-style-observer.js +2 -3
  57. package/generated/internal/class/form-associated-base.js +5 -5
  58. package/generated/internal/class/navigation-view.js +3 -4
  59. package/generated/internal/decorators/adaptive-slot.js +4 -5
  60. package/generated/internal/privateNamespace.d.ts +1 -1
  61. package/generated/internal/privateNamespace.js +12 -12
  62. package/generated/internal/utils/debug.d.ts +1 -0
  63. package/generated/internal/utils/debug.js +4 -0
  64. package/generated/internal/utils/index.d.ts +2 -2
  65. package/generated/internal/utils/index.js +2 -2
  66. package/generated/internal/utils/is-inside.js +1 -1
  67. package/generated/snapshot/index.js +3 -4
  68. package/package.json +2 -1
  69. package/scss/_utils.scss +2 -0
  70. package/scss/base/_root.scss +6 -3
  71. package/scss/colors/_index.scss +11 -0
  72. package/scss/components/_navigation-large-title.scss +14 -8
  73. package/scss/components/_scroll-view.scss +12 -0
  74. package/scss/components/_toggle-view.scss +10 -0
  75. package/scss/utils/_background.scss +52 -0
  76. package/scss/utils/_index.scss +20 -17
  77. package/web-components.html-data/en.json +11 -11
  78. package/generated/internal/utils/dev-flags.d.ts +0 -3
  79. package/generated/internal/utils/dev-flags.js +0 -5
@@ -302,8 +302,12 @@
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);
305
307
  --form-item-padding-inline-start: 1rem;
306
308
  --form-item-padding-inline-end: 1rem;
309
+ --insetgroupedform-background-color: var(--background);
310
+ --insetgroupedform-item-background-color: var(--quaternaryGroupedBackground);
307
311
  --toggle-inline-size: 3.4rem;
308
312
  --toggle-block-size: 1.3rem;
309
313
  --control-clear-glass-bg: var(--white);
@@ -3621,6 +3625,12 @@
3621
3625
  --toggle--dot-inset-inline-start: calc(100% - var(--toggle--dot-size));
3622
3626
  --toggle--dot-inset-inline-end: 0;
3623
3627
  }
3628
+ :where(toggle-view[aria-checked=true]):window-inactive {
3629
+ --toggle--track-bg: var(--toggle--track-off-bg);
3630
+ }
3631
+ :where(toggle-view[aria-checked=true][js-window-inactive]) {
3632
+ --toggle--track-bg: var(--toggle--track-off-bg);
3633
+ }
3624
3634
  :where(toggle-view > :nth-child(n+2 of [slot=label])) {
3625
3635
  --label-font: callout;
3626
3636
  }
@@ -3698,16 +3708,13 @@
3698
3708
  navigation-large-title :nth-child(1 of label-view)) {
3699
3709
  --label-image-size: 5;
3700
3710
  }
3711
+ :where(navigation-large-title :nth-child(1 of image-view)) {
3712
+ color: var(--accentColor);
3713
+ }
3701
3714
  :where(scroll-view[navigation-bar-title-display-mode=inline]:has(navigation-large-title) navigation-large-title[navigation-bar-auto-hide]) {
3702
3715
  opacity: 0;
3703
3716
  visibility: collapse;
3704
3717
  }
3705
- :where(navigation-large-title[background-style=grouped]) {
3706
- background-color: var(--secondaryGroupedBackground);
3707
- border-radius: var(--insetlist-item-border-radius);
3708
- padding-inline: var(--list-item-padding-inline-start) var(--list-item-padding-inline-end);
3709
- padding-block: 1rem;
3710
- }
3711
3718
  }
3712
3719
  @layer sw-components {}
3713
3720
  @layer sw-components {
@@ -6094,11 +6101,13 @@
6094
6101
  }
6095
6102
  }
6096
6103
  @layer sw-utils {
6097
- :where([background-style=grouped]) {
6098
- --background: var(--groupedBackground);
6099
- --secondaryBackground: var(--secondaryGroupedBackground);
6100
- --tertiaryBackground: var(--tertiaryGroupedBackground);
6101
- --face: var(--background);
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
+ }
6102
6111
  }
6103
6112
  :where([foreground=primary]) {
6104
6113
  color: var(--primary);
@@ -9177,6 +9186,50 @@
9177
9186
  }
9178
9187
  }
9179
9188
  @layer sw-utils {}
9189
+ @layer sw-utils {
9190
+ :where(list-view[background=system-background],
9191
+ [is=form-view][background=system-background]) {
9192
+ --list--host-background-color: var(--background);
9193
+ }
9194
+ :where(list-view[list-row-background=system-tertiary-grouped-background],
9195
+ [is=form-view][list-row-background=system-tertiary-grouped-background]) {
9196
+ --list--item-background-color: var(--tertiaryGroupedBackground);
9197
+ }
9198
+ :where(list-view[list-row-background=system-quaternary-grouped-background],
9199
+ [is=form-view][list-row-background=system-quaternary-grouped-background]) {
9200
+ --list--item-background-color: var(--quaternaryGroupedBackground);
9201
+ }
9202
+ :where([is=sheet-view] list-view[background=system-background],
9203
+ [is=sheet-view] [is=form-view][background=system-background],
9204
+ [is=full-screen] list-view[background=system-background],
9205
+ [is=full-screen] [is=form-view][background=system-background],
9206
+ [is=confirmation-dialog] list-view[background=system-background],
9207
+ [is=confirmation-dialog] [is=form-view][background=system-background],
9208
+ [is=alert-dialog] list-view[background=system-background],
9209
+ [is=alert-dialog] [is=form-view][background=system-background]) {
9210
+ --list--host-background-color: var(--secondaryBackground);
9211
+ }
9212
+ :where([is=sheet-view] list-view[list-row-background=system-tertiary-grouped-background],
9213
+ [is=sheet-view] [is=form-view][list-row-background=system-tertiary-grouped-background],
9214
+ [is=full-screen] list-view[list-row-background=system-tertiary-grouped-background],
9215
+ [is=full-screen] [is=form-view][list-row-background=system-tertiary-grouped-background],
9216
+ [is=confirmation-dialog] list-view[list-row-background=system-tertiary-grouped-background],
9217
+ [is=confirmation-dialog] [is=form-view][list-row-background=system-tertiary-grouped-background],
9218
+ [is=alert-dialog] list-view[list-row-background=system-tertiary-grouped-background],
9219
+ [is=alert-dialog] [is=form-view][list-row-background=system-tertiary-grouped-background]) {
9220
+ --list--item-background-color: var(--quaternaryGroupedBackground);
9221
+ }
9222
+ :where([is=sheet-view] list-view[list-row-background=system-quaternary-grouped-background],
9223
+ [is=sheet-view] [is=form-view][list-row-background=system-quaternary-grouped-background],
9224
+ [is=full-screen] list-view[list-row-background=system-quaternary-grouped-background],
9225
+ [is=full-screen] [is=form-view][list-row-background=system-quaternary-grouped-background],
9226
+ [is=confirmation-dialog] list-view[list-row-background=system-quaternary-grouped-background],
9227
+ [is=confirmation-dialog] [is=form-view][list-row-background=system-quaternary-grouped-background],
9228
+ [is=alert-dialog] list-view[list-row-background=system-quaternary-grouped-background],
9229
+ [is=alert-dialog] [is=form-view][list-row-background=system-quaternary-grouped-background]) {
9230
+ --list--item-background-color: var(--quaintaryGroupedBackground);
9231
+ }
9232
+ }
9180
9233
  @layer sw-transitions {
9181
9234
  @media (prefers-reduced-motion: no-preference) {
9182
9235
  scroll-view.fwd, scroll-view.fwdd, scroll-view.bwd, scroll-view.bwdd {
@@ -10181,6 +10234,18 @@
10181
10234
  inherits: true;
10182
10235
  }
10183
10236
  }
10237
+ @property --quaternaryGroupedBackground {
10238
+ syntax: "<color>";
10239
+ initial-value: oklch(97.61% 0 0deg);
10240
+ inherits: true;
10241
+ }
10242
+ @media (prefers-color-scheme: dark) {
10243
+ @property --quaternaryGroupedBackground {
10244
+ syntax: "<color>";
10245
+ initial-value: oklch(27.51% 0.0039 128.62deg);
10246
+ inherits: true;
10247
+ }
10248
+ }
10184
10249
  @property --separator {
10185
10250
  syntax: "<color>";
10186
10251
  initial-value: oklch(94.31% 0 0deg);
@@ -1,6 +1,5 @@
1
1
  var _a;
2
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
3
- import { onoff } from '../../internal/utils';
2
+ import { debug, onoff } from '../../internal/utils';
4
3
  export class CSSStyleObserver {
5
4
  #cleanups;
6
5
  #options;
@@ -17,7 +16,7 @@ export class CSSStyleObserver {
17
16
  this.#cleanups?.();
18
17
  }
19
18
  #handleTransitionrun = (callback, evt) => {
20
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
19
+ debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
21
20
  if (!this.#options?.properties.some((prop) => evt.propertyName.startsWith(prop)))
22
21
  return;
23
22
  callback?.(evt);
@@ -1,4 +1,4 @@
1
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../../internal/utils';
2
2
  import { CleanupRegistry } from './cleanup-registry';
3
3
  const internals = new WeakMap();
4
4
  // const trackedElements = new WeakMap<FormAssociatedBase, Set<Element>>()
@@ -11,14 +11,14 @@ export function getInternals(instance) {
11
11
  }
12
12
  // export function makeSlotchangeHandler(t: FormAssociatedBase) {
13
13
  // const handleSlotchange = ({ type, target: slot }: Event) => {
14
- // DEBUG && console.debug(`${makeSlotchangeHandler.name} ⚡️ ${type}`)
14
+ // debug(`${makeSlotchangeHandler.name} ⚡️ ${type}`)
15
15
  // if (!(slot instanceof HTMLSlotElement && slot)) return
16
16
  // const assigned = slot.assignedElements({ flatten: true })
17
17
  // observers.syncObservations(trackedElements.get(t) ?? new Set(), assigned, handleTagMutation, ['value', 'label'])
18
18
  // if (0 < assigned.length) handleTagMutation()
19
19
  // },
20
20
  // handleTagMutation = (entry?: MutationRecord) => {
21
- // DEBUG && console.debug(`${handleTagMutation.name} ⚡️ mutation`)
21
+ // debug(`${handleTagMutation.name} ⚡️ mutation`)
22
22
  // t.setValidity(t.validity, t.validationMessage)
23
23
  // }
24
24
  // return [{ types: 'slotchange', listener: handleSlotchange }]
@@ -33,12 +33,12 @@ export class FormAssociatedBase extends HTMLElement {
33
33
  // trackedElements.set(this, new Set<Element>())
34
34
  }
35
35
  disconnectedCallback() {
36
- DEBUG && console.debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
36
+ debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
37
37
  CleanupRegistry.unregister(this);
38
38
  // observers.clearObservationsSet(trackedElements.get(this) ?? new Set())
39
39
  }
40
40
  connectedCallback() {
41
- DEBUG && console.debug(`${FormAssociatedBase.name} ⚡️ connect`);
41
+ debug(`${FormAssociatedBase.name} ⚡️ connect`);
42
42
  }
43
43
  get type() {
44
44
  return this.localName;
@@ -1,8 +1,7 @@
1
1
  var _a;
2
2
  import { lifecycleObserver } from '../../buses';
3
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
4
3
  import { CleanupRegistry } from '../../internal/class/cleanup-registry';
5
- import { frame, onoff } from '../utils';
4
+ import { debug, frame, onoff } from '../utils';
6
5
  export class NavigationView extends HTMLElement {
7
6
  static get observedAttributes() {
8
7
  return ['hidden'];
@@ -32,7 +31,7 @@ export class NavigationView extends HTMLElement {
32
31
  // consume it (important so it doesn’t leak to next change)
33
32
  this.#recentBefore = undefined;
34
33
  }
35
- DEBUG && console.debug(`${_a.name} 💡 ${eventType}`);
34
+ debug(`${_a.name} 💡 ${eventType}`);
36
35
  frame(this).then(() => target.dispatchEvent(new CustomEvent(eventType, { detail: { tag: this.id }, bubbles: true, composed: true })));
37
36
  break;
38
37
  }
@@ -56,7 +55,7 @@ export class NavigationView extends HTMLElement {
56
55
  frame(this).then(() => lifecycleObserver.dispatchEvent(new CustomEvent('tabshow', { detail: { tag: this.id }, bubbles: true, composed: true })));
57
56
  }
58
57
  #handleBeforeTabRevealOrSwap = ({ type, detail }) => {
59
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
58
+ debug(`${_a.name} ⚡️ ${type}`);
60
59
  if (this.id !== detail?.tag)
61
60
  return;
62
61
  this.#recentBefore = {
@@ -1,10 +1,9 @@
1
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
2
1
  import { Snapshot } from '../../snapshot';
3
2
  import { CleanupRegistry } from '../class/cleanup-registry';
4
- import { onoff } from '../utils';
3
+ import { debug, onoff } from '../utils';
5
4
  export default function (filter) {
6
5
  const handleMediaChange = (el, { type, matches }) => {
7
- DEBUG && console.debug(`${el.localName} ⚡️ ${type}`);
6
+ debug(`${el.localName} ⚡️ ${type}`);
8
7
  if (matches) {
9
8
  if (!el.matches(`[slot="cancellation-action"],[slot="primary-action"],[slot="confirmation-action"],[slot="destructive-action"]`))
10
9
  return;
@@ -23,7 +22,7 @@ export default function (filter) {
23
22
  return function (Base, _context) {
24
23
  const originalConnected = Base.prototype.connectedCallback, originalDisconnected = Base.prototype.disconnectedCallback;
25
24
  Base.prototype.connectedCallback = function () {
26
- DEBUG && console.debug(`decorator:[${this.localName}] ⚡️ connect`);
25
+ debug(`decorator:[${this.localName}] ⚡️ connect`);
27
26
  originalConnected?.call(this);
28
27
  if (filter && !filter(this))
29
28
  return;
@@ -40,7 +39,7 @@ export default function (filter) {
40
39
  });
41
40
  };
42
41
  Base.prototype.disconnectedCallback = function () {
43
- DEBUG && console.debug(`decorator:[${this.localName}] ⚡️ disconnect`);
42
+ debug(`decorator:[${this.localName}] ⚡️ disconnect`);
44
43
  originalDisconnected?.call(this);
45
44
  CleanupRegistry.unregister(this, 'adaptive-slot');
46
45
  };
@@ -4,7 +4,7 @@ type TransitionType = 'forwards' | 'backwards' | 'reload';
4
4
  export type NavigationHost = Components.BodyView | Components.SheetView | Components.NavigationStack | Components.NavigationSplitView;
5
5
  export type NavigationToolbarConfiguration = Components.ToolBarItem | Components.ToolBarItemGroup;
6
6
  export type NavigationPage = Components.SidebarView | Components.ScrollView;
7
- export declare function queryInsertPosition(frame: NavigationHost): "afterend" | "beforebegin";
7
+ export declare function queryInsertPosition(frame?: NavigationHost): "afterend" | "beforebegin";
8
8
  type UpdateCallback = () => void | Promise<void>;
9
9
  type NavigateOptions = {
10
10
  updateCallback?: UpdateCallback;
@@ -1,5 +1,5 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
1
  import { NavigationPath } from '../internal/class/navigation-path';
2
+ import { debug } from '../internal/utils';
3
3
  import { Snapshot } from '../snapshot';
4
4
  export function queryInsertPosition(frame) {
5
5
  if ('NAVIGATION-SPLIT-VIEW' === frame?.tagName)
@@ -18,7 +18,7 @@ const cleanup = (lm, type) => {
18
18
  el.classList.remove(...arr);
19
19
  };
20
20
  export const startViewTransition = async (target, type = 'forwards', updateCallbackOrOptions = async () => { }) => {
21
- DEBUG && console.debug(`startViewTransition (${type})`, target);
21
+ debug(`startViewTransition (${type})`, target);
22
22
  if (!(target instanceof HTMLElement))
23
23
  throw new TypeError("Argument 1 ('target') to client.startViewTransition must be an instance of HTMLElement");
24
24
  if (!['forwards', 'backwards', 'reload'].includes(type))
@@ -57,9 +57,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
57
57
  // dialogFrames = [toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item): item is HTMLDialogElement => item instanceof HTMLDialogElement) //[toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item) => item?.matches('dialog'))
58
58
  // if ('DIALOG' === newHost?.tagName) {
59
59
  // ;(newHost as HTMLDialogElement).showModal()
60
- // DEBUG && console.debug(`⚡️ view-transition-start (${type})`)
60
+ // debug(`⚡️ view-transition-start (${type})`)
61
61
  // await Promise.allSettled(newHost.getAnimations().map(({ finished }) => finished))
62
- // DEBUG && console.debug(`⚡️ view-transition-end (${type})`)
62
+ // debug(`⚡️ view-transition-end (${type})`)
63
63
  // return
64
64
  // }
65
65
  // purge
@@ -82,14 +82,14 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
82
82
  if (0 < modalViews.length) {
83
83
  for await (const el of modalViews)
84
84
  el.showModal();
85
- DEBUG && console.debug(`⚡️ view-dialog-transition-start (${type})`);
85
+ debug(`⚡️ view-dialog-transition-start (${type})`);
86
86
  await Promise.allSettled(modalViews?.[0].getAnimations().map(({ finished }) => finished));
87
- DEBUG && console.debug(`⚡️ view-dialog-transition-end (${type})`);
87
+ debug(`⚡️ view-dialog-transition-end (${type})`);
88
88
  }
89
89
  else {
90
- DEBUG && console.debug(`⚡️ view-transition-start (${type})`);
90
+ debug(`⚡️ view-transition-start (${type})`);
91
91
  await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to?.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
92
- DEBUG && console.debug(`⚡️ view-transition-end (${type})`);
92
+ debug(`⚡️ view-transition-end (${type})`);
93
93
  }
94
94
  if (0 < (to?.component?.querySelectorAll(`.${Snapshot.config?.['vt-fwd-class-name']},.bwd`) ?? []).length)
95
95
  return;
@@ -110,9 +110,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
110
110
  if ('DIALOG' === from.component?.tagName) {
111
111
  from.body?.dispatchEvent(new CustomEvent('pageswap', { detail: { page: from.body }, bubbles: true, composed: true }));
112
112
  from.component.close();
113
- DEBUG && console.debug(`⚡️ view-dialog-transition-start (${type})`);
113
+ debug(`⚡️ view-dialog-transition-start (${type})`);
114
114
  await Promise.allSettled(from.component.getAnimations().map(({ finished }) => finished));
115
- DEBUG && console.debug(`⚡️ view-dialog-transition-end (${type})`);
115
+ debug(`⚡️ view-dialog-transition-end (${type})`);
116
116
  if (from.component.matches('[open]'))
117
117
  return;
118
118
  await updateCallback();
@@ -147,9 +147,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
147
147
  for (const el of inbetweenModals)
148
148
  el.close(); // close old inbetween modals
149
149
  // capture trans
150
- DEBUG && console.debug(`⚡️ view-transition-start (${type})`);
150
+ debug(`⚡️ view-transition-start (${type})`);
151
151
  await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
152
- DEBUG && console.debug(`⚡️ view-transition-end (${type})`);
152
+ debug(`⚡️ view-transition-end (${type})`);
153
153
  if (to.body?.closest(`.bwd,.${Snapshot.config?.['vt-fwd-class-name']}`))
154
154
  return;
155
155
  cleanup(root);
@@ -0,0 +1 @@
1
+ export default function (...args: Parameters<typeof self.console.debug>): void;
@@ -0,0 +1,4 @@
1
+ import flags from '../flags.json' with { type: 'json' };
2
+ export default function (...args) {
3
+ flags.DEBUG && self.console.debug(...args);
4
+ }
@@ -12,10 +12,10 @@ export { default as cssTime } from './css-time';
12
12
  export * from './css-time';
13
13
  export { default as debounce } from './debounce';
14
14
  export * from './debounce';
15
+ export { default as debug } from './debug';
16
+ export * from './debug';
15
17
  export { default as defineTranslations } from './define-translations';
16
18
  export * from './define-translations';
17
- export { default as devFlags } from './dev-flags';
18
- export * from './dev-flags';
19
19
  export { default as ensurePlaceholder } from './ensure-placeholder';
20
20
  export * from './ensure-placeholder';
21
21
  export { default as frame } from './frame';
@@ -12,10 +12,10 @@ export { default as cssTime } from './css-time';
12
12
  export * from './css-time';
13
13
  export { default as debounce } from './debounce';
14
14
  export * from './debounce';
15
+ export { default as debug } from './debug';
16
+ export * from './debug';
15
17
  export { default as defineTranslations } from './define-translations';
16
18
  export * from './define-translations';
17
- export { default as devFlags } from './dev-flags';
18
- export * from './dev-flags';
19
19
  export { default as ensurePlaceholder } from './ensure-placeholder';
20
20
  export * from './ensure-placeholder';
21
21
  export { default as frame } from './frame';
@@ -1,4 +1,4 @@
1
1
  export default function (x, y, rect) {
2
2
  const { left, right, top, bottom } = rect;
3
- return x >= left && x <= right && y >= top && y <= bottom;
3
+ return left <= x && x <= right && top <= y && y <= bottom;
4
4
  }
@@ -1,5 +1,4 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
- import { onoff } from '../internal/utils';
1
+ import { debug, onoff } from '../internal/utils';
3
2
  export class Snapshot {
4
3
  static #readyCalled = false;
5
4
  static #config;
@@ -46,10 +45,10 @@ export class Snapshot {
46
45
  const mediaQueryList = self.matchMedia(`(pointer: fine) and (min-width: ${this.#config['ipad-sheet-view-inline-size']}) and (min-height: ${this.#config['ipad-sheet-view-height']})`);
47
46
  this.#breakpoints = new Map([['fine_dialog_sheet', mediaQueryList.matches]]);
48
47
  this.#listeners.add(onoff('change', (evt) => this.#handleMediaChange(evt, 'fine_dialog_sheet:change'), mediaQueryList).on());
49
- DEBUG && console.debug(this.#config);
48
+ debug(this.#config);
50
49
  }
51
50
  static #handleMediaChange = ({ type, matches, media }, kind) => {
52
- DEBUG && console.debug(`${Snapshot.name} ⚡️ ${type}`);
51
+ debug(`${Snapshot.name} ⚡️ ${type}`);
53
52
  this.#breakpoints?.set('fine_dialog_sheet', matches);
54
53
  this.on.dispatchEvent(new MediaQueryListEvent(kind, {
55
54
  matches,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.105",
3
+ "version": "0.0.0-dev.107",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -81,6 +81,7 @@
81
81
  "test": "vitest --dom",
82
82
  "prepackage": "rm -rf generated && npm run debug:off",
83
83
  "package": "npm run build:ts && npm run build:scss ; npm run debug:reset",
84
+ "postpublish": "git checkout dev",
84
85
  "debug:off": "node -e \"const fs=require('node:fs');const f='./js/internal/flags.json';const j=JSON.parse(fs.readFileSync(f));j.DEBUG=false;fs.writeFileSync(f,JSON.stringify(j,null,2)+'\\n')\"",
85
86
  "debug:reset": "git checkout -- ./js/internal/flags.json",
86
87
  "version:pkg": "npm version $npm_config_bump --no-git-tag-version --preid=dev"
package/scss/_utils.scss CHANGED
@@ -7,3 +7,5 @@
7
7
  @forward 'utils/spacing';
8
8
 
9
9
  @forward 'utils/scroll-view';
10
+
11
+ @forward 'utils/background';
@@ -274,18 +274,18 @@
274
274
  --#{$v}-item-padding-block-start: 1rem;
275
275
 
276
276
  // FIXME: feat-sheet 3/3
277
- --#{$v}-item-background-color: var(--background); //light-dark(var(--system-bg), var(--primary-bg-dark)); // ✅
277
+ --#{$v}-item-background-color: var(--background);
278
278
  --#{$v}-item-color: var(--primary);
279
279
  --#{$v}-highlighteditem-background-color: var(--accentColor3);
280
280
  --#{$v}-highlighteditem-color: ;
281
281
 
282
282
  // FIXME: feat-sheet 3/3
283
- --inset#{$v}-item-background-color: var(--background); //light-dark(var(--system-bg), var(--primary-bg-dark)); // ✅
283
+ --inset#{$v}-item-background-color: var(--background);
284
284
  --inset#{$v}-item-color: var(--primary);
285
285
  --inset#{$v}-highlighteditem-background-color: var(--accentColor3); //var(--accentColor);
286
286
  --inset#{$v}-highlighteditem-color: ; //var(--tintcontrast);
287
287
 
288
- --insetgrouped#{$v}-item-background-color: var(--secondaryGroupedBackground); //light-dark(var(--system-bg), oklch(0.2186 0.0039 286.08)); // ✅
288
+ --insetgrouped#{$v}-item-background-color: var(--secondaryGroupedBackground);
289
289
  --insetgrouped#{$v}-item-color: var(--primary);
290
290
  --insetgrouped#{$v}-highlighteditem-background-color: var(--accentColor3); //var(--accentColor);
291
291
  --insetgrouped#{$v}-highlighteditem-color: ; //var(--tintcontrast);
@@ -376,6 +376,9 @@
376
376
  @each $v in list, form {
377
377
  --#{$v}-item-padding-inline-start: 1rem;
378
378
  --#{$v}-item-padding-inline-end: 1rem;
379
+
380
+ --insetgrouped#{$v}-background-color: var(--background);
381
+ --insetgrouped#{$v}-item-background-color: var(--quaternaryGroupedBackground);
379
382
  }
380
383
 
381
384
  --toggle-inline-size: 3.4rem;
@@ -526,6 +526,17 @@ $color-tokens: (
526
526
  ),
527
527
  ),
528
528
  ),
529
+ quaternaryGroupedBackground: (
530
+ props: (
531
+ inherits: true,
532
+ ),
533
+ media: (
534
+ base: (
535
+ light: oklch(0.9761 0 0),
536
+ dark: oklch(0.2751 0.0039 128.62),
537
+ ),
538
+ ),
539
+ ),
529
540
  // SECTION: semantic colors
530
541
  separator: (
531
542
  props: (
@@ -23,6 +23,12 @@
23
23
  }
24
24
  }
25
25
 
26
+ :nth-child(1 of image-view) {
27
+ :where(&) {
28
+ color: var(--accentColor);
29
+ }
30
+ }
31
+
26
32
  scroll-view[navigation-bar-title-display-mode='inline']:has(&) &[navigation-bar-auto-hide] {
27
33
  :where(&) {
28
34
  opacity: 0;
@@ -31,14 +37,14 @@
31
37
  }
32
38
  }
33
39
 
34
- &[background-style='grouped'] {
35
- :where(&) {
36
- background-color: var(--secondaryGroupedBackground);
37
- border-radius: var(--insetlist-item-border-radius);
40
+ // &[background-style='grouped'] {
41
+ // :where(&) {
42
+ // background-color: var(--secondaryGroupedBackground);
43
+ // border-radius: var(--insetlist-item-border-radius);
38
44
 
39
- padding-inline: var(--list-item-padding-inline-start) var(--list-item-padding-inline-end);
40
- padding-block: 1rem;
41
- }
42
- }
45
+ // padding-inline: var(--list-item-padding-inline-start) var(--list-item-padding-inline-end);
46
+ // padding-block: 1rem;
47
+ // }
48
+ // }
43
49
  }
44
50
  }
@@ -116,6 +116,18 @@
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
+ // }
119
131
  }
120
132
  }
121
133
 
@@ -133,6 +133,16 @@
133
133
 
134
134
  --toggle--dot-inset-inline-start: calc(100% - var(--toggle--dot-size));
135
135
  --toggle--dot-inset-inline-end: 0;
136
+
137
+ &:window-inactive {
138
+ --toggle--track-bg: var(--toggle--track-off-bg);
139
+ }
140
+ }
141
+
142
+ &[js-window-inactive] {
143
+ :where(&) {
144
+ --toggle--track-bg: var(--toggle--track-off-bg);
145
+ }
136
146
  }
137
147
  }
138
148
 
@@ -0,0 +1,52 @@
1
+ @use 'sass:math';
2
+ @use 'sass:string';
3
+ @use '../vars';
4
+
5
+ @layer #{vars.$utils-layer} {
6
+ list-view,
7
+ [is='form-view'] {
8
+ :where(&[background='system-background']) {
9
+ --list--host-background-color: var(--background);
10
+ }
11
+
12
+ :where(&[list-row-background='system-tertiary-grouped-background']) {
13
+ --list--item-background-color: var(--tertiaryGroupedBackground);
14
+ }
15
+
16
+ :where(&[list-row-background='system-quaternary-grouped-background']) {
17
+ --list--item-background-color: var(--quaternaryGroupedBackground);
18
+ }
19
+ }
20
+
21
+ // naviation-stack,
22
+ // navigation-split-view,
23
+ // scroll-view {
24
+ // :where(&[background='system-grouped-background']) {
25
+ // --face: var(--groupedBackground);
26
+ // }
27
+ // }
28
+
29
+ [is='sheet-view'],
30
+ [is='full-screen'],
31
+ [is='confirmation-dialog'],
32
+ [is='alert-dialog'] {
33
+ list-view,
34
+ [is='form-view'] {
35
+ :where(&[background='system-background']) {
36
+ --list--host-background-color: var(--secondaryBackground);
37
+ }
38
+
39
+ :where(&[list-row-background='system-tertiary-grouped-background']) {
40
+ --list--item-background-color: var(--quaternaryGroupedBackground);
41
+ }
42
+
43
+ :where(&[list-row-background='system-quaternary-grouped-background']) {
44
+ --list--item-background-color: var(--quaintaryGroupedBackground);
45
+ }
46
+ }
47
+
48
+ // :where(& scroll-view[background='system-grouped-background']) {
49
+ // --face: var(--groupedBackground);
50
+ // }
51
+ }
52
+ }
@@ -3,25 +3,28 @@
3
3
 
4
4
  @layer #{vars.$utils-layer} {
5
5
  [background-style='grouped'] {
6
- :where(&) {
7
- --background: var(--groupedBackground);
8
- --secondaryBackground: var(--secondaryGroupedBackground);
9
- --tertiaryBackground: var(--tertiaryGroupedBackground);
6
+ @media (pointer: coarse) {
7
+ :where(&) {
8
+ // --face: var(--groupedBackground);
9
+ --background: var(--groupedBackground);
10
+ --secondaryBackground: var(--secondaryGroupedBackground);
11
+ --tertiaryBackground: var(--tertiaryGroupedBackground);
10
12
 
11
- --face: var(--background);
12
- // --face2: var(--secondaryBackground);
13
- // --face3: var(--tertiaryBackground);
14
- }
13
+ --face: var(--background);
14
+ // --face2: var(--secondaryBackground);
15
+ // --face3: var(--tertiaryBackground);
16
+ }
15
17
 
16
- // FIXME: feat-sheet 2/3
17
- [is='sheet-view'] &,
18
- [is='full-screen'] &,
19
- [is='confirmation-dialog'] &,
20
- [is='alert-dialog'] & {
21
- :where(&) {
22
- // --background: var(--secondaryGroupedBackground);
23
- // --secondaryBackground: var(--secondaryGroupedBackground);
24
- // --tertiaryBackground: var(--tertiaryGroupedBackground);
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
+ }
25
28
  }
26
29
  }
27
30
  }