@swiftwc/ui 0.0.0-dev.20 → 0.0.0-dev.22

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 (113) 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 +17 -4
  10. package/generated/client/index.js +83 -32
  11. package/generated/components/alert-dialog.d.ts +8 -0
  12. package/generated/components/alert-dialog.js +94 -0
  13. package/generated/components/bordered-button.d.ts +6 -0
  14. package/generated/components/bordered-button.js +22 -1
  15. package/generated/components/bordered-prominent-button.d.ts +6 -0
  16. package/generated/components/bordered-prominent-button.js +22 -1
  17. package/generated/components/borderless-button.d.ts +5 -1
  18. package/generated/components/borderless-button.js +13 -7
  19. package/generated/components/confirmation-dialog.d.ts +1 -1
  20. package/generated/components/confirmation-dialog.js +26 -20
  21. package/generated/components/content-unavailable-view.js +2 -2
  22. package/generated/components/date-picker.js +24 -10
  23. package/generated/components/disclosure-group.js +4 -1
  24. package/generated/components/glass-button.d.ts +6 -0
  25. package/generated/components/glass-button.js +22 -1
  26. package/generated/components/glass-prominent-button.d.ts +6 -0
  27. package/generated/components/glass-prominent-button.js +22 -1
  28. package/generated/components/index.d.ts +1 -0
  29. package/generated/components/index.js +1 -0
  30. package/generated/components/label-view.js +3 -35
  31. package/generated/components/menu-view.js +12 -7
  32. package/generated/components/navigation-title.js +4 -4
  33. package/generated/components/picker-view.js +35 -25
  34. package/generated/components/scroll-view.js +27 -13
  35. package/generated/components/section-view.js +3 -3
  36. package/generated/components/sheet-view.d.ts +1 -2
  37. package/generated/components/sheet-view.js +38 -22
  38. package/generated/components/sidebar-toggle.js +6 -4
  39. package/generated/components/sidebar-view.js +10 -4
  40. package/generated/components/sticky-container.js +3 -1
  41. package/generated/components/tab-bar.js +10 -4
  42. package/generated/components/tab-item.js +3 -1
  43. package/generated/components/tab-view.js +11 -8
  44. package/generated/components/table-view.js +22 -10
  45. package/generated/components/text-field.js +37 -32
  46. package/generated/components/tool-bar-item-group.js +17 -0
  47. package/generated/components/tool-bar-item.js +20 -1
  48. package/generated/components/tool-bar.d.ts +12 -0
  49. package/generated/components/tool-bar.js +20 -7
  50. package/generated/components/v-stack.d.ts +5 -0
  51. package/generated/components/v-stack.js +5 -0
  52. package/generated/css/index.css +377 -86
  53. package/generated/events/alert-dialog.d.ts +8 -0
  54. package/generated/events/alert-dialog.js +1 -0
  55. package/generated/events/confirmation-dialog.d.ts +2 -2
  56. package/generated/events/index.d.ts +1 -0
  57. package/generated/events/index.js +1 -0
  58. package/generated/events/tab-view.d.ts +6 -2
  59. package/generated/i18n/locales/el.d.ts +9 -0
  60. package/generated/i18n/locales/el.js +9 -0
  61. package/generated/i18n/locales/en.d.ts +9 -0
  62. package/generated/i18n/locales/en.js +9 -0
  63. package/generated/internal/class/css-style-observer.js +1 -1
  64. package/generated/internal/class/form-associated-base.js +4 -1
  65. package/generated/internal/class/navigation-view.js +4 -4
  66. package/generated/internal/utils/button-role.d.ts +1 -0
  67. package/generated/internal/utils/button-role.js +39 -0
  68. package/generated/internal/utils/cash/index.d.ts +4 -3
  69. package/generated/internal/utils/cash/index.js +6 -4
  70. package/generated/internal/utils/index.d.ts +2 -0
  71. package/generated/internal/utils/index.js +2 -0
  72. package/generated/internal/utils/is-inside.d.ts +1 -0
  73. package/generated/internal/utils/is-inside.js +4 -0
  74. package/generated/internal/utils/list-active.js +15 -5
  75. package/generated/snapshot/index.d.ts +2 -0
  76. package/generated/snapshot/index.js +21 -0
  77. package/package.json +7 -4
  78. package/scss/_components.scss +2 -0
  79. package/scss/_functions.scss +10 -0
  80. package/scss/_transitions.scss +1 -0
  81. package/scss/_vars.scss +5 -0
  82. package/scss/base/_reboot.scss +10 -0
  83. package/scss/colors/_index.scss +39 -21
  84. package/scss/components/_alert-dialog.scss +106 -0
  85. package/scss/components/_bordered-button.scss +14 -0
  86. package/scss/components/_bordered-prominent-button.scss +13 -0
  87. package/scss/components/_borderless-button.scss +4 -0
  88. package/scss/components/_confirmation-dialog.scss +39 -39
  89. package/scss/components/_content-unavailable-view.scss +1 -1
  90. package/scss/components/_disclosure-group.scss +80 -33
  91. package/scss/components/_glass-button.scss +14 -0
  92. package/scss/components/_glass-prominent-button.scss +14 -0
  93. package/scss/components/_h-stack.scss +3 -13
  94. package/scss/components/_index.scss +1 -0
  95. package/scss/components/_label-view.scss +42 -16
  96. package/scss/components/_label-view.scss.txt +536 -0
  97. package/scss/components/_sheet-view.scss +13 -3
  98. package/scss/components/_tab-bar.scss +5 -0
  99. package/scss/components/_tool-bar-item.scss +19 -0
  100. package/scss/components/_tool-bar.scss +25 -0
  101. package/scss/components/_v-stack.scss +3 -13
  102. package/scss/final/_touch-glass.scss +7 -0
  103. package/scss/mixins/_index.scss +17 -0
  104. package/scss/placeholders/_buttons.scss +87 -10
  105. package/scss/transitions/_alert-dialog.scss +19 -0
  106. package/scss/transitions/_tab-bar.scss +6 -5
  107. package/scss/utils/_frame.scss +7 -0
  108. package/web-components.html-data/en.json +81 -13
  109. package/generated/confirmation-dialog/index.d.ts +0 -1
  110. package/generated/confirmation-dialog/index.js +0 -1
  111. package/generated/lifecycle-observer/index.d.ts +0 -1
  112. package/generated/lifecycle-observer/index.js +0 -1
  113. package/scss/components/_components.scss +0 -76
