@mono-lit/helper 0.0.9 → 0.1.0

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 (164) hide show
  1. package/dist/accordion-core-DaNyPWRr.js +277 -0
  2. package/dist/alert-core-DWtHbX_-.js +134 -0
  3. package/dist/breadcrumb-list-core-Dh68T8Cf.js +747 -0
  4. package/dist/{mono-button-CLkHg3WW.js → button-core-DerXg84Q.js} +3 -276
  5. package/dist/button-dropdown-core-DKYEOyjy.js +654 -0
  6. package/dist/button-utils-D5-66M02.js +63 -0
  7. package/dist/card-utils-l80qAmrN.js +312 -0
  8. package/dist/chart-core-DV7hD3ZY.js +801 -0
  9. package/dist/checkbox-utils-DKdrhAzF.js +337 -0
  10. package/dist/chip-utils-DpRrd7Zj.js +403 -0
  11. package/dist/{data-source-controller-C6C4ej_M.js → data-source-controller-DS_JLrmS.js} +1 -1
  12. package/dist/{data-source-options-fxT5QIX4.js → data-source-options-DJUNU26C.js} +6 -6
  13. package/dist/{data-source-read-BL266IW0.js → data-source-read-uKJpRAzx.js} +2 -2
  14. package/dist/date-core-CyuSyvvG.js +734 -0
  15. package/dist/drawer-core-DbFWvNln.js +759 -0
  16. package/dist/dropdown-core-BCH1pK14.js +511 -0
  17. package/dist/dropdown-table-core-SfHUJVFq.js +1342 -0
  18. package/dist/export.js +1 -1
  19. package/dist/{field-path-BabiMrrA.js → field-path-DK2VBWHl.js} +1 -1
  20. package/dist/field-tooltip.css_raw-DVblekCl.js +5 -0
  21. package/dist/{field-validation.css_raw-Cx6SGrfP.js → field-validation.css_raw-BU7C6173.js} +1 -170
  22. package/dist/file-upload-core-Cz_dBQMx.js +624 -0
  23. package/dist/filter-builder-core-DyWjbBP7.js +381 -0
  24. package/dist/{filter-builder-B6Y2mmbM.js → filter-builder-vbqIuPhX.js} +1 -1
  25. package/dist/{filter-eval-ChDSaAUH.js → filter-eval-CqeBnMYh.js} +1 -1
  26. package/dist/{filter-odata-Bi27XUpQ.js → filter-odata-GsczYKNC.js} +1 -1
  27. package/dist/{hydration-flush-BaE9gN3C.js → hydration-flush-Volt9X7Q.js} +2 -1071
  28. package/dist/index.js +11 -11
  29. package/dist/{index.node-DTqDBca7.js → index.node-Csy9zrr1.js} +4 -4
  30. package/dist/index.node.js +11 -11
  31. package/dist/input-utils-BglY-k0H.js +1145 -0
  32. package/dist/menu-core-DkAYuCZ2.js +831 -0
  33. package/dist/modal-core-CSBSPN_m.js +844 -0
  34. package/dist/mono-button-DVvZ03P-.js +280 -0
  35. package/dist/{mono-button.shadow-DqZMpcqY.js → mono-button.shadow-BANxMGln.js} +6 -594
  36. package/dist/{mono-data-chart-NKPdAgVq.js → mono-data-chart-ChF4J9RT.js} +6 -6
  37. package/dist/{mono-data-dropdown-B2iRpJuI.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
  38. package/dist/{mono-data-grid-llJCX9MC.js → mono-data-grid-DJkp96N-.js} +144 -46
  39. package/dist/{mono-event-BPku9HpS.js → mono-event-CAZf0F_k.js} +14 -9
  40. package/dist/{mono-form-controller-BrA10erm.js → mono-form-controller-DxZLvyg6.js} +2 -1
  41. package/dist/mono-table-checkbox-core-BKOMx8R5.js +5288 -0
  42. package/dist/nav-core-B5qU2dzn.js +225 -0
  43. package/dist/{normalize-error-D93O4q8g.js → normalize-error-BEcd1tmS.js} +2 -2
  44. package/dist/nuxt.js +1 -1
  45. package/dist/otp-core-DXg3vFLh.js +758 -0
  46. package/dist/radio-utils-Dk9Tl1jz.js +319 -0
  47. package/dist/rich-text-editor-core-Ddd_QaLn.js +1280 -0
  48. package/dist/select-utils-BgArYHk8.js +2140 -0
  49. package/dist/sidebar-core-CD6txDo3.js +583 -0
  50. package/dist/slider-core-vcWr321-.js +1014 -0
  51. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +2 -2
  52. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +1 -1
  53. package/dist/src/components/dropdown-table/index.d.ts +1 -1
  54. package/dist/src/components/dropdown-table/index.shadow.d.ts +1 -1
  55. package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +1 -1
  56. package/dist/src/components/form/form-types.d.ts +9 -3
  57. package/dist/src/components/input/input-core.d.ts +1 -1
  58. package/dist/src/components/input/input-types.d.ts +1 -1
  59. package/dist/src/components/otp/otp-core.d.ts +1 -1
  60. package/dist/src/components/select/select-core.d.ts +1 -1
  61. package/dist/src/components/select/select-types.d.ts +1 -1
  62. package/dist/src/components/slider/slider-core.d.ts +1 -1
  63. package/dist/src/components/slider/slider-types.d.ts +1 -1
  64. package/dist/src/components/table/filter-suggestion.d.ts +171 -0
  65. package/dist/src/components/table/index.d.ts +5 -4
  66. package/dist/src/components/table/index.shadow.d.ts +5 -4
  67. package/dist/src/components/table/mono-data-grid.d.ts +22 -3
  68. package/dist/src/components/table/mono-table-empty-core.d.ts +37 -0
  69. package/dist/src/components/table/mono-table-search-core.d.ts +22 -3
  70. package/dist/src/components/table/table-types.d.ts +74 -4
  71. package/dist/src/components/tag-input/tag-input-core.d.ts +1 -1
  72. package/dist/src/components/tag-input/tag-input-types.d.ts +1 -1
  73. package/dist/src/components/textarea/textarea-core.d.ts +1 -1
  74. package/dist/src/composables/mono-event.d.ts +7 -1
  75. package/dist/src/entries/index.d.ts +8 -6
  76. package/dist/src/entries/index.node.d.ts +8 -6
  77. package/dist/src/search/index.d.ts +1 -1
  78. package/dist/src/utils/group-count.d.ts +36 -0
  79. package/dist/switch-utils-CTZ4id2V.js +338 -0
  80. package/dist/tabs-core-r5-B8k_N.js +317 -0
  81. package/dist/tag-input-utils-D2JA90DQ.js +3060 -0
  82. package/dist/textarea-utils-VU1KeXm8.js +821 -0
  83. package/dist/ui/accordion.js +2 -274
  84. package/dist/ui/alert.js +2 -131
  85. package/dist/ui/breadcrumb.js +4 -745
  86. package/dist/ui/button-dropdown.js +4 -652
  87. package/dist/ui/button.js +2 -63
  88. package/dist/ui/card.js +2 -310
  89. package/dist/ui/chart.js +4 -800
  90. package/dist/ui/checkbox.js +4 -335
  91. package/dist/ui/chip.js +4 -402
  92. package/dist/ui/date.js +3 -732
  93. package/dist/ui/drawer.js +3 -757
  94. package/dist/ui/dropdown-table.js +5 -1341
  95. package/dist/ui/dropdown.js +4 -509
  96. package/dist/ui/file-upload.js +3 -622
  97. package/dist/ui/filter.js +5 -380
  98. package/dist/ui/form.js +1 -1
  99. package/dist/ui/index.css +118 -1
  100. package/dist/ui/input.js +3 -1141
  101. package/dist/ui/menu.js +4 -828
  102. package/dist/ui/modal.js +4 -843
  103. package/dist/ui/nav.js +4 -223
  104. package/dist/ui/otp.js +4 -756
  105. package/dist/ui/radio.js +4 -317
  106. package/dist/ui/rich-text-editor.js +4 -1278
  107. package/dist/ui/select.js +5 -2138
  108. package/dist/ui/shadow/accordion.js +4 -273
  109. package/dist/ui/shadow/alert.js +4 -130
  110. package/dist/ui/shadow/breadcrumb.js +5 -744
  111. package/dist/ui/shadow/button-dropdown.js +6 -652
  112. package/dist/ui/shadow/button.js +3 -63
  113. package/dist/ui/shadow/card.js +4 -309
  114. package/dist/ui/shadow/chart.js +6 -1576
  115. package/dist/ui/shadow/checkbox.js +4 -334
  116. package/dist/ui/shadow/chip.js +4 -396
  117. package/dist/ui/shadow/date.js +7 -731
  118. package/dist/ui/shadow/drawer.js +4 -756
  119. package/dist/ui/shadow/dropdown-table.js +8 -1762
  120. package/dist/ui/shadow/dropdown.js +4 -508
  121. package/dist/ui/shadow/file-upload.js +4 -620
  122. package/dist/ui/shadow/filter.js +7 -379
  123. package/dist/ui/shadow/input.js +6 -1140
  124. package/dist/ui/shadow/menu.js +5 -828
  125. package/dist/ui/shadow/modal.js +6 -1063
  126. package/dist/ui/shadow/nav.js +5 -223
  127. package/dist/ui/shadow/otp.js +6 -754
  128. package/dist/ui/shadow/radio.js +4 -316
  129. package/dist/ui/shadow/rich-text-editor.js +4 -1276
  130. package/dist/ui/shadow/select.js +6 -2136
  131. package/dist/ui/shadow/sidebar.js +5 -581
  132. package/dist/ui/shadow/slider.js +5 -1010
  133. package/dist/ui/shadow/switch.js +4 -335
  134. package/dist/ui/shadow/table.js +10 -4501
  135. package/dist/ui/shadow/tabs.js +6 -315
  136. package/dist/ui/shadow/tag-input.js +7 -3057
  137. package/dist/ui/shadow/textarea.js +6 -817
  138. package/dist/ui/sidebar.js +3 -581
  139. package/dist/ui/slider.js +4 -1012
  140. package/dist/ui/switch.js +4 -336
  141. package/dist/ui/table.js +9 -4502
  142. package/dist/ui/tabs.js +4 -315
  143. package/dist/ui/tag-input.js +5 -3058
  144. package/dist/ui/textarea.js +4 -819
  145. package/dist/{vite-CivRCJaf.js → vite-CfW7z2wn.js} +21 -14
  146. package/dist/vite.js +1 -1
  147. package/dist/vue.d.ts +3 -2
  148. package/package.json +10 -11
  149. package/dist/chip-strip-bNfLn52Z.js +0 -215
  150. package/dist/data-source-controller-Dx6IQ2CN.js +0 -243
  151. package/dist/data-source-options-BM4r4PRw.js +0 -558
  152. package/dist/data-source-read-HyBCRg1t.js +0 -242
  153. package/dist/excel-BXzr3uI1.js +0 -784
  154. package/dist/export-ixRdCS2y.js +0 -2388
  155. package/dist/field-tooltip-addon-CWCp19mJ.js +0 -702
  156. package/dist/field-tooltip.css_raw-U5UeTa2d.js +0 -269
  157. package/dist/filter-builder-C0T3pMx2.js +0 -208
  158. package/dist/form-control-core-BbiACMtL.js +0 -226
  159. package/dist/icon-ClxnYhBG.js +0 -19
  160. package/dist/import-Dc4eXC02.js +0 -612
  161. package/dist/light-slots-_no0r2Z-.js +0 -246
  162. package/dist/markdown-uGlE_OfJ.js +0 -20191
  163. package/dist/mono-data-grid-e9ZVBlNN.js +0 -4240
  164. package/dist/normalize-error-BmLbgANw.js +0 -1048
@@ -1,297 +1,9 @@
1
- import { a as __decorate, c as defineHybridPropAlias, f as customElement, i as withShadowUtilityStyles, l as defineHybridPropAliases, r as toShadowCss, s as booleanStringConverter, t as flushSsrHydration } from "../../hydration-flush-BaE9gN3C.js";
2
- import { t as dispatchMonoEvent } from "../../mono-event-BPku9HpS.js";
3
- import { t as MonoFormControlCore } from "../../form-control-core-BbiACMtL.js";
1
+ import { t as customElement } from "../../mono-element-CKcT0rwv.js";
2
+ import { t as __decorate } from "../../decorate-DbYFpi8R.js";
3
+ import { n as validateSwitchProps, r as MonoSwitchCore, t as generateSwitchAttributes } from "../../switch-utils-CTZ4id2V.js";
4
+ import { i as withShadowUtilityStyles, r as toShadowCss, t as flushSsrHydration } from "../../hydration-flush-Volt9X7Q.js";
4
5
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
5
- import { property, state } from "lit/decorators.js";
6
- import { ifDefined } from "lit/directives/if-defined.js";
7
6
 
8
- //#region src/components/switch/switch-core.ts
9
- /**
10
- * `MonoSwitchCore` — all render-mode-agnostic logic for `mono-switch`: reactive
11
- * props (incl. SSR boolean coercion), hybrid aliases, camelCase attribute
12
- * fallbacks, the `modelValue`↔`checked` sync, class computation, change
13
- * interactivity (`mno-change`), `focus`/`blur`, AND the shared `render()`
14
- * skeleton (`<label><input role=switch><track><thumb></track><labelBlock></label>`).
15
- * The slot-bearing label/description region is an overridable hook
16
- * (`_renderLabelBlock()`) that defaults to the light build's `[data-mono-slot]`
17
- * placeholders; the shadow build overrides it with native `<slot>` (mirrors
18
- * `mono-checkbox`). SSR-safe: no `document`/`window`; `focus`/`blur` query
19
- * `this.renderRoot`.
20
- */
21
- const MonoSwitchCore = (superClass) => {
22
- class MonoSwitchCoreClass extends MonoFormControlCore(superClass) {
23
- constructor(...args) {
24
- super(...args);
25
- this.size = "md";
26
- this.color = "primary";
27
- this.modelValue = false;
28
- this.checked = false;
29
- this.disabled = false;
30
- this.loading = false;
31
- this.label = "";
32
- this.sublabel = "";
33
- this.value = "";
34
- this.name = "";
35
- this.cssClass = {};
36
- this.cssClassName = "";
37
- this._hasLabelSlotState = false;
38
- this._hasDescriptionSlotState = false;
39
- defineHybridPropAliases(this, [
40
- "modelValue",
41
- "ariaLabelText",
42
- "cssClass"
43
- ]);
44
- defineHybridPropAlias(this, "description", "sublabel");
45
- Object.defineProperty(this, "css-class", {
46
- get: () => this.cssClass,
47
- set: (value) => this._setCssClass(value),
48
- configurable: true,
49
- enumerable: false
50
- });
51
- Object.defineProperty(this, "cssclass", {
52
- get: () => this.cssClass,
53
- set: (value) => this._setCssClass(value),
54
- configurable: true,
55
- enumerable: false
56
- });
57
- for (const alias of [
58
- "ariaLabel",
59
- "aria-label",
60
- "arialabel"
61
- ]) Object.defineProperty(this, alias, {
62
- get: () => this.ariaLabelText,
63
- set: (value) => {
64
- this.ariaLabelText = value == null ? void 0 : String(value);
65
- },
66
- configurable: true,
67
- enumerable: false
68
- });
69
- }
70
- static get observedAttributes() {
71
- return [
72
- ...super.observedAttributes ?? [],
73
- "modelvalue",
74
- "arialabeltext",
75
- "arialabel",
76
- "description",
77
- "css-class",
78
- "cssclass"
79
- ];
80
- }
81
- attributeChangedCallback(name, oldValue, newValue) {
82
- super.attributeChangedCallback(name, oldValue, newValue);
83
- if (oldValue === newValue) return;
84
- if (name === "modelvalue") {
85
- this.modelValue = this._toBoolean(newValue);
86
- return;
87
- }
88
- if (name === "arialabeltext" || name === "arialabel") {
89
- this.ariaLabelText = newValue ?? void 0;
90
- return;
91
- }
92
- if (name === "description") {
93
- this.sublabel = newValue ?? "";
94
- return;
95
- }
96
- if (name === "css-class" || name === "cssclass") this._setCssClass(newValue);
97
- }
98
- willUpdate(changed) {
99
- for (const key of [
100
- "modelValue",
101
- "checked",
102
- "disabled",
103
- "loading"
104
- ]) if (typeof this[key] === "string") this[key] = this._toBoolean(this[key]);
105
- if (changed.has("modelValue") && this.checked !== this.modelValue) this.checked = this.modelValue;
106
- if (changed.has("checked") && this.modelValue !== this.checked) this.modelValue = this.checked;
107
- super.willUpdate?.(changed);
108
- }
109
- _toBoolean(value) {
110
- if (typeof value === "boolean") return value;
111
- if (typeof value === "string") {
112
- const normalized = value.toLowerCase().trim();
113
- return normalized === "" || normalized === "true";
114
- }
115
- return Boolean(value);
116
- }
117
- _setCssClass(value) {
118
- if (value == null) {
119
- this.cssClass = {};
120
- this.cssClassName = "";
121
- return;
122
- }
123
- if (typeof value === "object") {
124
- this.cssClass = value;
125
- return;
126
- }
127
- if (typeof value === "string") {
128
- const trimmed = value.trim();
129
- if (!trimmed) {
130
- this.cssClass = {};
131
- this.cssClassName = "";
132
- return;
133
- }
134
- if (trimmed.startsWith("{") && trimmed.endsWith("}")) try {
135
- this.cssClass = JSON.parse(trimmed);
136
- return;
137
- } catch {}
138
- this.cssClassName = trimmed;
139
- }
140
- }
141
- _cls(base, key) {
142
- const extra = this.cssClass?.[key];
143
- return extra ? `${base} ${extra}` : base;
144
- }
145
- get _wrapperClasses() {
146
- return [
147
- "mono-switch",
148
- this.size,
149
- this.color,
150
- this.disabled ? "disabled" : "",
151
- this.loading ? "loading" : "",
152
- this.checked ? "mono-switch-checked" : "",
153
- this.cssClassName,
154
- this.cssClass?.root
155
- ].filter(Boolean).join(" ");
156
- }
157
- get _inputClasses() {
158
- return this._cls("mono-switch-input", "input");
159
- }
160
- get _trackClasses() {
161
- return [this._cls("mono-switch-track", "track"), this.size].filter(Boolean).join(" ");
162
- }
163
- get _thumbClasses() {
164
- return [this._cls("mono-switch-thumb", "thumb"), this.size].filter(Boolean).join(" ");
165
- }
166
- _hasLabelContent() {
167
- return Boolean(this.label) || this._hasLabelSlotState;
168
- }
169
- _hasDescriptionContent() {
170
- return Boolean(this.sublabel) || this._hasDescriptionSlotState;
171
- }
172
- _createModelDetail(args) {
173
- return {
174
- modelValue: args.modelValue,
175
- currentValue: args.modelValue,
176
- oldValue: args.oldValue,
177
- checked: args.modelValue,
178
- value: this.value,
179
- name: this.name,
180
- sourceEvent: args.sourceEvent
181
- };
182
- }
183
- _emitChange(detail) {
184
- dispatchMonoEvent(this, "change", detail);
185
- }
186
- _handleChange(event) {
187
- if (this.disabled || this.loading) return;
188
- const input = event.currentTarget;
189
- const oldValue = this.modelValue;
190
- const nextValue = input.checked;
191
- this.checked = nextValue;
192
- this.modelValue = nextValue;
193
- const detail = this._createModelDetail({
194
- modelValue: nextValue,
195
- oldValue,
196
- sourceEvent: event
197
- });
198
- this._emitChange(detail);
199
- }
200
- /** Light-DOM label block (data-mono-slot). Shadow build overrides with `<slot>`. */
201
- _renderLabelBlock() {
202
- if (!this._hasLabelContent() && !this._hasDescriptionContent()) return nothing;
203
- return html`
204
- <span class=${this._cls("mono-switch-label", "label")} mono-label>
205
- ${this._hasLabelContent() ? html`
206
- <span class=${this._cls("mono-switch-label-text", "labelText")} mono-label-text>
207
- ${this._hasLabelSlotState ? html`<span data-mono-slot="label"></span>` : this.label}
208
- </span>
209
- ` : nothing}
210
-
211
- ${this._hasDescriptionContent() ? html`
212
- <span class=${this._cls("mono-switch-label-description", "description")} mono-description>
213
- ${this._hasDescriptionSlotState ? html`<span data-mono-slot="description"></span>` : this.sublabel}
214
- </span>
215
- ` : nothing}
216
- </span>
217
- `;
218
- }
219
- render() {
220
- const ariaLabel = this.ariaLabelText || this.label || (this._hasLabelSlotState ? "Switch" : void 0);
221
- return html`
222
- <label
223
- class=${this._wrapperClasses}
224
- mono-switch
225
- mono-size=${this.size === "md" ? nothing : this.size}
226
- mono-color=${this.color === "primary" ? nothing : this.color}
227
- ?mono-checked=${this.checked}
228
- ?mono-disabled=${this.disabled}
229
- ?mono-loading=${this.loading}
230
- >
231
- <input
232
- class=${this._inputClasses}
233
- mono-input
234
- type="checkbox"
235
- role="switch"
236
- .checked=${this.checked}
237
- .value=${this.value}
238
- name=${ifDefined(this.name || void 0)}
239
- ?disabled=${this.disabled || this.loading}
240
- aria-checked=${String(this.checked)}
241
- aria-label=${ifDefined(ariaLabel)}
242
- @change=${this._handleChange}
243
- />
244
-
245
- <span class=${this._trackClasses} mono-track aria-hidden="true">
246
- <span class=${this._thumbClasses} mono-thumb></span>
247
- </span>
248
-
249
- ${this._renderLabelBlock()}
250
- </label>
251
- `;
252
- }
253
- focus(options) {
254
- this.renderRoot.querySelector(".mono-switch-input")?.focus(options);
255
- }
256
- blur() {
257
- this.renderRoot.querySelector(".mono-switch-input")?.blur();
258
- }
259
- }
260
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "size", void 0);
261
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "color", void 0);
262
- __decorate([property({
263
- attribute: "model-value",
264
- reflect: true,
265
- converter: booleanStringConverter
266
- })], MonoSwitchCoreClass.prototype, "modelValue", void 0);
267
- __decorate([property({
268
- reflect: true,
269
- converter: booleanStringConverter
270
- })], MonoSwitchCoreClass.prototype, "checked", void 0);
271
- __decorate([property({
272
- reflect: true,
273
- converter: booleanStringConverter
274
- })], MonoSwitchCoreClass.prototype, "disabled", void 0);
275
- __decorate([property({
276
- reflect: true,
277
- converter: booleanStringConverter
278
- })], MonoSwitchCoreClass.prototype, "loading", void 0);
279
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "label", void 0);
280
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "sublabel", void 0);
281
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "value", void 0);
282
- __decorate([property({ type: String })], MonoSwitchCoreClass.prototype, "name", void 0);
283
- __decorate([property({
284
- type: String,
285
- attribute: "aria-label"
286
- })], MonoSwitchCoreClass.prototype, "ariaLabelText", void 0);
287
- __decorate([property({ attribute: false })], MonoSwitchCoreClass.prototype, "cssClass", void 0);
288
- __decorate([property({ attribute: false })], MonoSwitchCoreClass.prototype, "cssClassName", void 0);
289
- __decorate([state()], MonoSwitchCoreClass.prototype, "_hasLabelSlotState", void 0);
290
- __decorate([state()], MonoSwitchCoreClass.prototype, "_hasDescriptionSlotState", void 0);
291
- return MonoSwitchCoreClass;
292
- };
293
-
294
- //#endregion
295
7
  //#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\switch\switch.css?raw.js
