@swiftwc/ui 0.0.0-dev.8 → 0.0.0-dev.80

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 (243) hide show
  1. package/generated/buses/alert-dialog.d.ts +2 -0
  2. package/generated/buses/alert-dialog.js +1 -0
  3. package/generated/buses/confirmation-dialog.d.ts +2 -0
  4. package/generated/buses/confirmation-dialog.js +1 -0
  5. package/generated/buses/index.d.ts +6 -0
  6. package/generated/buses/index.js +6 -0
  7. package/generated/buses/lifecycle-observer.d.ts +2 -0
  8. package/generated/buses/lifecycle-observer.js +1 -0
  9. package/generated/client/index.d.ts +21 -10
  10. package/generated/client/index.js +177 -194
  11. package/generated/components/alert-dialog.d.ts +8 -0
  12. package/generated/components/alert-dialog.js +99 -0
  13. package/generated/components/body-view.js +5 -2
  14. package/generated/components/bordered-button.d.ts +10 -0
  15. package/generated/components/bordered-button.js +39 -3
  16. package/generated/components/bordered-prominent-button.d.ts +10 -0
  17. package/generated/components/bordered-prominent-button.js +39 -3
  18. package/generated/components/borderless-button.d.ts +9 -1
  19. package/generated/components/borderless-button.js +32 -11
  20. package/generated/components/color-scheme.d.ts +7 -0
  21. package/generated/components/color-scheme.js +54 -0
  22. package/generated/components/confirmation-dialog.d.ts +1 -1
  23. package/generated/components/confirmation-dialog.js +43 -32
  24. package/generated/components/content-unavailable-view.d.ts +24 -0
  25. package/generated/components/content-unavailable-view.js +81 -0
  26. package/generated/components/date-picker.d.ts +2 -12
  27. package/generated/components/date-picker.js +96 -65
  28. package/generated/components/disclosure-group.d.ts +5 -0
  29. package/generated/components/disclosure-group.js +18 -7
  30. package/generated/components/fine-tooltip.d.ts +7 -0
  31. package/generated/components/fine-tooltip.js +107 -0
  32. package/generated/components/form-view.d.ts +3 -0
  33. package/generated/components/form-view.js +8 -3
  34. package/generated/components/glass-button.d.ts +10 -0
  35. package/generated/components/glass-button.js +39 -3
  36. package/generated/components/glass-prominent-button.d.ts +10 -0
  37. package/generated/components/glass-prominent-button.js +39 -3
  38. package/generated/components/h-stack.d.ts +14 -0
  39. package/generated/components/h-stack.js +23 -0
  40. package/generated/components/image-view.d.ts +9 -0
  41. package/generated/components/image-view.js +64 -0
  42. package/generated/components/index.d.ts +11 -3
  43. package/generated/components/index.js +11 -3
  44. package/generated/components/label-view.d.ts +6 -1
  45. package/generated/components/label-view.js +32 -59
  46. package/generated/components/labeled-content.d.ts +9 -0
  47. package/generated/components/labeled-content.js +116 -0
  48. package/generated/components/list-view.d.ts +3 -0
  49. package/generated/components/list-view.js +20 -17
  50. package/generated/components/menu-view.d.ts +4 -1
  51. package/generated/components/menu-view.js +60 -51
  52. package/generated/components/navigation-large-title.js +9 -5
  53. package/generated/components/navigation-split-view.d.ts +4 -1
  54. package/generated/components/navigation-split-view.js +13 -6
  55. package/generated/components/navigation-stack.d.ts +4 -1
  56. package/generated/components/navigation-stack.js +16 -9
  57. package/generated/components/navigation-title.d.ts +1 -1
  58. package/generated/components/navigation-title.js +58 -55
  59. package/generated/components/picker-view.d.ts +32 -4
  60. package/generated/components/picker-view.js +924 -234
  61. package/generated/components/plain-button.js +5 -3
  62. package/generated/components/progress-view.d.ts +13 -0
  63. package/generated/components/progress-view.js +120 -0
  64. package/generated/components/screen-view.js +3 -1
  65. package/generated/components/scroll-view-proxy.d.ts +8 -0
  66. package/generated/components/scroll-view-proxy.js +17 -0
  67. package/generated/components/scroll-view.d.ts +1 -1
  68. package/generated/components/scroll-view.js +101 -85
  69. package/generated/components/search-view.d.ts +7 -0
  70. package/generated/components/search-view.js +30 -0
  71. package/generated/components/section-view.d.ts +1 -1
  72. package/generated/components/section-view.js +35 -30
  73. package/generated/components/sheet-view.d.ts +1 -2
  74. package/generated/components/sheet-view.js +32 -39
  75. package/generated/components/sidebar-toggle.js +44 -66
  76. package/generated/components/sidebar-view.js +13 -8
  77. package/generated/components/sticky-container.js +8 -4
  78. package/generated/components/tab-bar.d.ts +3 -0
  79. package/generated/components/tab-bar.js +20 -10
  80. package/generated/components/tab-item.js +24 -13
  81. package/generated/components/tab-view.js +25 -17
  82. package/generated/components/table-view.d.ts +5 -0
  83. package/generated/components/table-view.js +55 -77
  84. package/generated/components/text-field.d.ts +2 -2
  85. package/generated/components/text-field.js +95 -88
  86. package/generated/components/toggle-view.d.ts +28 -0
  87. package/generated/components/toggle-view.js +224 -0
  88. package/generated/components/tool-bar-item-group.js +21 -4
  89. package/generated/components/tool-bar-item.d.ts +4 -1
  90. package/generated/components/tool-bar-item.js +57 -10
  91. package/generated/components/tool-bar.d.ts +12 -0
  92. package/generated/components/tool-bar.js +27 -11
  93. package/generated/components/v-keyboard.d.ts +3 -1
  94. package/generated/components/v-keyboard.js +12 -6
  95. package/generated/components/v-stack.d.ts +12 -0
  96. package/generated/components/v-stack.js +17 -2
  97. package/generated/css/index.css +2533 -941
  98. package/generated/events/alert-dialog.d.ts +8 -0
  99. package/generated/events/alert-dialog.js +1 -0
  100. package/generated/events/confirmation-dialog.d.ts +2 -2
  101. package/generated/events/index.d.ts +2 -0
  102. package/generated/events/index.js +2 -0
  103. package/generated/events/picker-view.d.ts +7 -0
  104. package/generated/events/scroll-view.js +4 -0
  105. package/generated/events/tab-view.d.ts +6 -2
  106. package/generated/events/text-field.js +3 -0
  107. package/generated/events/toggle-view.d.ts +9 -0
  108. package/generated/events/toggle-view.js +4 -0
  109. package/generated/i18n/index.d.ts +20 -10
  110. package/generated/i18n/index.js +82 -54
  111. package/generated/i18n/locales/el.d.ts +16 -0
  112. package/generated/i18n/locales/el.js +16 -0
  113. package/generated/i18n/locales/en.d.ts +16 -0
  114. package/generated/i18n/locales/en.js +16 -0
  115. package/generated/i18n/locales/index.d.ts +4 -0
  116. package/generated/i18n/locales/index.js +4 -0
  117. package/generated/internal/class/css-style-observer.js +3 -2
  118. package/generated/internal/class/form-associated-base.d.ts +0 -4
  119. package/generated/internal/class/form-associated-base.js +23 -38
  120. package/generated/internal/class/mutation-observer-set.d.ts +9 -0
  121. package/generated/internal/class/mutation-observer-set.js +42 -0
  122. package/generated/internal/class/mutation-observer-singleton.js +18 -0
  123. package/generated/internal/class/navigation-view.d.ts +1 -1
  124. package/generated/internal/class/navigation-view.js +38 -43
  125. package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
  126. package/generated/internal/decorators/adaptive-slot.js +50 -0
  127. package/generated/internal/decorators/custom-element.d.ts +1 -1
  128. package/generated/internal/decorators/custom-element.js +2 -1
  129. package/generated/internal/decorators/index.d.ts +6 -0
  130. package/generated/internal/decorators/index.js +6 -0
  131. package/generated/internal/decorators/microtask-on-connected.d.ts +39 -0
  132. package/generated/internal/decorators/microtask-on-connected.js +67 -0
  133. package/generated/internal/privateNamespace.d.ts +10 -0
  134. package/generated/internal/privateNamespace.js +168 -1
  135. package/generated/internal/utils/cash/index.d.ts +4 -3
  136. package/generated/internal/utils/cash/index.js +6 -4
  137. package/generated/internal/utils/dev-flags.d.ts +3 -0
  138. package/generated/internal/utils/dev-flags.js +5 -0
  139. package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
  140. package/generated/internal/utils/ensure-placeholder.js +55 -0
  141. package/generated/internal/utils/index.d.ts +7 -2
  142. package/generated/internal/utils/index.js +9 -2
  143. package/generated/internal/utils/is-inside.d.ts +1 -0
  144. package/generated/internal/utils/is-inside.js +4 -0
  145. package/generated/internal/utils/list-active.js +67 -12
  146. package/generated/internal/utils/render-label-icon.d.ts +2 -0
  147. package/generated/internal/utils/render-label-icon.js +19 -0
  148. package/generated/internal/utils/render-label-title.d.ts +2 -0
  149. package/generated/internal/utils/render-label-title.js +16 -0
  150. package/generated/internal/utils/render-label.d.ts +1 -0
  151. package/generated/internal/utils/render-label.js +19 -0
  152. package/generated/internal/utils/touch-glass.js +5 -5
  153. package/generated/namespace-browser/base.d.ts +12 -3
  154. package/generated/namespace-browser/base.js +41 -18
  155. package/generated/namespace-browser/event.d.ts +10 -0
  156. package/generated/namespace-browser/event.js +1 -0
  157. package/generated/snapshot/index.d.ts +3 -1
  158. package/generated/snapshot/index.js +25 -2
  159. package/generated/tpl/html.d.ts +5 -0
  160. package/generated/tpl/html.js +3 -0
  161. package/generated/tpl/index.d.ts +4 -0
  162. package/generated/tpl/index.js +4 -0
  163. package/generated/tpl/render.d.ts +2 -0
  164. package/generated/tpl/render.js +132 -0
  165. package/package.json +18 -4
  166. package/scss/_components.scss +14 -0
  167. package/scss/_functions.scss +10 -0
  168. package/scss/_mixins.scss +4 -0
  169. package/scss/_transitions.scss +6 -1
  170. package/scss/_vars.scss +9 -2
  171. package/scss/base/_layout.scss +17 -7
  172. package/scss/base/_reboot.scss +34 -1
  173. package/scss/base/_root.scss +117 -114
  174. package/scss/colors/_index.scss +304 -85
  175. package/scss/components/_alert-dialog.scss +111 -0
  176. package/scss/components/_bordered-button.scss +35 -0
  177. package/scss/components/_bordered-prominent-button.scss +45 -0
  178. package/scss/components/_borderless-button.scss +25 -0
  179. package/scss/components/_confirmation-dialog.scss +41 -49
  180. package/scss/components/_content-unavailable-view.scss +56 -0
  181. package/scss/components/_date-picker.scss +15 -15
  182. package/scss/components/_detail-placeholder.scss +1 -3
  183. package/scss/components/_disclosure-group.scss +84 -33
  184. package/scss/components/_fine-tooltip.scss +84 -0
  185. package/scss/components/_form-view.scss +58 -20
  186. package/scss/components/_glass-button.scss +35 -0
  187. package/scss/components/_glass-prominent-button.scss +46 -0
  188. package/scss/components/_group-box.scss +27 -0
  189. package/scss/components/_h-flex-stack.scss +23 -0
  190. package/scss/components/_h-stack.scss +21 -15
  191. package/scss/components/_image-view.scss +20 -0
  192. package/scss/components/_index.scss +40 -20
  193. package/scss/components/_label-view copy.scss.txt +420 -0
  194. package/scss/components/_label-view.scss +94 -110
  195. package/scss/components/_label-view.scss.txt +536 -0
  196. package/scss/components/_labeled-content.scss +59 -1
  197. package/scss/components/_list-view.scss +65 -25
  198. package/scss/components/_menu-view.scss +95 -60
  199. package/scss/components/_navigation-large-title.scss +17 -0
  200. package/scss/components/_navigation-split-view.scss +3 -3
  201. package/scss/components/_picker-view.scss +259 -59
  202. package/scss/components/_plain-button.scss +7 -0
  203. package/scss/components/_progress-view.scss +98 -0
  204. package/scss/components/_scroll-view-proxy.scss +22 -20
  205. package/scss/components/_scroll-view.scss +4 -0
  206. package/scss/components/_search-view.scss +22 -0
  207. package/scss/components/_section-view.scss +23 -22
  208. package/scss/components/_sheet-view.scss +16 -6
  209. package/scss/components/_sidebar-toggle.scss +1 -4
  210. package/scss/components/_sticky-container.scss +1 -1
  211. package/scss/components/_tab-bar.scss +17 -3
  212. package/scss/components/_tab-view.scss +4 -2
  213. package/scss/components/_table-column.scss +2 -0
  214. package/scss/components/_table-row.scss +69 -1
  215. package/scss/components/_table-view.scss +22 -14
  216. package/scss/components/_text-field.scss +37 -17
  217. package/scss/components/_toggle-view.scss +112 -0
  218. package/scss/components/_tool-bar-item.scss +34 -82
  219. package/scss/components/_tool-bar.scss +77 -57
  220. package/scss/components/_v-stack.scss +9 -2
  221. package/scss/final/_touch-glass.scss +24 -0
  222. package/scss/mixins/_button.scss +44 -0
  223. package/scss/mixins/_color.scss +16 -0
  224. package/scss/mixins/_dialog.scss +1 -0
  225. package/scss/mixins/_index.scss +64 -2
  226. package/scss/placeholders/_buttons.scss +44 -10
  227. package/scss/placeholders/_lists.scss +133 -126
  228. package/scss/transitions/_alert-dialog.scss +18 -0
  229. package/scss/transitions/_confirmation-dialog.scss +8 -0
  230. package/scss/transitions/_fine-tooltip.scss +21 -0
  231. package/scss/transitions/_menu-view.scss +17 -15
  232. package/scss/transitions/_progress-view.scss +23 -0
  233. package/scss/transitions/_sheet-view.scss +30 -0
  234. package/scss/transitions/_tab-bar.scss +6 -5
  235. package/scss/utils/_frame.scss +42 -0
  236. package/scss/utils/_index.scss +67 -52
  237. package/scss/utils/_stacks.scss +56 -73
  238. package/web-components.html-data/en.json +623 -24
  239. package/generated/confirmation-dialog/index.d.ts +0 -1
  240. package/generated/confirmation-dialog/index.js +0 -1
  241. package/generated/lifecycle-observer/index.d.ts +0 -1
  242. package/generated/lifecycle-observer/index.js +0 -1
  243. package/scss/transitions/_dialog.scss +0 -28
