@swiftwc/ui 0.0.0-dev.21 → 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 (54) hide show
  1. package/generated/components/bordered-button.d.ts +4 -0
  2. package/generated/components/bordered-button.js +8 -1
  3. package/generated/components/bordered-prominent-button.d.ts +4 -0
  4. package/generated/components/bordered-prominent-button.js +8 -1
  5. package/generated/components/borderless-button.d.ts +4 -0
  6. package/generated/components/borderless-button.js +8 -1
  7. package/generated/components/date-picker.js +10 -4
  8. package/generated/components/glass-button.d.ts +4 -0
  9. package/generated/components/glass-button.js +8 -1
  10. package/generated/components/glass-prominent-button.d.ts +4 -0
  11. package/generated/components/glass-prominent-button.js +8 -1
  12. package/generated/components/label-view.js +1 -33
  13. package/generated/components/picker-view.js +19 -15
  14. package/generated/components/scroll-view.js +8 -3
  15. package/generated/components/sheet-view.d.ts +0 -1
  16. package/generated/components/sheet-view.js +19 -7
  17. package/generated/components/sidebar-toggle.js +1 -1
  18. package/generated/components/tab-view.js +7 -7
  19. package/generated/components/table-view.js +11 -5
  20. package/generated/components/text-field.js +9 -4
  21. package/generated/components/tool-bar-item-group.d.ts +0 -2
  22. package/generated/components/tool-bar-item-group.js +15 -26
  23. package/generated/components/tool-bar-item.d.ts +0 -2
  24. package/generated/components/tool-bar-item.js +17 -28
  25. package/generated/components/tool-bar.d.ts +12 -0
  26. package/generated/components/tool-bar.js +19 -6
  27. package/generated/css/index.css +270 -70
  28. package/generated/events/tab-view.d.ts +6 -2
  29. package/generated/internal/class/css-style-observer.js +1 -1
  30. package/generated/internal/utils/button-role.js +25 -5
  31. package/generated/internal/utils/index.d.ts +0 -1
  32. package/generated/internal/utils/index.js +0 -1
  33. package/package.json +1 -1
  34. package/scss/_vars.scss +5 -0
  35. package/scss/base/_reboot.scss +10 -0
  36. package/scss/colors/_index.scss +37 -19
  37. package/scss/components/_bordered-button.scss +14 -0
  38. package/scss/components/_bordered-prominent-button.scss +13 -0
  39. package/scss/components/_borderless-button.scss +4 -0
  40. package/scss/components/_content-unavailable-view.scss +1 -1
  41. package/scss/components/_disclosure-group.scss +80 -33
  42. package/scss/components/_glass-button.scss +14 -0
  43. package/scss/components/_glass-prominent-button.scss +14 -0
  44. package/scss/components/_label-view.scss +42 -16
  45. package/scss/components/_label-view.scss.txt +536 -0
  46. package/scss/components/_sheet-view.scss +12 -12
  47. package/scss/components/_tab-bar.scss +5 -0
  48. package/scss/components/_tool-bar-item.scss +19 -0
  49. package/scss/components/_tool-bar.scss +25 -0
  50. package/scss/placeholders/_buttons.scss +72 -37
  51. package/scss/transitions/_tab-bar.scss +6 -5
  52. package/web-components.html-data/en.json +12 -21
  53. package/generated/internal/utils/toolbar-repositioner.d.ts +0 -1
  54. package/generated/internal/utils/toolbar-repositioner.js +0 -12
@@ -1,7 +1,5 @@
1
1
  export declare class ToolBarItem extends HTMLElement {
2
- static get observedAttributes(): string[];
3
2
  constructor();
4
3
  connectedCallback(): void;
5
4
  disconnectedCallback(): void;
6
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
7
5
  }
@@ -1,10 +1,9 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { onoff, toolbarRepositioner, touchGlass } from '../internal/utils';
3
- import { Snapshot } from '../snapshot';
2
+ import { onoff, touchGlass } from '../internal/utils';
4
3
  export class ToolBarItem extends HTMLElement {
5
- static get observedAttributes() {
6
- return ['preferred-fine-modal-placement'];
7
- }
4
+ // static get observedAttributes() {
5
+ // return ['preferred-fine-modal-placement']
6
+ // }
8
7
  constructor() {
9
8
  super();
10
9
  }
@@ -18,32 +17,22 @@ export class ToolBarItem extends HTMLElement {
18
17
  return false;
19
18
  return true;
20
19
  }), this).on());
21
- if (this.closest('tool-bar-item-group'))
22
- return;
23
- if (!this.closest('[is=sheet-view]'))
24
- return;
25
- const handler1 = toolbarRepositioner.bind(null, this);
26
- CleanupRegistry.register(this, onoff('fine_dialog_sheet:change', handler1, Snapshot.on).on());
27
- Snapshot.waitReady.then(() => {
28
- toolbarRepositioner(this, new MediaQueryListEvent(`media-change`, {
29
- matches: Snapshot.breakpoints?.get('fine_dialog_sheet'),
30
- })); // Initial check
31
- });
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
+ // })
32
33
  }
33
34
  disconnectedCallback() {
34
35
  console.debug(`${ToolBarItem.name} ⚡️ disconnect`);
35
36
  CleanupRegistry.unregister(this);
36
37
  }
37
- attributeChangedCallback(name, oldValue, newValue) {
38
- console.debug(`${ToolBarItem.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
39
- switch (name) {
40
- case 'preferred-fine-modal-placement':
41
- Snapshot.waitReady.then(() => {
42
- toolbarRepositioner(this, new MediaQueryListEvent(`media-change`, {
43
- matches: Snapshot.breakpoints?.get('fine_dialog_sheet'),
44
- })); // Initial check
45
- });
46
- break;
47
- }
48
- }
49
38
  }
@@ -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">
@@ -32,15 +48,12 @@ export class ToolBar extends HTMLElement {
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;