@vollowx/seele 0.13.5 → 0.13.6

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 (146) hide show
  1. package/custom-elements.json +1256 -115
  2. package/package.json +22 -14
  3. package/src/all.d.ts +34 -0
  4. package/src/base/autocomplete.d.ts +56 -0
  5. package/src/base/autocomplete.js +75 -87
  6. package/src/base/button.d.ts +13 -0
  7. package/src/base/button.js +21 -19
  8. package/src/base/checkbox.d.ts +18 -0
  9. package/src/base/checkbox.js +39 -34
  10. package/src/base/controllers/list-controller.d.ts +37 -0
  11. package/src/base/controllers/list-controller.js +23 -15
  12. package/src/base/controllers/popover-controller.d.ts +35 -0
  13. package/src/base/controllers/popover-controller.js +37 -29
  14. package/src/base/dialog.d.ts +20 -0
  15. package/src/base/dialog.js +11 -9
  16. package/src/base/field.d.ts +3 -0
  17. package/src/base/input.d.ts +44 -0
  18. package/src/base/input.js +57 -65
  19. package/src/base/item.d.ts +7 -0
  20. package/src/base/item.js +2 -1
  21. package/src/base/list-item.d.ts +15 -0
  22. package/src/base/list-item.js +22 -22
  23. package/src/base/list.d.ts +54 -0
  24. package/src/base/list.js +69 -55
  25. package/src/base/menu-item.d.ts +6 -0
  26. package/src/base/menu-item.js +4 -3
  27. package/src/base/menu.d.ts +76 -0
  28. package/src/base/menu.js +135 -143
  29. package/src/base/mixins/attachable.d.ts +9 -0
  30. package/src/base/mixins/attachable.js +22 -18
  31. package/src/base/mixins/focus-delegated.d.ts +5 -0
  32. package/src/base/mixins/focus-delegated.js +6 -8
  33. package/src/base/mixins/form-associated.d.ts +15 -0
  34. package/src/base/mixins/form-associated.js +11 -18
  35. package/src/base/mixins/internals-attached.d.ts +6 -0
  36. package/src/base/mixins/internals-attached.js +1 -1
  37. package/src/base/option.d.ts +9 -0
  38. package/src/base/option.js +7 -8
  39. package/src/base/radio.d.ts +13 -0
  40. package/src/base/radio.js +49 -42
  41. package/src/base/select.d.ts +116 -0
  42. package/src/base/select.js +130 -128
  43. package/src/base/slider.d.ts +75 -0
  44. package/src/base/slider.js +115 -118
  45. package/src/base/tab-panel.d.ts +9 -0
  46. package/src/base/tab-panel.js +11 -11
  47. package/src/base/tab.d.ts +18 -0
  48. package/src/base/tab.js +25 -24
  49. package/src/base/tabs.d.ts +19 -0
  50. package/src/base/tabs.js +84 -81
  51. package/src/base/toggle-button.d.ts +47 -0
  52. package/src/base/toggle-button.js +56 -52
  53. package/src/base/tooltip.d.ts +37 -0
  54. package/src/base/tooltip.js +70 -65
  55. package/src/core/decorators.d.ts +2 -0
  56. package/src/core/decorators.js +4 -3
  57. package/src/core/focus-visible.d.ts +2 -0
  58. package/src/core/focus-visible.js +4 -4
  59. package/src/core/shared.d.ts +1 -0
  60. package/src/core/unique-id.d.ts +4 -0
  61. package/src/core/unique-id.js +2 -1
  62. package/src/m3/autocomplete/autocomplete.d.ts +8 -0
  63. package/src/m3/autocomplete/autocomplete.js +10 -10
  64. package/src/m3/badge/badge.d.ts +12 -0
  65. package/src/m3/badge/badge.js +24 -37
  66. package/src/m3/button/common-button-toggle.d.ts +31 -0
  67. package/src/m3/button/common-button-toggle.js +44 -41
  68. package/src/m3/button/common-button.d.ts +29 -0
  69. package/src/m3/button/common-button.js +40 -40
  70. package/src/m3/button/icon-button-toggle.d.ts +24 -0
  71. package/src/m3/button/icon-button-toggle.js +35 -32
  72. package/src/m3/button/icon-button.d.ts +23 -0
  73. package/src/m3/button/icon-button.js +33 -31
  74. package/src/m3/button-group/connected-button-group.d.ts +19 -0
  75. package/src/m3/button-group/connected-button-group.js +26 -24
  76. package/src/m3/button-group/standard-button-group.d.ts +24 -0
  77. package/src/m3/button-group/standard-button-group.js +71 -65
  78. package/src/m3/checkbox/checkbox.d.ts +25 -0
  79. package/src/m3/checkbox/checkbox.js +23 -22
  80. package/src/m3/dialog/dialog-spring.d.ts +45 -0
  81. package/src/m3/dialog/dialog-spring.js +83 -86
  82. package/src/m3/dialog/dialog.d.ts +46 -0
  83. package/src/m3/dialog/dialog.js +90 -117
  84. package/src/m3/divider/divider.d.ts +13 -0
  85. package/src/m3/divider/divider.js +20 -33
  86. package/src/m3/fab/fab.d.ts +23 -0
  87. package/src/m3/fab/fab.js +24 -23
  88. package/src/m3/field/field.d.ts +28 -0
  89. package/src/m3/field/field.js +40 -55
  90. package/src/m3/field/filled-field.d.ts +11 -0
  91. package/src/m3/field/filled-field.js +7 -11
  92. package/src/m3/field/outlined-field.d.ts +11 -0
  93. package/src/m3/field/outlined-field.js +8 -12
  94. package/src/m3/focus-ring/focus-ring.d.ts +32 -0
  95. package/src/m3/focus-ring/focus-ring.js +38 -23
  96. package/src/m3/item/item.d.ts +31 -0
  97. package/src/m3/item/item.js +32 -17
  98. package/src/m3/list/list-item.d.ts +22 -0
  99. package/src/m3/list/list-item.js +18 -16
  100. package/src/m3/list/list.d.ts +15 -0
  101. package/src/m3/list/list.js +16 -15
  102. package/src/m3/loading-indicator/loading-indicator.d.ts +26 -0
  103. package/src/m3/loading-indicator/loading-indicator.js +113 -161
  104. package/src/m3/menu/menu-item.d.ts +15 -0
  105. package/src/m3/menu/menu-item.js +10 -4
  106. package/src/m3/menu/menu.d.ts +22 -0
  107. package/src/m3/menu/menu.js +20 -18
  108. package/src/m3/radio/radio-styles.css.js +1 -1
  109. package/src/m3/radio/radio.d.ts +17 -0
  110. package/src/m3/radio/radio.js +22 -11
  111. package/src/m3/ripple/ripple.d.ts +43 -0
  112. package/src/m3/ripple/ripple.js +82 -89
  113. package/src/m3/select/filled-select.d.ts +16 -0
  114. package/src/m3/select/filled-select.js +12 -10
  115. package/src/m3/select/option.d.ts +15 -0
  116. package/src/m3/select/option.js +10 -4
  117. package/src/m3/select/outlined-select.d.ts +16 -0
  118. package/src/m3/select/outlined-select.js +12 -10
  119. package/src/m3/select/select.d.ts +13 -0
  120. package/src/m3/select/select.js +16 -16
  121. package/src/m3/slider/slider.d.ts +20 -0
  122. package/src/m3/slider/slider.js +32 -26
  123. package/src/m3/switch/switch.d.ts +27 -0
  124. package/src/m3/switch/switch.js +62 -53
  125. package/src/m3/system/motion.d.ts +12 -0
  126. package/src/m3/system/motion.js +16 -9
  127. package/src/m3/tab/tab-panel.d.ts +9 -0
  128. package/src/m3/tab/tab-panel.js +6 -9
  129. package/src/m3/tab/tab.d.ts +19 -0
  130. package/src/m3/tab/tab.js +14 -12
  131. package/src/m3/tab/tabs.d.ts +25 -0
  132. package/src/m3/tab/tabs.js +34 -30
  133. package/src/m3/text-field/filled-text-field.d.ts +13 -0
  134. package/src/m3/text-field/filled-text-field.js +15 -20
  135. package/src/m3/text-field/outlined-text-field.d.ts +13 -0
  136. package/src/m3/text-field/outlined-text-field.js +15 -20
  137. package/src/m3/toolbar/toolbar.d.ts +26 -0
  138. package/src/m3/toolbar/toolbar.js +28 -25
  139. package/src/m3/tooltip/tooltip.d.ts +19 -0
  140. package/src/m3/tooltip/tooltip.js +15 -14
  141. package/src/win98/button/button.d.ts +13 -0
  142. package/src/win98/button/button.js +13 -11
  143. package/src/win98/button/radio.d.ts +3 -0
  144. package/src/win98/button/radio.js +5 -4
  145. package/src/win98/radio/radio.d.ts +3 -0
  146. package/src/win98/radio/radio.js +5 -4