@@ -1,11 +1,28 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
1
2
  export class ToolBarItemGroup extends HTMLElement {
3
+ // static get observedAttributes() {
4
+ // return ['preferred-fine-modal-placement']
5
+ // }
2
6
  constructor() {
3
7
  super();
4
8
  }
5
9
  connectedCallback() {
6
10
  console.debug(`${ToolBarItemGroup.name} ⚡️ connect`);
11
+ // if (!this.closest('[is=sheet-view]')) return
12
+ // if (!self.matchMedia('(pointer: fine)').matches) return
13
+ // const handler1 = toolbarRepositioner.bind(null, this)
14
+ // CleanupRegistry.register(this, onoff('fine_dialog_sheet:change', handler1 as unknown as EventListener, Snapshot.on).on())
15
+ // Snapshot.waitReady.then(() => {
16
+ // toolbarRepositioner(
17
+ // this,
18
+ // new MediaQueryListEvent(`media-change`, {
19
+ // matches: Snapshot.breakpoints?.get('fine_dialog_sheet'),
20
+ // })
21
+ // ) // Initial check
22
+ // })
7
23
  }
8
24
  disconnectedCallback() {
9
25
  console.debug(`${ToolBarItemGroup.name} ⚡️ disconnect`);
26
+ CleanupRegistry.unregister(this);
10
27
  }
11
28
  }
