@vollowx/seele 0.13.5 → 0.13.7

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 (145) 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 +57 -0
  5. package/src/base/autocomplete.js +80 -98
  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 +78 -0
  28. package/src/base/menu.js +137 -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/ensure-ready.d.ts +1 -0
  58. package/src/core/ensure-ready.js +15 -0
  59. package/src/core/focus-visible.d.ts +2 -0
  60. package/src/core/focus-visible.js +4 -4
  61. package/src/core/shared.d.ts +1 -0
  62. package/src/core/unique-id.d.ts +4 -0
  63. package/src/core/unique-id.js +2 -1
  64. package/src/m3/autocomplete/autocomplete.d.ts +9 -0
  65. package/src/m3/autocomplete/autocomplete.js +11 -10
  66. package/src/m3/badge/badge.d.ts +13 -0
  67. package/src/m3/badge/badge.js +28 -37
  68. package/src/m3/button/common-button-toggle.d.ts +31 -0
  69. package/src/m3/button/common-button-toggle.js +44 -41
  70. package/src/m3/button/common-button.d.ts +29 -0
  71. package/src/m3/button/common-button.js +40 -40
  72. package/src/m3/button/icon-button-toggle.d.ts +24 -0
  73. package/src/m3/button/icon-button-toggle.js +35 -32
  74. package/src/m3/button/icon-button.d.ts +23 -0
  75. package/src/m3/button/icon-button.js +33 -31
  76. package/src/m3/button-group/connected-button-group.d.ts +19 -0
  77. package/src/m3/button-group/connected-button-group.js +26 -24
  78. package/src/m3/button-group/standard-button-group.d.ts +24 -0
  79. package/src/m3/button-group/standard-button-group.js +71 -65
  80. package/src/m3/checkbox/checkbox.d.ts +25 -0
  81. package/src/m3/checkbox/checkbox.js +23 -22
  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 +24 -0
  99. package/src/m3/list/list-item.js +20 -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 +14 -0
  120. package/src/m3/select/select.js +17 -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/m3/dialog/dialog-spring.js +0 -179
  144. package/src/win98/button/radio.js +0 -8
  145. package/src/win98/radio/radio.js +0 -8
@@ -1,20 +1,21 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
1
+ import { __decorate } from "tslib";
2
2
  import { customElement } from '../../core/decorators.js';
3
3
  import { Tooltip } from '../../base/tooltip.js';
4
4
  import { tooltipStyles } from './tooltip-styles.css.js';