@@ -0,0 +1,27 @@
1
+ import { ToggleButton } from '../../base/toggle-button.js';
2
+ import '../focus-ring/focus-ring.js';
3
+ import { M3Ripple } from '../ripple/ripple.js';
4
+ /**
5
+ * @tag md-switch
6
+ *
7
+ * @csspart thumb
8
+ * @csspart label
9
+ */
10
+ export declare class M3Switch extends ToggleButton {
11
+ #private;
12
+ $ripple: M3Ripple;
13
+ $thumb: HTMLSpanElement;
14
+ static styles: any[];
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ renderOnIcon(): import("lit-html").TemplateResult<1>;
17
+ renderOffIcon(): import("lit-html").TemplateResult<1>;
18
+ connectedCallback(): void;
19
+ disconnectedCallback(): void;
20
+ icons: boolean;
21
+ checkedIconOnly: boolean;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ 'md-switch': M3Switch;
26
+ }
27
+ }
@@ -1,4 +1,4 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { html } from 'lit';
3
3
  import { customElement, property, query } from 'lit/decorators.js';
4
4
  import { ToggleButton } from '../../base/toggle-button.js';
@@ -8,25 +8,67 @@ import { targetStyles } from '../target-styles.css.js';
8
8
  function isRTL() {
9
9
  return document.documentElement.dir === 'rtl';
10
10
  }