@@ -1,16 +1,35 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
2
  import { onoff, touchGlass } from '../internal/utils';
3
3
  export class ToolBarItem extends HTMLElement {
4
+ // static get observedAttributes() {
5
+ // return ['preferred-fine-modal-placement']
6
+ // }
4
7
  constructor() {
5
8
  super();
6
9
  }
7
10
  connectedCallback() {
8
11
  console.debug(`${ToolBarItem.name} ⚡️ connect`);
9
12
  CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, (evt) => {
10
- if (evt.target.closest('menu-view[open]'))
13
+ const target = evt.target instanceof HTMLElement && evt.target;
14
+ if (!target)
15
+ return true;
16
+ if (target.closest('menu-view[open]'))
11
17
  return false;
12
18
  return true;
13
19
  }), this).on());
20
+ // if (this.closest('tool-bar-item-group')) return
21
+ // if (!this.closest('[is=sheet-view]')) return
22
+ // if (!self.matchMedia('(pointer: fine)').matches) return
23
+ // const handler1 = toolbarRepositioner.bind(null, this)
24
+ // CleanupRegistry.register(this, onoff('fine_dialog_sheet:change', handler1 as unknown as EventListener, Snapshot.on).on())
25
+ // Snapshot.waitReady.then(() => {
26
+ // toolbarRepositioner(
27
+ // this,
28
+ // new MediaQueryListEvent(`media-change`, {
29
+ // matches: Snapshot.breakpoints?.get('fine_dialog_sheet'),
30
+ // })
31
+ // ) // Initial check
32
+ // })
14
33
  }