@@ -1,11 +1,14 @@
1
+ import { devFlags } from '../internal/utils';
1
2
  export class BodyView extends HTMLElement {
2
3
  constructor() {
3
4
  super();
4
5
  }
5
6
  disconnectedCallback() {
6
- console.debug(`${BodyView.name} ⚡️ disconnect`);
7
+ if (devFlags.debug)
8
+ console.debug(`${BodyView.name} ⚡️ disconnect`);
7
9
  }
8
10
  connectedCallback() {
9
- console.debug(`${BodyView.name} ⚡️ connect`);
11
+ if (devFlags.debug)
12
+ console.debug(`${BodyView.name} ⚡️ connect`);
10
13
  }
11
14
  }
@@ -1,7 +1,17 @@
1
1
  import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A button that applies standard border artwork based on the button’s context.
4
+ *
5
+ * @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
6
+ *
7
+ * @slot overlay
8
+ *
9
+ */
2
10
  export declare class BorderedButton extends ButtonBase {
3
11
  #private;
12
+ static get observedAttributes(): string[];
4
13
  constructor();
5
14
  static polyfillDisconnectedCallback(el: BorderedButton): void;
6
15
  static polyfillConnectedCallback(el: BorderedButton): void;
16
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
7
17
  }
@@ -1,19 +1,55 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { onoff } from '../internal/utils';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @summary A button that applies standard border artwork based on the button’s context.
7
+ *
8
+ * @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
9
+ *
10
+ * @slot overlay
11
+ *
12
+ */
4
13
  export class BorderedButton extends ButtonBase {
14
+ static get observedAttributes() {
15
+ return [
16
+ /**
17
+ * A value that describes the purpose of a button
18
+ * @type {destructive|confirm}
19
+ */
20
+ 'role',
21
+ 'title-key',
22
+ ];
23
+ }
5
24
  constructor() {
6
25
  super();
7
26
  }
8
27
  static polyfillDisconnectedCallback(el) {
9
- console.debug(`${BorderedButton.name} ⚡️ disconnect`);
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderedButton.name} ⚡️ disconnect`);
10
30
  CleanupRegistry.unregister(el);
11
31
  }
12
32
  static polyfillConnectedCallback(el) {
13
- console.debug(`${BorderedButton.name} ⚡️ connect`);
33
+ if (devFlags.debug)
34
+ console.debug(`${BorderedButton.name} ⚡️ connect`);
14
35
  el.tabIndex = 0;
15
36
  CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
16
37
  }
38
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
+ if (devFlags.debug)
40
+ console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
+ const node = target instanceof HTMLButtonElement;
42
+ if (!node)
43
+ return;
44
+ switch (attributeName) {
45
+ case 'title-key':
46
+ case 'role':
47
+ Snapshot.waitReady.then(() => {
48
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
49
+ });
50
+ break;
51
+ }
52
+ }
17
53
  static #handleClick = async (evt) => {
18
54
  //
19
55
  };
@@ -1,7 +1,17 @@
1
1
  import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A button that applies standard border prominent artwork based on the button’s context.
4
+ *
5
+ * @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
6
+ *
7
+ * @slot overlay
8
+ *
9
+ */
2
10
  export declare class BorderedProminentButton extends ButtonBase {
3
11
  #private;
12
+ static get observedAttributes(): string[];
4
13
  constructor();
5
14
  static polyfillDisconnectedCallback(el: BorderedProminentButton): void;
6
15
  static polyfillConnectedCallback(el: BorderedProminentButton): void;
16
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
7
17
  }
@@ -1,19 +1,55 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { onoff } from '../internal/utils';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @summary A button that applies standard border prominent artwork based on the button’s context.
7
+ *
8
+ * @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
9
+ *
10
+ * @slot overlay
11
+ *
12
+ */
4
13
  export class BorderedProminentButton extends ButtonBase {
14
+ static get observedAttributes() {
15
+ return [
16
+ /**
17
+ * A value that describes the purpose of a button
18
+ * @type {destructive|confirm}
19
+ */
20
+ 'role',
21
+ 'title-key',
22
+ ];
23
+ }
5
24
  constructor() {
6
25
  super();
7
26
  }
8
27
  static polyfillDisconnectedCallback(el) {
9
- console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
10
30
  CleanupRegistry.unregister(el);
11
31
  }
12
32
  static polyfillConnectedCallback(el) {
13
- console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
33
+ if (devFlags.debug)
34
+ console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
14
35
  el.tabIndex = 0;
15
36
  CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
16
37
  }
38
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
+ if (devFlags.debug)
40
+ console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
+ const node = target instanceof HTMLButtonElement;
42
+ if (!node)
43
+ return;
44
+ switch (attributeName) {
45
+ case 'title-key':
46
+ case 'role':
47
+ Snapshot.waitReady.then(() => {
48
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
49
+ });
50
+ break;
51
+ }
52
+ }
17
53
  static #handleClick = async (evt) => {
18
54
  //
19
55
  };
@@ -1,9 +1,17 @@
1
1
  import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A button that doesn’t apply a border.
4
+ *
5
+ * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
6
+ *
7
+ * @slot overlay
8
+ *
9
+ */
2
10
  export declare class BorderlessButton extends ButtonBase {
3
11
  #private;
4
12
  static get observedAttributes(): string[];
5
13
  constructor();
6
14
  static polyfillDisconnectedCallback(el: BorderlessButton): void;
7
15
  static polyfillConnectedCallback(el: BorderlessButton): void;
8
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): Promise<void>;
16
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
9
17
  }
@@ -1,31 +1,52 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { onoff } from '../internal/utils';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @summary A button that doesn’t apply a border.
7
+ *
8
+ * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
9
+ *
10
+ * @slot overlay
11
+ *
12
+ */
4
13
  export class BorderlessButton extends ButtonBase {
5
14
  static get observedAttributes() {
6
- return ['role'];
15
+ return [
16
+ /**
17
+ * A value that describes the purpose of a button
18
+ * @type {destructive|confirm}
19
+ */
20
+ 'role',
21
+ 'title-key',
22
+ ];
7
23
  }
8
24
  constructor() {
9
25
  super();
10
26
  }
11
27
  static polyfillDisconnectedCallback(el) {
12
- console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
13
30
  CleanupRegistry.unregister(el);
14
31
  }
15
32
  static polyfillConnectedCallback(el) {
16
- console.debug(`${BorderlessButton.name} ⚡️ connect`);
33
+ if (devFlags.debug)
34
+ console.debug(`${BorderlessButton.name} ⚡️ connect`);
17
35
  el.tabIndex = 0;
18
36
  CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
19
37
  }
20
- static async polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
21
- console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
38
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
+ if (devFlags.debug)
40
+ console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
+ const node = target instanceof HTMLButtonElement;
42
+ if (!node)
43
+ return;
22
44
  switch (attributeName) {
45
+ case 'title-key':
23
46
  case 'role':
24
- // let label = this.querySelector(':scope>[slot=label]')
25
- // if (newValue) {
26
- // label ??= this.appendChild($(`<label-view slot="label"></label-view>`))
27
- // label.setAttribute('title', newValue)
28
- // } else label?.remove()
47
+ Snapshot.waitReady.then(() => {
48
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
49
+ });
29
50
  break;
30
51
  }
31
52
  }
@@ -0,0 +1,7 @@
1
+ export declare class ColorScheme extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ constructor();
4
+ connectedCallback(): void;
5
+ disconnectedCallback(): void;
6
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
7
+ }
@@ -0,0 +1,54 @@
1
+ import { devFlags } from '../internal/utils';
2
+ export class ColorScheme extends HTMLElement {
3
+ static get observedAttributes() {
4
+ return ['dark'];
5
+ }
6
+ constructor() {
7
+ super();
8
+ }
9
+ connectedCallback() {
10
+ if (devFlags.debug)
11
+ console.debug(`${ColorScheme.name} ⚡️ connect`);
12
+ this.hidden = true;
13
+ this.inert = true;
14
+ }
15
+ disconnectedCallback() {
16
+ if (devFlags.debug)
17
+ console.debug(`${ColorScheme.name} ⚡️ disconnect`);
18
+ }
19
+ attributeChangedCallback(name, oldValue, newValue) {
20
+ if (devFlags.debug)
21
+ console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
22
+ // self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
23
+ if (newValue)
24
+ self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
25
+ // @property --canvas {
26
+ // syntax: "<color>";
27
+ // initial-value: oklch(100% 0 0deg);
28
+ // inherits: false;
29
+ // }
30
+ // @media (prefers-color-scheme: dark) {
31
+ // @property --canvas {
32
+ // syntax: "<color>";
33
+ // initial-value: oklch(0% 0 0deg);
34
+ // inherits: false;
35
+ // }
36
+ // }
37
+ // @property --canvastext {
38
+ // syntax: "<color>";
39
+ // initial-value: oklch(0% 0 0deg);
40
+ // inherits: false;
41
+ // }
42
+ // @media (prefers-color-scheme: dark) {
43
+ // @property --canvastext {
44
+ // syntax: "<color>";
45
+ // initial-value: oklch(100% 0 0deg);
46
+ // inherits: false;
47
+ // }
48
+ // }
49
+ // if (CSS.supports('interpolate-size', 'allow-keywords')) {
50
+ // self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
51
+ if (null !== newValue)
52
+ self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
53
+ }
54
+ }
@@ -5,5 +5,5 @@ export declare class ConfirmationDialog extends DialogBase {
5
5
  constructor();
6
6
  static polyfillDisconnectedCallback(el: ConfirmationDialog): void;
7
7
  static polyfillConnectedCallback(el: ConfirmationDialog): void;
8
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): Promise<void>;
8
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
9
9
  }
@@ -1,6 +1,6 @@
1
- import { ConfirmationDialog as EvtBus } from '../confirmation-dialog';
1
+ import { confirmationDialog } from '../buses';
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { $, onoff, touchGlass } from '../internal/utils';
3
+ import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
4
4
  import { DialogBase } from '../namespace-browser/base';
5
5
  export class ConfirmationDialog extends DialogBase {
6
6
  static get observedAttributes() {
@@ -10,38 +10,45 @@ export class ConfirmationDialog extends DialogBase {
10
10
  super();
11
11
  }
12
12
  static polyfillDisconnectedCallback(el) {
13
- console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
13
+ if (devFlags.debug)
14
+ console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
14
15
  const positionAnchor = el.style.getPropertyValue('position-anchor');
15
- $.prop('anchor-name', null, document.querySelector(`[style*="${positionAnchor}"]`));
16
- $.prop('position-anchor', null, el);
16
+ document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
17
+ el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
17
18
  CleanupRegistry.unregister(el);
18
- EvtBus.dispatchEvent(new CustomEvent('return', {
19
+ confirmationDialog.dispatchEvent(new CustomEvent('confirmation:return', {
19
20
  detail: { returnValue: el.returnValue, positionAnchor },
20
21
  bubbles: true,
21
22
  composed: true,
22
23
  }));
23
24
  }
24
25
  static polyfillConnectedCallback(el) {
25
- console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
26
+ if (devFlags.debug)
27
+ console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
26
28
  CleanupRegistry.register(el, onoff([
27
29
  { types: 'click', listener: this.#handleDialogClick },
28
30
  { types: 'close', listener: this.#handleDialogClose },
29
31
  { types: 'cancel', listener: this.#handleDialogCancel },
30
32
  ], el).on());
31
- CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, (evt) => {
32
- if (evt.target.matches('[is=confirmation-dialog]'))
33
+ CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
34
+ if (!(target instanceof HTMLElement))
35
+ return true;
36
+ if (target.matches('[is=confirmation-dialog]'))
33
37
  return false;
34
38
  // if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
35
39
  return true;
36
40
  }), el).on());
37
- console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
41
+ if (devFlags.debug)
42
+ console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
38
43
  el.removeAttribute('closing');
39
44
  el.scrollTop = 0;
40
45
  el.returnValue = '';
46
+ el.autofocus = true;
41
47
  el.showModal();
42
48
  }
43
- static async polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
44
- console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
49
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
50
+ if (devFlags.debug)
51
+ console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
45
52
  // const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
46
53
  switch (attributeName) {
47
54
  case 'label':
@@ -54,16 +61,16 @@ export class ConfirmationDialog extends DialogBase {
54
61
  }
55
62
  }
56
63
  static #handleDialogClick = (evt) => {
57
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
58
- const dialog = evt.currentTarget;
59
- if (!dialog)
64
+ if (devFlags.debug)
65
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
66
+ const { target, currentTarget: dialog } = evt;
67
+ if (!(dialog instanceof HTMLDialogElement))
60
68
  return;
61
- const target = evt.target;
62
- const rect = dialog.getBoundingClientRect();
63
- const isInside = evt.clientX >= rect.left && evt.clientX <= rect.right && evt.clientY >= rect.top && evt.clientY <= rect.bottom;
64
- if (target?.matches('dialog') && !isInside)
65
- return dialog?.requestClose(); // click outside
66
- const button = target?.closest('button');
69
+ if (!(target instanceof HTMLElement))
70
+ return;
71
+ if (target.matches('dialog') && !isInside(evt.clientX, evt.clientY, dialog.getBoundingClientRect()))
72
+ return dialog.requestClose(); // click outside
73
+ const button = target.closest('button');
67
74
  if (!button)
68
75
  return;
69
76
  button.scrollIntoView({
@@ -72,20 +79,22 @@ export class ConfirmationDialog extends DialogBase {
72
79
  inline: 'nearest',
73
80
  });
74
81
  dialog.returnValue = button.value;
75
- dialog?.requestClose(button.value);
76
- evt?.stopPropagation();
77
- evt?.stopImmediatePropagation();
82
+ dialog.requestClose(button.value);
83
+ evt.stopPropagation();
84
+ evt.stopImmediatePropagation();
78
85
  };
79
86
  static #handleDialogCancel = (evt) => {
80
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
87
+ if (devFlags.debug)
88
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
81
89
  if (!evt.cancelable)
82
90
  return;
83
- const target = evt.target;
84
- if (!target)
91
+ const { target } = evt;
92
+ if (!(target instanceof HTMLDialogElement))
85
93
  return;
86
94
  evt.preventDefault();
87
95
  target.inert = true;
88
- console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
96
+ if (devFlags.debug)
97
+ console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
89
98
  target.setAttribute('closing', '');
90
99
  Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
91
100
  if (!target.hasAttribute('closing'))
@@ -94,9 +103,11 @@ export class ConfirmationDialog extends DialogBase {
94
103
  target.removeAttribute('closing');
95
104
  });
96
105
  };
97
- static #handleDialogClose = (evt) => {
98
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
99
- const target = evt.target;
100
- target?.remove();
106
+ static #handleDialogClose = ({ type, target }) => {
107
+ if (devFlags.debug)
108
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
109
+ if (!(target instanceof HTMLDialogElement))
110
+ return;
111
+ target.remove();
101
112
  };
102
113
  }
@@ -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="icon" 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="icon" 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
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
22
+ disconnectedCallback(): void;
23
+ connectedCallback(): void;
24
+ }
@@ -0,0 +1,81 @@
1
+ import { I18n } from '../i18n';
2
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
+ import { $, devFlags, onoff } from '../internal/utils';
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="icon" 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="icon" 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
+ attributeChangedCallback(name, oldValue, newValue) {
49
+ if (devFlags.debug)
50
+ console.debug(`${ContentUnavailableView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
51
+ switch (name) {
52
+ case 'search':
53
+ if (oldValue === newValue)
54
+ break;
55
+ this.#renderSearch(newValue);
56
+ CleanupRegistry.unregister(this, 'i18n');
57
+ CleanupRegistry.register(this, onoff('localechange', () => {
58
+ this.#renderSearch(this.getAttribute('search'));
59
+ }, I18n.on).on(), 'i18n');
60
+ break;
61
+ }
62
+ }
63
+ disconnectedCallback() {
64
+ if (devFlags.debug)
65
+ console.debug(`${ContentUnavailableView.name} ⚡️ disconnect`);
66
+ }
67
+ connectedCallback() {
68
+ if (devFlags.debug)
69
+ console.debug(`${ContentUnavailableView.name} ⚡️ connect`);
70
+ }
71
+ #renderSearch = (search) => {
72
+ const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(`<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
73
+ if (search) {
74
+ const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
75
+ titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
76
+ }
77
+ else
78
+ titleLabel?.setAttribute('title', I18n.t('SearchUnavailableContent').NoLabel);
79
+ descText.setAttribute('title', I18n.t('SearchUnavailableContent').Description);
80
+ };
81
+ }
@@ -6,20 +6,10 @@ export declare class DatePicker extends FormAssociatedBase {
6
6
  static get observedAttributes(): string[];
7
7
  get template(): DocumentFragment;
8
8
  constructor();
9
- connectedCallback(): void;
10
- disconnectedCallback(): void;
11
9
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
10
+ disconnectedCallback(): void;
11
+ connectedCallback(): void;
12
12
  get datePickerStyle(): DatePickerStyle;
13
- get selection(): {
14
- year: string;
15
- month: string;
16
- day: string;
17
- };
18
- set selection(v: {
19
- year: string;
20
- month: string;
21
- day: string;
22
- });
23
13
  get name(): string;
24
14
  get value(): {
25
15
  year: string;