@swiftwc/ui 0.0.0-dev.18 → 0.0.0-dev.19

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 (37) hide show
  1. package/generated/client/index.js +3 -11
  2. package/generated/components/content-unavailable-view.d.ts +24 -0
  3. package/generated/components/content-unavailable-view.js +78 -0
  4. package/generated/components/date-picker.js +2 -4
  5. package/generated/components/index.d.ts +1 -3
  6. package/generated/components/index.js +1 -3
  7. package/generated/components/navigation-split-view.d.ts +3 -0
  8. package/generated/components/navigation-split-view.js +3 -0
  9. package/generated/components/navigation-stack.d.ts +3 -0
  10. package/generated/components/navigation-stack.js +3 -0
  11. package/generated/components/tab-bar.d.ts +3 -0
  12. package/generated/components/tab-bar.js +3 -0
  13. package/generated/components/text-field.js +1 -1
  14. package/generated/css/index.css +114 -61
  15. package/generated/i18n/index.d.ts +20 -10
  16. package/generated/i18n/index.js +82 -54
  17. package/generated/i18n/locales/el.d.ts +8 -0
  18. package/generated/i18n/locales/el.js +8 -0
  19. package/generated/i18n/locales/en.d.ts +8 -0
  20. package/generated/i18n/locales/en.js +8 -0
  21. package/generated/i18n/locales/index.d.ts +4 -0
  22. package/generated/i18n/locales/index.js +4 -0
  23. package/package.json +8 -4
  24. package/scss/_components.scss +2 -0
  25. package/scss/components/_bordered-button.scss +8 -0
  26. package/scss/components/_bordered-prominent-button.scss +8 -0
  27. package/scss/components/_borderless-button.scss +8 -0
  28. package/scss/components/_content-unavailable-view.scss +45 -0
  29. package/scss/components/_glass-button.scss +8 -0
  30. package/scss/components/_glass-prominent-button.scss +8 -0
  31. package/scss/components/_index.scss +4 -0
  32. package/scss/components/_label-view.scss +29 -22
  33. package/scss/components/_plain-button.scss +7 -0
  34. package/scss/components/_v-stack.scss +17 -0
  35. package/scss/placeholders/_lists.scss +10 -38
  36. package/scss/utils/_stacks.scss +4 -0
  37. package/web-components.html-data/en.json +19 -3
@@ -167,9 +167,7 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
167
167
  // prepare new
168
168
  const toolbarExclusion = 0 < modalViews.length
169
169
  ? (value, index, array) => value.parentElement?.matches('tool-bar:not(dialog tool-bar,body-view ~ tool-bar)')
170
- : (value, index, array) => value.parentElement?.matches('tool-bar:not(body-view ~ tool-bar)'), bodyExclusion = 0 < modalViews.length
171
- ? (item) => item.body?.matches('scroll-view:not(dialog scroll-view)')
172
- : (value, index, array) => value;
170
+ : (value, index, array) => value.parentElement?.matches('tool-bar:not(body-view ~ tool-bar)'), bodyExclusion = 0 < modalViews.length ? (item) => item.body?.matches('scroll-view:not(dialog scroll-view)') : (value, index, array) => value;
173
171
  for (const bti of newToolbars?.filter?.(toolbarExclusion) ?? [])
174
172
  bti.classList.add('fwnn'); // for (const ti of newToolbars ?? []) ti.classList.add('fwnn') //
175
173
  for (const bt of tos?.filter?.(bodyExclusion) ?? []) {
@@ -185,10 +183,7 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
185
183
  }
186
184
  else {
187
185
  console.debug(`⚡️ view-transition-start (${type})`);
188
- await Promise.allSettled([
189
- ...(from.body?.getAnimations().map(({ finished }) => finished) ?? []),
190
- ...(to?.body?.getAnimations().map(({ finished }) => finished) ?? []),
191
- ]);
186
+ await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to?.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
192
187
  console.debug(`⚡️ view-transition-end (${type})`);
193
188
  }
194
189
  if (0 < (to?.component?.querySelectorAll(`.${Snapshot.config?.['vt-fwd-class-name']},.bwd`) ?? []).length)
@@ -249,10 +244,7 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
249
244
  el.close(); // close old inbetween modals
250
245
  // capture trans
251
246
  console.debug(`⚡️ view-transition-start (${type})`);