15
34
  disconnectedCallback() {
16
35
  console.debug(`${ToolBarItem.name} ⚡️ disconnect`);
@@ -1,3 +1,15 @@
1
+ /**
2
+ * @slot cancellation-action - The item represents a cancellation action for a modal interface. Places the item in the leading edge of the top bar and on the leading edge of the bottom bar when fine modal
3
+ * @slot primary-action - The item represents a primary action. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
4
+ * @slot confirmation-action - The item represents a confirmation action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
5
+ * @slot destructive-action - The item represents a destructive action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
6
+ * @slot top-bar-leading - Places the item in the leading edge of the top bar
7
+ * @slot top-bar-principal - Places the item in the middle of the top bar
8
+ * @slot top-bar-trailing - Places the item in the trailing edge of the top bar
9
+ * @slot bottom-bar-leading - Places the item in the leading edge of the bottom bar
10
+ * @slot bottom-bar-principal - Places the item in the middle of the bottom bar
11
+ * @slot bottom-bar-trailing - Places the item in the trailing edge of the bottom bar
12
+ */
1
13
  export declare class ToolBar extends HTMLElement {
2
14
  #private;
3
15
  static get template(): DocumentFragment;
@@ -2,6 +2,18 @@ var _a;
2
2
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
3
3
  import { $ } from '../internal/utils';
4
4
  const observers = new ResizeObserverSingleton();
5
+ /**
6
+ * @slot cancellation-action - The item represents a cancellation action for a modal interface. Places the item in the leading edge of the top bar and on the leading edge of the bottom bar when fine modal
7
+ * @slot primary-action - The item represents a primary action. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
8
+ * @slot confirmation-action - The item represents a confirmation action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
9
+ * @slot destructive-action - The item represents a destructive action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
10
+ * @slot top-bar-leading - Places the item in the leading edge of the top bar
11
+ * @slot top-bar-principal - Places the item in the middle of the top bar
12
+ * @slot top-bar-trailing - Places the item in the trailing edge of the top bar
13
+ * @slot bottom-bar-leading - Places the item in the leading edge of the bottom bar
14
+ * @slot bottom-bar-principal - Places the item in the middle of the bottom bar
15
+ * @slot bottom-bar-trailing - Places the item in the trailing edge of the bottom bar
16
+ */
5
17
  export class ToolBar extends HTMLElement {
6
18
  static #template;
7
19
  static get template() {
@@ -9,6 +21,7 @@ export class ToolBar extends HTMLElement {
9
21
  return (this.#template ??= $(String.raw `
10
22
  <div part="root top-bar">
11
23
  <div part="root toolbar-leading-stack">
24
+ <slot name="cancellation-action"></slot>
12
25
  <slot name="top-bar-leading"></slot>
13
26
  </div>
14
27
  <div part="root toolbar-principal-stack">
@@ -16,6 +29,9 @@ export class ToolBar extends HTMLElement {
16
29
  </div>
17
30
  <div part="root toolbar-trailing-stack">
18
31
  <slot name="top-bar-trailing"></slot>
32
+ <slot name="primary-action"></slot>
33
+ <slot name="confirmation-action"></slot>
34
+ <slot name="destructive-action"></slot>
19
35
  </div>
20
36
  </div>
21
37
  <div part="root bottom-bar">
@@ -28,19 +44,16 @@ export class ToolBar extends HTMLElement {
28
44
  <div part="root toolbar-trailing-stack">
29
45
  <slot name="bottom-bar-trailing"></slot>
30
46
  </div>
31
- </div>`, ''));
47
+ </div>`));
32
48
  }
33
49
  #shadowRoot;
34
50
  get #scrollView() {
35
- return this.parentElement?.querySelector(':scope > scroll-view') ?? undefined; //this.previousElementSibling ?? undefined
51
+ return this.parentElement?.querySelector(':scope>scroll-view') ?? undefined; //this.previousElementSibling ?? undefined
36
52
  }
37
53
  constructor() {
38
54
  super();
39
55
  this.#shadowRoot = this.attachShadow({ mode: 'closed' });
40
- // NOTE: wait for config
41
- // Snapshot.waitReady.then(() => {
42
56
  this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
43
- // })
44
57
  }
45
58
  connectedCallback() {
46
59
  console.debug(`${_a.name} ⚡️ connect`);
@@ -63,7 +76,7 @@ export class ToolBar extends HTMLElement {
63
76
  'top-bar': 'navbar',
64
77
  'bottom-bar': 'toolbar', //'bottombar',
65
78
  };
66
- const { contentRect, target } = entry;
79
+ const { contentRect: { width }, target, } = entry;
67
80
  const parentPart = target.parentElement?.part.contains('top-bar') ? 'top-bar' : target.parentElement?.part.contains('bottom-bar') ? 'bottom-bar' : null;
68
81
  if (!parentPart)
69
82
  return;
@@ -71,7 +84,7 @@ export class ToolBar extends HTMLElement {
71
84
  if (!side)
72
85
  return;
73
86
  const prop = `--${parentMap[parentPart]}-padding-${side}`;
74
- $.prop(prop, `${Math.round(contentRect.width)}px`, this.#scrollView); //;(this.#scrollView as HTMLElement)?.style?.setProperty(prop, `${Math.round(contentRect.width)}px`)
87
+ this.#scrollView?.style?.setProperty(prop, `${Math.round(width)}px`); // $.prop(prop, `${Math.round(width)}px`, this.#scrollView) //
75
88
  }
76
89
  }
77
90
  _a = ToolBar;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution - The distribution of cols
3
+ *
4
+ * @attr {"auto spacer"|"auto auto spacer"|"auto auto auto spacer"} template
5
+ */
1
6
  export declare class VStack extends HTMLElement {
2
7
  constructor();
3
8
  connectedCallback(): void;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution - The distribution of cols
3
+ *
4
+ * @attr {"auto spacer"|"auto auto spacer"|"auto auto auto spacer"} template
5
+ */
1
6
  export class VStack extends HTMLElement {
2
7
  constructor() {
3
8
  super();