5
- export class M3Tooltip extends Tooltip {
6
- static{
7
- this.styles = [
8
- tooltipStyles
9
- ];
5
+ /**
6
+ * @tag md-tooltip
7
+ *
8
+ * TODO: should not disable SSR, since the raw text would flash, but could try
9
+ * to SSR a simpler one
10
+ */
11
+ let M3Tooltip = class M3Tooltip extends Tooltip {
12
+ constructor() {
13
+ super(...arguments);
14
+ this._durations = { show: 150, hide: 150 };
10
15
  }
11
- constructor(...args){
12
- super(...args), this._durations = {
13
- show: 150,
14
- hide: 150
15
- };
16
- }
17
- }
18
- M3Tooltip = _ts_decorate([
16
+ static { this.styles = [tooltipStyles]; }
17
+ };
18
+ M3Tooltip = __decorate([
19
19
  customElement('md-tooltip', true)
20
20
  ], M3Tooltip);
21
+ export { M3Tooltip };
@@ -0,0 +1,13 @@
1
+ import { Button } from '../../base/button.js';
2
+ /**
3
+ * @tag win98-button
4
+ */
5
+ export declare class Win98Button extends Button {
6
+ static styles: any[];
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'win98-button': Win98Button;
12
+ }
13
+ }
@@ -1,19 +1,21 @@
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 } from 'lit/decorators.js';
4
4
  import { Button } from '../../base/button.js';
5
5
  import { buttonStyles } from './button-styles.css.js';
6
- export class Win98Button extends Button {
7
- static{
8
- this.styles = [
9
- ...super.styles,
10
- buttonStyles
11
- ];
12
- }
6
+ /**
7
+ * @tag win98-button
8
+ */
9
+ let Win98Button = class Win98Button extends Button {
10
+ static { this.styles = [
11
+ ...super.styles,
12
+ buttonStyles,
13
+ ]; }
13
14
  render() {
14
- return html`<slot></slot>`;
15
+ return html `<slot></slot>`;
15
16
  }
16
- }
17
- Win98Button = _ts_decorate([
17
+ };
18
+ Win98Button = __decorate([
18
19
  customElement('win98-button')
19
20
  ], Win98Button);
21
+ export { Win98Button };
@@ -1,179 +0,0 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
- import { html } from 'lit';
3
- import { query, state, customElement } from 'lit/decorators.js';
4
- import { Dialog } from '../../base/dialog.js';
5
- import { getSpring } from '../system/motion.js';
6
- import { dialogStyles } from './dialog-styles.css.js';
7
- export class M3Dialog extends Dialog {
8
- static{
9
- this.styles = [
10
- dialogStyles
11
- ];
12
- }
13
- render() {
14
- return html`<dialog part="dialog" @click="${this.#handleClick}" @cancel="${this._handleCancel}"><div part="container"><div part="body"><div part="headline" class="${this.hasIcon ? 'has-icon' : ''}"><slot name="icon" @slotchange="${this.#handleIconSlotChange}"></slot><slot name="headline"></slot></div><div part="content"><slot></slot></div><div class="actions-placeholder"></div></div><div part="actions"><slot name="actions"></slot></div></div></dialog><div part="scrim"></div>`;
15
- }
16
- #activeAnimations;
17
- #clearAnimations() {
18
- this.#activeAnimations.forEach((anim)=>anim.cancel());
19
- this.#activeAnimations = [];
20
- this.#opening = this.#closing = false;
21
- }
22
- #handleClick;
23
- #handleIconSlotChange;
24
- get #springs() {
25
- return {
26
- spatialDefault: getSpring(this, 'spatial', 'default'),
27
- spatialFast: getSpring(this, 'spatial', 'fast'),
28
- effectsDefault: getSpring(this, 'effects', 'default'),
29
- effectsFast: getSpring(this, 'effects', 'fast')
30
- };
31
- }
32
- #opening;
33
- show() {
34
- if (this.#opening) return;
35
- this.#clearAnimations();
36
- this.#opening = true;
37
- // Reset margins to allow browser centering
38
- this.$dialog.style.marginTop = 'auto';
39
- this.$dialog.style.marginBottom = 'auto';
40
- super.show();
41
- const actionsHeight = this.$actions.offsetHeight;
42
- this.$actionsPlaceholder.style.height = `${actionsHeight}px`;
43
- this.$container.style.height = 'auto';
44
- const startHeight = 0;
45
- const endHeight = this.$container.offsetHeight;
46
- // Lock the position to prevent auto-centering during animation
47
- const rect = this.$container.getBoundingClientRect();
48
- this.$dialog.style.marginTop = `${rect.top}px`;
49
- this.$dialog.style.marginBottom = 'auto';
50
- this.$container.style.minHeight = '0px';
51
- const container = this.$container.animate([
52
- {
53
- height: `${startHeight}px`,
54
- transform: `translateY(-40px)`
55
- },
56
- {
57
- height: `${endHeight}px`,
58
- transform: 'translateY(0px)'
59
- }
60
- ], this.#springs.spatialDefault);
61
- const scrim = this.$scrim.animate([
62
- {
63
- opacity: 0
64
- },
65
- {
66
- opacity: 0.32
67
- }
68
- ], {
69
- ...this.#springs.effectsDefault,
70
- fill: 'forwards'
71
- });
72
- const body = this.$body.animate([
73
- {
74
- opacity: 0.2
75
- },
76
- {
77
- opacity: 1
78
- }
79
- ], {
80
- ...this.#springs.effectsDefault,
81
- fill: 'forwards'
82
- });
83
- const actions = this.$actions.animate([
84
- {
85
- opacity: 0.5
86
- },
87
- {
88
- opacity: 1
89
- }
90
- ], {
91
- ...this.#springs.effectsDefault,
92
- fill: 'forwards'
93
- });
94
- this.#activeAnimations.push(container, scrim, body, actions);
95
- container.onfinish = ()=>{
96
- this.$container.style.minHeight = '';
97
- this.#clearAnimations();
98
- };
99
- }
100
- #closing;
101
- close() {
102
- if (this.#closing) return;
103
- this.#clearAnimations();
104
- this.#closing = true;
105
- const startHeight = this.$container.offsetHeight;
106
- const endHeight = startHeight * 0.35;
107
- this.$container.style.minHeight = '0px';
108
- const containerSpatial = this.$container.animate([
109
- {
110
- height: `${startHeight}px`,
111
- transform: 'translateY(0px)'
112
- },
113
- {
114
- height: `${endHeight}px`,
115
- transform: `translateY(-40px)`
116
- }
117
- ], this.#springs.spatialFast);
118
- const containerEffects = this.$container.animate([
119
- {
120
- opacity: 1
121
- },
122
- {
123
- opacity: 0
124
- }
125
- ], {
126
- ...this.#springs.effectsFast,
127
- fill: 'forwards'
128
- });
129
- const scrim = this.$scrim.animate([
130
- {
131
- opacity: 0.32
132
- },
133
- {
134
- opacity: 0
135
- }
136
- ], {
137
- ...this.#springs.effectsFast,
138
- fill: 'forwards'
139
- });
140
- this.#activeAnimations.push(containerSpatial, containerEffects, scrim);
141
- containerEffects.onfinish = ()=>{
142
- this.$container.style.minHeight = '';
143
- super.close();
144
- this.#clearAnimations();
145
- };
146
- }
147
- constructor(...args){
148
- super(...args), this.hasIcon = false, this.#activeAnimations = [], this.#handleClick = (e)=>{
149
- const target = e.target;
150
- if (!this.$container.contains(target) && !this.contains(target)) this.close();
151
- }, this.#handleIconSlotChange = (e)=>{
152
- const slot = e.target;
153
- this.hasIcon = slot.assignedElements({
154
- flatten: true
155
- }).length > 0;
156
- }, this.#opening = false, this.#closing = false;
157
- }
158
- }
159
- _ts_decorate([
160
- state()
161
- ], M3Dialog.prototype, "hasIcon", void 0);
162
- _ts_decorate([
163
- query('[part=container]')
164
- ], M3Dialog.prototype, "$container", void 0);
165
- _ts_decorate([
166
- query('[part=body]')
167
- ], M3Dialog.prototype, "$body", void 0);
168
- _ts_decorate([
169
- query('[part=actions]')
170
- ], M3Dialog.prototype, "$actions", void 0);
171
- _ts_decorate([
172
- query('.actions-placeholder')
173
- ], M3Dialog.prototype, "$actionsPlaceholder", void 0);
174
- _ts_decorate([
175
- query('[part=scrim]')
176
- ], M3Dialog.prototype, "$scrim", void 0);
177
- M3Dialog = _ts_decorate([
178
- customElement('md-dialog')
179
- ], M3Dialog);
@@ -1,8 +0,0 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
- import { Radio } from '../../base/radio.js';
3
- import { customElement } from '../../core/decorators.js';
4
- export class Win98Radio extends Radio {
5
- }
6
- Win98Radio = _ts_decorate([
7
- customElement('win98-radio')
8
- ], Win98Radio);
@@ -1,8 +0,0 @@
1
- import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
- import { Radio } from '../../base/radio.js';
3
- import { customElement } from '../../core/decorators.js';
4
- export class Win98Radio extends Radio {
5
- }
6
- Win98Radio = _ts_decorate([
7
- customElement('win98-radio')
8
- ], Win98Radio);