aeico-components 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/chunks/action-button.cjs +2 -2
- package/dist/chunks/action-button.js +2 -2
- package/dist/chunks/alert.cjs +22 -28
- package/dist/chunks/alert.cjs.map +1 -1
- package/dist/chunks/alert.js +22 -28
- package/dist/chunks/alert.js.map +1 -1
- package/dist/chunks/badge.cjs +1 -1
- package/dist/chunks/badge.js +1 -1
- package/dist/chunks/breadcrumb-item.cjs +7 -7
- package/dist/chunks/breadcrumb-item.js +7 -7
- package/dist/chunks/button.cjs +39 -50
- package/dist/chunks/button.cjs.map +1 -1
- package/dist/chunks/button.js +39 -50
- package/dist/chunks/button.js.map +1 -1
- package/dist/chunks/card.cjs +1 -1
- package/dist/chunks/card.js +1 -1
- package/dist/chunks/checkbox.cjs +1 -1
- package/dist/chunks/checkbox.js +1 -1
- package/dist/chunks/color.cjs +1 -1
- package/dist/chunks/color.js +1 -1
- package/dist/chunks/copy-button.cjs +7 -4
- package/dist/chunks/copy-button.cjs.map +1 -1
- package/dist/chunks/copy-button.js +7 -4
- package/dist/chunks/copy-button.js.map +1 -1
- package/dist/chunks/detail-group.cjs +65 -0
- package/dist/chunks/detail-group.cjs.map +1 -0
- package/dist/chunks/detail-group.js +66 -0
- package/dist/chunks/detail-group.js.map +1 -0
- package/dist/chunks/detail.cjs +1 -1
- package/dist/chunks/detail.js +1 -1
- package/dist/chunks/dialog.cjs +1 -1
- package/dist/chunks/dialog.js +1 -1
- package/dist/chunks/divider.cjs +1 -1
- package/dist/chunks/divider.js +1 -1
- package/dist/chunks/drawer.cjs +1 -1
- package/dist/chunks/drawer.js +1 -1
- package/dist/chunks/dropdown-button.cjs +8 -9
- package/dist/chunks/dropdown-button.cjs.map +1 -1
- package/dist/chunks/dropdown-button.js +11 -12
- package/dist/chunks/dropdown-button.js.map +1 -1
- package/dist/chunks/icon.cjs +27 -11
- package/dist/chunks/icon.cjs.map +1 -1
- package/dist/chunks/icon.js +27 -11
- package/dist/chunks/icon.js.map +1 -1
- package/dist/chunks/menu.cjs +1 -1
- package/dist/chunks/menu.js +1 -1
- package/dist/chunks/navbar.cjs +1 -1
- package/dist/chunks/navbar.js +1 -1
- package/dist/chunks/number-input.cjs +110 -0
- package/dist/chunks/number-input.cjs.map +1 -0
- package/dist/chunks/number-input.js +111 -0
- package/dist/chunks/number-input.js.map +1 -0
- package/dist/chunks/pagination.cjs +31 -31
- package/dist/chunks/pagination.js +31 -31
- package/dist/chunks/progress-bar.cjs +1 -1
- package/dist/chunks/progress-bar.js +1 -1
- package/dist/chunks/radio.cjs +1 -1
- package/dist/chunks/radio.js +1 -1
- package/dist/chunks/select.cjs +1 -1
- package/dist/chunks/select.js +1 -1
- package/dist/chunks/size.cjs +1 -1
- package/dist/chunks/size.js +1 -1
- package/dist/chunks/slider.cjs +26 -29
- package/dist/chunks/slider.cjs.map +1 -1
- package/dist/chunks/slider.js +26 -29
- package/dist/chunks/slider.js.map +1 -1
- package/dist/chunks/spinner.cjs +1 -1
- package/dist/chunks/spinner.js +1 -1
- package/dist/chunks/switch.cjs +1 -1
- package/dist/chunks/switch.js +1 -1
- package/dist/chunks/tab-panel.cjs +12 -3
- package/dist/chunks/tab-panel.cjs.map +1 -1
- package/dist/chunks/tab-panel.js +12 -3
- package/dist/chunks/tab-panel.js.map +1 -1
- package/dist/chunks/tag.cjs +1 -1
- package/dist/chunks/tag.js +1 -1
- package/dist/chunks/text-input.cjs +1 -1
- package/dist/chunks/text-input.js +1 -1
- package/dist/chunks/textarea.cjs +1 -1
- package/dist/chunks/textarea.js +1 -1
- package/dist/chunks/tooltip.cjs +4 -5
- package/dist/chunks/tooltip.cjs.map +1 -1
- package/dist/chunks/tooltip.js +4 -5
- package/dist/chunks/tooltip.js.map +1 -1
- package/dist/chunks/tree.cjs +1 -1
- package/dist/chunks/tree.js +1 -1
- package/dist/chunks/variables.cjs +271 -247
- package/dist/chunks/variables.cjs.map +1 -1
- package/dist/chunks/variables.js +271 -247
- package/dist/chunks/variables.js.map +1 -1
- package/dist/detail-group.cjs +6 -0
- package/dist/detail-group.cjs.map +1 -0
- package/dist/detail-group.js +6 -0
- package/dist/detail-group.js.map +1 -0
- package/dist/dropdown.js +4 -4
- package/dist/index.cjs +4 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -172
- package/dist/index.js.map +1 -1
- package/dist/number-input.cjs +6 -0
- package/dist/number-input.cjs.map +1 -0
- package/dist/number-input.js +6 -0
- package/dist/number-input.js.map +1 -0
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/types/card/defines.d.ts +1 -1
- package/dist/types/detail/defines.d.ts +1 -1
- package/dist/types/icon/defines.d.ts +5 -1
- package/dist/types/icon/index.d.ts +1 -1
- package/dist/types/tabs/defines.d.ts +1 -0
- package/dist/types/tabs/tabs.d.ts +3 -0
- package/package.json +1 -1
- package/src/card/defines.ts +1 -1
- package/src/copy-button/copy-button.ts +9 -5
- package/src/detail/defines.ts +1 -1
- package/src/icon/defines.ts +6 -1
- package/src/icon/icon.ts +28 -10
- package/src/icon/index.ts +1 -1
- package/src/icon/registry.ts +2 -2
- package/src/styles/color.css +91 -91
- package/src/styles/components/action-button.css +12 -12
- package/src/styles/components/alert.css +22 -28
- package/src/styles/components/badge.css +13 -20
- package/src/styles/components/breadcrumb-item.css +7 -7
- package/src/styles/components/button.css +39 -50
- package/src/styles/components/card.css +45 -30
- package/src/styles/components/checkbox.css +6 -11
- package/src/styles/components/copy-button.css +22 -33
- package/src/styles/components/detail.css +51 -39
- package/src/styles/components/dialog.css +11 -11
- package/src/styles/components/divider.css +3 -3
- package/src/styles/components/drawer.css +14 -23
- package/src/styles/components/dropdown-item.css +7 -8
- package/src/styles/components/dropdown.css +3 -4
- package/src/styles/components/field-label.css +12 -12
- package/src/styles/components/icon-button.css +25 -36
- package/src/styles/components/icon.css +1 -1
- package/src/styles/components/menu-item.css +7 -8
- package/src/styles/components/navbar.css +16 -16
- package/src/styles/components/number-input.css +27 -36
- package/src/styles/components/pagination.css +31 -31
- package/src/styles/components/progress-bar.css +2 -3
- package/src/styles/components/radio-group.css +69 -83
- package/src/styles/components/select-option.css +5 -5
- package/src/styles/components/select.css +21 -33
- package/src/styles/components/slider.css +26 -29
- package/src/styles/components/spinner.css +7 -9
- package/src/styles/components/switch.css +5 -17
- package/src/styles/components/tab.css +4 -5
- package/src/styles/components/tabs.css +48 -1
- package/src/styles/components/tag.css +14 -21
- package/src/styles/components/text-input.css +13 -22
- package/src/styles/components/textarea.css +12 -21
- package/src/styles/components/tooltip.css +4 -5
- package/src/styles/components/tree-item.css +12 -12
- package/src/styles/radius.css +10 -0
- package/src/styles/size.css +7 -7
- package/src/styles/variables.css +271 -247
- package/src/tabs/defines.ts +1 -0
- package/src/tabs/tabs.ts +12 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
const actionButton = require("./action-button.cjs");
|
|
6
|
+
const aeico = require("aeico");
|
|
7
|
+
const variables = require("./variables.cjs");
|
|
8
|
+
const size = require("./size.cjs");
|
|
9
|
+
const style = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--ae-size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--ae-border-subtle);\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n background: var(--ae-surface-base);\n color: var(--ae-color-text-muted);\n transition: var(--input-transition);\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\n/* Hide number spinner arrows in WebKit browsers */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput::placeholder {\n color: var(--ae-color-text-disabled);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--ae-border-focus);\n background: var(--ae-surface-raised);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--ae-border-default);\n background: var(--ae-surface-raised);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Number stepper controls (right side, integrated, horizontal) */\n.number-controls {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n border: var(--input-border-width) solid var(--ae-border-subtle);\n border-radius: 0 var(--ae-border-radius, var(--ae-radius-xs)) var(--ae-border-radius, var(--ae-radius-xs)) 0;\n overflow: hidden;\n flex-shrink: 0;\n transition: var(--input-transition);\n background: var(--ae-surface-base);\n position: relative;\n z-index: 1;\n align-self: stretch;\n}\n\n.number-btn {\n border: none;\n background: transparent;\n color: var(--ae-color-text-muted);\n font-size: 0.875em;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 0.5em;\n transition: background 0.12s;\n}\n\n.number-btn:hover:not(:disabled) {\n background: var(--ae-surface-raised);\n}\n\n.number-btn:active:not(:disabled) {\n background: var(--ae-surface-raised);\n}\n\n.number-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.number-btn-increment {\n border-right: var(--input-border-width) solid var(--ae-border-subtle);\n}\n\n.input-container:has(input:focus) .number-controls {\n border-color: var(--ae-border-focus);\n}\n\n.input-container:has(input:hover:not(:focus)) .number-controls {\n border-color: var(--ae-border-default);\n}\n\n:host(:has(.number-controls)) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n:host(:has(.action-controls)) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.number-controls ~ .action-controls {\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n}\n\n.input-container:has(.number-controls):has(.action-controls) .number-controls {\n border-right: none;\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.number-controls) ~ .action-controls,\n.input-container:has(.action-controls) .number-controls {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.number-controls) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.action-controls) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n:host([error]) input {\n border-color: var(--field-error-color, var(--ae-red));\n}\n\n:host([error]) input:hover:not(:focus),\n:host([error]) input:focus {\n border-color: var(--field-error-color, var(--ae-red));\n}\n";
|
|
10
|
+
class NumberInput extends actionButton.AeicoField {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
__publicField(this, "fieldElement", null);
|
|
14
|
+
__publicField(this, "boundOnIncrement", () => {
|
|
15
|
+
const current = this.getValue() || 0;
|
|
16
|
+
const step = this.step ?? 1;
|
|
17
|
+
let next = current + step;
|
|
18
|
+
if (this.max != null && next > this.max) {
|
|
19
|
+
next = this.max;
|
|
20
|
+
}
|
|
21
|
+
this.setValue(next, { silent: false, action: "change" });
|
|
22
|
+
});
|
|
23
|
+
__publicField(this, "boundOnDecrement", () => {
|
|
24
|
+
const current = this.getValue() || 0;
|
|
25
|
+
const step = this.step ?? 1;
|
|
26
|
+
let next = current - step;
|
|
27
|
+
if (this.min != null && next < this.min) {
|
|
28
|
+
next = this.min;
|
|
29
|
+
}
|
|
30
|
+
this.setValue(next, { silent: false, action: "change" });
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return aeico.html(({ div, input, button }) => {
|
|
35
|
+
const id = this.getFieldId();
|
|
36
|
+
this.renderLabel(id);
|
|
37
|
+
div({ className: "input-container field-body" }, () => {
|
|
38
|
+
this.fieldElement = input({
|
|
39
|
+
id,
|
|
40
|
+
type: "number",
|
|
41
|
+
placeholder: this.placeholder || "",
|
|
42
|
+
required: Boolean(this.required),
|
|
43
|
+
disabled: Boolean(this.disabled),
|
|
44
|
+
min: this.min != null ? String(this.min) : void 0,
|
|
45
|
+
max: this.max != null ? String(this.max) : void 0,
|
|
46
|
+
step: this.step != null ? String(this.step) : void 0,
|
|
47
|
+
"@input": this.boundOnChange
|
|
48
|
+
});
|
|
49
|
+
if (this.controls) {
|
|
50
|
+
div({ className: "number-controls" }, () => {
|
|
51
|
+
button({
|
|
52
|
+
className: "number-btn number-btn-increment",
|
|
53
|
+
textContent: "+",
|
|
54
|
+
disabled: Boolean(this.disabled),
|
|
55
|
+
"@click": this.boundOnIncrement
|
|
56
|
+
});
|
|
57
|
+
button({
|
|
58
|
+
className: "number-btn number-btn-decrement",
|
|
59
|
+
textContent: "-",
|
|
60
|
+
disabled: Boolean(this.disabled),
|
|
61
|
+
"@click": this.boundOnDecrement
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
this.renderActionButtons();
|
|
66
|
+
});
|
|
67
|
+
this.renderHelperText();
|
|
68
|
+
this.renderError();
|
|
69
|
+
if (this.fieldElement && this.value != null) {
|
|
70
|
+
this.fieldElement.value = String(this.value);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get current value as number
|
|
76
|
+
*/
|
|
77
|
+
getValue() {
|
|
78
|
+
if (!this.fieldElement) return 0;
|
|
79
|
+
const val = this.fieldElement.value;
|
|
80
|
+
if (val === "") return 0;
|
|
81
|
+
const num = parseFloat(val);
|
|
82
|
+
return isNaN(num) ? 0 : num;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Write value to the input element (DOM only)
|
|
86
|
+
*/
|
|
87
|
+
writeValue(value) {
|
|
88
|
+
if (this.fieldElement) {
|
|
89
|
+
this.fieldElement.value = value != null ? String(value) : "";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get event payload for change events
|
|
94
|
+
*/
|
|
95
|
+
getEventPayload(value, oldValue, action) {
|
|
96
|
+
return { value, oldValue, action };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
__publicField(NumberInput, "tagName", "number-input");
|
|
100
|
+
__publicField(NumberInput, "props", {
|
|
101
|
+
placeholder: { type: String },
|
|
102
|
+
min: { type: Number },
|
|
103
|
+
max: { type: Number },
|
|
104
|
+
step: { type: Number },
|
|
105
|
+
controls: { type: Boolean }
|
|
106
|
+
});
|
|
107
|
+
__publicField(NumberInput, "styles", [variables.variables, size.sizeCSS, actionButton.fieldLabelCSS, actionButton.actionButtonCSS, style]);
|
|
108
|
+
NumberInput.register();
|
|
109
|
+
exports.NumberInput = NumberInput;
|
|
110
|
+
//# sourceMappingURL=number-input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-input.cjs","sources":["../../src/number-input/number-input.ts"],"sourcesContent":["import AeicoField from '../aeico-field';\nimport type { InferProps, Props } from 'aeico';\nimport { html } from 'aeico';\nimport variables from '../styles/variables.css?inline';\nimport sizeCSS from '../styles/size.css?inline';\nimport fieldLabelCSS from '../styles/components/field-label.css?inline';\nimport actionButtonCSS from '../styles/components/action-button.css?inline';\nimport style from '../styles/components/number-input.css?inline';\n\nclass NumberInput extends AeicoField<number> {\n protected fieldElement: HTMLInputElement | null = null;\n\n static tagName = 'number-input';\n\n static props: Props = {\n placeholder: { type: String },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n controls: { type: Boolean },\n };\n\n declare placeholder?: string;\n declare min?: number;\n declare max?: number;\n declare step?: number;\n declare controls?: boolean;\n\n protected static styles = [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style];\n\n render() {\n return html(({ div, input, button }) => {\n const id = this.getFieldId();\n this.renderLabel(id);\n div({ className: 'input-container field-body' }, () => {\n this.fieldElement = input({\n id,\n type: 'number',\n placeholder: this.placeholder || '',\n required: Boolean(this.required),\n disabled: Boolean(this.disabled),\n min: this.min != null ? String(this.min) : undefined,\n max: this.max != null ? String(this.max) : undefined,\n step: this.step != null ? String(this.step) : undefined,\n '@input': this.boundOnChange,\n });\n\n if (this.controls) {\n div({ className: 'number-controls' }, () => {\n button({\n className: 'number-btn number-btn-increment',\n textContent: '+',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnIncrement,\n });\n button({\n className: 'number-btn number-btn-decrement',\n textContent: '-',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnDecrement,\n });\n });\n }\n\n this.renderActionButtons();\n });\n this.renderHelperText();\n this.renderError();\n\n if (this.fieldElement && this.value != null) {\n this.fieldElement.value = String(this.value);\n }\n });\n }\n\n protected readonly boundOnIncrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current + step;\n if (this.max != null && next > this.max) {\n next = this.max;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n protected readonly boundOnDecrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current - step;\n if (this.min != null && next < this.min) {\n next = this.min;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n /**\n * Get current value as number\n */\n protected getValue(): number {\n if (!this.fieldElement) return 0;\n const val = this.fieldElement.value;\n if (val === '') return 0;\n const num = parseFloat(val);\n return isNaN(num) ? 0 : num;\n }\n\n /**\n * Write value to the input element (DOM only)\n */\n protected writeValue(value: number): void {\n if (this.fieldElement) {\n this.fieldElement.value = value != null ? String(value) : '';\n }\n }\n\n /**\n * Get event payload for change events\n */\n protected getEventPayload(\n value: number,\n oldValue: number,\n action: import('../aeico-field').FieldAction,\n ): Record<string, unknown> {\n return { value, oldValue, action };\n }\n}\n\nNumberInput.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-number-input': NumberInput;\n }\n}\n\nexport default NumberInput;\nexport type NumberInputProps = InferProps<typeof NumberInput>;\n"],"names":["AeicoField","html","variables","sizeCSS","fieldLabelCSS","actionButtonCSS"],"mappings":"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"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { A as AeicoField, f as fieldLabelCSS, a as actionButtonCSS } from "./action-button.js";
|
|
5
|
+
import { html } from "aeico";
|
|
6
|
+
import { v as variables } from "./variables.js";
|
|
7
|
+
import { s as sizeCSS } from "./size.js";
|
|
8
|
+
const style = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--ae-size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--ae-border-subtle);\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n background: var(--ae-surface-base);\n color: var(--ae-color-text-muted);\n transition: var(--input-transition);\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\n/* Hide number spinner arrows in WebKit browsers */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput::placeholder {\n color: var(--ae-color-text-disabled);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--ae-border-focus);\n background: var(--ae-surface-raised);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--ae-border-default);\n background: var(--ae-surface-raised);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Number stepper controls (right side, integrated, horizontal) */\n.number-controls {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n border: var(--input-border-width) solid var(--ae-border-subtle);\n border-radius: 0 var(--ae-border-radius, var(--ae-radius-xs)) var(--ae-border-radius, var(--ae-radius-xs)) 0;\n overflow: hidden;\n flex-shrink: 0;\n transition: var(--input-transition);\n background: var(--ae-surface-base);\n position: relative;\n z-index: 1;\n align-self: stretch;\n}\n\n.number-btn {\n border: none;\n background: transparent;\n color: var(--ae-color-text-muted);\n font-size: 0.875em;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 0.5em;\n transition: background 0.12s;\n}\n\n.number-btn:hover:not(:disabled) {\n background: var(--ae-surface-raised);\n}\n\n.number-btn:active:not(:disabled) {\n background: var(--ae-surface-raised);\n}\n\n.number-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.number-btn-increment {\n border-right: var(--input-border-width) solid var(--ae-border-subtle);\n}\n\n.input-container:has(input:focus) .number-controls {\n border-color: var(--ae-border-focus);\n}\n\n.input-container:has(input:hover:not(:focus)) .number-controls {\n border-color: var(--ae-border-default);\n}\n\n:host(:has(.number-controls)) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n:host(:has(.action-controls)) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.number-controls ~ .action-controls {\n margin-left: calc(-1 * var(--input-field-gap) - 1px);\n}\n\n.input-container:has(.number-controls):has(.action-controls) .number-controls {\n border-right: none;\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.number-controls) ~ .action-controls,\n.input-container:has(.action-controls) .number-controls {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.number-controls) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n.input-container:has(.action-controls) input {\n border-radius: var(--ae-border-radius, var(--ae-radius-xs)) 0 0 var(--ae-border-radius, var(--ae-radius-xs));\n}\n\n:host([error]) input {\n border-color: var(--field-error-color, var(--ae-red));\n}\n\n:host([error]) input:hover:not(:focus),\n:host([error]) input:focus {\n border-color: var(--field-error-color, var(--ae-red));\n}\n";
|
|
9
|
+
class NumberInput extends AeicoField {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
__publicField(this, "fieldElement", null);
|
|
13
|
+
__publicField(this, "boundOnIncrement", () => {
|
|
14
|
+
const current = this.getValue() || 0;
|
|
15
|
+
const step = this.step ?? 1;
|
|
16
|
+
let next = current + step;
|
|
17
|
+
if (this.max != null && next > this.max) {
|
|
18
|
+
next = this.max;
|
|
19
|
+
}
|
|
20
|
+
this.setValue(next, { silent: false, action: "change" });
|
|
21
|
+
});
|
|
22
|
+
__publicField(this, "boundOnDecrement", () => {
|
|
23
|
+
const current = this.getValue() || 0;
|
|
24
|
+
const step = this.step ?? 1;
|
|
25
|
+
let next = current - step;
|
|
26
|
+
if (this.min != null && next < this.min) {
|
|
27
|
+
next = this.min;
|
|
28
|
+
}
|
|
29
|
+
this.setValue(next, { silent: false, action: "change" });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return html(({ div, input, button }) => {
|
|
34
|
+
const id = this.getFieldId();
|
|
35
|
+
this.renderLabel(id);
|
|
36
|
+
div({ className: "input-container field-body" }, () => {
|
|
37
|
+
this.fieldElement = input({
|
|
38
|
+
id,
|
|
39
|
+
type: "number",
|
|
40
|
+
placeholder: this.placeholder || "",
|
|
41
|
+
required: Boolean(this.required),
|
|
42
|
+
disabled: Boolean(this.disabled),
|
|
43
|
+
min: this.min != null ? String(this.min) : void 0,
|
|
44
|
+
max: this.max != null ? String(this.max) : void 0,
|
|
45
|
+
step: this.step != null ? String(this.step) : void 0,
|
|
46
|
+
"@input": this.boundOnChange
|
|
47
|
+
});
|
|
48
|
+
if (this.controls) {
|
|
49
|
+
div({ className: "number-controls" }, () => {
|
|
50
|
+
button({
|
|
51
|
+
className: "number-btn number-btn-increment",
|
|
52
|
+
textContent: "+",
|
|
53
|
+
disabled: Boolean(this.disabled),
|
|
54
|
+
"@click": this.boundOnIncrement
|
|
55
|
+
});
|
|
56
|
+
button({
|
|
57
|
+
className: "number-btn number-btn-decrement",
|
|
58
|
+
textContent: "-",
|
|
59
|
+
disabled: Boolean(this.disabled),
|
|
60
|
+
"@click": this.boundOnDecrement
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
this.renderActionButtons();
|
|
65
|
+
});
|
|
66
|
+
this.renderHelperText();
|
|
67
|
+
this.renderError();
|
|
68
|
+
if (this.fieldElement && this.value != null) {
|
|
69
|
+
this.fieldElement.value = String(this.value);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get current value as number
|
|
75
|
+
*/
|
|
76
|
+
getValue() {
|
|
77
|
+
if (!this.fieldElement) return 0;
|
|
78
|
+
const val = this.fieldElement.value;
|
|
79
|
+
if (val === "") return 0;
|
|
80
|
+
const num = parseFloat(val);
|
|
81
|
+
return isNaN(num) ? 0 : num;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Write value to the input element (DOM only)
|
|
85
|
+
*/
|
|
86
|
+
writeValue(value) {
|
|
87
|
+
if (this.fieldElement) {
|
|
88
|
+
this.fieldElement.value = value != null ? String(value) : "";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get event payload for change events
|
|
93
|
+
*/
|
|
94
|
+
getEventPayload(value, oldValue, action) {
|
|
95
|
+
return { value, oldValue, action };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
__publicField(NumberInput, "tagName", "number-input");
|
|
99
|
+
__publicField(NumberInput, "props", {
|
|
100
|
+
placeholder: { type: String },
|
|
101
|
+
min: { type: Number },
|
|
102
|
+
max: { type: Number },
|
|
103
|
+
step: { type: Number },
|
|
104
|
+
controls: { type: Boolean }
|
|
105
|
+
});
|
|
106
|
+
__publicField(NumberInput, "styles", [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style]);
|
|
107
|
+
NumberInput.register();
|
|
108
|
+
export {
|
|
109
|
+
NumberInput as N
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=number-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-input.js","sources":["../../src/number-input/number-input.ts"],"sourcesContent":["import AeicoField from '../aeico-field';\nimport type { InferProps, Props } from 'aeico';\nimport { html } from 'aeico';\nimport variables from '../styles/variables.css?inline';\nimport sizeCSS from '../styles/size.css?inline';\nimport fieldLabelCSS from '../styles/components/field-label.css?inline';\nimport actionButtonCSS from '../styles/components/action-button.css?inline';\nimport style from '../styles/components/number-input.css?inline';\n\nclass NumberInput extends AeicoField<number> {\n protected fieldElement: HTMLInputElement | null = null;\n\n static tagName = 'number-input';\n\n static props: Props = {\n placeholder: { type: String },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n controls: { type: Boolean },\n };\n\n declare placeholder?: string;\n declare min?: number;\n declare max?: number;\n declare step?: number;\n declare controls?: boolean;\n\n protected static styles = [variables, sizeCSS, fieldLabelCSS, actionButtonCSS, style];\n\n render() {\n return html(({ div, input, button }) => {\n const id = this.getFieldId();\n this.renderLabel(id);\n div({ className: 'input-container field-body' }, () => {\n this.fieldElement = input({\n id,\n type: 'number',\n placeholder: this.placeholder || '',\n required: Boolean(this.required),\n disabled: Boolean(this.disabled),\n min: this.min != null ? String(this.min) : undefined,\n max: this.max != null ? String(this.max) : undefined,\n step: this.step != null ? String(this.step) : undefined,\n '@input': this.boundOnChange,\n });\n\n if (this.controls) {\n div({ className: 'number-controls' }, () => {\n button({\n className: 'number-btn number-btn-increment',\n textContent: '+',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnIncrement,\n });\n button({\n className: 'number-btn number-btn-decrement',\n textContent: '-',\n disabled: Boolean(this.disabled),\n '@click': this.boundOnDecrement,\n });\n });\n }\n\n this.renderActionButtons();\n });\n this.renderHelperText();\n this.renderError();\n\n if (this.fieldElement && this.value != null) {\n this.fieldElement.value = String(this.value);\n }\n });\n }\n\n protected readonly boundOnIncrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current + step;\n if (this.max != null && next > this.max) {\n next = this.max;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n protected readonly boundOnDecrement = () => {\n const current = this.getValue() || 0;\n const step = this.step ?? 1;\n let next = current - step;\n if (this.min != null && next < this.min) {\n next = this.min;\n }\n this.setValue(next, { silent: false, action: 'change' });\n };\n\n /**\n * Get current value as number\n */\n protected getValue(): number {\n if (!this.fieldElement) return 0;\n const val = this.fieldElement.value;\n if (val === '') return 0;\n const num = parseFloat(val);\n return isNaN(num) ? 0 : num;\n }\n\n /**\n * Write value to the input element (DOM only)\n */\n protected writeValue(value: number): void {\n if (this.fieldElement) {\n this.fieldElement.value = value != null ? String(value) : '';\n }\n }\n\n /**\n * Get event payload for change events\n */\n protected getEventPayload(\n value: number,\n oldValue: number,\n action: import('../aeico-field').FieldAction,\n ): Record<string, unknown> {\n return { value, oldValue, action };\n }\n}\n\nNumberInput.register();\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ae-number-input': NumberInput;\n }\n}\n\nexport default NumberInput;\nexport type NumberInputProps = InferProps<typeof NumberInput>;\n"],"names":[],"mappings":"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"}
|
|
@@ -6,7 +6,7 @@ const size = require("./size.cjs");
|
|
|
6
6
|
const paginationStyle = `:host {
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
font-size: var(--size-m);
|
|
9
|
+
font-size: var(--ae-size-m);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
nav {
|
|
@@ -29,27 +29,27 @@ button {
|
|
|
29
29
|
line-height: 1;
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
user-select: none;
|
|
32
|
-
border-radius:
|
|
33
|
-
border: 1px solid var(--border-default);
|
|
32
|
+
border-radius: var(--ae-border-radius, var(--ae-radius-sm));
|
|
33
|
+
border: 1px solid var(--ae-border-default);
|
|
34
34
|
background: transparent;
|
|
35
|
-
color: var(--color-text-main);
|
|
35
|
+
color: var(--ae-color-text-main);
|
|
36
36
|
transition: background 0.15s, border-color 0.15s, color 0.15s;
|
|
37
37
|
outline: none;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
button:focus-visible {
|
|
41
|
-
box-shadow: 0 0 0 2px var(--focus-ring);
|
|
42
|
-
border-color: var(--border-focus);
|
|
41
|
+
box-shadow: 0 0 0 2px var(--ae-focus-ring);
|
|
42
|
+
border-color: var(--ae-border-focus);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
button:hover:not(:disabled) {
|
|
46
|
-
border-color: var(--color-primary);
|
|
47
|
-
color: var(--color-primary);
|
|
48
|
-
background: var(--color-primary-bg-subtle);
|
|
46
|
+
border-color: var(--ae-color-primary);
|
|
47
|
+
color: var(--ae-color-primary);
|
|
48
|
+
background: var(--ae-color-primary-bg-subtle);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
button:active:not(:disabled) {
|
|
52
|
-
background: color-mix(in srgb, var(--color-primary-bg-subtle), var(--color-primary) 10%);
|
|
52
|
+
background: color-mix(in srgb, var(--ae-color-primary-bg-subtle), var(--ae-color-primary) 10%);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
button:disabled {
|
|
@@ -58,16 +58,16 @@ button:disabled {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
button.active {
|
|
61
|
-
background: var(--color-primary);
|
|
62
|
-
border-color: var(--color-primary);
|
|
61
|
+
background: var(--ae-color-primary);
|
|
62
|
+
border-color: var(--ae-color-primary);
|
|
63
63
|
color: white;
|
|
64
64
|
font-weight: 600;
|
|
65
65
|
cursor: default;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
button.active:hover:not(:disabled) {
|
|
69
|
-
background: var(--color-primary-hover);
|
|
70
|
-
border-color: var(--color-primary-hover);
|
|
69
|
+
background: var(--ae-color-primary-hover);
|
|
70
|
+
border-color: var(--ae-color-primary-hover);
|
|
71
71
|
color: white;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -83,7 +83,7 @@ button.nav-btn {
|
|
|
83
83
|
justify-content: center;
|
|
84
84
|
min-width: 2em;
|
|
85
85
|
height: 2em;
|
|
86
|
-
color: var(--color-text-muted);
|
|
86
|
+
color: var(--ae-color-text-muted);
|
|
87
87
|
user-select: none;
|
|
88
88
|
letter-spacing: 0.1em;
|
|
89
89
|
padding-bottom: 0.2em;
|
|
@@ -94,12 +94,12 @@ input[part="page-input"] {
|
|
|
94
94
|
height: 2em;
|
|
95
95
|
padding: 0 0.4em;
|
|
96
96
|
text-align: center;
|
|
97
|
-
border: 1px solid var(--border-subtle);
|
|
98
|
-
border-radius:
|
|
97
|
+
border: 1px solid var(--ae-border-subtle);
|
|
98
|
+
border-radius: var(--ae-border-radius, var(--ae-border-radius));
|
|
99
99
|
font-size: inherit;
|
|
100
100
|
font-family: inherit;
|
|
101
|
-
color: var(--color-text-main);
|
|
102
|
-
background: var(--surface-base);
|
|
101
|
+
color: var(--ae-color-text-main);
|
|
102
|
+
background: var(--ae-surface-base);
|
|
103
103
|
box-shadow: none;
|
|
104
104
|
-webkit-appearance: none;
|
|
105
105
|
-moz-appearance: textfield;
|
|
@@ -109,7 +109,7 @@ input[part="page-input"] {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
input[part="page-input"]:hover:not(:disabled) {
|
|
112
|
-
border-color: var(--border-default);
|
|
112
|
+
border-color: var(--ae-border-default);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
input[part="page-input"]::-webkit-inner-spin-button,
|
|
@@ -119,8 +119,8 @@ input[part="page-input"]::-webkit-outer-spin-button {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
input[part="page-input"]:focus {
|
|
122
|
-
border-color: var(--border-focus);
|
|
123
|
-
box-shadow: 0 0 0 2px var(--focus-ring);
|
|
122
|
+
border-color: var(--ae-border-focus);
|
|
123
|
+
box-shadow: 0 0 0 2px var(--ae-focus-ring);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
input[part="page-input"]:disabled {
|
|
@@ -129,7 +129,7 @@ input[part="page-input"]:disabled {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
[part="page-total"] {
|
|
132
|
-
color: var(--color-text-muted);
|
|
132
|
+
color: var(--ae-color-text-muted);
|
|
133
133
|
white-space: nowrap;
|
|
134
134
|
padding: 0 0.25em;
|
|
135
135
|
line-height: 2em;
|
|
@@ -157,7 +157,7 @@ input[part="page-input"]:disabled {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
:host([variant='borderless']) input[part='page-input']:focus {
|
|
160
|
-
border-color: var(--border-focus);
|
|
160
|
+
border-color: var(--ae-border-focus);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/* ── Link variant ────────────────────────────────────────────────────── */
|
|
@@ -169,7 +169,7 @@ input[part="page-input"]:disabled {
|
|
|
169
169
|
:host([variant='link']) button:hover:not(:disabled) {
|
|
170
170
|
border-color: transparent;
|
|
171
171
|
background: transparent;
|
|
172
|
-
color: var(--color-primary);
|
|
172
|
+
color: var(--ae-color-primary);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
:host([variant='link']) button:active:not(:disabled) {
|
|
@@ -183,29 +183,29 @@ input[part="page-input"]:disabled {
|
|
|
183
183
|
:host([variant='link']) button.active {
|
|
184
184
|
background: transparent;
|
|
185
185
|
border-color: transparent;
|
|
186
|
-
color: var(--color-primary);
|
|
186
|
+
color: var(--ae-color-primary);
|
|
187
187
|
font-weight: 600;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
:host([variant='link']) button.active:hover:not(:disabled) {
|
|
191
191
|
background: transparent;
|
|
192
|
-
color: var(--color-primary);
|
|
192
|
+
color: var(--ae-color-primary);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
:host([variant='link']) input[part='page-input'] {
|
|
196
196
|
border-color: transparent;
|
|
197
|
-
border-bottom-color: var(--border-subtle);
|
|
198
|
-
border-radius:
|
|
197
|
+
border-bottom-color: var(--ae-border-subtle);
|
|
198
|
+
border-radius: var(--ae-border-radius, var(--ae-radius-sm));
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
:host([variant='link']) input[part='page-input']:hover:not(:disabled) {
|
|
202
202
|
border-color: transparent;
|
|
203
|
-
border-bottom-color: var(--border-default);
|
|
203
|
+
border-bottom-color: var(--ae-border-default);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
:host([variant='link']) input[part='page-input']:focus {
|
|
207
207
|
border-color: transparent;
|
|
208
|
-
border-bottom-color: var(--border-focus);
|
|
208
|
+
border-bottom-color: var(--ae-border-focus);
|
|
209
209
|
box-shadow: none;
|
|
210
210
|
}
|
|
211
211
|
`;
|
|
@@ -5,7 +5,7 @@ import { s as sizeCSS } from "./size.js";
|
|
|
5
5
|
const paginationStyle = `:host {
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
font-size: var(--size-m);
|
|
8
|
+
font-size: var(--ae-size-m);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
nav {
|
|
@@ -28,27 +28,27 @@ button {
|
|
|
28
28
|
line-height: 1;
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
user-select: none;
|
|
31
|
-
border-radius:
|
|
32
|
-
border: 1px solid var(--border-default);
|
|
31
|
+
border-radius: var(--ae-border-radius, var(--ae-radius-sm));
|
|
32
|
+
border: 1px solid var(--ae-border-default);
|
|
33
33
|
background: transparent;
|
|
34
|
-
color: var(--color-text-main);
|
|
34
|
+
color: var(--ae-color-text-main);
|
|
35
35
|
transition: background 0.15s, border-color 0.15s, color 0.15s;
|
|
36
36
|
outline: none;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
button:focus-visible {
|
|
40
|
-
box-shadow: 0 0 0 2px var(--focus-ring);
|
|
41
|
-
border-color: var(--border-focus);
|
|
40
|
+
box-shadow: 0 0 0 2px var(--ae-focus-ring);
|
|
41
|
+
border-color: var(--ae-border-focus);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
button:hover:not(:disabled) {
|
|
45
|
-
border-color: var(--color-primary);
|
|
46
|
-
color: var(--color-primary);
|
|
47
|
-
background: var(--color-primary-bg-subtle);
|
|
45
|
+
border-color: var(--ae-color-primary);
|
|
46
|
+
color: var(--ae-color-primary);
|
|
47
|
+
background: var(--ae-color-primary-bg-subtle);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
button:active:not(:disabled) {
|
|
51
|
-
background: color-mix(in srgb, var(--color-primary-bg-subtle), var(--color-primary) 10%);
|
|
51
|
+
background: color-mix(in srgb, var(--ae-color-primary-bg-subtle), var(--ae-color-primary) 10%);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
button:disabled {
|
|
@@ -57,16 +57,16 @@ button:disabled {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
button.active {
|
|
60
|
-
background: var(--color-primary);
|
|
61
|
-
border-color: var(--color-primary);
|
|
60
|
+
background: var(--ae-color-primary);
|
|
61
|
+
border-color: var(--ae-color-primary);
|
|
62
62
|
color: white;
|
|
63
63
|
font-weight: 600;
|
|
64
64
|
cursor: default;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
button.active:hover:not(:disabled) {
|
|
68
|
-
background: var(--color-primary-hover);
|
|
69
|
-
border-color: var(--color-primary-hover);
|
|
68
|
+
background: var(--ae-color-primary-hover);
|
|
69
|
+
border-color: var(--ae-color-primary-hover);
|
|
70
70
|
color: white;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -82,7 +82,7 @@ button.nav-btn {
|
|
|
82
82
|
justify-content: center;
|
|
83
83
|
min-width: 2em;
|
|
84
84
|
height: 2em;
|
|
85
|
-
color: var(--color-text-muted);
|
|
85
|
+
color: var(--ae-color-text-muted);
|
|
86
86
|
user-select: none;
|
|
87
87
|
letter-spacing: 0.1em;
|
|
88
88
|
padding-bottom: 0.2em;
|
|
@@ -93,12 +93,12 @@ input[part="page-input"] {
|
|
|
93
93
|
height: 2em;
|
|
94
94
|
padding: 0 0.4em;
|
|
95
95
|
text-align: center;
|
|
96
|
-
border: 1px solid var(--border-subtle);
|
|
97
|
-
border-radius:
|
|
96
|
+
border: 1px solid var(--ae-border-subtle);
|
|
97
|
+
border-radius: var(--ae-border-radius, var(--ae-border-radius));
|
|
98
98
|
font-size: inherit;
|
|
99
99
|
font-family: inherit;
|
|
100
|
-
color: var(--color-text-main);
|
|
101
|
-
background: var(--surface-base);
|
|
100
|
+
color: var(--ae-color-text-main);
|
|
101
|
+
background: var(--ae-surface-base);
|
|
102
102
|
box-shadow: none;
|
|
103
103
|
-webkit-appearance: none;
|
|
104
104
|
-moz-appearance: textfield;
|
|
@@ -108,7 +108,7 @@ input[part="page-input"] {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
input[part="page-input"]:hover:not(:disabled) {
|
|
111
|
-
border-color: var(--border-default);
|
|
111
|
+
border-color: var(--ae-border-default);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
input[part="page-input"]::-webkit-inner-spin-button,
|
|
@@ -118,8 +118,8 @@ input[part="page-input"]::-webkit-outer-spin-button {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
input[part="page-input"]:focus {
|
|
121
|
-
border-color: var(--border-focus);
|
|
122
|
-
box-shadow: 0 0 0 2px var(--focus-ring);
|
|
121
|
+
border-color: var(--ae-border-focus);
|
|
122
|
+
box-shadow: 0 0 0 2px var(--ae-focus-ring);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
input[part="page-input"]:disabled {
|
|
@@ -128,7 +128,7 @@ input[part="page-input"]:disabled {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
[part="page-total"] {
|
|
131
|
-
color: var(--color-text-muted);
|
|
131
|
+
color: var(--ae-color-text-muted);
|
|
132
132
|
white-space: nowrap;
|
|
133
133
|
padding: 0 0.25em;
|
|
134
134
|
line-height: 2em;
|
|
@@ -156,7 +156,7 @@ input[part="page-input"]:disabled {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
:host([variant='borderless']) input[part='page-input']:focus {
|
|
159
|
-
border-color: var(--border-focus);
|
|
159
|
+
border-color: var(--ae-border-focus);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
/* ── Link variant ────────────────────────────────────────────────────── */
|
|
@@ -168,7 +168,7 @@ input[part="page-input"]:disabled {
|
|
|
168
168
|
:host([variant='link']) button:hover:not(:disabled) {
|
|
169
169
|
border-color: transparent;
|
|
170
170
|
background: transparent;
|
|
171
|
-
color: var(--color-primary);
|
|
171
|
+
color: var(--ae-color-primary);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
:host([variant='link']) button:active:not(:disabled) {
|
|
@@ -182,29 +182,29 @@ input[part="page-input"]:disabled {
|
|
|
182
182
|
:host([variant='link']) button.active {
|
|
183
183
|
background: transparent;
|
|
184
184
|
border-color: transparent;
|
|
185
|
-
color: var(--color-primary);
|
|
185
|
+
color: var(--ae-color-primary);
|
|
186
186
|
font-weight: 600;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
:host([variant='link']) button.active:hover:not(:disabled) {
|
|
190
190
|
background: transparent;
|
|
191
|
-
color: var(--color-primary);
|
|
191
|
+
color: var(--ae-color-primary);
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
:host([variant='link']) input[part='page-input'] {
|
|
195
195
|
border-color: transparent;
|
|
196
|
-
border-bottom-color: var(--border-subtle);
|
|
197
|
-
border-radius:
|
|
196
|
+
border-bottom-color: var(--ae-border-subtle);
|
|
197
|
+
border-radius: var(--ae-border-radius, var(--ae-radius-sm));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
:host([variant='link']) input[part='page-input']:hover:not(:disabled) {
|
|
201
201
|
border-color: transparent;
|
|
202
|
-
border-bottom-color: var(--border-default);
|
|
202
|
+
border-bottom-color: var(--ae-border-default);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
:host([variant='link']) input[part='page-input']:focus {
|
|
206
206
|
border-color: transparent;
|
|
207
|
-
border-bottom-color: var(--border-focus);
|
|
207
|
+
border-bottom-color: var(--ae-border-focus);
|
|
208
208
|
box-shadow: none;
|
|
209
209
|
}
|
|
210
210
|
`;
|
|
@@ -3,7 +3,7 @@ const aeico = require("aeico");
|
|
|
3
3
|
const aeicoComponent = require("./aeico-component.cjs");
|
|
4
4
|
const variables = require("./variables.cjs");
|
|
5
5
|
const color = require("./color.cjs");
|
|
6
|
-
const style = ":host {\n display: block;\n --progress-height: 8px;\n
|
|
6
|
+
const style = ":host {\n display: block;\n --progress-height: 8px;\n}\n\n.progress-track {\n width: 100%;\n height: var(--progress-height);\n background: var(--ae-border-subtle);\n border-radius: calc(var(--progress-height) / 2);\n overflow: hidden;\n}\n\n.progress-bar {\n display: block;\n height: 100%;\n border-radius: inherit;\n background: var(--progress-bar-color, var(--ae-color-solid));\n width: 0%;\n transition: width 0.35s ease;\n position: relative;\n}\n\n/* animated: shimmer sweep on top of the solid fill */\n:host([animated]) .progress-bar::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n rgba(255, 255, 255, 0.35) 50%,\n transparent 100%\n );\n background-size: 200% 100%;\n animation: progress-shimmer 1.4s linear infinite;\n}\n\n@keyframes progress-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n";
|
|
7
7
|
var __create = Object.create;
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
9
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2,7 +2,7 @@ import { prop, html } from "aeico";
|
|
|
2
2
|
import { A as AeicoComponent } from "./aeico-component.js";
|
|
3
3
|
import { v as variables } from "./variables.js";
|
|
4
4
|
import { c as colorCSS } from "./color.js";
|
|
5
|
-
const style = ":host {\n display: block;\n --progress-height: 8px;\n
|
|
5
|
+
const style = ":host {\n display: block;\n --progress-height: 8px;\n}\n\n.progress-track {\n width: 100%;\n height: var(--progress-height);\n background: var(--ae-border-subtle);\n border-radius: calc(var(--progress-height) / 2);\n overflow: hidden;\n}\n\n.progress-bar {\n display: block;\n height: 100%;\n border-radius: inherit;\n background: var(--progress-bar-color, var(--ae-color-solid));\n width: 0%;\n transition: width 0.35s ease;\n position: relative;\n}\n\n/* animated: shimmer sweep on top of the solid fill */\n:host([animated]) .progress-bar::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n rgba(255, 255, 255, 0.35) 50%,\n transparent 100%\n );\n background-size: 200% 100%;\n animation: progress-shimmer 1.4s linear infinite;\n}\n\n@keyframes progress-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n";
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|