296
8
  var switch_css_raw_default = "/* =========================================================================\r\n mono-switch — a port of Basecoat's `.input[type='checkbox'][role='switch']`\r\n and the `.label` beside it (basecoat-css@1.0.2, vega style).\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-switch size=\"sm\" color=\"danger\" label=\"Notifications\" model-value>\r\n <label mono-switch mono-size=\"sm\" mono-color=\"danger\">\r\n <input mono-input type=\"checkbox\" role=\"switch\" checked />\r\n <span mono-track aria-hidden=\"true\"><span mono-thumb></span></span>\r\n <span mono-label><span mono-label-text>Notifications</span></span>\r\n </label>\r\n\r\n An absent attribute is the prop's default (`:not([mono-size])` = md,\r\n `:not([mono-color])` = primary). The element renders these attributes on its\r\n root <label> (both builds) plus the STATES `mono-checked` / `mono-loading`;\r\n hand-written markup may rely on the native input's `:checked` instead — every\r\n state rule reads both. The old classes (`.mono-switch.sm.mono-switch-checked`)\r\n are still emitted as inert hooks until 2.0 but no rule here reads them.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-switch] ≡ .label (flex gap-2 text-sm font-medium leading-snug select-none)\r\n [mono-switch] > [mono-track] ≡ .input[type='checkbox'][role='switch'] (h-[18.4px] w-[32px] rounded-full border border-transparent shadow-xs, not-checked:bg-input)\r\n [mono-track] > [mono-thumb] ≡ :before (size-4 rounded-full bg-background; dark not-checked:bg-foreground, checked:bg-primary-foreground — via --mono-mode-switch-thumb*)\r\n [mono-checked] / [mono-input]:checked ≡ :checked (bg-primary) + :before translate-x-[calc(100%-2px)]\r\n [mono-input]:focus-visible + [mono-track] ≡ focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\r\n [mono-invalid] / [mono-input][aria-invalid] ≡ aria-invalid:border-destructive aria-invalid:ring-destructive/20\r\n [mono-disabled] / [mono-input]:disabled ≡ disabled:cursor-not-allowed disabled:opacity-50\r\n [mono-label-text] ≡ .label text\r\n [mono-description] ≡ .field > p (text-sm text-muted-foreground)\r\n [mono-size=\"xs|sm|lg|xl|xxl\"] ≡ EXTENSION — upstream has two steps (default / data-size='sm');\r\n mono derives all six from --mono-control-height-*\r\n [mono-color=\"…\"] ≡ EXTENSION (the ON track in the role's colour)\r\n [mono-loading] ≡ EXTENSION (the thumb pulses while a change is in flight)\r\n\r\n GEOMETRY — one anchor, everything else derived, and it lands exactly on\r\n Basecoat at md: the THUMB is the checkbox box (--mono-control-height-md × 4/9\r\n = 16px = upstream's `size-4`), the track is 1.15 × that tall (18.4px =\r\n `h-[18.4px]`) and 2 × that wide (32px = `w-[32px]`). So a switch, a checkbox\r\n and a radio in one column share one scale by construction. The thumb travels\r\n the width of the track's CONTENT box minus its own — which parks it flush\r\n inside the border at both ends, so there is no inset to tune. (Upstream writes\r\n that as `calc(100% - 2px)`, the same number at vega's 1px border and 2:1\r\n track, but wrong for any flavor that changes either.)\r\n\r\n Specificity contract (same as the pre-port class sheet): a part's RESTING rule\r\n is exactly one attribute strong — `:where([mono-switch]) [mono-track]` =\r\n (0,1,0) — so a utility class handed in through `cssClass` wins by source\r\n order, while state rules (checked / focus / invalid / disabled / loading,\r\n keyed on the root or the native input) stay heavier and win over it.\r\n\r\n Inner parts: [mono-input], [mono-track] > [mono-thumb], [mono-label] >\r\n [mono-label-text] / [mono-description]. The shadow build marks an unassigned\r\n slot wrapper [mono-empty].\r\n\r\n The track sits on the label's CAP BAND (see `--_mono-switch-line-offset`) —\r\n mono's own alignment rule, kept, and the same numbers checkbox.css uses.\r\n\r\n FLAVORS set `--mono-switch-{radius,shadow,border-width,border-color,\r\n checked-border-color,ring-width,ring-alpha,track-off,track-height-md,\r\n track-ratio,thumb-ratio,thumb-width-ratio,thumb-radius,thumb-shadow}` (the per-style `[role='switch']` deltas); every fallback here is\r\n vega's value (`node scripts/basecoat-styles.mjs --varying \"role='switch'\"`).\r\n ========================================================================= */\r\n\r\nmono-switch {\r\n display: inline-block;\r\n}\r\n\r\n[mono-switch] {\r\n /* ── palette: each slot is a public knob over a Basecoat token ─────────── */\r\n --_mono-switch-text: var(--mono-switch-text, var(--foreground));\r\n --_mono-switch-description: var(--mono-switch-description, var(--muted-foreground));\r\n --_mono-switch-primary: var(--mono-switch-primary, var(--primary));\r\n --_mono-switch-accent: var(--mono-switch-accent, var(--_mono-switch-accent-preset, var(--_mono-switch-primary)));\r\n /* not-checked:bg-input (dark: /80 — the mode token carries it) */\r\n --_mono-switch-track-off: var(--mono-switch-track-off, var(--mono-mode-surface-strong));\r\n --_mono-switch-thumb: var(--mono-switch-thumb, var(--mono-mode-switch-thumb));\r\n --_mono-switch-thumb-checked: var(--mono-switch-thumb-checked, var(--mono-mode-switch-thumb-checked));\r\n --_mono-switch-shadow: var(--mono-switch-shadow, var(--mono-shadow-xs));\r\n --_mono-switch-thumb-shadow: var(--mono-switch-thumb-shadow, 0 0 #0000);\r\n --_mono-switch-radius: var(--mono-switch-radius, var(--mono-radius-full));\r\n --_mono-switch-border-width: var(--mono-switch-border-width, var(--mono-border-width));\r\n --_mono-switch-border-color: var(--mono-switch-border-color, transparent);\r\n --_mono-switch-ring-color: var(--mono-switch-ring-color, var(--ring));\r\n --_mono-switch-ring-width: var(--mono-switch-ring-width, var(--mono-ring-width));\r\n --_mono-switch-ring-alpha: var(--mono-switch-ring-alpha, var(--mono-ring-alpha));\r\n\r\n /* ── md metrics live on the unqualified root ON PURPOSE ────────────────────\r\n basecoat@1.0.2 styles/vega.css [role='switch'] — h-[18.4px] w-[32px] with a\r\n size-4 thumb; 18.4 = (36 × 4/9) × 1.15 and 32 = (36 × 4/9) × 2 */\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-md, calc(var(--mono-control-height-md) * 23 / 45)));\r\n --_mono-switch-track-w: var(--mono-switch-track-width, calc(var(--_mono-switch-track-h) * var(--mono-switch-track-ratio, 1.7391)));\r\n --_mono-switch-track-inner-h: calc(var(--_mono-switch-track-h) - 2 * var(--_mono-switch-border-width));\r\n --_mono-switch-track-inner-w: calc(var(--_mono-switch-track-w) - 2 * var(--_mono-switch-border-width));\r\n /* `min()` so a flavor with a thicker border (luma, rhea: border-2) cannot\r\n push the thumb past the track content box. The width is its own ratio:\r\n luma's thumb is a PILL (h-4 w-6), not a circle. */\r\n --_mono-switch-thumb-size: min(\r\n calc(var(--_mono-switch-track-h) * var(--mono-switch-thumb-ratio, 0.8696)),\r\n var(--_mono-switch-track-inner-h)\r\n );\r\n --_mono-switch-thumb-w: min(\r\n calc(var(--_mono-switch-track-h) * var(--mono-switch-thumb-width-ratio, var(--mono-switch-thumb-ratio, 0.8696))),\r\n var(--_mono-switch-track-inner-w)\r\n );\r\n /* ON travel = the content box minus the thumb. Upstream writes it\r\n `translate-x-[calc(100%-2px)]`, which is the same number at vega's 1px\r\n border and 2:1 track — and only there: luma's border-2 left the thumb short\r\n of the end, rhea's narrower track pushed it past. */\r\n --_mono-switch-travel: calc(var(--_mono-switch-track-inner-w) - var(--_mono-switch-thumb-w));\r\n /* ── whole pixels ────────────────────────────────────────────────────────\r\n Every part of the switch is a ratio of the control step, so it lands on a\r\n fraction (18.39px, 16.34px, 17.77px…). A fractional round shape is\r\n antialiased on every edge, and the thumb — which parks flush against the\r\n track's cap — picked up a dark rim that changed with the flavor and the\r\n screen's pixel ratio.\r\n\r\n Snap the THUMB and its inset, then build the track height from them, rather\r\n than rounding each value on its own: rounding independently can leave half a\r\n pixel above and below the thumb (an odd track around an even thumb), which\r\n blurs exactly the edge this is meant to sharpen, or stretch the thumb into an\r\n ellipse. `round()` has the same browser floor as `color-mix()` and `:has()`,\r\n which this sheet already requires. */\r\n --_mono-switch-thumb-h-px: round(nearest, var(--_mono-switch-thumb-size), 1px);\r\n --_mono-switch-thumb-w-px: round(nearest, var(--_mono-switch-thumb-w), 1px);\r\n --_mono-switch-thumb-inset-y: max(\r\n 0px,\r\n round(nearest, calc((var(--_mono-switch-track-inner-h) - var(--_mono-switch-thumb-size)) / 2), 1px)\r\n );\r\n --_mono-switch-track-h-px: calc(\r\n var(--_mono-switch-thumb-h-px) + 2 * var(--_mono-switch-border-width) + 2 * var(--_mono-switch-thumb-inset-y)\r\n );\r\n --_mono-switch-track-w-px: round(nearest, var(--_mono-switch-track-w), 1px);\r\n --_mono-switch-travel-px: calc(\r\n var(--_mono-switch-track-w-px) - 2 * var(--_mono-switch-border-width) - var(--_mono-switch-thumb-w-px)\r\n );\r\n\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-md, calc(var(--mono-spacing) * 2)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-md, var(--mono-text-sm));\r\n --_mono-switch-description-font: var(--mono-switch-description-font-md, 0.8125rem);\r\n\r\n /* ── alignment with the label ────────────────────────────────────────────\r\n The track is centred on the label's CAP BAND — the ink the eye reads, not\r\n the line box. Every number is checkbox.css's. */\r\n --_mono-switch-label-line-height: var(--mono-switch-label-line-height, var(--mono-leading-snug));\r\n --_mono-switch-optical-shift: 0.045;\r\n --_mono-switch-optical-nudge: 0px;\r\n --_mono-switch-line-offset: calc(\r\n (var(--_mono-switch-label-font) * var(--_mono-switch-label-line-height) - var(--_mono-switch-track-h-px)) / 2 +\r\n var(--_mono-switch-label-font) * var(--_mono-switch-optical-shift) + var(--_mono-switch-optical-nudge)\r\n );\r\n\r\n /* The element build nests this root inside its host, so it is never itself a\r\n grid or flex item and shrink-wraps its content. Hand-written markup usually\r\n IS the item (a radio in a `display: grid` list), and an item blockifies —\r\n `inline-flex` becomes `flex` and the row stretches to the widest sibling,\r\n wrapping its label at a different point than the element's. `fit-content`\r\n keeps both shapes shrink-wrapped; a consumer who wants a full-width row\r\n still sets a width. */\r\n width: fit-content;\r\n display: inline-flex;\r\n align-items: flex-start;\r\n gap: var(--_mono-switch-gap);\r\n position: relative;\r\n vertical-align: top;\r\n cursor: pointer;\r\n user-select: none;\r\n font-family: inherit;\r\n color: var(--_mono-switch-text);\r\n}\r\n\r\n[mono-switch],\r\n:where([mono-switch]) *,\r\n:where([mono-switch]) *::before,\r\n:where([mono-switch]) *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n:where([mono-switch]) :is([mono-label], [mono-label-text], [mono-description])[mono-empty] {\r\n display: none;\r\n}\r\n\r\n/* the track seats on the first line of a label that is actually there; a bare\r\n track stays flush at the top */\r\n[mono-switch]:has([mono-label-text]:not([mono-empty])) > [mono-track] {\r\n margin-top: var(--_mono-switch-line-offset, 0px);\r\n}\r\n\r\n/* =========================================\r\n Sizes — EXTENSION: upstream has two steps; mono derives six from the control\r\n ladder, so the thumb is the checkbox box at every one of them\r\n ========================================= */\r\n\r\n[mono-switch][mono-size=\"xs\"] {\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-xs, calc(var(--mono-control-height-xs) * 23 / 45)));\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-xs, calc(var(--mono-spacing) * 1.25)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-xs, var(--mono-text-xs));\r\n --_mono-switch-description-font: var(--mono-switch-description-font-xs, 0.6875rem);\r\n}\r\n\r\n[mono-switch][mono-size=\"sm\"] {\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-sm, calc(var(--mono-control-height-sm) * 23 / 45)));\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-sm, calc(var(--mono-spacing) * 1.5)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-sm, 0.8125rem);\r\n --_mono-switch-description-font: var(--mono-switch-description-font-sm, var(--mono-text-xs));\r\n}\r\n\r\n[mono-switch][mono-size=\"lg\"] {\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-lg, calc(var(--mono-control-height-lg) * 23 / 45)));\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-lg, calc(var(--mono-spacing) * 2.5)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-lg, var(--mono-text-base));\r\n --_mono-switch-description-font: var(--mono-switch-description-font-lg, var(--mono-text-sm));\r\n /* 16px text rounds its ascent such that the track lands ~0.35px low */\r\n --_mono-switch-optical-nudge: -0.35px;\r\n}\r\n\r\n[mono-switch][mono-size=\"xl\"] {\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-xl, calc(var(--mono-control-height-xl) * 23 / 45)));\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-xl, calc(var(--mono-spacing) * 3)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-xl, var(--mono-text-lg));\r\n --_mono-switch-description-font: var(--mono-switch-description-font-xl, var(--mono-text-base));\r\n}\r\n\r\n[mono-switch][mono-size=\"xxl\"] {\r\n --_mono-switch-track-h: var(--mono-switch-track-height, var(--mono-switch-track-height-xxl, calc(var(--mono-control-height-xxl) * 23 / 45)));\r\n --_mono-switch-gap: var(--mono-switch-gap, var(--mono-switch-gap-xxl, calc(var(--mono-spacing) * 3.5)));\r\n --_mono-switch-label-font: var(--mono-switch-label-font-xxl, var(--mono-text-xl));\r\n --_mono-switch-description-font: var(--mono-switch-description-font-xxl, var(--mono-text-lg));\r\n /* 20px text rounds the other way, leaving the track ~1.1px high */\r\n --_mono-switch-optical-nudge: 1.1px;\r\n}\r\n\r\n/* =========================================\r\n Colours — EXTENSION: the ON track in the role's colour\r\n ========================================= */\r\n\r\n[mono-switch]:is(:not([mono-color]), [mono-color=\"primary\"]) {\r\n --_mono-switch-accent-preset: var(--_mono-switch-primary);\r\n}\r\n[mono-switch][mono-color=\"secondary\"] {\r\n --_mono-switch-accent-preset: var(--secondary-foreground);\r\n}\r\n[mono-switch][mono-color=\"success\"] {\r\n --_mono-switch-accent-preset: var(--success);\r\n}\r\n[mono-switch][mono-color=\"danger\"] {\r\n --_mono-switch-accent-preset: var(--destructive);\r\n}\r\n[mono-switch][mono-color=\"warning\"] {\r\n --_mono-switch-accent-preset: var(--warning);\r\n}\r\n[mono-switch][mono-color=\"info\"] {\r\n --_mono-switch-accent-preset: var(--info);\r\n}\r\n[mono-switch][mono-color=\"teal\"] {\r\n --_mono-switch-accent-preset: var(--teal);\r\n}\r\n[mono-switch][mono-color=\"purple\"] {\r\n --_mono-switch-accent-preset: var(--purple);\r\n}\r\n[mono-switch][mono-color=\"neutral\"] {\r\n --_mono-switch-accent-preset: var(--neutral);\r\n}\r\n[mono-switch][mono-color=\"dark\"] {\r\n --_mono-switch-accent-preset: var(--dark);\r\n}\r\n\r\n/* =========================================\r\n States on the root\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/switch.css .field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']\r\n — disabled:cursor-not-allowed disabled:opacity-50.\r\n A BUSY switch is exempt: the input is disabled so a second click cannot race\r\n the first, but it reads as \"working\", not \"unavailable\". */\r\n[mono-switch][mono-disabled]:not([mono-loading]),\r\n[mono-switch]:not([mono-loading]):has(> [mono-input]:disabled) {\r\n cursor: not-allowed;\r\n opacity: 0.5;\r\n pointer-events: none;\r\n}\r\n\r\n[mono-switch][mono-loading] {\r\n cursor: progress;\r\n pointer-events: none;\r\n}\r\n\r\n/* the native input is the accessible control; the track is its painted twin */\r\n:where([mono-switch]) [mono-input] {\r\n position: absolute;\r\n opacity: 0;\r\n pointer-events: none;\r\n width: 1px;\r\n height: 1px;\r\n margin: 0;\r\n /* the UA gives an <input> its own font; inside a shadow root nothing resets it,\r\n so the hidden control ended up with a different computed font in the two\r\n builds. It paints nothing either way — this just keeps them identical. */\r\n font: inherit;\r\n color: inherit;\r\n}\r\n\r\n/* =========================================\r\n The track\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/switch.css .field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']\r\n — inline-flex shrink-0 appearance-none items-center transition-all outline-none */\r\n/* basecoat@1.0.2 styles/vega.css .field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']\r\n — rounded-full border border-transparent shadow-xs; not-checked:bg-input\r\n (dark /80 via --mono-mode-surface-strong); checked:bg-primary;\r\n mono: `--tw-ring-*` flattened to the ring + shadow slots */\r\n/* basecoat@1.0.2 styles/vega.css :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not([data-size='sm'])\r\n — h-[18.4px] w-[32px] (mono derives both from the control step) */\r\n:where([mono-switch]) > [mono-track] {\r\n --_mono-switch-ring: 0 0 #0000;\r\n position: relative;\r\n flex: 0 0 auto;\r\n display: inline-flex;\r\n align-items: center;\r\n width: var(--_mono-switch-track-w-px);\r\n height: var(--_mono-switch-track-h-px);\r\n border: var(--_mono-switch-border-width) solid var(--_mono-switch-border-color);\r\n border-radius: var(--_mono-switch-radius);\r\n background-color: var(--_mono-switch-track-off);\r\n box-shadow: var(--_mono-switch-ring), var(--_mono-switch-shadow);\r\n /* the track's own ink is the ACCENT, so a flavor that outlines the ON track\r\n (luma, sera, rhea) says `--mono-switch-checked-border-color: currentColor`\r\n with public knobs alone */\r\n color: var(--_mono-switch-accent);\r\n transition-property: box-shadow, background-color, border-color;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n\r\n/* focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 */\r\n:where([mono-switch]) > [mono-input]:focus-visible + [mono-track] {\r\n border-color: var(--_mono-switch-ring-color);\r\n --_mono-switch-ring: 0 0 0 var(--_mono-switch-ring-width) color-mix(in oklab, var(--_mono-switch-ring-color) var(--_mono-switch-ring-alpha), transparent);\r\n}\r\n\r\n/* aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20\r\n (dark: /50, /40 via the mode tokens) */\r\n[mono-switch][mono-invalid] > [mono-track],\r\n:where([mono-switch]) > [mono-input][aria-invalid=\"true\"] + [mono-track] {\r\n border-color: var(--mono-mode-invalid-border);\r\n --_mono-switch-ring: 0 0 0 var(--_mono-switch-ring-width) var(--mono-mode-invalid-ring);\r\n}\r\n\r\n/* checked:bg-primary — generalised per hue */\r\n[mono-switch][mono-checked] > [mono-track],\r\n:where([mono-switch]) > [mono-input]:checked + [mono-track] {\r\n background-color: var(--_mono-switch-accent);\r\n border-color: var(--mono-switch-checked-border-color, var(--_mono-switch-border-color));\r\n}\r\n\r\n/* =========================================\r\n The thumb — upstream's `:before`\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 components/switch.css .field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']\r\n — before:pointer-events-none before:block before:content-[''] before:ring-0 before:transition-transform */\r\n/* basecoat@1.0.2 styles/vega.css :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):before\r\n — bg-background rounded-full (dark: not-checked bg-foreground / checked\r\n bg-primary-foreground, via --mono-mode-switch-thumb*) */\r\n/* basecoat@1.0.2 styles/vega.css :is(.field > input[type='checkbox'][role='switch'], .input[type='checkbox'][role='switch']):not([data-size='sm']):before\r\n — size-4 (mono: that share of the track, so it tracks every step) */\r\n:where([mono-switch]) > [mono-track] > [mono-thumb] {\r\n display: block;\r\n flex: 0 0 auto;\r\n pointer-events: none;\r\n width: var(--_mono-switch-thumb-w-px);\r\n height: var(--_mono-switch-thumb-h-px);\r\n border-radius: var(--mono-switch-thumb-radius, var(--mono-radius-full));\r\n background-color: var(--_mono-switch-thumb);\r\n box-shadow: var(--_mono-switch-thumb-shadow);\r\n /* `translate`, not `transform`: the loading pulse owns `transform`, and the\r\n two are independent properties, so they no longer collide */\r\n translate: 0;\r\n transition-property: translate, background-color;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n\r\n/* :checked:before — translate-x-[calc(100%-2px)]: the thumb parks flush inside\r\n the track's border at both ends (see --_mono-switch-travel) */\r\n[mono-switch][mono-checked] > [mono-track] > [mono-thumb],\r\n:where([mono-switch]) > [mono-input]:checked + [mono-track] > [mono-thumb] {\r\n translate: var(--_mono-switch-travel-px);\r\n background-color: var(--_mono-switch-thumb-checked);\r\n}\r\n\r\n[mono-switch][mono-checked] > [mono-track] > [mono-thumb]:dir(rtl),\r\n:where([mono-switch]) > [mono-input]:checked + [mono-track] > [mono-thumb]:dir(rtl) {\r\n translate: calc(-1 * var(--_mono-switch-travel-px));\r\n}\r\n\r\n/* EXTENSION — the thumb pulses while a change is in flight */\r\n[mono-switch][mono-loading] > [mono-track] > [mono-thumb] {\r\n animation: mono-switch-pulse 1s ease-in-out infinite;\r\n}\r\n\r\n@keyframes mono-switch-pulse {\r\n 0%,\r\n 100% {\r\n transform: scale(1);\r\n }\r\n 50% {\r\n transform: scale(0.86);\r\n }\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n :where([mono-switch]) > [mono-track],\r\n :where([mono-switch]) > [mono-track] > [mono-thumb] {\r\n transition: none;\r\n }\r\n\r\n [mono-switch][mono-loading] > [mono-track] > [mono-thumb] {\r\n animation-duration: 2.4s;\r\n }\r\n}\r\n\r\n/* =========================================\r\n Label\r\n ========================================= */\r\n\r\n:where([mono-switch]) > [mono-label] {\r\n min-width: 0;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > label, .label — text-sm leading-snug font-medium;\r\n `block` so the first line box is exactly font × line-height */\r\n:where([mono-switch]) [mono-label-text] {\r\n display: block;\r\n font-size: var(--_mono-switch-label-font);\r\n line-height: var(--_mono-switch-label-line-height);\r\n font-weight: var(--mono-switch-label-font-weight, var(--mono-label-font-weight, var(--mono-font-weight-medium)));\r\n color: var(--_mono-switch-text);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .fieldset legend + p, .field > p, .field section > p\r\n — text-sm text-muted-foreground leading-normal font-normal; EXTENSION: one step\r\n under the label per size */\r\n:where([mono-switch]) [mono-description] {\r\n display: block;\r\n margin-top: calc(var(--mono-spacing) * 0.5);\r\n font-size: var(--_mono-switch-description-font);\r\n line-height: var(--mono-leading-normal);\r\n font-weight: var(--mono-font-weight-normal);\r\n color: var(--_mono-switch-description);\r\n}\r\n";
