@hypoth-ui/wc 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/button-MKQKTC5Q.js +10 -0
- package/dist/button-MKQKTC5Q.js.map +1 -0
- package/dist/chunk-4HLM6DBG.js +910 -0
- package/dist/chunk-4HLM6DBG.js.map +1 -0
- package/dist/chunk-55ID7LJL.js +3602 -0
- package/dist/chunk-55ID7LJL.js.map +1 -0
- package/dist/chunk-66HFYJD7.js +86 -0
- package/dist/chunk-66HFYJD7.js.map +1 -0
- package/dist/chunk-CZOXIJVS.js +70 -0
- package/dist/chunk-CZOXIJVS.js.map +1 -0
- package/dist/chunk-DHUM4Q5Y.js +495 -0
- package/dist/chunk-DHUM4Q5Y.js.map +1 -0
- package/dist/chunk-DNNI5BDE.js +1842 -0
- package/dist/chunk-DNNI5BDE.js.map +1 -0
- package/dist/chunk-GXKZ6E6K.js +99 -0
- package/dist/chunk-GXKZ6E6K.js.map +1 -0
- package/dist/chunk-H4GJJZ3N.js +51 -0
- package/dist/chunk-H4GJJZ3N.js.map +1 -0
- package/dist/chunk-JMPTFALJ.js +175 -0
- package/dist/chunk-JMPTFALJ.js.map +1 -0
- package/dist/chunk-MYQWCLUJ.js +45 -0
- package/dist/chunk-MYQWCLUJ.js.map +1 -0
- package/dist/chunk-QZSPWT7L.js +183 -0
- package/dist/chunk-QZSPWT7L.js.map +1 -0
- package/dist/chunk-TSKBQCTR.js +5137 -0
- package/dist/chunk-TSKBQCTR.js.map +1 -0
- package/dist/chunk-TXIIUVL3.js +130 -0
- package/dist/chunk-TXIIUVL3.js.map +1 -0
- package/dist/chunk-UM7WRO7W.js +237 -0
- package/dist/chunk-UM7WRO7W.js.map +1 -0
- package/dist/chunk-VPXL4RB3.js +202 -0
- package/dist/chunk-VPXL4RB3.js.map +1 -0
- package/dist/chunk-VX5CKSMN.js +39 -0
- package/dist/chunk-VX5CKSMN.js.map +1 -0
- package/dist/chunk-WQ5BEP3E.js +2845 -0
- package/dist/chunk-WQ5BEP3E.js.map +1 -0
- package/dist/chunk-YDQ434UH.js +60 -0
- package/dist/chunk-YDQ434UH.js.map +1 -0
- package/dist/chunk-ZWV4VI6D.js +153 -0
- package/dist/chunk-ZWV4VI6D.js.map +1 -0
- package/dist/core.d.ts +127 -0
- package/dist/core.js +38 -0
- package/dist/core.js.map +1 -0
- package/dist/data-display.d.ts +872 -0
- package/dist/data-display.js +57 -0
- package/dist/data-display.js.map +1 -0
- package/dist/ds-element-Db0LMfxI.d.ts +43 -0
- package/dist/feedback.d.ts +292 -0
- package/dist/feedback.js +31 -0
- package/dist/feedback.js.map +1 -0
- package/dist/form-controls.d.ts +1713 -0
- package/dist/form-controls.js +63 -0
- package/dist/form-controls.js.map +1 -0
- package/dist/icon-7IZTJ5WT.js +8 -0
- package/dist/icon-7IZTJ5WT.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +423 -0
- package/dist/index.js.map +1 -0
- package/dist/input-LB6UR37A.js +10 -0
- package/dist/input-LB6UR37A.js.map +1 -0
- package/dist/layout.d.ts +504 -0
- package/dist/layout.js +34 -0
- package/dist/layout.js.map +1 -0
- package/dist/link-NHDJ6SFY.js +9 -0
- package/dist/link-NHDJ6SFY.js.map +1 -0
- package/dist/navigation.d.ts +255 -0
- package/dist/navigation.js +111 -0
- package/dist/navigation.js.map +1 -0
- package/dist/overlays.d.ts +1291 -0
- package/dist/overlays.js +106 -0
- package/dist/overlays.js.map +1 -0
- package/dist/primitives.d.ts +230 -0
- package/dist/primitives.js +26 -0
- package/dist/primitives.js.map +1 -0
- package/dist/registry-Bns0t11H.d.ts +233 -0
- package/dist/skeleton-MUdd2029.d.ts +109 -0
- package/dist/spinner-BWaNlc-Y.d.ts +45 -0
- package/dist/spinner-UIYDUVBZ.js +8 -0
- package/dist/spinner-UIYDUVBZ.js.map +1 -0
- package/dist/stepper-CCRwcQOe.d.ts +851 -0
- package/dist/text-MT3S3EMU.js +8 -0
- package/dist/text-MT3S3EMU.js.map +1 -0
- package/dist/visually-hidden-MW2XY4CS.js +8 -0
- package/dist/visually-hidden-MW2XY4CS.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateProp
|
|
3
|
+
} from "./chunk-JMPTFALJ.js";
|
|
4
|
+
import {
|
|
5
|
+
StandardEvents,
|
|
6
|
+
emitEvent
|
|
7
|
+
} from "./chunk-YDQ434UH.js";
|
|
8
|
+
import {
|
|
9
|
+
DSElement,
|
|
10
|
+
__decorateClass,
|
|
11
|
+
define
|
|
12
|
+
} from "./chunk-H4GJJZ3N.js";
|
|
13
|
+
|
|
14
|
+
// src/components/button/button.ts
|
|
15
|
+
import { createButtonBehavior } from "@hypoth-ui/primitives-dom";
|
|
16
|
+
import { html, nothing } from "lit";
|
|
17
|
+
import { property } from "lit/decorators.js";
|
|
18
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
19
|
+
var VALID_VARIANTS = ["primary", "secondary", "ghost", "destructive"];
|
|
20
|
+
var VALID_SIZES = ["sm", "md", "lg"];
|
|
21
|
+
var DsButton = class extends DSElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.variant = "primary";
|
|
25
|
+
this.size = "md";
|
|
26
|
+
this.disabled = false;
|
|
27
|
+
this.loading = false;
|
|
28
|
+
this.type = "button";
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = [];
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
super.connectedCallback();
|
|
35
|
+
this.behavior = createButtonBehavior({
|
|
36
|
+
disabled: this.disabled,
|
|
37
|
+
loading: this.loading,
|
|
38
|
+
type: this.type
|
|
39
|
+
});
|
|
40
|
+
validateProp("ds-button", "variant", this.variant, VALID_VARIANTS);
|
|
41
|
+
validateProp("ds-button", "size", this.size, VALID_SIZES);
|
|
42
|
+
}
|
|
43
|
+
updated(changedProperties) {
|
|
44
|
+
super.updated(changedProperties);
|
|
45
|
+
if (changedProperties.has("disabled") || changedProperties.has("loading") || changedProperties.has("type")) {
|
|
46
|
+
this.behavior.setState({
|
|
47
|
+
disabled: this.disabled,
|
|
48
|
+
loading: this.loading,
|
|
49
|
+
type: this.type
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
handleClick(event) {
|
|
54
|
+
if (this.disabled || this.loading) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
emitEvent(this, StandardEvents.PRESS, {
|
|
60
|
+
detail: {
|
|
61
|
+
originalEvent: event,
|
|
62
|
+
target: this,
|
|
63
|
+
isKeyboard: false
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
handleKeyDown(event) {
|
|
68
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
if (!this.disabled && !this.loading) {
|
|
71
|
+
emitEvent(this, StandardEvents.PRESS, {
|
|
72
|
+
detail: {
|
|
73
|
+
originalEvent: event,
|
|
74
|
+
target: this,
|
|
75
|
+
isKeyboard: true
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
const classes = {
|
|
83
|
+
"ds-button": true,
|
|
84
|
+
[`ds-button--${this.variant}`]: true,
|
|
85
|
+
[`ds-button--${this.size}`]: true,
|
|
86
|
+
"ds-button--disabled": this.disabled,
|
|
87
|
+
"ds-button--loading": this.loading
|
|
88
|
+
};
|
|
89
|
+
const isDisabled = this.disabled || this.loading;
|
|
90
|
+
return html`
|
|
91
|
+
<button
|
|
92
|
+
part="button"
|
|
93
|
+
class=${classMap(classes)}
|
|
94
|
+
type=${this.type}
|
|
95
|
+
?disabled=${this.disabled}
|
|
96
|
+
aria-disabled=${isDisabled ? "true" : nothing}
|
|
97
|
+
aria-busy=${this.loading ? "true" : nothing}
|
|
98
|
+
tabindex=${isDisabled ? -1 : 0}
|
|
99
|
+
@click=${this.handleClick}
|
|
100
|
+
@keydown=${this.handleKeyDown}
|
|
101
|
+
>
|
|
102
|
+
${this.loading ? html`<span class="ds-button__spinner" aria-hidden="true"></span>` : null}
|
|
103
|
+
<span class="ds-button__content">
|
|
104
|
+
<slot></slot>
|
|
105
|
+
</span>
|
|
106
|
+
</button>
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
__decorateClass([
|
|
111
|
+
property({ type: String, reflect: true })
|
|
112
|
+
], DsButton.prototype, "variant", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
property({ type: String, reflect: true })
|
|
115
|
+
], DsButton.prototype, "size", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
property({ type: Boolean, reflect: true })
|
|
118
|
+
], DsButton.prototype, "disabled", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
property({ type: Boolean, reflect: true })
|
|
121
|
+
], DsButton.prototype, "loading", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property({ type: String })
|
|
124
|
+
], DsButton.prototype, "type", 2);
|
|
125
|
+
define("ds-button", DsButton);
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
DsButton
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=chunk-TXIIUVL3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/button/button.ts"],"sourcesContent":["import { type ButtonBehavior, createButtonBehavior } from \"@hypoth-ui/primitives-dom\";\nimport { type TemplateResult, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { DSElement } from \"../../base/ds-element.js\";\nimport { StandardEvents, emitEvent } from \"../../events/emit.js\";\nimport { define } from \"../../registry/define.js\";\nimport { validateProp } from \"../../utils/dev-warnings.js\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"destructive\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nconst VALID_VARIANTS: readonly ButtonVariant[] = [\"primary\", \"secondary\", \"ghost\", \"destructive\"];\nconst VALID_SIZES: readonly ButtonSize[] = [\"sm\", \"md\", \"lg\"];\n\n/**\n * A button component following WAI-ARIA button pattern.\n *\n * @element ds-button\n * @slot - Default slot for button content\n *\n * @csspart button - The button element\n *\n * @fires ds:press - When the button is activated (click, Enter, Space)\n */\nexport class DsButton extends DSElement {\n static override styles = [];\n\n /**\n * The button variant.\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * The button size.\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"md\";\n\n /**\n * Whether the button is disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the button is in a loading state.\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Button type attribute.\n */\n @property({ type: String })\n type: \"button\" | \"submit\" | \"reset\" = \"button\";\n\n /** Button behavior instance */\n private behavior!: ButtonBehavior;\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Create behavior with current property values\n this.behavior = createButtonBehavior({\n disabled: this.disabled,\n loading: this.loading,\n type: this.type,\n });\n\n // Dev warnings: Validate variant and size\n validateProp(\"ds-button\", \"variant\", this.variant, VALID_VARIANTS);\n validateProp(\"ds-button\", \"size\", this.size, VALID_SIZES);\n }\n\n override updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n // Sync behavior state with component properties\n if (\n changedProperties.has(\"disabled\") ||\n changedProperties.has(\"loading\") ||\n changedProperties.has(\"type\")\n ) {\n this.behavior.setState({\n disabled: this.disabled,\n loading: this.loading,\n type: this.type,\n });\n }\n }\n\n private handleClick(event: MouseEvent): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n // Dispatch ds:press event per standard event naming convention\n emitEvent(this, StandardEvents.PRESS, {\n detail: {\n originalEvent: event,\n target: this,\n isKeyboard: false,\n },\n });\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n // For WC compatibility, handle both Enter and Space on keydown\n // The behavior only handles Enter on keydown (Space is typically keyup)\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (!this.disabled && !this.loading) {\n // Dispatch ds:press event with keyboard flag\n // Note: We do NOT call this.click() to avoid double event emission\n emitEvent(this, StandardEvents.PRESS, {\n detail: {\n originalEvent: event,\n target: this,\n isKeyboard: true,\n },\n });\n }\n }\n }\n\n override render(): TemplateResult {\n const classes = {\n \"ds-button\": true,\n [`ds-button--${this.variant}`]: true,\n [`ds-button--${this.size}`]: true,\n \"ds-button--disabled\": this.disabled,\n \"ds-button--loading\": this.loading,\n };\n\n // Compute ARIA props based on current component state\n const isDisabled = this.disabled || this.loading;\n\n return html`\n <button\n part=\"button\"\n class=${classMap(classes)}\n type=${this.type}\n ?disabled=${this.disabled}\n aria-disabled=${isDisabled ? \"true\" : nothing}\n aria-busy=${this.loading ? \"true\" : nothing}\n tabindex=${isDisabled ? -1 : 0}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n >\n ${this.loading ? html`<span class=\"ds-button__spinner\" aria-hidden=\"true\"></span>` : null}\n <span class=\"ds-button__content\">\n <slot></slot>\n </span>\n </button>\n `;\n }\n}\n\n// Register the component\ndefine(\"ds-button\", DsButton);\n\n// TypeScript declaration for HTML\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ds-button\": DsButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAA8B,4BAA4B;AAC1D,SAA8B,MAAM,eAAe;AACnD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AASzB,IAAM,iBAA2C,CAAC,WAAW,aAAa,SAAS,aAAa;AAChG,IAAM,cAAqC,CAAC,MAAM,MAAM,IAAI;AAYrD,IAAM,WAAN,cAA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|
+
function FormAssociatedMixin(Base) {
|
|
8
|
+
class FormAssociatedClass extends Base {
|
|
9
|
+
// biome-ignore lint/suspicious/noExplicitAny: Mixin pattern requires any[] for constructor args
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
super(...args);
|
|
12
|
+
/**
|
|
13
|
+
* Default value for form reset.
|
|
14
|
+
*/
|
|
15
|
+
this._defaultValue = null;
|
|
16
|
+
this.name = "";
|
|
17
|
+
this.value = "";
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.required = false;
|
|
20
|
+
this.customValidation = false;
|
|
21
|
+
/**
|
|
22
|
+
* Custom error message set via setCustomValidity().
|
|
23
|
+
*/
|
|
24
|
+
this._customValidityMessage = "";
|
|
25
|
+
this._internals = this.attachInternals();
|
|
26
|
+
}
|
|
27
|
+
static {
|
|
28
|
+
/**
|
|
29
|
+
* Required static property for form association.
|
|
30
|
+
* Signals to the browser that this element participates in forms.
|
|
31
|
+
*/
|
|
32
|
+
this.formAssociated = true;
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
this._defaultValue = this.value;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Current validity state of the control.
|
|
40
|
+
*/
|
|
41
|
+
get validity() {
|
|
42
|
+
return this._internals.validity;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Localized message describing the validation error.
|
|
46
|
+
*/
|
|
47
|
+
get validationMessage() {
|
|
48
|
+
return this._internals.validationMessage;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether the control will be validated when the form is submitted.
|
|
52
|
+
*/
|
|
53
|
+
get willValidate() {
|
|
54
|
+
return this._internals.willValidate;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The form element that this control is associated with.
|
|
58
|
+
*/
|
|
59
|
+
get form() {
|
|
60
|
+
return this._internals.form;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if the control satisfies its constraints.
|
|
64
|
+
* Does not show any UI feedback.
|
|
65
|
+
*/
|
|
66
|
+
checkValidity() {
|
|
67
|
+
return this._internals.checkValidity();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Check validity and show validation UI if invalid.
|
|
71
|
+
* When customValidation is true, emits ds:invalid event instead of native UI.
|
|
72
|
+
*/
|
|
73
|
+
reportValidity() {
|
|
74
|
+
if (this.customValidation) {
|
|
75
|
+
const valid = this._internals.checkValidity();
|
|
76
|
+
if (!valid) {
|
|
77
|
+
this.dispatchEvent(
|
|
78
|
+
new CustomEvent("ds:invalid", {
|
|
79
|
+
detail: { message: this._internals.validationMessage },
|
|
80
|
+
bubbles: true,
|
|
81
|
+
composed: true
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return valid;
|
|
86
|
+
}
|
|
87
|
+
return this._internals.reportValidity();
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Set a custom validation message.
|
|
91
|
+
* Empty string clears custom validity.
|
|
92
|
+
*/
|
|
93
|
+
setCustomValidity(message) {
|
|
94
|
+
this._customValidityMessage = message;
|
|
95
|
+
if (message) {
|
|
96
|
+
this._internals.setValidity({ customError: true }, message, this.getValidationAnchor());
|
|
97
|
+
} else {
|
|
98
|
+
this.updateValidity();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Called when the element is associated with a form.
|
|
103
|
+
*/
|
|
104
|
+
formAssociatedCallback(form) {
|
|
105
|
+
void form;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Called when the element or ancestor fieldset is disabled/enabled.
|
|
109
|
+
*/
|
|
110
|
+
formDisabledCallback(disabled) {
|
|
111
|
+
this.disabled = disabled;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Called when the form is reset.
|
|
115
|
+
* Subclasses should override to restore their specific default state.
|
|
116
|
+
*/
|
|
117
|
+
formResetCallback() {
|
|
118
|
+
this.value = this._defaultValue ?? "";
|
|
119
|
+
this._customValidityMessage = "";
|
|
120
|
+
this._internals.setFormValue(null);
|
|
121
|
+
this._internals.setValidity({});
|
|
122
|
+
this.onFormReset();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Called during form state restoration (navigation, autofill).
|
|
126
|
+
*/
|
|
127
|
+
formStateRestoreCallback(state, mode) {
|
|
128
|
+
if (typeof state === "string") {
|
|
129
|
+
this.value = state;
|
|
130
|
+
}
|
|
131
|
+
this.onFormStateRestore(state, mode);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Override in subclass to return the anchor element for validation messages.
|
|
135
|
+
* This is typically the interactive element within the component.
|
|
136
|
+
*/
|
|
137
|
+
getValidationAnchor() {
|
|
138
|
+
return void 0;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Override in subclass to return validation flags.
|
|
142
|
+
* Called by updateValidity() to determine validity state.
|
|
143
|
+
*/
|
|
144
|
+
getValidationFlags() {
|
|
145
|
+
return {};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Override in subclass to return validation message for current flags.
|
|
149
|
+
*/
|
|
150
|
+
getValidationMessage(_flags) {
|
|
151
|
+
return "";
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Hook for subclasses to handle form reset.
|
|
155
|
+
*/
|
|
156
|
+
onFormReset() {
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Hook for subclasses to handle form state restore.
|
|
160
|
+
*/
|
|
161
|
+
onFormStateRestore(_state, _mode) {
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Updates the form value. Call this when the component's value changes.
|
|
165
|
+
*/
|
|
166
|
+
updateFormValue() {
|
|
167
|
+
const value = this.getFormValue();
|
|
168
|
+
this._internals.setFormValue(value);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Updates the validity state. Call this when validation-relevant state changes.
|
|
172
|
+
*/
|
|
173
|
+
updateValidity() {
|
|
174
|
+
if (this._customValidityMessage) {
|
|
175
|
+
this._internals.setValidity(
|
|
176
|
+
{ customError: true },
|
|
177
|
+
this._customValidityMessage,
|
|
178
|
+
this.getValidationAnchor()
|
|
179
|
+
);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const flags = this.getValidationFlags();
|
|
183
|
+
const hasError = Object.values(flags).some(Boolean);
|
|
184
|
+
if (hasError) {
|
|
185
|
+
const message = this.getValidationMessage(flags);
|
|
186
|
+
this._internals.setValidity(flags, message, this.getValidationAnchor());
|
|
187
|
+
} else {
|
|
188
|
+
this._internals.setValidity({});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Lifecycle hook to sync form value and validity on property changes.
|
|
193
|
+
*/
|
|
194
|
+
updated(changedProperties) {
|
|
195
|
+
super.updated(changedProperties);
|
|
196
|
+
if (changedProperties.has("value") || this.shouldUpdateFormValue(changedProperties)) {
|
|
197
|
+
this.updateFormValue();
|
|
198
|
+
}
|
|
199
|
+
if (changedProperties.has("required") || changedProperties.has("disabled") || this.shouldUpdateValidity(changedProperties)) {
|
|
200
|
+
this.updateValidity();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Override to specify additional properties that should trigger form value update.
|
|
205
|
+
*/
|
|
206
|
+
shouldUpdateFormValue(_changedProperties) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Override to specify additional properties that should trigger validity update.
|
|
211
|
+
*/
|
|
212
|
+
shouldUpdateValidity(_changedProperties) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
__decorateClass([
|
|
217
|
+
property({ type: String, reflect: true })
|
|
218
|
+
], FormAssociatedClass.prototype, "name", 2);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
property({ type: String })
|
|
221
|
+
], FormAssociatedClass.prototype, "value", 2);
|
|
222
|
+
__decorateClass([
|
|
223
|
+
property({ type: Boolean, reflect: true })
|
|
224
|
+
], FormAssociatedClass.prototype, "disabled", 2);
|
|
225
|
+
__decorateClass([
|
|
226
|
+
property({ type: Boolean, reflect: true })
|
|
227
|
+
], FormAssociatedClass.prototype, "required", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
property({ type: Boolean, attribute: "custom-validation" })
|
|
230
|
+
], FormAssociatedClass.prototype, "customValidation", 2);
|
|
231
|
+
return FormAssociatedClass;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export {
|
|
235
|
+
FormAssociatedMixin
|
|
236
|
+
};
|
|
237
|
+
//# sourceMappingURL=chunk-UM7WRO7W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/base/form-associated.ts"],"sourcesContent":["import type { LitElement } from \"lit\";\nimport type { PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\n/**\n * Validation flags for ElementInternals.setValidity().\n */\nexport interface ValidationFlags {\n /** Element is required but has no value */\n valueMissing?: boolean;\n /** Value doesn't match the expected type */\n typeMismatch?: boolean;\n /** Value doesn't match the pattern attribute */\n patternMismatch?: boolean;\n /** Value exceeds maxlength */\n tooLong?: boolean;\n /** Value is shorter than minlength */\n tooShort?: boolean;\n /** Value exceeds max */\n rangeOverflow?: boolean;\n /** Value is less than min */\n rangeUnderflow?: boolean;\n /** Value doesn't match step */\n stepMismatch?: boolean;\n /** Custom validation failed */\n customError?: boolean;\n /** Value doesn't match any option */\n badInput?: boolean;\n}\n\n/**\n * Type for mixin constructor with any args.\n */\n// biome-ignore lint/suspicious/noExplicitAny: Mixin pattern requires any[] for constructor args\ntype Constructor<T = object> = new (...args: any[]) => T;\n\n/**\n * Interface for form-associated element properties and methods.\n */\nexport interface FormAssociatedInterface {\n name: string;\n value: string;\n disabled: boolean;\n required: boolean;\n customValidation: boolean;\n readonly validity: ValidityState;\n readonly validationMessage: string;\n readonly willValidate: boolean;\n readonly form: HTMLFormElement | null;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(message: string): void;\n}\n\n/**\n * Type for form lifecycle callbacks.\n */\nexport interface FormLifecycleCallbacks {\n formAssociatedCallback?(form: HTMLFormElement | null): void;\n formDisabledCallback?(disabled: boolean): void;\n formResetCallback?(): void;\n formStateRestoreCallback?(\n state: string | File | FormData | null,\n mode: \"restore\" | \"autocomplete\"\n ): void;\n}\n\n/**\n * Combined interface for form-associated elements.\n */\nexport type FormAssociatedElement = FormAssociatedInterface & FormLifecycleCallbacks;\n\n/**\n * Form-associated mixin for Lit elements.\n *\n * Adds ElementInternals-based form participation to any Lit component.\n * Components using this mixin participate in native HTML form submission,\n * validation, and lifecycle callbacks.\n *\n * @example\n * ```typescript\n * import { FormAssociatedMixin } from '../base/form-associated.js';\n * import { DSElement } from '../base/ds-element.js';\n *\n * class DsCheckbox extends FormAssociatedMixin(DSElement) {\n * @property({ type: Boolean }) checked = false;\n *\n * protected getFormValue(): FormData | string | null {\n * return this.checked ? this.value : null;\n * }\n *\n * protected getValidationAnchor(): HTMLElement | undefined {\n * return this.renderRoot.querySelector('.ds-checkbox__control') ?? undefined;\n * }\n * }\n * ```\n */\nexport function FormAssociatedMixin<T extends Constructor<LitElement>>(Base: T) {\n abstract class FormAssociatedClass extends Base implements FormAssociatedInterface {\n /**\n * Required static property for form association.\n * Signals to the browser that this element participates in forms.\n */\n static formAssociated = true;\n\n /**\n * ElementInternals reference for form participation.\n */\n private _internals!: ElementInternals;\n\n /**\n * Default value for form reset.\n */\n private _defaultValue: string | null = null;\n\n /**\n * Form field name, used as the key in FormData.\n */\n @property({ type: String, reflect: true })\n name = \"\";\n\n /**\n * Current value of the control.\n */\n @property({ type: String })\n value = \"\";\n\n /**\n * Whether the control is disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the control is required.\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Opt-in for custom validation UI (ds-field-error) instead of native browser UI.\n */\n @property({ type: Boolean, attribute: \"custom-validation\" })\n customValidation = false;\n\n /**\n * Custom error message set via setCustomValidity().\n */\n private _customValidityMessage = \"\";\n\n // biome-ignore lint/suspicious/noExplicitAny: Mixin pattern requires any[] for constructor args\n constructor(...args: any[]) {\n super(...args);\n this._internals = this.attachInternals();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Store default value for form reset\n this._defaultValue = this.value;\n }\n\n /**\n * Current validity state of the control.\n */\n get validity(): ValidityState {\n return this._internals.validity;\n }\n\n /**\n * Localized message describing the validation error.\n */\n get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n /**\n * Whether the control will be validated when the form is submitted.\n */\n get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /**\n * The form element that this control is associated with.\n */\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /**\n * Check if the control satisfies its constraints.\n * Does not show any UI feedback.\n */\n checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Check validity and show validation UI if invalid.\n * When customValidation is true, emits ds:invalid event instead of native UI.\n */\n reportValidity(): boolean {\n if (this.customValidation) {\n const valid = this._internals.checkValidity();\n if (!valid) {\n this.dispatchEvent(\n new CustomEvent(\"ds:invalid\", {\n detail: { message: this._internals.validationMessage },\n bubbles: true,\n composed: true,\n })\n );\n }\n return valid;\n }\n return this._internals.reportValidity();\n }\n\n /**\n * Set a custom validation message.\n * Empty string clears custom validity.\n */\n setCustomValidity(message: string): void {\n this._customValidityMessage = message;\n if (message) {\n this._internals.setValidity({ customError: true }, message, this.getValidationAnchor());\n } else {\n this.updateValidity();\n }\n }\n\n /**\n * Called when the element is associated with a form.\n */\n formAssociatedCallback(form: HTMLFormElement | null): void {\n // Can be overridden by subclasses\n void form;\n }\n\n /**\n * Called when the element or ancestor fieldset is disabled/enabled.\n */\n formDisabledCallback(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /**\n * Called when the form is reset.\n * Subclasses should override to restore their specific default state.\n */\n formResetCallback(): void {\n this.value = this._defaultValue ?? \"\";\n this._customValidityMessage = \"\";\n this._internals.setFormValue(null);\n this._internals.setValidity({});\n this.onFormReset();\n }\n\n /**\n * Called during form state restoration (navigation, autofill).\n */\n formStateRestoreCallback(\n state: string | File | FormData | null,\n mode: \"restore\" | \"autocomplete\"\n ): void {\n if (typeof state === \"string\") {\n this.value = state;\n }\n this.onFormStateRestore(state, mode);\n }\n\n /**\n * Override in subclass to return the form value.\n * Return null to indicate no value (won't be submitted).\n */\n protected abstract getFormValue(): FormData | string | null;\n\n /**\n * Override in subclass to return the anchor element for validation messages.\n * This is typically the interactive element within the component.\n */\n protected getValidationAnchor(): HTMLElement | undefined {\n return undefined;\n }\n\n /**\n * Override in subclass to return validation flags.\n * Called by updateValidity() to determine validity state.\n */\n protected getValidationFlags(): ValidationFlags {\n return {};\n }\n\n /**\n * Override in subclass to return validation message for current flags.\n */\n protected getValidationMessage(_flags: ValidationFlags): string {\n return \"\";\n }\n\n /**\n * Hook for subclasses to handle form reset.\n */\n protected onFormReset(): void {\n // Override in subclass\n }\n\n /**\n * Hook for subclasses to handle form state restore.\n */\n protected onFormStateRestore(\n _state: string | File | FormData | null,\n _mode: \"restore\" | \"autocomplete\"\n ): void {\n // Override in subclass\n }\n\n /**\n * Updates the form value. Call this when the component's value changes.\n */\n protected updateFormValue(): void {\n const value = this.getFormValue();\n this._internals.setFormValue(value);\n }\n\n /**\n * Updates the validity state. Call this when validation-relevant state changes.\n */\n protected updateValidity(): void {\n // Check for custom validity first\n if (this._customValidityMessage) {\n this._internals.setValidity(\n { customError: true },\n this._customValidityMessage,\n this.getValidationAnchor()\n );\n return;\n }\n\n // Get validation flags from subclass\n const flags = this.getValidationFlags();\n const hasError = Object.values(flags).some(Boolean);\n\n if (hasError) {\n const message = this.getValidationMessage(flags);\n this._internals.setValidity(flags, message, this.getValidationAnchor());\n } else {\n this._internals.setValidity({});\n }\n }\n\n /**\n * Lifecycle hook to sync form value and validity on property changes.\n */\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n // Update form value when value or relevant state changes\n if (changedProperties.has(\"value\") || this.shouldUpdateFormValue(changedProperties)) {\n this.updateFormValue();\n }\n\n // Update validity when validation-relevant properties change\n if (\n changedProperties.has(\"required\") ||\n changedProperties.has(\"disabled\") ||\n this.shouldUpdateValidity(changedProperties)\n ) {\n this.updateValidity();\n }\n }\n\n /**\n * Override to specify additional properties that should trigger form value update.\n */\n protected shouldUpdateFormValue(_changedProperties: PropertyValues): boolean {\n return false;\n }\n\n /**\n * Override to specify additional properties that should trigger validity update.\n */\n protected shouldUpdateValidity(_changedProperties: PropertyValues): boolean {\n return false;\n }\n }\n\n return FormAssociatedClass as unknown as Constructor<FormAssociatedInterface & LitElement> & T & { formAssociated: true };\n}\n"],"mappings":";;;;;AAEA,SAAS,gBAAgB;AA+FlB,SAAS,oBAAuD,MAAS;AAAA,EAC9E,MAAe,4BAA4B,KAAwC;AAAA;AAAA,IAqDjF,eAAe,MAAa;AAC1B,YAAM,GAAG,IAAI;AAvCf;AAAA;AAAA;AAAA,WAAQ,gBAA+B;AAMvC,kBAAO;AAMP,mBAAQ;AAMR,sBAAW;AAMX,sBAAW;AAMX,8BAAmB;AAKnB;AAAA;AAAA;AAAA,WAAQ,yBAAyB;AAK/B,WAAK,aAAa,KAAK,gBAAgB;AAAA,IACzC;AAAA,IAnDA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAO,iBAAiB;AAAA;AAAA,IAqDf,oBAA0B;AACjC,YAAM,kBAAkB;AAExB,WAAK,gBAAgB,KAAK;AAAA,IAC5B;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,WAA0B;AAC5B,aAAO,KAAK,WAAW;AAAA,IACzB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,oBAA4B;AAC9B,aAAO,KAAK,WAAW;AAAA,IACzB;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,eAAwB;AAC1B,aAAO,KAAK,WAAW;AA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;AAAA;AAAA;AAAA,IAKU,sBAAsB,oBAA6C;AAC3E,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKU,qBAAqB,oBAA6C;AAC1E,aAAO;AAAA,IACT;AAAA,EACF;AA3QE;AAAA,IADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,KApB5B,oBAqBb;AAMA;AAAA,IADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,KA1Bb,oBA2Bb;AAMA;AAAA,IADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,KAhC7B,oBAiCb;AAMA;AAAA,IADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,KAtC7B,oBAuCb;AAMA;AAAA,IADC,SAAS,EAAE,MAAM,SAAS,WAAW,oBAAoB,CAAC;AAAA,KA5C9C,oBA6Cb;AAqPF,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DSElement,
|
|
3
|
+
__decorateClass,
|
|
4
|
+
define
|
|
5
|
+
} from "./chunk-H4GJJZ3N.js";
|
|
6
|
+
|
|
7
|
+
// src/components/progress/progress.ts
|
|
8
|
+
import { html, nothing } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
+
var DsProgress = class extends DSElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.max = 100;
|
|
15
|
+
this.variant = "linear";
|
|
16
|
+
this.size = "md";
|
|
17
|
+
this.label = "";
|
|
18
|
+
this.showValue = false;
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [];
|
|
22
|
+
}
|
|
23
|
+
get isIndeterminate() {
|
|
24
|
+
return this.value === void 0 || this.value === null;
|
|
25
|
+
}
|
|
26
|
+
get percentage() {
|
|
27
|
+
if (this.isIndeterminate) return 0;
|
|
28
|
+
return Math.min(100, Math.max(0, (this.value ?? 0) / this.max * 100));
|
|
29
|
+
}
|
|
30
|
+
get valueText() {
|
|
31
|
+
if (this.isIndeterminate) {
|
|
32
|
+
return this.label || "Loading...";
|
|
33
|
+
}
|
|
34
|
+
return `${Math.round(this.percentage)}% complete`;
|
|
35
|
+
}
|
|
36
|
+
renderLinear() {
|
|
37
|
+
const classes = {
|
|
38
|
+
"ds-progress": true
|
|
39
|
+
};
|
|
40
|
+
return html`
|
|
41
|
+
<div
|
|
42
|
+
part="track"
|
|
43
|
+
class=${classMap(classes)}
|
|
44
|
+
role="progressbar"
|
|
45
|
+
aria-valuenow=${this.isIndeterminate ? nothing : this.value}
|
|
46
|
+
aria-valuemin="0"
|
|
47
|
+
aria-valuemax=${this.max}
|
|
48
|
+
aria-valuetext=${this.valueText}
|
|
49
|
+
aria-label=${this.label || nothing}
|
|
50
|
+
?aria-busy=${this.isIndeterminate}
|
|
51
|
+
data-size=${this.size}
|
|
52
|
+
?data-indeterminate=${this.isIndeterminate}
|
|
53
|
+
>
|
|
54
|
+
<div
|
|
55
|
+
part="bar"
|
|
56
|
+
class="ds-progress__bar"
|
|
57
|
+
style=${this.isIndeterminate ? "" : `width: ${this.percentage}%`}
|
|
58
|
+
></div>
|
|
59
|
+
${this.label ? html`<span part="label" class="ds-progress__label">${this.label}</span>` : nothing}
|
|
60
|
+
</div>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
renderCircular() {
|
|
64
|
+
const size = this.size === "sm" ? 24 : this.size === "lg" ? 64 : 40;
|
|
65
|
+
const strokeWidth = this.size === "sm" ? 3 : this.size === "lg" ? 6 : 4;
|
|
66
|
+
const radius = (size - strokeWidth) / 2;
|
|
67
|
+
const circumference = 2 * Math.PI * radius;
|
|
68
|
+
const offset = circumference - this.percentage / 100 * circumference;
|
|
69
|
+
const classes = {
|
|
70
|
+
"ds-progress-circular": true
|
|
71
|
+
};
|
|
72
|
+
return html`
|
|
73
|
+
<div
|
|
74
|
+
class=${classMap(classes)}
|
|
75
|
+
role="progressbar"
|
|
76
|
+
aria-valuenow=${this.isIndeterminate ? nothing : this.value}
|
|
77
|
+
aria-valuemin="0"
|
|
78
|
+
aria-valuemax=${this.max}
|
|
79
|
+
aria-valuetext=${this.valueText}
|
|
80
|
+
aria-label=${this.label || nothing}
|
|
81
|
+
?aria-busy=${this.isIndeterminate}
|
|
82
|
+
data-size=${this.size}
|
|
83
|
+
?data-indeterminate=${this.isIndeterminate}
|
|
84
|
+
>
|
|
85
|
+
<svg class="ds-progress-circular__svg" viewBox="0 0 ${size} ${size}">
|
|
86
|
+
<circle
|
|
87
|
+
class="ds-progress-circular__track"
|
|
88
|
+
cx=${size / 2}
|
|
89
|
+
cy=${size / 2}
|
|
90
|
+
r=${radius}
|
|
91
|
+
/>
|
|
92
|
+
<circle
|
|
93
|
+
class="ds-progress-circular__fill"
|
|
94
|
+
cx=${size / 2}
|
|
95
|
+
cy=${size / 2}
|
|
96
|
+
r=${radius}
|
|
97
|
+
stroke-dasharray=${circumference}
|
|
98
|
+
stroke-dashoffset=${this.isIndeterminate ? 0 : offset}
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
${this.showValue && !this.isIndeterminate ? html`<span class="ds-progress-circular__label">${Math.round(this.percentage)}%</span>` : nothing}
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
return this.variant === "circular" ? this.renderCircular() : this.renderLinear();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
__decorateClass([
|
|
110
|
+
property({ type: Number })
|
|
111
|
+
], DsProgress.prototype, "value", 2);
|
|
112
|
+
__decorateClass([
|
|
113
|
+
property({ type: Number })
|
|
114
|
+
], DsProgress.prototype, "max", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
property({ type: String, reflect: true })
|
|
117
|
+
], DsProgress.prototype, "variant", 2);
|
|
118
|
+
__decorateClass([
|
|
119
|
+
property({ type: String, reflect: true })
|
|
120
|
+
], DsProgress.prototype, "size", 2);
|
|
121
|
+
__decorateClass([
|
|
122
|
+
property({ type: String })
|
|
123
|
+
], DsProgress.prototype, "label", 2);
|
|
124
|
+
__decorateClass([
|
|
125
|
+
property({ type: Boolean, attribute: "show-value" })
|
|
126
|
+
], DsProgress.prototype, "showValue", 2);
|
|
127
|
+
define("ds-progress", DsProgress);
|
|
128
|
+
|
|
129
|
+
// src/components/skeleton/skeleton.ts
|
|
130
|
+
import { html as html2, nothing as nothing2 } from "lit";
|
|
131
|
+
import { property as property2 } from "lit/decorators.js";
|
|
132
|
+
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
133
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
134
|
+
var DsSkeleton = class extends DSElement {
|
|
135
|
+
constructor() {
|
|
136
|
+
super(...arguments);
|
|
137
|
+
this.variant = "text";
|
|
138
|
+
this.customWidth = "";
|
|
139
|
+
this.customHeight = "";
|
|
140
|
+
this.animation = "wave";
|
|
141
|
+
this.label = "Loading...";
|
|
142
|
+
}
|
|
143
|
+
static {
|
|
144
|
+
this.styles = [];
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
const classes = {
|
|
148
|
+
"ds-skeleton": true
|
|
149
|
+
};
|
|
150
|
+
const styles = {};
|
|
151
|
+
if (this.customWidth) {
|
|
152
|
+
styles.width = this.customWidth;
|
|
153
|
+
}
|
|
154
|
+
if (this.customHeight) {
|
|
155
|
+
styles.height = this.customHeight;
|
|
156
|
+
}
|
|
157
|
+
return html2`
|
|
158
|
+
<div
|
|
159
|
+
class=${classMap2(classes)}
|
|
160
|
+
role="status"
|
|
161
|
+
aria-busy="true"
|
|
162
|
+
aria-label=${this.label}
|
|
163
|
+
data-variant=${this.variant}
|
|
164
|
+
data-size=${this.size || nothing2}
|
|
165
|
+
data-width=${!this.customWidth && this.width ? this.width : nothing2}
|
|
166
|
+
data-animation=${this.animation}
|
|
167
|
+
?data-no-animation=${this.animation === "none"}
|
|
168
|
+
style=${Object.keys(styles).length > 0 ? styleMap(styles) : nothing2}
|
|
169
|
+
>
|
|
170
|
+
<span class="ds-visually-hidden">${this.label}</span>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
__decorateClass([
|
|
176
|
+
property2({ type: String, reflect: true })
|
|
177
|
+
], DsSkeleton.prototype, "variant", 2);
|
|
178
|
+
__decorateClass([
|
|
179
|
+
property2({ type: String, reflect: true })
|
|
180
|
+
], DsSkeleton.prototype, "size", 2);
|
|
181
|
+
__decorateClass([
|
|
182
|
+
property2({ type: String, reflect: true })
|
|
183
|
+
], DsSkeleton.prototype, "width", 2);
|
|
184
|
+
__decorateClass([
|
|
185
|
+
property2({ type: String, attribute: "custom-width" })
|
|
186
|
+
], DsSkeleton.prototype, "customWidth", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
property2({ type: String, attribute: "custom-height" })
|
|
189
|
+
], DsSkeleton.prototype, "customHeight", 2);
|
|
190
|
+
__decorateClass([
|
|
191
|
+
property2({ type: String, reflect: true })
|
|
192
|
+
], DsSkeleton.prototype, "animation", 2);
|
|
193
|
+
__decorateClass([
|
|
194
|
+
property2({ type: String })
|
|
195
|
+
], DsSkeleton.prototype, "label", 2);
|
|
196
|
+
define("ds-skeleton", DsSkeleton);
|
|
197
|
+
|
|
198
|
+
export {
|
|
199
|
+
DsProgress,
|
|
200
|
+
DsSkeleton
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=chunk-VPXL4RB3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/progress/progress.ts","../src/components/skeleton/skeleton.ts"],"sourcesContent":["import { type TemplateResult, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { DSElement } from \"../../base/ds-element.js\";\nimport { define } from \"../../registry/define.js\";\n\nexport type ProgressVariant = \"linear\" | \"circular\";\nexport type ProgressSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Progress indicator component.\n *\n * @element ds-progress\n *\n * @csspart track - The progress track\n * @csspart bar - The progress bar/fill\n * @csspart label - The accessible label\n *\n * @cssprop --ds-progress-track - Track background color\n * @cssprop --ds-progress-fill - Fill/indicator color\n * @cssprop --ds-progress-height - Track height (linear)\n */\nexport class DsProgress extends DSElement {\n static override styles = [];\n\n /**\n * Current progress value (0-100). Omit for indeterminate.\n */\n @property({ type: Number })\n value?: number;\n\n /**\n * Maximum value.\n */\n @property({ type: Number })\n max = 100;\n\n /**\n * Visual variant.\n */\n @property({ type: String, reflect: true })\n variant: ProgressVariant = \"linear\";\n\n /**\n * Size variant.\n */\n @property({ type: String, reflect: true })\n size: ProgressSize = \"md\";\n\n /**\n * Accessible label.\n */\n @property({ type: String })\n label = \"\";\n\n /**\n * Show value as percentage text (circular only).\n */\n @property({ type: Boolean, attribute: \"show-value\" })\n showValue = false;\n\n private get isIndeterminate(): boolean {\n return this.value === undefined || this.value === null;\n }\n\n private get percentage(): number {\n if (this.isIndeterminate) return 0;\n return Math.min(100, Math.max(0, ((this.value ?? 0) / this.max) * 100));\n }\n\n private get valueText(): string {\n if (this.isIndeterminate) {\n return this.label || \"Loading...\";\n }\n return `${Math.round(this.percentage)}% complete`;\n }\n\n private renderLinear(): TemplateResult {\n const classes = {\n \"ds-progress\": true,\n };\n\n return html`\n <div\n part=\"track\"\n class=${classMap(classes)}\n role=\"progressbar\"\n aria-valuenow=${this.isIndeterminate ? nothing : this.value}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n aria-valuetext=${this.valueText}\n aria-label=${this.label || nothing}\n ?aria-busy=${this.isIndeterminate}\n data-size=${this.size}\n ?data-indeterminate=${this.isIndeterminate}\n >\n <div\n part=\"bar\"\n class=\"ds-progress__bar\"\n style=${this.isIndeterminate ? \"\" : `width: ${this.percentage}%`}\n ></div>\n ${\n this.label\n ? html`<span part=\"label\" class=\"ds-progress__label\">${this.label}</span>`\n : nothing\n }\n </div>\n `;\n }\n\n private renderCircular(): TemplateResult {\n // SVG circle calculations\n const size = this.size === \"sm\" ? 24 : this.size === \"lg\" ? 64 : 40;\n const strokeWidth = this.size === \"sm\" ? 3 : this.size === \"lg\" ? 6 : 4;\n const radius = (size - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const offset = circumference - (this.percentage / 100) * circumference;\n\n const classes = {\n \"ds-progress-circular\": true,\n };\n\n return html`\n <div\n class=${classMap(classes)}\n role=\"progressbar\"\n aria-valuenow=${this.isIndeterminate ? nothing : this.value}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n aria-valuetext=${this.valueText}\n aria-label=${this.label || nothing}\n ?aria-busy=${this.isIndeterminate}\n data-size=${this.size}\n ?data-indeterminate=${this.isIndeterminate}\n >\n <svg class=\"ds-progress-circular__svg\" viewBox=\"0 0 ${size} ${size}\">\n <circle\n class=\"ds-progress-circular__track\"\n cx=${size / 2}\n cy=${size / 2}\n r=${radius}\n />\n <circle\n class=\"ds-progress-circular__fill\"\n cx=${size / 2}\n cy=${size / 2}\n r=${radius}\n stroke-dasharray=${circumference}\n stroke-dashoffset=${this.isIndeterminate ? 0 : offset}\n />\n </svg>\n ${\n this.showValue && !this.isIndeterminate\n ? html`<span class=\"ds-progress-circular__label\">${Math.round(this.percentage)}%</span>`\n : nothing\n }\n </div>\n `;\n }\n\n override render(): TemplateResult {\n return this.variant === \"circular\" ? this.renderCircular() : this.renderLinear();\n }\n}\n\n// Register the component\ndefine(\"ds-progress\", DsProgress);\n\n// TypeScript declaration for HTML\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ds-progress\": DsProgress;\n }\n}\n","import { type TemplateResult, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { DSElement } from \"../../base/ds-element.js\";\nimport { define } from \"../../registry/define.js\";\n\nexport type SkeletonVariant = \"text\" | \"circular\" | \"rectangular\" | \"rounded\";\nexport type SkeletonSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SkeletonWidth = \"full\" | \"3/4\" | \"1/2\" | \"1/4\";\nexport type SkeletonAnimation = \"wave\" | \"pulse\" | \"none\";\n\n/**\n * Skeleton loading placeholder component.\n *\n * @element ds-skeleton\n *\n * @cssprop --ds-skeleton-bg - Background color\n * @cssprop --ds-skeleton-highlight - Shimmer highlight color\n * @cssprop --ds-skeleton-radius - Border radius\n */\nexport class DsSkeleton extends DSElement {\n static override styles = [];\n\n /**\n * Shape variant.\n */\n @property({ type: String, reflect: true })\n variant: SkeletonVariant = \"text\";\n\n /**\n * Size preset for height.\n */\n @property({ type: String, reflect: true })\n size?: SkeletonSize;\n\n /**\n * Width preset.\n */\n @property({ type: String, reflect: true })\n width?: SkeletonWidth;\n\n /**\n * Custom width (CSS value).\n */\n @property({ type: String, attribute: \"custom-width\" })\n customWidth = \"\";\n\n /**\n * Custom height (CSS value).\n */\n @property({ type: String, attribute: \"custom-height\" })\n customHeight = \"\";\n\n /**\n * Animation type.\n */\n @property({ type: String, reflect: true })\n animation: SkeletonAnimation = \"wave\";\n\n /**\n * Accessible label for screen readers.\n */\n @property({ type: String })\n label = \"Loading...\";\n\n override render(): TemplateResult {\n const classes = {\n \"ds-skeleton\": true,\n };\n\n const styles: Record<string, string> = {};\n if (this.customWidth) {\n styles.width = this.customWidth;\n }\n if (this.customHeight) {\n styles.height = this.customHeight;\n }\n\n return html`\n <div\n class=${classMap(classes)}\n role=\"status\"\n aria-busy=\"true\"\n aria-label=${this.label}\n data-variant=${this.variant}\n data-size=${this.size || nothing}\n data-width=${!this.customWidth && this.width ? this.width : nothing}\n data-animation=${this.animation}\n ?data-no-animation=${this.animation === \"none\"}\n style=${Object.keys(styles).length > 0 ? styleMap(styles) : nothing}\n >\n <span class=\"ds-visually-hidden\">${this.label}</span>\n </div>\n `;\n }\n}\n\n// Register the component\ndefine(\"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