@auvyx/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +48 -0
- package/README.md +43 -2
- package/dist/auvyx.bundle.css +5941 -0
- package/dist/auvyx.chart.min.js +2 -0
- package/dist/auvyx.corners.min.js +2 -0
- package/dist/auvyx.css +10880 -0
- package/dist/auvyx.js +3222 -0
- package/dist/auvyx.min.css +2 -0
- package/dist/auvyx.min.js +19 -0
- package/dist/custom-elements.json +948 -0
- package/dist/elements/calendar.min.js +2 -0
- package/dist/elements/context-menu.min.js +2 -0
- package/dist/elements/data-table.min.js +2 -0
- package/dist/elements/date-picker.min.js +2 -0
- package/dist/elements/index.min.js +2 -0
- package/dist/elements/menu.min.js +2 -0
- package/dist/elements/resizable.min.js +2 -0
- package/dist/js/accordion.min.js +2 -0
- package/dist/js/calendar.min.js +2 -0
- package/dist/js/combobox.min.js +2 -0
- package/dist/js/command.min.js +2 -0
- package/dist/js/context-menu.min.js +2 -0
- package/dist/js/copy.min.js +2 -0
- package/dist/js/data-table.min.js +2 -0
- package/dist/js/date-picker.min.js +2 -0
- package/dist/js/drawer.min.js +2 -0
- package/dist/js/dropdown-menu.min.js +2 -0
- package/dist/js/manifest.json +114 -0
- package/dist/js/menu.min.js +2 -0
- package/dist/js/popover.min.js +2 -0
- package/dist/js/resizable.min.js +2 -0
- package/dist/js/select.min.js +2 -0
- package/dist/js/sidebar.min.js +2 -0
- package/dist/js/slider.min.js +2 -0
- package/dist/js/tabs.min.js +2 -0
- package/dist/js/toast.min.js +19 -0
- package/dist/styles/auvyx-luma.min.css +3 -0
- package/dist/styles/auvyx-lyra.min.css +3 -0
- package/dist/styles/auvyx-maia.min.css +3 -0
- package/dist/styles/auvyx-mira.min.css +3 -0
- package/dist/styles/auvyx-nova.min.css +3 -0
- package/dist/styles/auvyx-rhea.min.css +3 -0
- package/dist/styles/auvyx-sera.min.css +3 -0
- package/dist/styles/auvyx-vega.min.css +3 -0
- package/dist/types/elements.d.ts +262 -0
- package/dist/types/react.d.ts +181 -0
- package/dist/types/vue.d.ts +155 -0
- package/dist/ui/accordion.css +91 -0
- package/dist/ui/accordion.js +249 -0
- package/dist/ui/accordion.native.css +24 -0
- package/dist/ui/alert.css +119 -0
- package/dist/ui/aspect-ratio.css +38 -0
- package/dist/ui/attachment.css +211 -0
- package/dist/ui/avatar.css +204 -0
- package/dist/ui/badge.css +183 -0
- package/dist/ui/base.css +1200 -0
- package/dist/ui/breadcrumb.css +90 -0
- package/dist/ui/bubble.css +171 -0
- package/dist/ui/button-group.css +110 -0
- package/dist/ui/button.css +328 -0
- package/dist/ui/calendar.css +260 -0
- package/dist/ui/calendar.js +317 -0
- package/dist/ui/card.css +126 -0
- package/dist/ui/carousel.css +172 -0
- package/dist/ui/chart.css +130 -0
- package/dist/ui/checkbox.css +119 -0
- package/dist/ui/code-block.css +235 -0
- package/dist/ui/combobox.css +500 -0
- package/dist/ui/combobox.js +757 -0
- package/dist/ui/command.css +366 -0
- package/dist/ui/command.js +382 -0
- package/dist/ui/context-menu.css +17 -0
- package/dist/ui/context-menu.js +52 -0
- package/dist/ui/copy.js +56 -0
- package/dist/ui/data-table.css +114 -0
- package/dist/ui/data-table.js +140 -0
- package/dist/ui/date-picker.css +14 -0
- package/dist/ui/date-picker.js +101 -0
- package/dist/ui/dialog.css +363 -0
- package/dist/ui/dialog.native.css +6 -0
- package/dist/ui/drawer.css +238 -0
- package/dist/ui/drawer.js +265 -0
- package/dist/ui/dropdown-menu.css +193 -0
- package/dist/ui/dropdown-menu.js +388 -0
- package/dist/ui/empty.css +111 -0
- package/dist/ui/field.css +293 -0
- package/dist/ui/hover-card.css +85 -0
- package/dist/ui/input-group.css +269 -0
- package/dist/ui/input-otp.css +101 -0
- package/dist/ui/input.css +117 -0
- package/dist/ui/item.css +223 -0
- package/dist/ui/kbd.css +50 -0
- package/dist/ui/label.css +48 -0
- package/dist/ui/manifest.json +667 -0
- package/dist/ui/marker.css +66 -0
- package/dist/ui/menu.js +161 -0
- package/dist/ui/menubar.css +55 -0
- package/dist/ui/message-scroller.css +83 -0
- package/dist/ui/message.css +69 -0
- package/dist/ui/native-select.css +130 -0
- package/dist/ui/navigation-menu.css +166 -0
- package/dist/ui/popover.css +154 -0
- package/dist/ui/popover.js +268 -0
- package/dist/ui/popover.native.css +84 -0
- package/dist/ui/progress.css +29 -0
- package/dist/ui/questionnaire.css +188 -0
- package/dist/ui/radio-group.css +115 -0
- package/dist/ui/resizable.css +94 -0
- package/dist/ui/resizable.js +95 -0
- package/dist/ui/scroll-area.css +43 -0
- package/dist/ui/select.css +289 -0
- package/dist/ui/select.js +646 -0
- package/dist/ui/sheet.css +219 -0
- package/dist/ui/sidebar.css +716 -0
- package/dist/ui/sidebar.js +287 -0
- package/dist/ui/skeleton.css +13 -0
- package/dist/ui/slider.css +184 -0
- package/dist/ui/slider.js +206 -0
- package/dist/ui/switch.css +156 -0
- package/dist/ui/table.css +157 -0
- package/dist/ui/tabs.css +240 -0
- package/dist/ui/tabs.js +288 -0
- package/dist/ui/textarea.css +91 -0
- package/dist/ui/toast.css +110 -0
- package/dist/ui/toast.js +378 -0
- package/dist/ui/toggle-group.css +42 -0
- package/dist/ui/toggle.css +150 -0
- package/dist/ui/tooltip.css +319 -0
- package/dist/ui/trace.css +142 -0
- package/dist/ui/typography.css +184 -0
- package/dist/wc/accordion.min.js +2 -0
- package/dist/wc/combobox.min.js +2 -0
- package/dist/wc/command.min.js +2 -0
- package/dist/wc/drawer.min.js +2 -0
- package/dist/wc/dropdown-menu.min.js +2 -0
- package/dist/wc/manifest.json +154 -0
- package/dist/wc/popover.min.js +2 -0
- package/dist/wc/select.min.js +2 -0
- package/dist/wc/sidebar.min.js +2 -0
- package/dist/wc/slider.min.js +2 -0
- package/dist/wc/tabs.min.js +2 -0
- package/dist/wc/toast.min.js +19 -0
- package/package.json +62 -4
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* @auvyx/ui v0.1.0 | MIT | based on Basecoat (MIT) */
|
|
2
|
+
(() => {
|
|
3
|
+
// ../elements/src/data-table.js
|
|
4
|
+
var AuvyxDataTable = class extends HTMLElement {
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
if (this._init) return;
|
|
7
|
+
this._init = true;
|
|
8
|
+
this.table = this.querySelector("table");
|
|
9
|
+
this.tbody = this.table?.tBodies[0];
|
|
10
|
+
if (!this.tbody) return;
|
|
11
|
+
this.rows = [...this.tbody.rows].filter((r) => !r.hasAttribute("data-empty"));
|
|
12
|
+
this.empty = this.tbody.querySelector("tr[data-empty]");
|
|
13
|
+
this.pageSize = parseInt(this.dataset.pageSize, 10) || 0;
|
|
14
|
+
this.page = 0;
|
|
15
|
+
this.query = "";
|
|
16
|
+
this.sort = { col: -1, dir: "ascending" };
|
|
17
|
+
this.collator = new Intl.Collator(this.closest("[lang]")?.lang || void 0, { numeric: true, sensitivity: "base" });
|
|
18
|
+
this.headers = [...this.table.tHead.rows[0].cells];
|
|
19
|
+
this.headers.forEach((th, col) => {
|
|
20
|
+
const button = th.hasAttribute("aria-sort") ? th.querySelector(":scope > button") : null;
|
|
21
|
+
button?.addEventListener("click", () => this.toggleSort(col));
|
|
22
|
+
});
|
|
23
|
+
this.filterInput = this.querySelector("input[data-filter]");
|
|
24
|
+
this.filterInput?.addEventListener("input", () => {
|
|
25
|
+
this.query = this.filterInput.value.trim().toLocaleLowerCase();
|
|
26
|
+
this.page = 0;
|
|
27
|
+
this.render();
|
|
28
|
+
});
|
|
29
|
+
this.selectAll = this.querySelector("input[data-select-all]");
|
|
30
|
+
this.selectAll?.addEventListener("change", () => {
|
|
31
|
+
this.visible().forEach((row) => this.setSelected(row, this.selectAll.checked));
|
|
32
|
+
this.updateSelection();
|
|
33
|
+
});
|
|
34
|
+
this.tbody.addEventListener("change", (e) => {
|
|
35
|
+
if (!e.target.matches("input[data-select]")) return;
|
|
36
|
+
this.setSelected(e.target.closest("tr"), e.target.checked);
|
|
37
|
+
this.updateSelection();
|
|
38
|
+
});
|
|
39
|
+
this.querySelectorAll("input[data-column]").forEach((toggle) => {
|
|
40
|
+
toggle.addEventListener("change", () => this.setColumn(parseInt(toggle.dataset.column, 10), toggle.checked));
|
|
41
|
+
if (!toggle.checked) this.setColumn(parseInt(toggle.dataset.column, 10), false);
|
|
42
|
+
});
|
|
43
|
+
this.querySelector('[data-page="prev"]')?.addEventListener("click", () => {
|
|
44
|
+
this.page--;
|
|
45
|
+
this.render();
|
|
46
|
+
});
|
|
47
|
+
this.querySelector('[data-page="next"]')?.addEventListener("click", () => {
|
|
48
|
+
this.page++;
|
|
49
|
+
this.render();
|
|
50
|
+
});
|
|
51
|
+
this.rows.forEach((row) => {
|
|
52
|
+
const box = row.querySelector("input[data-select]");
|
|
53
|
+
if (box?.checked) row.setAttribute("aria-selected", "true");
|
|
54
|
+
});
|
|
55
|
+
this.render();
|
|
56
|
+
}
|
|
57
|
+
cellValue(row, col) {
|
|
58
|
+
const cell = row.cells[col];
|
|
59
|
+
return cell ? cell.dataset.value ?? cell.textContent.trim() : "";
|
|
60
|
+
}
|
|
61
|
+
matches(row) {
|
|
62
|
+
if (!this.query) return true;
|
|
63
|
+
const only = this.filterInput?.dataset.filter;
|
|
64
|
+
const cols = only ? only.split(",").map(Number) : null;
|
|
65
|
+
return [...row.cells].some((cell, i) => (!cols || cols.includes(i)) && cell.textContent.toLocaleLowerCase().includes(this.query));
|
|
66
|
+
}
|
|
67
|
+
toggleSort(col) {
|
|
68
|
+
this.sort = this.sort.col === col ? { col, dir: this.sort.dir === "ascending" ? "descending" : "ascending" } : { col, dir: "ascending" };
|
|
69
|
+
this.headers.forEach((th, i) => th.hasAttribute("aria-sort") && th.setAttribute("aria-sort", i === col ? this.sort.dir : "none"));
|
|
70
|
+
this.render();
|
|
71
|
+
}
|
|
72
|
+
ordered() {
|
|
73
|
+
const list = this.rows.filter((r) => this.matches(r));
|
|
74
|
+
const { col, dir } = this.sort;
|
|
75
|
+
if (col < 0) return list;
|
|
76
|
+
const numeric = this.headers[col]?.dataset.type === "number";
|
|
77
|
+
const sign = dir === "descending" ? -1 : 1;
|
|
78
|
+
return list.sort((a, b) => {
|
|
79
|
+
const x = this.cellValue(a, col);
|
|
80
|
+
const y = this.cellValue(b, col);
|
|
81
|
+
return sign * (numeric ? (parseFloat(x) || 0) - (parseFloat(y) || 0) : this.collator.compare(x, y));
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
visible() {
|
|
85
|
+
return this.rows.filter((r) => !r.hidden);
|
|
86
|
+
}
|
|
87
|
+
setSelected(row, on) {
|
|
88
|
+
const box = row.querySelector("input[data-select]");
|
|
89
|
+
if (box) box.checked = on;
|
|
90
|
+
if (on) row.setAttribute("aria-selected", "true");
|
|
91
|
+
else row.removeAttribute("aria-selected");
|
|
92
|
+
}
|
|
93
|
+
setColumn(col, show) {
|
|
94
|
+
[this.table.tHead, ...this.table.tBodies, this.table.tFoot].filter(Boolean).forEach((section) => {
|
|
95
|
+
[...section.rows].forEach((row) => {
|
|
96
|
+
if (row.cells[col] && !row.hasAttribute("data-empty")) row.cells[col].hidden = !show;
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
updateSelection() {
|
|
101
|
+
const shown = this.visible();
|
|
102
|
+
const selected = this.rows.filter((r) => r.getAttribute("aria-selected") === "true").length;
|
|
103
|
+
const shownSelected = shown.filter((r) => r.getAttribute("aria-selected") === "true").length;
|
|
104
|
+
if (this.selectAll) {
|
|
105
|
+
this.selectAll.checked = shown.length > 0 && shownSelected === shown.length;
|
|
106
|
+
this.selectAll.indeterminate = shownSelected > 0 && shownSelected < shown.length;
|
|
107
|
+
}
|
|
108
|
+
const count = this.querySelector("[data-selected-count]");
|
|
109
|
+
if (count) {
|
|
110
|
+
const tpl = count.dataset.template || "{selected} of {total} row(s) selected.";
|
|
111
|
+
count.textContent = tpl.replace("{selected}", selected).replace("{total}", this.rows.length);
|
|
112
|
+
}
|
|
113
|
+
this.dispatchEvent(new CustomEvent("selectionchange", { detail: { rows: this.rows.filter((r) => r.getAttribute("aria-selected") === "true") } }));
|
|
114
|
+
}
|
|
115
|
+
render() {
|
|
116
|
+
const list = this.ordered();
|
|
117
|
+
const pages = this.pageSize ? Math.max(1, Math.ceil(list.length / this.pageSize)) : 1;
|
|
118
|
+
this.page = Math.min(Math.max(0, this.page), pages - 1);
|
|
119
|
+
const from = this.pageSize ? this.page * this.pageSize : 0;
|
|
120
|
+
const to = this.pageSize ? from + this.pageSize : list.length;
|
|
121
|
+
const shown = new Set(list.slice(from, to));
|
|
122
|
+
list.forEach((row) => this.tbody.insertBefore(row, this.empty));
|
|
123
|
+
this.rows.forEach((row) => {
|
|
124
|
+
row.hidden = !shown.has(row);
|
|
125
|
+
});
|
|
126
|
+
if (this.empty) this.empty.hidden = list.length > 0;
|
|
127
|
+
const status = this.querySelector("[data-page-status]");
|
|
128
|
+
if (status) {
|
|
129
|
+
const tpl = status.dataset.template || "Page {page} of {pages}";
|
|
130
|
+
status.textContent = tpl.replace("{page}", this.page + 1).replace("{pages}", pages);
|
|
131
|
+
}
|
|
132
|
+
const prev = this.querySelector('[data-page="prev"]');
|
|
133
|
+
const next = this.querySelector('[data-page="next"]');
|
|
134
|
+
if (prev) prev.disabled = this.page <= 0;
|
|
135
|
+
if (next) next.disabled = this.page >= pages - 1;
|
|
136
|
+
this.updateSelection();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
if (!customElements.get("auvyx-data-table")) customElements.define("auvyx-data-table", AuvyxDataTable);
|
|
140
|
+
})();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* @auvyx/ui date-picker | order 59 */
|
|
2
|
+
@layer components {
|
|
3
|
+
.date-picker > button:first-child {
|
|
4
|
+
width: calc(var(--spacing) * 60);
|
|
5
|
+
--tw-font-weight: var(--font-weight-normal);
|
|
6
|
+
font-weight: var(--font-weight-normal);
|
|
7
|
+
}
|
|
8
|
+
.date-picker > button:first-child:not([data-value]) {
|
|
9
|
+
color: var(--color-muted-foreground);
|
|
10
|
+
}
|
|
11
|
+
.date-picker > [data-popover] {
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* @auvyx/ui v0.1.0 | MIT | based on Basecoat (MIT) */
|
|
2
|
+
(() => {
|
|
3
|
+
// ../elements/src/date-picker.js
|
|
4
|
+
var calendarIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>';
|
|
5
|
+
var PASS = ["months", "caption", "week-numbers", "disabled-days", "disabled-dates", "booked", "min-days", "max-days"];
|
|
6
|
+
var asDate = (v) => v ? /* @__PURE__ */ new Date(`${v}T00:00:00`) : null;
|
|
7
|
+
var AuvyxDatePicker = class extends HTMLElement {
|
|
8
|
+
connectedCallback() {
|
|
9
|
+
if (this._init) return;
|
|
10
|
+
this.inputs = [...this.querySelectorAll(':scope > input[type="date"]')];
|
|
11
|
+
if (!this.inputs.length) return;
|
|
12
|
+
this._init = true;
|
|
13
|
+
this.range = this.getAttribute("mode") === "range" && this.inputs.length >= 2;
|
|
14
|
+
const first = this.inputs[0];
|
|
15
|
+
const uid = first.id || `dp-${Math.random().toString(36).slice(2, 8)}`;
|
|
16
|
+
const locale = this.closest("[lang]")?.getAttribute("lang") || navigator.language;
|
|
17
|
+
this.format = new Intl.DateTimeFormat(locale, { dateStyle: "medium" });
|
|
18
|
+
this.button = document.createElement("button");
|
|
19
|
+
this.button.type = "button";
|
|
20
|
+
this.button.className = "btn";
|
|
21
|
+
this.button.dataset.variant = this.dataset.variant || "outline";
|
|
22
|
+
this.button.setAttribute("popovertarget", `${uid}-popover`);
|
|
23
|
+
this.button.setAttribute("aria-haspopup", "dialog");
|
|
24
|
+
const label = first.labels?.[0];
|
|
25
|
+
if (label) {
|
|
26
|
+
label.id ||= `${uid}-label`;
|
|
27
|
+
this.button.setAttribute("aria-labelledby", `${label.id} ${uid}-value`);
|
|
28
|
+
label.htmlFor = "";
|
|
29
|
+
label.addEventListener("click", () => this.button.focus());
|
|
30
|
+
}
|
|
31
|
+
this.button.innerHTML = `${calendarIcon}<span id="${uid}-value"></span>`;
|
|
32
|
+
this.panel = document.createElement("div");
|
|
33
|
+
this.panel.id = `${uid}-popover`;
|
|
34
|
+
this.panel.setAttribute("data-popover", "");
|
|
35
|
+
this.panel.setAttribute("popover", "");
|
|
36
|
+
this.panel.setAttribute("role", "dialog");
|
|
37
|
+
this.panel.setAttribute("aria-label", this.dataset.dialogLabel || (this.range ? "Choose dates" : "Choose date"));
|
|
38
|
+
this.panel.dataset.side = this.dataset.side || "bottom";
|
|
39
|
+
this.panel.dataset.align = this.dataset.align || "start";
|
|
40
|
+
this.calendar = document.createElement("auvyx-calendar");
|
|
41
|
+
this.calendar.className = "calendar";
|
|
42
|
+
if (this.range) this.calendar.setAttribute("mode", "range");
|
|
43
|
+
for (const attr of ["min", "max"]) if (first[attr]) this.calendar.setAttribute(attr, first[attr]);
|
|
44
|
+
for (const attr of PASS) if (this.hasAttribute(attr)) this.calendar.setAttribute(attr, this.getAttribute(attr));
|
|
45
|
+
if (this.dataset.weekStart) this.calendar.dataset.weekStart = this.dataset.weekStart;
|
|
46
|
+
const v = this.range ? this.inputs[0].value ? `${this.inputs[0].value}/${this.inputs[1].value}` : "" : first.value;
|
|
47
|
+
if (v) this.calendar.setAttribute("value", v);
|
|
48
|
+
this.panel.append(this.calendar);
|
|
49
|
+
for (const input of this.inputs) {
|
|
50
|
+
input.hidden = true;
|
|
51
|
+
input.tabIndex = -1;
|
|
52
|
+
input.addEventListener("invalid", (e) => {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
this.button.setAttribute("aria-invalid", "true");
|
|
55
|
+
this.button.focus();
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
this.prepend(this.button);
|
|
59
|
+
this.append(this.panel);
|
|
60
|
+
this.update();
|
|
61
|
+
this.calendar.addEventListener("change", (e) => {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
const [a, b] = e.detail.value.split("/");
|
|
64
|
+
this.setInput(this.inputs[0], a || "");
|
|
65
|
+
if (this.range) this.setInput(this.inputs[1], b || "");
|
|
66
|
+
this.button.removeAttribute("aria-invalid");
|
|
67
|
+
this.update();
|
|
68
|
+
if (e.detail.complete) {
|
|
69
|
+
this.panel.hidePopover();
|
|
70
|
+
this.button.focus();
|
|
71
|
+
}
|
|
72
|
+
this.dispatchEvent(new CustomEvent("change", { bubbles: true, detail: { value: e.detail.value, complete: e.detail.complete } }));
|
|
73
|
+
});
|
|
74
|
+
this.panel.addEventListener("toggle", (e) => {
|
|
75
|
+
if (e.newState === "open") requestAnimationFrame(() => this.calendar.focusDate?.());
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
setInput(input, value) {
|
|
79
|
+
if (input.value === value) return;
|
|
80
|
+
input.value = value;
|
|
81
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
82
|
+
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
83
|
+
}
|
|
84
|
+
get value() {
|
|
85
|
+
return this.range ? `${this.inputs[0].value}/${this.inputs[1].value}` : this.inputs[0].value;
|
|
86
|
+
}
|
|
87
|
+
update() {
|
|
88
|
+
const text = this.button.querySelector("span");
|
|
89
|
+
const a = asDate(this.inputs[0].value);
|
|
90
|
+
const b = this.range ? asDate(this.inputs[1].value) : null;
|
|
91
|
+
let label;
|
|
92
|
+
if (this.range && a && b) label = this.format.formatRange(a, b);
|
|
93
|
+
else if (a) label = this.format.format(a) + (this.range ? " \u2013" : "");
|
|
94
|
+
else label = this.dataset.placeholder || this.inputs[0].placeholder || (this.range ? "Pick a date range" : "Pick a date");
|
|
95
|
+
text.textContent = label;
|
|
96
|
+
if (a) this.button.dataset.value = this.value;
|
|
97
|
+
else delete this.button.dataset.value;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
if (!customElements.get("auvyx-date-picker")) customElements.define("auvyx-date-picker", AuvyxDatePicker);
|
|
101
|
+
})();
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
/* @auvyx/ui dialog | order 12 */
|
|
2
|
+
@keyframes dialog-scroll-lock {
|
|
3
|
+
from, to {
|
|
4
|
+
scrollbar-gutter: stable;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@layer components {
|
|
9
|
+
html:has(:is(.dialog, .alert-dialog, .command-dialog, .drawer):modal) {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
animation: dialog-scroll-lock linear both;
|
|
12
|
+
animation-timeline: scroll(self);
|
|
13
|
+
}
|
|
14
|
+
.dialog, .alert-dialog {
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
padding: 0;
|
|
17
|
+
color: inherit;
|
|
18
|
+
opacity: 0%;
|
|
19
|
+
transition-property: all;
|
|
20
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
21
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
22
|
+
transition-behavior: allow-discrete;
|
|
23
|
+
&::backdrop {
|
|
24
|
+
opacity: 0%;
|
|
25
|
+
}
|
|
26
|
+
&::backdrop {
|
|
27
|
+
transition-property: all;
|
|
28
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
29
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
30
|
+
}
|
|
31
|
+
&::backdrop {
|
|
32
|
+
transition-behavior: allow-discrete;
|
|
33
|
+
}
|
|
34
|
+
max-width: none;
|
|
35
|
+
max-height: none;
|
|
36
|
+
&:is([open], :popover-open) {
|
|
37
|
+
opacity: 100%;
|
|
38
|
+
&::backdrop {
|
|
39
|
+
opacity: 100%;
|
|
40
|
+
}
|
|
41
|
+
> * {
|
|
42
|
+
--tw-scale-x: 100%;
|
|
43
|
+
--tw-scale-y: 100%;
|
|
44
|
+
--tw-scale-z: 100%;
|
|
45
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
46
|
+
}
|
|
47
|
+
@starting-style {
|
|
48
|
+
opacity: 0%;
|
|
49
|
+
&::backdrop {
|
|
50
|
+
opacity: 0%;
|
|
51
|
+
}
|
|
52
|
+
> * {
|
|
53
|
+
--tw-scale-x: 95%;
|
|
54
|
+
--tw-scale-y: 95%;
|
|
55
|
+
--tw-scale-z: 95%;
|
|
56
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
> * {
|
|
61
|
+
position: fixed;
|
|
62
|
+
top: calc(1 / 2 * 100%);
|
|
63
|
+
left: calc(1 / 2 * 100%);
|
|
64
|
+
z-index: 50;
|
|
65
|
+
display: flex;
|
|
66
|
+
max-height: calc(100% - 2rem);
|
|
67
|
+
width: 100%;
|
|
68
|
+
--tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
|
|
69
|
+
--tw-translate-y: calc(calc(1 / 2 * 100%) * -1);
|
|
70
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
71
|
+
--tw-scale-x: 95%;
|
|
72
|
+
--tw-scale-y: 95%;
|
|
73
|
+
--tw-scale-z: 95%;
|
|
74
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
--tw-outline-style: none;
|
|
77
|
+
outline-style: none;
|
|
78
|
+
@media (forced-colors: active) {
|
|
79
|
+
outline: 2px solid transparent;
|
|
80
|
+
outline-offset: 2px;
|
|
81
|
+
}
|
|
82
|
+
transition-property: all;
|
|
83
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
84
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.dialog {
|
|
88
|
+
> * > header {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
}
|
|
92
|
+
> * > section {
|
|
93
|
+
flex: 1;
|
|
94
|
+
}
|
|
95
|
+
> * > footer {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column-reverse;
|
|
98
|
+
@media (width >= 40rem) {
|
|
99
|
+
flex-direction: row;
|
|
100
|
+
}
|
|
101
|
+
@media (width >= 40rem) {
|
|
102
|
+
justify-content: flex-end;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
> * > :is(button, form[method='dialog']) {
|
|
106
|
+
position: absolute;
|
|
107
|
+
}
|
|
108
|
+
> * > :is(button, form[method='dialog'] > button) {
|
|
109
|
+
display: inline-flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
opacity: 70%;
|
|
113
|
+
transition-property: opacity;
|
|
114
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
115
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
116
|
+
&:hover {
|
|
117
|
+
@media (hover: hover) {
|
|
118
|
+
opacity: 100%;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
&:focus-visible {
|
|
122
|
+
--tw-outline-style: none;
|
|
123
|
+
outline-style: none;
|
|
124
|
+
@media (forced-colors: active) {
|
|
125
|
+
outline: 2px solid transparent;
|
|
126
|
+
outline-offset: 2px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
&:disabled {
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
& svg {
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
}
|
|
135
|
+
& svg {
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
> * > :is(button, form[method='dialog'] > button) > svg:not([class*='size-']) {
|
|
140
|
+
width: calc(var(--spacing) * 4);
|
|
141
|
+
height: calc(var(--spacing) * 4);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.alert-dialog {
|
|
145
|
+
> * > header {
|
|
146
|
+
display: grid;
|
|
147
|
+
grid-template-rows: auto 1fr;
|
|
148
|
+
place-items: center;
|
|
149
|
+
text-align: center;
|
|
150
|
+
@media (width >= 40rem) {
|
|
151
|
+
place-items: start;
|
|
152
|
+
}
|
|
153
|
+
@media (width >= 40rem) {
|
|
154
|
+
text-align: start;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
> * > header:has(> figure) {
|
|
158
|
+
grid-template-rows: auto auto 1fr;
|
|
159
|
+
@media (width >= 40rem) {
|
|
160
|
+
grid-template-rows: auto 1fr;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
> * > header > figure {
|
|
164
|
+
margin: 0;
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
@media (width >= 40rem) {
|
|
167
|
+
grid-row: span 2 / span 2;
|
|
168
|
+
}
|
|
169
|
+
& svg {
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
}
|
|
172
|
+
& svg {
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
> * > header > figure:has(img) {
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
& img {
|
|
179
|
+
width: 100%;
|
|
180
|
+
height: 100%;
|
|
181
|
+
}
|
|
182
|
+
& img {
|
|
183
|
+
object-fit: cover;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
> * > header:has(> figure) > :is(h2, p) {
|
|
187
|
+
@media (width >= 40rem) {
|
|
188
|
+
grid-column-start: 2;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
> * > footer {
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column-reverse;
|
|
194
|
+
@media (width >= 40rem) {
|
|
195
|
+
flex-direction: row;
|
|
196
|
+
}
|
|
197
|
+
@media (width >= 40rem) {
|
|
198
|
+
justify-content: flex-end;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
&:is([data-size='sm']) > * > header, > [data-size='sm'] > header {
|
|
202
|
+
@media (width >= 40rem) {
|
|
203
|
+
place-items: center;
|
|
204
|
+
}
|
|
205
|
+
@media (width >= 40rem) {
|
|
206
|
+
text-align: center;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
&:is([data-size='sm']) > * > header:has(> figure), > [data-size='sm'] > header:has(> figure) {
|
|
210
|
+
@media (width >= 40rem) {
|
|
211
|
+
grid-template-rows: auto auto 1fr;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
&:is([data-size='sm']) > * > header:has(> figure) > :is(h2, p), > [data-size='sm'] > header:has(> figure) > :is(h2, p) {
|
|
215
|
+
@media (width >= 40rem) {
|
|
216
|
+
grid-column-start: auto;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
&:is([data-size='sm']) > * > footer, > [data-size='sm'] > footer {
|
|
220
|
+
display: grid;
|
|
221
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
222
|
+
@media (width >= 40rem) {
|
|
223
|
+
display: grid;
|
|
224
|
+
}
|
|
225
|
+
@media (width >= 40rem) {
|
|
226
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@layer components {
|
|
233
|
+
.dialog::backdrop, .alert-dialog::backdrop, .command-dialog::backdrop {
|
|
234
|
+
background-color: color-mix(in srgb, #000 10%, transparent);
|
|
235
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
236
|
+
background-color: color-mix(in oklab, var(--color-black) 10%, transparent);
|
|
237
|
+
}
|
|
238
|
+
--tw-backdrop-blur: blur(var(--blur-xs));
|
|
239
|
+
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
240
|
+
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
241
|
+
--tw-duration: 100ms;
|
|
242
|
+
transition-duration: 100ms;
|
|
243
|
+
}
|
|
244
|
+
.alert-dialog > * {
|
|
245
|
+
max-width: var(--container-xs);
|
|
246
|
+
gap: calc(var(--spacing) * 6);
|
|
247
|
+
border-radius: var(--radius-xl);
|
|
248
|
+
background-color: var(--color-popover);
|
|
249
|
+
padding: calc(var(--spacing) * 6);
|
|
250
|
+
color: var(--color-popover-foreground);
|
|
251
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
252
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
253
|
+
--tw-ring-color: var(--color-foreground);
|
|
254
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
255
|
+
--tw-ring-color: color-mix(in oklab, var(--color-foreground) 10%, transparent);
|
|
256
|
+
}
|
|
257
|
+
--tw-duration: 100ms;
|
|
258
|
+
transition-duration: 100ms;
|
|
259
|
+
@media (width >= 40rem) {
|
|
260
|
+
max-width: var(--container-lg);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.alert-dialog:is([data-size='sm']) > *, .alert-dialog > [data-size='sm'] {
|
|
264
|
+
@media (width >= 40rem) {
|
|
265
|
+
max-width: var(--container-xs);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
.dialog > * {
|
|
269
|
+
max-width: calc(100% - 2rem);
|
|
270
|
+
gap: calc(var(--spacing) * 6);
|
|
271
|
+
border-radius: var(--radius-xl);
|
|
272
|
+
background-color: var(--color-popover);
|
|
273
|
+
padding: calc(var(--spacing) * 6);
|
|
274
|
+
font-size: var(--text-sm);
|
|
275
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
276
|
+
color: var(--color-popover-foreground);
|
|
277
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
278
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
279
|
+
--tw-ring-color: var(--color-foreground);
|
|
280
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
281
|
+
--tw-ring-color: color-mix(in oklab, var(--color-foreground) 10%, transparent);
|
|
282
|
+
}
|
|
283
|
+
--tw-duration: 100ms;
|
|
284
|
+
transition-duration: 100ms;
|
|
285
|
+
@media (width >= 40rem) {
|
|
286
|
+
max-width: var(--container-md);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
.dialog > * > :is(button, form[method='dialog']) {
|
|
290
|
+
inset-inline-end: calc(var(--spacing) * 4);
|
|
291
|
+
top: calc(var(--spacing) * 4);
|
|
292
|
+
}
|
|
293
|
+
.dialog > * > header {
|
|
294
|
+
gap: calc(var(--spacing) * 2);
|
|
295
|
+
}
|
|
296
|
+
.alert-dialog > * > header {
|
|
297
|
+
column-gap: calc(var(--spacing) * 6);
|
|
298
|
+
row-gap: calc(var(--spacing) * 1.5);
|
|
299
|
+
}
|
|
300
|
+
.alert-dialog > * > header > figure {
|
|
301
|
+
margin-bottom: calc(var(--spacing) * 2);
|
|
302
|
+
display: inline-flex;
|
|
303
|
+
width: calc(var(--spacing) * 16);
|
|
304
|
+
height: calc(var(--spacing) * 16);
|
|
305
|
+
align-items: center;
|
|
306
|
+
justify-content: center;
|
|
307
|
+
border-radius: var(--radius-md);
|
|
308
|
+
background-color: var(--color-muted);
|
|
309
|
+
&>svg:not([class*='size-']) {
|
|
310
|
+
width: calc(var(--spacing) * 8);
|
|
311
|
+
height: calc(var(--spacing) * 8);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
.alert-dialog > * > footer, .dialog > * > footer {
|
|
315
|
+
gap: calc(var(--spacing) * 2);
|
|
316
|
+
}
|
|
317
|
+
.dialog > * > header > h2, .dialog > * > [data-title] {
|
|
318
|
+
--tw-leading: 1;
|
|
319
|
+
line-height: 1;
|
|
320
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
321
|
+
font-weight: var(--font-weight-medium);
|
|
322
|
+
}
|
|
323
|
+
.alert-dialog > * > header > h2, .alert-dialog > * > [data-title] {
|
|
324
|
+
font-size: var(--text-lg);
|
|
325
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
326
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
327
|
+
font-weight: var(--font-weight-medium);
|
|
328
|
+
}
|
|
329
|
+
.dialog > * > header > p, .dialog > * > [data-description] {
|
|
330
|
+
font-size: var(--text-sm);
|
|
331
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
332
|
+
--tw-leading: var(--leading-normal);
|
|
333
|
+
line-height: var(--leading-normal);
|
|
334
|
+
color: var(--color-muted-foreground);
|
|
335
|
+
& a {
|
|
336
|
+
text-decoration-line: underline;
|
|
337
|
+
}
|
|
338
|
+
& a {
|
|
339
|
+
text-underline-offset: 3px;
|
|
340
|
+
}
|
|
341
|
+
& a:hover {
|
|
342
|
+
color: var(--color-foreground);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
.alert-dialog > * > header > p, .alert-dialog > * > [data-description] {
|
|
346
|
+
font-size: var(--text-sm);
|
|
347
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
348
|
+
text-wrap: balance;
|
|
349
|
+
color: var(--color-muted-foreground);
|
|
350
|
+
@media (width >= 48rem) {
|
|
351
|
+
text-wrap: pretty;
|
|
352
|
+
}
|
|
353
|
+
& a {
|
|
354
|
+
text-decoration-line: underline;
|
|
355
|
+
}
|
|
356
|
+
& a {
|
|
357
|
+
text-underline-offset: 3px;
|
|
358
|
+
}
|
|
359
|
+
& a:hover {
|
|
360
|
+
color: var(--color-foreground);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|