11
- export class M3Switch extends ToggleButton {
12
- static{
13
- this.styles = [
14
- targetStyles,
15
- switchStyles
16
- ];
11
+ /**
12
+ * @tag md-switch
13
+ *
14
+ * @csspart thumb
15
+ * @csspart label
16
+ */
17
+ let M3Switch = class M3Switch extends ToggleButton {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.icons = false;
21
+ this.checkedIconOnly = false;
22
+ this.#pointerDownX = 0;
23
+ this.#handlePointerDown = (e) => {
24
+ this._ignoreClick = false;
25
+ if (e.button !== 0)
26
+ return;
27
+ this.#pointerDownX = e.clientX;
28
+ this.setPointerCapture(e.pointerId);
29
+ this.addEventListener('pointermove', this.#handlePointerMove);
30
+ };
31
+ this.#handlePointerMove = (e) => {
32
+ const diff = (isRTL() ? -1 : 1) * (e.clientX - this.#pointerDownX);
33
+ this._ignoreClick = true;
34
+ const limitedDiff = this.checked
35
+ ? Math.min(0, Math.max(-20, diff))
36
+ : Math.min(20, Math.max(0, diff));
37
+ this.$thumb.style.setProperty('--_thumb-diff-pointer', `${2 * limitedDiff}px`);
38
+ // Thumb loses its `:active` status before pointer up event
39
+ this.$thumb.style.setProperty('--_thumb-diameter', '28px');
40
+ this.$thumb.style.transitionDuration = '0s';
41
+ };
42
+ this.#handlePointerUp = (e) => {
43
+ this.removeEventListener('pointermove', this.#handlePointerMove);
44
+ this.releasePointerCapture(e.pointerId);
45
+ const trackRect = this.getBoundingClientRect();
46
+ const thumbRect = this.$thumb.getBoundingClientRect();
47
+ const diff = thumbRect.left +
48
+ thumbRect.width / 2 -
49
+ trackRect.left -
50
+ trackRect.width / 2;
51
+ const shouldBeChecked = (diff >= 0 && !isRTL()) || (diff < 0 && isRTL());
52
+ this.$thumb.style.setProperty('--_thumb-diff-pointer', '');
53
+ this.$thumb.style.setProperty('--_thumb-diameter', '');
54
+ this.$thumb.style.transitionDuration = '';
55
+ if (this.checked != shouldBeChecked)
56
+ this.toggleChecked();
57
+ };
17
58
  }
59
+ static { this.styles = [targetStyles, switchStyles]; }
18
60
  render() {
19
- return html`<md-focus-ring></md-focus-ring><div part="thumb"><md-ripple spacebehavior="always"></md-ripple><span part="target"></span> ${this.renderOffIcon()}${this.renderOnIcon()}</div>`;
61
+ return html `<md-focus-ring></md-focus-ring><div part="thumb"><md-ripple spacebehavior="always"></md-ripple><span part="target"></span> ${this.renderOffIcon()}${this.renderOnIcon()}</div>`;
20
62
  }
21
63
  renderOnIcon() {
22
- return html`<svg part="icons icon-on" viewBox="0 0 24 24" aria-hidden="true"><path d="M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z"/></svg>`;
64
+ return html `<svg part="icons icon-on" viewBox="0 0 24 24" aria-hidden="true"><path d="M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z"/></svg>`;
23
65
  }
24
66
  renderOffIcon() {
25
- return html`<svg part="icons icon-off" viewBox="0 0 24 24" aria-hidden="true"><path d="M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z"/></svg>`;
67
+ return html `<svg part="icons icon-off" viewBox="0 0 24 24" aria-hidden="true"><path d="M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z"/></svg>`;
26
68
  }
27
69
  connectedCallback() {
28
70
  super.connectedCallback();
29
- this.updateComplete.then(()=>{
71
+ this.updateComplete.then(() => {
30
72
  this.$ripple.attach(this);
31
73
  });
32
74
  this.addEventListener('pointerdown', this.#handlePointerDown);
@@ -41,53 +83,20 @@ export class M3Switch extends ToggleButton {
41
83
  #handlePointerDown;
42
84
  #handlePointerMove;
43
85
  #handlePointerUp;
44
- constructor(...args){
45
- super(...args), this.icons = false, this.checkedIconOnly = false, this.#pointerDownX = 0, this.#handlePointerDown = (e)=>{
46
- this._ignoreClick = false;
47
- if (e.button !== 0) return;
48
- this.#pointerDownX = e.clientX;
49
- this.setPointerCapture(e.pointerId);
50
- this.addEventListener('pointermove', this.#handlePointerMove);
51
- }, this.#handlePointerMove = (e)=>{
52
- const diff = (isRTL() ? -1 : 1) * (e.clientX - this.#pointerDownX);
53
- this._ignoreClick = true;
54
- const limitedDiff = this.checked ? Math.min(0, Math.max(-20, diff)) : Math.min(20, Math.max(0, diff));
55
- this.$thumb.style.setProperty('--_thumb-diff-pointer', `${2 * limitedDiff}px`);
56
- // Thumb loses its `:active` status before pointer up event
57
- this.$thumb.style.setProperty('--_thumb-diameter', '28px');
58
- this.$thumb.style.transitionDuration = '0s';
59
- }, this.#handlePointerUp = (e)=>{
60
- this.removeEventListener('pointermove', this.#handlePointerMove);
61
- this.releasePointerCapture(e.pointerId);
62
- const trackRect = this.getBoundingClientRect();
63
- const thumbRect = this.$thumb.getBoundingClientRect();
64
- const diff = thumbRect.left + thumbRect.width / 2 - trackRect.left - trackRect.width / 2;
65
- const shouldBeChecked = diff >= 0 && !isRTL() || diff < 0 && isRTL();
66
- this.$thumb.style.setProperty('--_thumb-diff-pointer', '');
67
- this.$thumb.style.setProperty('--_thumb-diameter', '');
68
- this.$thumb.style.transitionDuration = '';
69
- if (this.checked != shouldBeChecked) this.toggleChecked();
70
- };
71
- }
72
- }
73
- _ts_decorate([
86
+ };
87
+ __decorate([
74
88
  query('md-ripple')
75
89
  ], M3Switch.prototype, "$ripple", void 0);
76
- _ts_decorate([
90
+ __decorate([
77
91
  query('[part~="thumb"]')
78
92
  ], M3Switch.prototype, "$thumb", void 0);
79
- _ts_decorate([
80
- property({
81
- type: Boolean,
82
- reflect: true
83
- })
93
+ __decorate([
94
+ property({ type: Boolean, reflect: true })
84
95
  ], M3Switch.prototype, "icons", void 0);
85
- _ts_decorate([
86
- property({
87
- type: Boolean,
88
- reflect: true
89
- })
96
+ __decorate([
97
+ property({ type: Boolean, reflect: true })
90
98
  ], M3Switch.prototype, "checkedIconOnly", void 0);
91
- M3Switch = _ts_decorate([
99
+ M3Switch = __decorate([
92
100
  customElement('md-switch')
93
101
  ], M3Switch);
102
+ export { M3Switch };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Workaround for `CSSNumericValue.parse()` not being supported by Firefox
3
+ * https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/parse_static
4
+ */
5
+ export declare const parseCSSNum: (css: string) => number;
6
+ /**
7
+ * https://m3.material.io/styles/motion/overview/specs
8
+ */
9
+ export declare const getSpring: (element: HTMLElement, type: 'spatial' | 'effects', duration: 'fast' | 'default' | 'slow') => {
10
+ easing: string;
11
+ duration: number;
12
+ };
@@ -1,27 +1,34 @@
1
1
  /**
2
2
  * Workaround for `CSSNumericValue.parse()` not being supported by Firefox
3
3
  * https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/parse_static
4
- */ export const parseCSSNum = (css)=>{
4
+ */
5
+ export const parseCSSNum = (css) => {
5
6
  if (typeof CSSNumericValue !== 'undefined') {
6
7
  try {
7
8
  return CSSNumericValue.parse(css).to('ms').value;
8
- } catch {
9
+ }
10
+ catch {
9
11
  return 0;
10
12
  }
11
- } else {
13
+ }
14
+ else {
12
15
  css = css.trim().toLowerCase();
13
- if (css.endsWith('ms')) return parseFloat(css.substring(0, css.length - 2)) | 0;
14
- else if (css.endsWith('s')) return parseFloat(css.substring(0, css.length - 1)) * 1000 | 0;
15
- else return 0;
16
+ if (css.endsWith('ms'))
17
+ return parseFloat(css.substring(0, css.length - 2)) | 0;
18
+ else if (css.endsWith('s'))
19
+ return (parseFloat(css.substring(0, css.length - 1)) * 1000) | 0;
20
+ else
21
+ return 0;
16
22
  }
17
23
  };
18
24
  /**
19
25
  * https://m3.material.io/styles/motion/overview/specs
20
- */ export const getSpring = (element, type, duration)=>{
26
+ */
27
+ export const getSpring = (element, type, duration) => {
21
28
  const styles = getComputedStyle(element);
22
- const get = (suffix)=>styles.getPropertyValue(`--md-sys-motion-${type}-${duration}${suffix}`);
29
+ const get = (suffix) => styles.getPropertyValue(`--md-sys-motion-${type}-${duration}${suffix}`);
23
30
  return {
24
31
  easing: get('') || 'ease',
25
- duration: parseCSSNum(get('-duration'))
32
+ duration: parseCSSNum(get('-duration')),
26
33
  };
27
34
  };
@@ -0,0 +1,9 @@
1
+ import { TabPanel } from '../../base/tab-panel.js';
2
+ export declare class M3TabPanel extends TabPanel {
3
+ static styles: any[];
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'md-tab-panel': M3TabPanel;
8
+ }
9
+ }
@@ -1,14 +1,11 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import { TabPanel } from '../../base/tab-panel.js';
4
4
  import { tabPanelStyles } from './tab-panel-styles.css.js';
5
- export class M3TabPanel extends TabPanel {
6
- static{
7
- this.styles = [
8
- tabPanelStyles
9
- ];
10
- }
11
- }
12
- M3TabPanel = _ts_decorate([
5
+ let M3TabPanel = class M3TabPanel extends TabPanel {
6
+ static { this.styles = [tabPanelStyles]; }
7
+ };
8
+ M3TabPanel = __decorate([
13
9
  customElement('md-tab-panel')
14
10
  ], M3TabPanel);
11
+ export { M3TabPanel };
@@ -0,0 +1,19 @@
1
+ import { Tab } from '../../base/tab.js';
2
+ import '../focus-ring/focus-ring.js';
3
+ import '../ripple/ripple.js';
4
+ /**
5
+ * @tag md-tab
6
+ *
7
+ * @slot icon - icon
8
+ * @slot - label
9
+ */
10
+ export declare class M3Tab extends Tab {
11
+ $content: HTMLDivElement;
12
+ static styles: any[];
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'md-tab': M3Tab;
18
+ }
19
+ }
package/src/m3/tab/tab.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { html } from 'lit';
3
3
  import { customElement, query } from 'lit/decorators.js';
4
4
  import { Tab } from '../../base/tab.js';
@@ -6,20 +6,22 @@ import '../focus-ring/focus-ring.js';
6
6
  import '../ripple/ripple.js';
7
7
  import { targetStyles } from '../target-styles.css.js';
8
8
  import { tabStyles } from './tab-styles.css.js';
9
- export class M3Tab extends Tab {
10
- static{
11
- this.styles = [
12
- targetStyles,
13
- tabStyles
14
- ];
15
- }
9
+ /**
10
+ * @tag md-tab
11
+ *
12
+ * @slot icon - icon
13
+ * @slot - label
14
+ */
15
+ let M3Tab = class M3Tab extends Tab {
16
+ static { this.styles = [targetStyles, tabStyles]; }
16
17
  render() {
17
- return html`<md-focus-ring inward></md-focus-ring><md-ripple inward></md-ripple><span part="target"></span><div part="content"><slot part="icon" name="icon" aria-hidden="true"></slot><slot part="label"></slot></div>`;
18
+ return html `<md-focus-ring inward></md-focus-ring><md-ripple inward></md-ripple><span part="target"></span><div part="content"><slot part="icon" name="icon" aria-hidden="true"></slot><slot part="label"></slot></div>`;
18
19
  }
19
- }
20
- _ts_decorate([
20
+ };
21
+ __decorate([
21
22
  query('[part="content"]')
22
23
  ], M3Tab.prototype, "$content", void 0);
23
- M3Tab = _ts_decorate([
24
+ M3Tab = __decorate([
24
25
  customElement('md-tab')
25
26
  ], M3Tab);
27
+ export { M3Tab };
@@ -0,0 +1,25 @@
1
+ import { Tabs } from '../../base/tabs.js';
2
+ import type { M3Tab } from './tab.js';
3
+ /**
4
+ * TODO: vertical tabs, tablist placement
5
+ *
6
+ * @tag md-tabs
7
+ *
8
+ * @csspart indicator
9
+ *
10
+ * @slot - tabs
11
+ */
12
+ export declare class M3Tabs extends Tabs {
13
+ #private;
14
+ $indicator: HTMLElement;
15
+ secondary: boolean;
16
+ iconsAbove: boolean;
17
+ static styles: any[];
18
+ render(): import("lit-html").TemplateResult<1>;
19
+ selectTab(selectedTab: M3Tab): void;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'md-tabs': M3Tabs;
24
+ }
25
+ }
@@ -1,18 +1,28 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { html } from 'lit';
3
3
  import { customElement, property, query } from 'lit/decorators.js';
4
4
  import { computePosition, autoUpdate } from '@floating-ui/dom';
5
5
  import { Tabs } from '../../base/tabs.js';
6
6
  import { tabsStyles } from './tabs-styles.css.js';
7
- export class M3Tabs extends Tabs {
8
- #cleanup;
9
- static{
10
- this.styles = [
11
- tabsStyles
12
- ];
7
+ /**
8
+ * TODO: vertical tabs, tablist placement
9
+ *
10
+ * @tag md-tabs
11
+ *
12
+ * @csspart indicator
13
+ *
14
+ * @slot - tabs
15
+ */
16
+ let M3Tabs = class M3Tabs extends Tabs {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.secondary = false;
20
+ this.iconsAbove = false;
13
21
  }
22
+ #cleanup;
23
+ static { this.styles = [tabsStyles]; }
14
24
  render() {
15
- return html`${super.render()}<div part="indicator" role="presentation"></div>`;
25
+ return html `${super.render()}<div part="indicator" role="presentation"></div>`;
16
26
  }
17
27
  selectTab(selectedTab) {
18
28
  super.selectTab(selectedTab);
@@ -21,40 +31,34 @@ export class M3Tabs extends Tabs {
21
31
  // Another solution is using CSS anchor, which does not work across Shadow
22
32
  // DOM for now.
23
33
  this.#cleanup?.();
24
- const updatePosition = ()=>{
34
+ const updatePosition = () => {
25
35
  computePosition(selectedTab, this.$indicator, {
26
36
  placement: 'bottom',
27
- strategy: 'absolute'
28
- }).then(({ x })=>{
29
- const left = this.secondary ? x : x + 2;
30
- const width = this.secondary ? selectedTab.offsetWidth : selectedTab.$content.offsetWidth - 4;
37
+ strategy: 'absolute',
38
+ }).then(({ x }) => {
39
+ const left = (this.secondary ? x : (x + 2));
40
+ const width = this.secondary
41
+ ? selectedTab.offsetWidth
42
+ : (selectedTab.$content.offsetWidth - 4);
31
43
  Object.assign(this.$indicator.style, {
32
44
  left: `${left}px`,
33
- width: `${width}px`
45
+ width: `${width}px`,
34
46
  });
35
47
  });
36
48
  };
37
49
  this.#cleanup = autoUpdate(selectedTab, this.$indicator, updatePosition);
38
50
  }
39
- constructor(...args){
40
- super(...args), this.secondary = false, this.iconsAbove = false;
41
- }
42
- }
43
- _ts_decorate([
51
+ };
52
+ __decorate([
44
53
  query('[part="indicator"]')
45
54
  ], M3Tabs.prototype, "$indicator", void 0);
46
- _ts_decorate([
47
- property({
48
- type: Boolean,
49
- reflect: true
50
- })
55
+ __decorate([
56
+ property({ type: Boolean, reflect: true })
51
57
  ], M3Tabs.prototype, "secondary", void 0);
52
- _ts_decorate([
53
- property({
54
- type: Boolean,
55
- reflect: true
56
- })
58
+ __decorate([
59
+ property({ type: Boolean, reflect: true })
57
60
  ], M3Tabs.prototype, "iconsAbove", void 0);
58
- M3Tabs = _ts_decorate([
61
+ M3Tabs = __decorate([
59
62
  customElement('md-tabs')
60
63
  ], M3Tabs);
64
+ export { M3Tabs };
@@ -0,0 +1,13 @@
1
+ import { Input } from '../../base/input.js';
2
+ import '../field/filled-field.js';
3
+ export declare class M3FilledTextField extends Input {
4
+ label: string;
5
+ supportingText: string;
6
+ static styles: any[];
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'md-filled-text-field': M3FilledTextField;
12
+ }
13
+ }
@@ -1,32 +1,27 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { html } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import { Input } from '../../base/input.js';
5
5
  import '../field/filled-field.js';
6
6
  import { textFieldStyles } from './text-field-styles.css.js';
7
- export class M3FilledTextField extends Input {
8
- static{
9
- this.styles = [
10
- textFieldStyles
11
- ];
7
+ let M3FilledTextField = class M3FilledTextField extends Input {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.label = '';
11
+ this.supportingText = '';
12
12
  }
13
+ static { this.styles = [textFieldStyles]; }
13
14
  render() {
14
- return html`<md-filled-field label="${this.label}" supportingtext="${this.supportingText}" ?populated="${!!this.value}" ?disabled="${this.disabled}" ?focused="${this.focused}" ?error="${this.checkValidity() === false}">${super.render()}</md-filled-field>`;
15
+ return html `<md-filled-field label="${this.label}" supportingtext="${this.supportingText}" ?populated="${!!this.value}" ?disabled="${this.disabled}" ?focused="${this.focused}" ?error="${this.checkValidity() === false}">${super.render()}</md-filled-field>`;
15
16
  }
16
- constructor(...args){
17
- super(...args), this.label = '', this.supportingText = '';
18
- }
19
- }
20
- _ts_decorate([
21
- property({
22
- reflect: true
23
- })
17
+ };
18
+ __decorate([
19
+ property({ reflect: true })
24
20
  ], M3FilledTextField.prototype, "label", void 0);
25
- _ts_decorate([
26
- property({
27
- reflect: true
28
- })
21
+ __decorate([
22
+ property({ reflect: true })
29
23
  ], M3FilledTextField.prototype, "supportingText", void 0);
30
- M3FilledTextField = _ts_decorate([
24
+ M3FilledTextField = __decorate([
31
25
  customElement('md-filled-text-field')
32
26
  ], M3FilledTextField);
27
+ export { M3FilledTextField };
@@ -0,0 +1,13 @@
1
+ import { Input } from '../../base/input.js';
2
+ import '../field/outlined-field.js';
3
+ export declare class M3OutlinedTextField extends Input {
4
+ label: string;
5
+ supportingText: string;
6
+ static styles: any[];
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'md-outlined-text-field': M3OutlinedTextField;
12
+ }
13
+ }
@@ -1,32 +1,27 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { html } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import { Input } from '../../base/input.js';
5
5
  import '../field/outlined-field.js';
6
6
  import { textFieldStyles } from './text-field-styles.css.js';
7
- export class M3OutlinedTextField extends Input {
8
- static{
9
- this.styles = [
10
- textFieldStyles
11
- ];
7
+ let M3OutlinedTextField = class M3OutlinedTextField extends Input {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.label = '';
11
+ this.supportingText = '';
12
12
  }
13
+ static { this.styles = [textFieldStyles]; }
13
14
  render() {
14
- return html`<md-outlined-field label="${this.label}" supportingtext="${this.supportingText}" ?populated="${!!this.value}" ?disabled="${this.disabled}" ?focused="${this.focused}" ?error="${this.checkValidity() === false}">${super.render()}<slot slot="start" name="start"></slot><slot slot="end" name="end"></slot></md-outlined-field>`;
15
+ return html `<md-outlined-field label="${this.label}" supportingtext="${this.supportingText}" ?populated="${!!this.value}" ?disabled="${this.disabled}" ?focused="${this.focused}" ?error="${this.checkValidity() === false}">${super.render()}<slot slot="start" name="start"></slot><slot slot="end" name="end"></slot></md-outlined-field>`;
15
16
  }
16
- constructor(...args){
17
- super(...args), this.label = '', this.supportingText = '';
18
- }
19
- }
20
- _ts_decorate([
21
- property({
22
- reflect: true
23
- })
17
+ };
18
+ __decorate([
19
+ property({ reflect: true })
24
20
  ], M3OutlinedTextField.prototype, "label", void 0);
25
- _ts_decorate([
26
- property({
27
- reflect: true
28
- })
21
+ __decorate([
22
+ property({ reflect: true })
29
23
  ], M3OutlinedTextField.prototype, "supportingText", void 0);
30
- M3OutlinedTextField = _ts_decorate([
24
+ M3OutlinedTextField = __decorate([
31
25
  customElement('md-outlined-text-field')
32
26
  ], M3OutlinedTextField);
27
+ export { M3OutlinedTextField };
@@ -0,0 +1,26 @@
1
+ import { LitElement } from 'lit';
2
+ declare const M3Toolbar_base: Constructor<import("../../base/mixins/internals-attached.js").InternalsAttachedInterface> & typeof LitElement;
3
+ /**
4
+ * @tag md-toolbar
5
+ *
6
+ * @csspart container
7
+ * @csspart fab-slot
8
+ *
9
+ * @slot - toolbar contents
10
+ * @slot fab - FAB element
11
+ */
12
+ export declare class M3Toolbar extends M3Toolbar_base {
13
+ type: 'docked' | 'floating';
14
+ color: 'standard' | 'vibrant';
15
+ orientation: 'horizontal' | 'vertical';
16
+ static styles: any[];
17
+ render(): import("lit-html").TemplateResult<1>;
18
+ constructor();
19
+ protected updated(changed: Map<string, unknown>): void;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'md-toolbar': M3Toolbar;
24
+ }
25
+ }
26
+ export {};