297
9
 
@@ -386,48 +98,5 @@ let MonoSwitchShadow = class MonoSwitchShadow extends withShadowUtilityStyles(Mo
386
98
  };
387
99
  MonoSwitchShadow = __decorate([customElement("mono-shadow-switch")], MonoSwitchShadow);
388
100
 
389
- //#endregion
390
- //#region src/components/switch/switch-utils.ts
391
- /**
392
- * Validate switch props
393
- */
394
- function validateSwitchProps(props) {
395
- const validSizes = [
396
- "xs",
397
- "sm",
398
- "md",
399
- "lg",
400
- "xl",
401
- "xxl"
402
- ];
403
- const validColors = [
404
- "primary",
405
- "secondary",
406
- "success",
407
- "danger",
408
- "warning",
409
- "info",
410
- "teal",
411
- "purple",
412
- "neutral",
413
- "dark"
414
- ];
415
- if (props.size && !validSizes.includes(props.size)) return false;
416
- if (props.color && !validColors.includes(props.color)) return false;
417
- return true;
418
- }
419
- /**
420
- * Generate ARIA attributes for accessibility
421
- */
422
- function generateSwitchAttributes(disabled, loading, checked, label) {
423
- return {
424
- "aria-disabled": disabled || loading ? "true" : void 0,
425
- "aria-busy": loading ? "true" : void 0,
426
- "aria-checked": String(checked),
427
- "role": "switch",
428
- "aria-label": label || void 0
429
- };
430
- }
431
-
432
101
  //#endregion
433
102
  export { MonoSwitchCore, MonoSwitchShadow, generateSwitchAttributes, validateSwitchProps };