252
- await Promise.allSettled([
253
- ...(from.body?.getAnimations().map(({ finished }) => finished) ?? []),
254
- ...(to.body?.getAnimations().map(({ finished }) => finished) ?? []),
255
- ]);
247
+ await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
256
248
  console.debug(`⚡️ view-transition-end (${type})`);
257
249
  if (to.body?.closest(`.bwd,.${Snapshot.config?.['vt-fwd-class-name']}`))
258
250
  return;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @summary A message with a title and extra information that you show when part of your app can’t be used.
3
+ *
4
+ * @example <content-unavailable-view search></content-unavailable-view>
5
+ *
6
+ * @example <content-unavailable-view search="foo"></content-unavailable-view>
7
+ *
8
+ * @example <content-unavailable-view padding><label-view title="No Mail"><i class="ph ph-tray" slot="image" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable-view>
9
+ *
10
+ * @example <content-unavailable-view padding><label-view title="No Mail"><svg slot="image" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable-view>
11
+ *
12
+ * @slot description
13
+ * @slot actions
14
+ *
15
+ */
16
+ export declare class ContentUnavailableView extends HTMLElement {
17
+ #private;
18
+ static get observedAttributes(): string[];
19
+ static get template(): DocumentFragment;
20
+ constructor();
21
+ disconnectedCallback(): void;
22
+ connectedCallback(): void;
23
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
24
+ }
@@ -0,0 +1,78 @@
1
+ import { CleanupRegistry } from '#internal/class/cleanup-registry.js';
2
+ import { $, onoff } from '#internal/utils/index.js';
3
+ import { I18n } from '../i18n';
4
+ /**
5
+ * @summary A message with a title and extra information that you show when part of your app can’t be used.
6
+ *
7
+ * @example <content-unavailable-view search></content-unavailable-view>
8
+ *
9
+ * @example <content-unavailable-view search="foo"></content-unavailable-view>
10
+ *
11
+ * @example <content-unavailable-view padding><label-view title="No Mail"><i class="ph ph-tray" slot="image" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable-view>
12
+ *
13
+ * @example <content-unavailable-view padding><label-view title="No Mail"><svg slot="image" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable-view>
14
+ *
15
+ * @slot description
16
+ * @slot actions
17
+ *
18
+ */
19
+ export class ContentUnavailableView extends HTMLElement {
20
+ static get observedAttributes() {
21
+ return ['search'];
22
+ }
23
+ static #template;
24
+ static get template() {
25
+ return (this.#template ??= $(String.raw `
26
+ <div part="root content-unavailable-title-stack">
27
+ <slot></slot>
28
+ </div>
29
+ <div part="root content-unavailable-description-stack">
30
+ <slot name="description"></slot>
31
+ </div>
32
+ <div part="root content-unavailable-actions-stack">
33
+ <slot name="actions"></slot>
34
+ </div>`, ''));
35
+ }
36
+ #shadowRoot;
37
+ #slots;
38
+ constructor() {
39
+ super();
40
+ this.#shadowRoot = this.attachShadow({ mode: 'closed' });
41
+ this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
42
+ this.#slots = {
43
+ '': this.#shadowRoot.querySelector('slot:not([name])') ?? undefined,
44
+ description: this.#shadowRoot.querySelector('slot[name="description"]') ?? undefined,
45
+ actions: this.#shadowRoot.querySelector('slot[name="actions"]') ?? undefined,
46
+ };
47
+ }
48
+ disconnectedCallback() {
49
+ console.debug(`${ContentUnavailableView.name} ⚡️ disconnect`);
50
+ }
51
+ connectedCallback() {
52
+ console.debug(`${ContentUnavailableView.name} ⚡️ connect`);
53
+ }
54
+ attributeChangedCallback(name, oldValue, newValue) {
55
+ console.debug(`${ContentUnavailableView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
56
+ switch (name) {
57
+ case 'search':
58
+ if (oldValue === newValue)
59
+ break;
60
+ this.#renderSearch(newValue);
61
+ CleanupRegistry.unregister(this, 'i18n');
62
+ CleanupRegistry.register(this, onoff('localechange', () => {
63
+ this.#renderSearch(this.getAttribute('search'));
64
+ }, I18n.on).on(), 'i18n');
65
+ break;
66
+ }
67
+ }
68
+ #renderSearch = (search) => {
69
+ const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<label-view><i class="ph ph-magnifying-glass" slot="image" foreground="secondary"></i></label-view>`)), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(`<label-view foreground="secondary" slot="description"></label-view>`));
70
+ if (search) {
71
+ const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
72
+ titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
73
+ }
74
+ else
75
+ titleLabel?.setAttribute('title', I18n.t('SearchUnavailableContent').NoLabel);
76
+ descText.setAttribute('title', I18n.t('SearchUnavailableContent').Description);
77
+ };
78
+ }
@@ -61,7 +61,7 @@ export class DatePicker extends FormAssociatedBase {
61
61
  super.connectedCallback();
62
62
  CleanupRegistry.register(this, onoff('click', this.#handleClick, this).on());
63
63
  this.#render();
64
- CleanupRegistry.register(this, onoff('change', () => {
64
+ CleanupRegistry.register(this, onoff('localechange', () => {
65
65
  this.#render();
66
66
  }, I18n.on).on());
67
67
  // finally
@@ -113,9 +113,7 @@ export class DatePicker extends FormAssociatedBase {
113
113
  }
114
114
  }
115
115
  get datePickerStyle() {
116
- return datePickerStyles.includes(this.getAttribute('date-picker-style') ?? '')
117
- ? this.getAttribute('date-picker-style')
118
- : 'automatic';
116
+ return datePickerStyles.includes(this.getAttribute('date-picker-style') ?? '') ? this.getAttribute('date-picker-style') : 'automatic';
119
117
  }
120
118
  #render() {
121
119
  console.debug(`${_a.name} ⚡️ render (${this.datePickerStyle})`);
@@ -1,11 +1,9 @@
1
- /**
2
- * @file Automatically generated by barrelsby.
3
- */
4
1
  export * from './body-view';
5
2
  export * from './bordered-button';
6
3
  export * from './bordered-prominent-button';
7
4
  export * from './borderless-button';
8
5
  export * from './confirmation-dialog';
6
+ export * from './content-unavailable-view';
9
7
  export * from './date-picker';
10
8
  export * from './disclosure-group';
11
9
  export * from './form-view';
@@ -1,11 +1,9 @@
1
- /**
2
- * @file Automatically generated by barrelsby.
3
- */
4
1
  export * from './body-view';
5
2
  export * from './bordered-button';
6
3
  export * from './bordered-prominent-button';
7
4
  export * from './borderless-button';
8
5
  export * from './confirmation-dialog';
6
+ export * from './content-unavailable-view';
9
7
  export * from './date-picker';
10
8
  export * from './disclosure-group';
11
9
  export * from './form-view';
@@ -1,4 +1,7 @@
1
1
  import { NavigationView } from '../internal/class/navigation-view';
2
+ /**
3
+ * @summary A view with two or three side-by-side sections, where what you choose in the left section changes what appears in the next section.
4
+ */
2
5
  export declare class NavigationSplitView extends NavigationView {
3
6
  constructor();
4
7
  disconnectedCallback(): void;
@@ -1,4 +1,7 @@
1
1
  import { NavigationView } from '../internal/class/navigation-view';
2
+ /**
3
+ * @summary A view with two or three side-by-side sections, where what you choose in the left section changes what appears in the next section.
4
+ */
2
5
  export class NavigationSplitView extends NavigationView {
3
6
  constructor() {
4
7
  super();
@@ -1,4 +1,7 @@
1
1
  import { NavigationView } from '../internal/class/navigation-view';
2
+ /**
3
+ * @summary A view that shows a main screen and lets you open other screens on top of it.
4
+ */
2
5
  export declare class NavigationStack extends NavigationView {
3
6
  constructor();
4
7
  disconnectedCallback(): void;
@@ -1,4 +1,7 @@
1
1
  import { NavigationView } from '../internal/class/navigation-view';
2
+ /**
3
+ * @summary A view that shows a main screen and lets you open other screens on top of it.
4
+ */
2
5
  export class NavigationStack extends NavigationView {
3
6
  constructor() {
4
7
  super();
@@ -1,4 +1,7 @@
1
1
  import { DialogBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A screen that lets users switch between different views using buttons, tabs, or other controls.
4
+ */
2
5
  export declare class TabBar extends DialogBase {
3
6
  #private;
4
7
  constructor();
@@ -1,6 +1,9 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
2
  import { onoff, touchGlass } from '../internal/utils';
3
3
  import { DialogBase } from '../namespace-browser/base';
4
+ /**
5
+ * @summary A screen that lets users switch between different views using buttons, tabs, or other controls.
6
+ */
4
7
  export class TabBar extends DialogBase {
5
8
  constructor() {
6
9
  super();
@@ -62,7 +62,7 @@ export class TextField extends FormAssociatedBase {
62
62
  { types: 'beforeinput', listener: this.#handleInputBeforeinput },
63
63
  { types: 'paste', listener: this.#handleInputPaste },
64
64
  ], this.#input).on());
65
- CleanupRegistry.register(this, onoff('change', () => {
65
+ CleanupRegistry.register(this, onoff('localechange', () => {
66
66
  this.text = this.text;
67
67
  }, I18n.on).on());
68
68
  }
@@ -499,10 +499,7 @@
499
499
  }
500
500
  :where(table-view:not(table-view table-view, list-view table-view, [is=form-view] table-view) [is=disclosure-group] > :not(summary), [is=form-view]:not([is=form-view] [is=form-view], list-view [is=form-view], table-view [is=form-view], [is=tab-bar] > [is=form-view]) [is=disclosure-group] > :not(summary), list-view:not(list-view list-view, [is=form-view] list-view, table-view list-view) [is=disclosure-group] > :not(summary)) {
501
501
  --itemface: var(--list--details-background-color, var(--list--item-background-color,));
502
- --itemhighlightface: var(
503
- --list--selecteddetails-background-color,
504
- var(--list--highlighteditem-background-color, var(--list--item-background-color,))
505
- );
502
+ --itemhighlightface: var(--list--selecteddetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
506
503
  --itemactiveface: var(--list--selecteddetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
507
504
  --itemtext: var(--list--details-color, var(--list--item-color,));
508
505
  --itemhighlighttext: var(--list--selecteddetails-color, var(--list--highlighteditem-color, var(--list--item-color,)));
@@ -510,14 +507,8 @@
510
507
  }
511
508
  :where([is=disclosure-group][open] table-view:not(table-view table-view, list-view table-view, [is=form-view] table-view) [is=disclosure-group] > summary, [is=disclosure-group][open] [is=form-view]:not([is=form-view] [is=form-view], list-view [is=form-view], table-view [is=form-view], [is=tab-bar] > [is=form-view]) [is=disclosure-group] > summary, [is=disclosure-group][open] list-view:not(list-view list-view, [is=form-view] list-view, table-view list-view) [is=disclosure-group] > summary) {
512
509
  --itemface: var(--list--opendetails-background-color, var(--list--item-background-color,));
513
- --itemhighlightface: var(
514
- --list--selectedopendetails-background-color,
515
- var(--list--highlighteditem-background-color, var(--list--item-background-color,))
516
- );
517
- --itemactiveface: var(
518
- --list--selectedopendetails-background-color,
519
- var(--list--highlighteditem-background-color, var(--list--item-background-color,))
520
- );
510
+ --itemhighlightface: var(--list--selectedopendetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
511
+ --itemactiveface: var(--list--selectedopendetails-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)));
521
512
  --itemtext: var(--list--opendetails-color, var(--list--item-color,));
522
513
  --itemhighlighttext: var(--list--selectedopendetails-color, var(--list--highlighteditem-color, var(--list--item-color,)));
523
514
  --itemactivetext: var(--list--selectedopendetails-color, var(--list--highlighteditem-color, var(--list--item-color,)));
@@ -533,14 +524,8 @@
533
524
  var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
534
525
  );
535
526
  --itemtext: var(--list--opensummary-color, var(--list--item-color,));
536
- --itemhighlighttext: var(
537
- --list--selectedopensummary-color,
538
- var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
539
- );
540
- --itemactivetext: var(
541
- --list--selectedopensummary-color,
542
- var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
543
- );
527
+ --itemhighlighttext: var(--list--selectedopensummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
528
+ --itemactivetext: var(--list--selectedopensummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
544
529
  }
545
530
  table-view:not(table-view table-view, list-view table-view, [is=form-view] table-view) > [is=disclosure-group], [is=form-view]:not([is=form-view] [is=form-view], list-view [is=form-view], table-view [is=form-view], [is=tab-bar] > [is=form-view]) > [is=disclosure-group], list-view:not(list-view list-view, [is=form-view] list-view, table-view list-view) > [is=disclosure-group],
546
531
  table-view:not(table-view table-view, list-view table-view, [is=form-view] table-view) > section-view > [is=disclosure-group],
@@ -562,14 +547,8 @@
562
547
  var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
563
548
  );
564
549
  --itemtext: var(--list--rootsummary-color, var(--list--item-color,));
565
- --itemhighlighttext: var(
566
- --list--selectedrootsummary-color,
567
- var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
568
- );
569
- --itemactivetext: var(
570
- --list--selectedrootsummary-color,
571
- var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,)))
572
- );
550
+ --itemhighlighttext: var(--list--selectedrootsummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
551
+ --itemactivetext: var(--list--selectedrootsummary-color, var(--list--selectedsummary-color, var(--list--highlighteditem-color, var(--list--item-color,))));
573
552
  --itempadistart: var(--list--rootsummary-padding-inline-start, var(--list--item-padding-inline-start,));
574
553
  --itempadiend: var(--list--rootsummary-padding-inline-end, var(--list--item-padding-inline-end,));
575
554
  --itempadbstart: var(--list--rootsummary-padding-block-start, var(--list--item-padding-block-start,));
@@ -582,17 +561,11 @@
582
561
  --itemface: var(--list--rootsummary-background-color, var(--list--opensummary-background-color, var(--list--item-background-color,)));
583
562
  --itemhighlightface: var(
584
563
  --list--selectedrootsummary-background-color,
585
- var(
586
- --list--selectedopensummary-background-color,
587
- var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
588
- )
564
+ var(--list--selectedopensummary-background-color, var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,))))
589
565
  );
590
566
  --itemactiveface: var(
591
567
  --list--selectedrootsummary-background-color,
592
- var(
593
- --list--selectedopensummary-background-color,
594
- var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,)))
595
- )
568
+ var(--list--selectedopensummary-background-color, var(--list--selectedsummary-background-color, var(--list--highlighteditem-background-color, var(--list--item-background-color,))))
596
569
  );
597
570
  --itemtext: var(--list--rootsummary-color, var(--list--opensummary-color, var(--list--item-color,)));
598
571
  --itemhighlighttext: var(
@@ -1057,6 +1030,7 @@
1057
1030
  [is=glass-prominent-button]:not([hidden]),
1058
1031
  list-view:not([hidden]),
1059
1032
  table-view:not([hidden]),
1033
+ content-unavailable-view:not([hidden]),
1060
1034
  tool-bar-item:not([hidden]),
1061
1035
  tool-bar-item-group:not([hidden]),
1062
1036
  sidebar-toggle:not([hidden]),
@@ -1072,6 +1046,9 @@
1072
1046
  picker-view:not([hidden])) {
1073
1047
  display: grid;
1074
1048
  }
1049
+ :where(content-unavailable-view)::part(content-unavailable-title-stack),
1050
+ :where(content-unavailable-view)::part(content-unavailable-description-stack),
1051
+ :where(content-unavailable-view)::part(content-unavailable-actions-stack),
1075
1052
  :where(table-view)::part(table-container),
1076
1053
  :where(table-view)::part(table-column-stack),
1077
1054
  :where(table-view)::part(table-header-stack),
@@ -1526,6 +1503,31 @@
1526
1503
  }
1527
1504
  }
1528
1505
  }
1506
+ @layer sw-components {
1507
+ :where(content-unavailable-view) {
1508
+ place-content: center;
1509
+ place-items: center;
1510
+ text-align: center;
1511
+ row-gap: 1rem;
1512
+ }
1513
+ :where(content-unavailable-view)::part(content-unavailable-actions-stack) {
1514
+ row-gap: 0.2rem;
1515
+ }
1516
+ :where(content-unavailable-view)::part(content-unavailable-title-stack) {
1517
+ --label-flow: vertical;
1518
+ --label-font: title3;
1519
+ }
1520
+ content-unavailable-view > :not([slot]) {
1521
+ --label-image-size: 5rem;
1522
+ --label-gap: 1rem;
1523
+ }
1524
+ :where(content-unavailable-view:not(:has(> [slot=description])))::part(content-unavailable-description-stack) {
1525
+ display: none;
1526
+ }
1527
+ :where(content-unavailable-view:not(:has(> [slot=actions])))::part(content-unavailable-actions-stack) {
1528
+ display: none;
1529
+ }
1530
+ }
1529
1531
  @layer sw-components {
1530
1532
  :where([is=confirmation-dialog]) {
1531
1533
  inset-inline: 0px;
@@ -1763,6 +1765,15 @@
1763
1765
  place-content: safe center;
1764
1766
  gap: 1rem;
1765
1767
  }
1768
+ :where(v-stack[template="auto auto minmax(0,1fr)"]) {
1769
+ grid-template-rows: auto auto minmax(0, 1fr);
1770
+ }
1771
+ :where(v-stack[template="auto minmax(0,1fr)"]) {
1772
+ grid-template-rows: auto minmax(0, 1fr);
1773
+ }
1774
+ :where(v-stack[template="auto auto autominmax(0,1fr)"]) {
1775
+ grid-template-rows: auto auto autominmax(0, 1fr);
1776
+ }
1766
1777
  }
1767
1778
  @layer sw-components {
1768
1779
  :where(v-flex-stack) {
@@ -1929,6 +1940,11 @@
1929
1940
  }
1930
1941
  }
1931
1942
  @layer sw-components {}
1943
+ @layer sw-utils {
1944
+ :where([is=plain-button]) {
1945
+ text-align: center;
1946
+ }
1947
+ }
1932
1948
  @layer sw-components {
1933
1949
  :where([is=borderless-button][role=destructive]) {
1934
1950
  --accentColor: var(--red);
@@ -1938,6 +1954,11 @@
1938
1954
  --accentColor5: var(--red5);
1939
1955
  }
1940
1956
  }
1957
+ @layer sw-utils {
1958
+ :where([is=borderless-button]) {
1959
+ text-align: center;
1960
+ }
1961
+ }
1941
1962
  @layer sw-components {
1942
1963
  @media (pointer: fine) {
1943
1964
  :where([is=bordered-button]) {
@@ -1952,6 +1973,11 @@
1952
1973
  --accentColor5: var(--red5);
1953
1974
  }
1954
1975
  }
1976
+ @layer sw-utils {
1977
+ :where([is=bordered-button]) {
1978
+ text-align: center;
1979
+ }
1980
+ }
1955
1981
  @layer sw-components {
1956
1982
  :where([is=bordered-prominent-button][role=destructive]) {
1957
1983
  --accentColor: var(--red);
@@ -1961,6 +1987,11 @@
1961
1987
  --accentColor5: var(--red5);
1962
1988
  }
1963
1989
  }
1990
+ @layer sw-utils {
1991
+ :where([is=bordered-prominent-button]) {
1992
+ text-align: center;
1993
+ }
1994
+ }
1964
1995
  @layer sw-components {
1965
1996
  :where([is=glass-button]) {
1966
1997
  backdrop-filter: var(--liquid-glass-backdrop-filter);
@@ -1975,6 +2006,11 @@
1975
2006
  --accentColor5: var(--red5);
1976
2007
  }
1977
2008
  }
2009
+ @layer sw-utils {
2010
+ :where([is=glass-button]) {
2011
+ text-align: center;
2012
+ }
2013
+ }
1978
2014
  @layer sw-components {
1979
2015
  :where([is=glass-prominent-button]) {
1980
2016
  backdrop-filter: var(--liquid-glass-backdrop-filter);
@@ -1989,6 +2025,11 @@
1989
2025
  --accentColor5: var(--red5);
1990
2026
  }
1991
2027
  }
2028
+ @layer sw-utils {
2029
+ :where([is=glass-prominent-button]) {
2030
+ text-align: center;
2031
+ }
2032
+ }
1992
2033
  @layer sw-components {
1993
2034
  :where(tool-bar) {
1994
2035
  pointer-events: none;
@@ -2047,6 +2088,16 @@
2047
2088
  }
2048
2089
  }
2049
2090
  }
2091
+ @property --label-gap {
2092
+ syntax: "<length>";
2093
+ inherits: false;
2094
+ initial-value: 0;
2095
+ }
2096
+ @property --label-image-size {
2097
+ syntax: "<length>";
2098
+ inherits: false;
2099
+ initial-value: 0;
2100
+ }
2050
2101
  @layer sw-components {
2051
2102
  :where(label-view) {
2052
2103
  align-items: var(--label--host-align-items, );
@@ -2054,6 +2105,8 @@
2054
2105
  grid-template-columns: var(--label--host-grid-template-columns, );
2055
2106
  grid-template-rows: var(--label--host-grid-template-rows, );
2056
2107
  gap: var(--label--host-gap, );
2108
+ --label-image-size: 2rem;
2109
+ --label-imagestack-fontsize: var(--label-image-size);
2057
2110
  white-space: var(--label--host-white-space, );
2058
2111
  }
2059
2112
  :where(label-view)::part(label-image-stack), :where(label-view)::part(label-title-stack) {
@@ -2068,8 +2121,8 @@
2068
2121
  }
2069
2122
  :where(label-view)::part(label-image-stack) {
2070
2123
  aspect-ratio: 1/1;
2071
- inline-size: var(--label-image-size, 2rem);
2072
- font-size: var(--label-image-size, 2rem);
2124
+ inline-size: var(--label-imagestack-fontsize);
2125
+ font-size: var(--label-imagestack-fontsize);
2073
2126
  }
2074
2127
  :where(label-view)::part(label-title-stack) {
2075
2128
  text-decoration: underline;
@@ -2107,31 +2160,20 @@
2107
2160
  --label--host-grid-template-columns: if(
2108
2161
  style(--label-style: icon-only): minmax(0, 1fr) ; style(--label-style: title-only): minmax(0, 1fr) ;
2109
2162
  style(--label-style: title-and-icon): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;) ;
2110
- else: if(
2111
- style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;)
2112
- ; else: minmax(0, 1fr) ;
2113
- )
2114
- ;
2163
+ else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): minmax(0, 1fr) ; else: auto minmax(0, 1fr) ;) ; else: minmax(0, 1fr) ;) ;
2115
2164
  );
2116
2165
  --label--host-grid-template-rows: if(
2117
2166
  style(--label-style: icon-only): minmax(0, 1fr) ; style(--label-style: title-only): minmax(0, 1fr) ;
2118
2167
  style(--label-style: title-and-icon): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ;
2119
- else: if(
2120
- style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;)
2121
- ; else: minmax(0, 1fr) ;
2122
- )
2123
- ;
2124
- );
2125
- --label--host-gap: if(
2126
- style(--label-style: title-and-icon): 0.3rem ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): 0.3rem ;) ;
2168
+ else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): if(style(--label-flow: vertical): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;) ; else: minmax(0, 1fr) ;) ;
2127
2169
  );
2170
+ --label-gap: if(style(--label-style: title-and-icon): 0.3rem ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): 0.3rem ;) ;);
2171
+ --label--host-gap: if(style(--label-style: title-and-icon): var(--label-gap) ; else: if(style(--label--has-icon: yes) and style(--label--has-title: yes): var(--label-gap) ;) ;);
2128
2172
  --label--iconstack-display: if(
2129
- style(--label-style: icon-only): grid ; style(--label-style: title-only): none ; style(--label-style: title-and-icon): grid ;
2130
- else: if(style(--label--has-icon: yes): grid ; else: none;) ;
2173
+ style(--label-style: icon-only): grid ; style(--label-style: title-only): none ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-icon: yes): grid ; else: none;) ;
2131
2174
  );
2132
2175
  --label--titlestack-display: if(
2133
- style(--label-style: icon-only): none ; style(--label-style: title-only): grid ; style(--label-style: title-and-icon): grid ;
2134
- else: if(style(--label--has-title: yes): grid ; else: none;) ;
2176
+ style(--label-style: icon-only): none ; style(--label-style: title-only): grid ; style(--label-style: title-and-icon): grid ; else: if(style(--label--has-title: yes): grid ; else: none;) ;
2135
2177
  );
2136
2178
  }
2137
2179
  }
@@ -2155,7 +2197,8 @@
2155
2197
  --label--host-grid-template-rows: minmax(0, 1fr);
2156
2198
  --label--host-align-items: center;
2157
2199
  --label--host-justify-items: normal;
2158
- --label--host-gap: 0.3rem;
2200
+ --label-gap: 0.3rem;
2201
+ --label--host-gap: var(--label-gap);
2159
2202
  --label--iconstack-display: grid;
2160
2203
  --label--titlestack-display: grid;
2161
2204
  }
@@ -2174,7 +2217,8 @@
2174
2217
  --label--host-grid-template-rows: minmax(0, 1fr);
2175
2218
  --label--host-align-items: center;
2176
2219
  --label--host-justify-items: normal;
2177
- --label--host-gap: 0.3rem;
2220
+ --label-gap: 0.3rem;
2221
+ --label--host-gap: var(--label-gap);
2178
2222
  --label--iconstack-display: grid;
2179
2223
  --label--titlestack-display: grid;
2180
2224
  }
@@ -2185,7 +2229,8 @@
2185
2229
  --label--host-grid-template-rows: minmax(0, 1fr);
2186
2230
  --label--host-align-items: center;
2187
2231
  --label--host-justify-items: normal;
2188
- --label--host-gap: 0.3rem;
2232
+ --label-gap: 0.3rem;
2233
+ --label--host-gap: var(--label-gap);
2189
2234
  --label--iconstack-display: grid;
2190
2235
  --label--titlestack-display: grid;
2191
2236
  }
@@ -2217,7 +2262,8 @@
2217
2262
  --label--host-grid-template-rows: auto minmax(0, 1fr);
2218
2263
  --label--host-align-items: normal;
2219
2264
  --label--host-justify-items: center;
2220
- --label--host-gap: 0.3rem;
2265
+ --label-gap: 0.3rem;
2266
+ --label--host-gap: var(--label-gap);
2221
2267
  --label--iconstack-display: grid;
2222
2268
  --label--titlestack-display: grid;
2223
2269
  }
@@ -2237,7 +2283,8 @@
2237
2283
  --label--host-grid-template-rows: auto minmax(0, 1fr);
2238
2284
  --label--host-align-items: normal;
2239
2285
  --label--host-justify-items: center;
2240
- --label--host-gap: 0.3rem;
2286
+ --label-gap: 0.3rem;
2287
+ --label--host-gap: var(--label-gap);
2241
2288
  --label--iconstack-display: grid;
2242
2289
  --label--titlestack-display: grid;
2243
2290
  }
@@ -2249,7 +2296,8 @@
2249
2296
  --label--host-grid-template-rows: auto minmax(0, 1fr);
2250
2297
  --label--host-align-items: normal;
2251
2298
  --label--host-justify-items: center;
2252
- --label--host-gap: 0.3rem;
2299
+ --label-gap: 0.3rem;
2300
+ --label--host-gap: var(--label-gap);
2253
2301
  --label--iconstack-display: grid;
2254
2302
  --label--titlestack-display: grid;
2255
2303
  }
@@ -5358,6 +5406,11 @@
5358
5406
  h-flex-stack[alignment=space-between] {
5359
5407
  justify-content: space-between ;
5360
5408
  }
5409
+ v-stack[placement=fill],
5410
+ h-flex-stack[placement=fill] {
5411
+ place-items: stretch ;
5412
+ place-content: stretch ;
5413
+ }
5361
5414
  v-stack[placement="leading fill"],
5362
5415
  h-flex-stack[placement="leading fill"] {
5363
5416
  place-items: start stretch ;
@@ -1,18 +1,26 @@
1
+ import { en } from './locales';
1
2
  type LocaleInput = Intl.UnicodeBCP47LocaleIdentifier | Intl.Locale;
2
- type I18nProps = {
3
- tag?: LocaleInput;
4
- options?: Intl.LocaleOptions;
5
- locale: Intl.Locale;
6
- decimalSeparator: string;
7
- dateSeparator: string;
8
- dateOrder: string[];
3
+ type DeepStringify<T> = {
4
+ [K in keyof T]: T[K] extends object ? DeepStringify<T[K]> : string;
9
5
  };
6
+ export declare function defineTranslations<const T extends object>(factory: () => T): () => T;
7
+ type EnTranslations = DeepStringify<ReturnType<typeof en>>;
8
+ /**
9
+ * @fires localechange - On html[lang] change!
10
+ */
10
11
  export declare class I18n {
11
12
  #private;
12
13
  static on: EventTarget;
13
- static _props: I18nProps;
14
- static get tag(): LocaleInput | undefined;
15
- static set tag(val: LocaleInput | undefined);
14
+ /**
15
+ * Register a translation factory for a language.
16
+ * Call this before the language is first needed.
17
+ *
18
+ * @example
19
+ * I18n.register('el', () => ({ SearchUnavailableContent: { … } }))
20
+ */
21
+ static register(lang: string, factory: () => EnTranslations): void;
22
+ static get tag(): LocaleInput;
23
+ static set tag(val: LocaleInput);
16
24
  static get options(): Intl.LocaleOptions | undefined;
17
25
  static set options(val: Intl.LocaleOptions | undefined);
18
26
  static get locale(): Intl.Locale;
@@ -20,5 +28,7 @@ export declare class I18n {
20
28
  static get dateSeparator(): string;
21
29
  static get dateOrder(): string[];
22
30
  static setOwnConfig(options?: Intl.LocaleOptions): void;
31
+ /** Look up a top-level translation key for the current language, falling back to 'en'. */
32
+ static t<K extends keyof EnTranslations>(key: K): EnTranslations[K];
23
33
  }
24
34
  export {};