@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
package/dist/ui/tabs.js
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/* @auvyx/ui v0.1.0 | MIT | based on Basecoat (MIT) */
|
|
2
|
+
// Basecoat core, once per page.
|
|
3
|
+
if (!window.basecoat) (() => {
|
|
4
|
+
const componentRegistry = {};
|
|
5
|
+
let observer = null;
|
|
6
|
+
|
|
7
|
+
const registerComponent = (name, selectorOrOptions, initFunction) => {
|
|
8
|
+
const options = typeof selectorOrOptions === 'object'
|
|
9
|
+
? selectorOrOptions
|
|
10
|
+
: { selector: selectorOrOptions, init: initFunction };
|
|
11
|
+
|
|
12
|
+
componentRegistry[name] = {
|
|
13
|
+
selector: options.selector,
|
|
14
|
+
init: options.init,
|
|
15
|
+
refresh: options.refresh,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const initComponent = (element, componentName) => {
|
|
20
|
+
const component = componentRegistry[componentName];
|
|
21
|
+
if (!component) return;
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
component.init(element);
|
|
25
|
+
if (element.hasAttribute(`data-${componentName}-initialized`)) {
|
|
26
|
+
element.dataset.basecoatComponent = componentName;
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error(`Failed to initialize ${componentName}:`, error);
|
|
30
|
+
if (typeof element._destroy === 'function') {
|
|
31
|
+
try {
|
|
32
|
+
element._destroy();
|
|
33
|
+
} catch (destroyError) {
|
|
34
|
+
console.error(`Failed to clean up ${componentName} after initialization error:`, destroyError);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
delete element._destroy;
|
|
38
|
+
element.removeAttribute(`data-${componentName}-initialized`);
|
|
39
|
+
delete element.dataset.basecoatComponent;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const destroyComponent = (element) => {
|
|
44
|
+
if (!element || element.nodeType !== Node.ELEMENT_NODE) return;
|
|
45
|
+
const componentName = element.dataset?.basecoatComponent;
|
|
46
|
+
|
|
47
|
+
if (typeof element._destroy === 'function') {
|
|
48
|
+
try {
|
|
49
|
+
element._destroy();
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Failed to destroy Basecoat component:', error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
delete element._destroy;
|
|
56
|
+
if (componentName) element.removeAttribute(`data-${componentName}-initialized`);
|
|
57
|
+
delete element.dataset.basecoatComponent;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const destroyRemovedComponents = (node) => {
|
|
61
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return;
|
|
62
|
+
if (node.isConnected) return;
|
|
63
|
+
|
|
64
|
+
if (node.dataset?.basecoatComponent) destroyComponent(node);
|
|
65
|
+
node.querySelectorAll('[data-basecoat-component]').forEach(destroyComponent);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const uniqueElements = (elements) => Array.from(new Set(elements));
|
|
69
|
+
|
|
70
|
+
const getComponentElements = (componentName, selector, force = false) => {
|
|
71
|
+
const elements = Array.from(document.querySelectorAll(selector));
|
|
72
|
+
if (force) {
|
|
73
|
+
elements.push(...document.querySelectorAll(`[data-basecoat-component="${componentName}"]`));
|
|
74
|
+
}
|
|
75
|
+
return uniqueElements(elements);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const initAllComponents = (options = {}) => {
|
|
79
|
+
const force = options.force === true;
|
|
80
|
+
Object.entries(componentRegistry).forEach(([name, { selector }]) => {
|
|
81
|
+
getComponentElements(name, selector, force).forEach((element) => {
|
|
82
|
+
const wasComponent = element.dataset?.basecoatComponent === name;
|
|
83
|
+
if (force) destroyComponent(element);
|
|
84
|
+
if (wasComponent || element.matches(selector)) initComponent(element, name);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const initNewComponents = (node) => {
|
|
90
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return;
|
|
91
|
+
|
|
92
|
+
Object.entries(componentRegistry).forEach(([name, { selector }]) => {
|
|
93
|
+
if (node.matches(selector)) initComponent(node, name);
|
|
94
|
+
node.querySelectorAll(selector).forEach(element => initComponent(element, name));
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const refreshComponent = (element) => {
|
|
99
|
+
if (!element) return;
|
|
100
|
+
if (typeof element.refresh === 'function') {
|
|
101
|
+
element.refresh();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const componentName = element.dataset?.basecoatComponent;
|
|
106
|
+
const component = componentName ? componentRegistry[componentName] : null;
|
|
107
|
+
if (component?.refresh) {
|
|
108
|
+
component.refresh(element);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const startObserver = () => {
|
|
113
|
+
if (observer) return;
|
|
114
|
+
|
|
115
|
+
observer = new MutationObserver((mutations) => {
|
|
116
|
+
mutations.forEach((mutation) => {
|
|
117
|
+
mutation.addedNodes.forEach(initNewComponents);
|
|
118
|
+
mutation.removedNodes.forEach(destroyRemovedComponents);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const stopObserver = () => {
|
|
126
|
+
if (!observer) return;
|
|
127
|
+
observer.disconnect();
|
|
128
|
+
observer = null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const initRegisteredComponent = (componentName, options = {}) => {
|
|
132
|
+
const component = componentRegistry[componentName];
|
|
133
|
+
if (!component) {
|
|
134
|
+
console.warn(`Component '${componentName}' not found in registry`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const force = options.force === true;
|
|
139
|
+
getComponentElements(componentName, component.selector, force).forEach((element) => {
|
|
140
|
+
const wasComponent = element.dataset?.basecoatComponent === componentName;
|
|
141
|
+
if (force) destroyComponent(element);
|
|
142
|
+
if (wasComponent || element.matches(component.selector)) initComponent(element, componentName);
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const initAllRegisteredComponents = (options = {}) => {
|
|
147
|
+
initAllComponents(options);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const setTheme = (mode) => {
|
|
151
|
+
const dark = mode === 'dark';
|
|
152
|
+
document.documentElement.classList.toggle('dark', dark);
|
|
153
|
+
try { localStorage.setItem('themeMode', dark ? 'dark' : 'light'); } catch (_) {}
|
|
154
|
+
document.dispatchEvent(new CustomEvent('basecoat:themechange', { detail: { mode: dark ? 'dark' : 'light' } }));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const getTheme = () => document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
|
158
|
+
|
|
159
|
+
window.basecoat = {
|
|
160
|
+
register: registerComponent,
|
|
161
|
+
init: initRegisteredComponent,
|
|
162
|
+
initAll: initAllRegisteredComponents,
|
|
163
|
+
refresh: refreshComponent,
|
|
164
|
+
start: startObserver,
|
|
165
|
+
stop: stopObserver,
|
|
166
|
+
theme: {
|
|
167
|
+
get: getTheme,
|
|
168
|
+
set: setTheme,
|
|
169
|
+
toggle: () => setTheme(getTheme() === 'dark' ? 'light' : 'dark'),
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
174
|
+
initAllComponents();
|
|
175
|
+
startObserver();
|
|
176
|
+
});
|
|
177
|
+
})();
|
|
178
|
+
|
|
179
|
+
(() => {
|
|
180
|
+
const states = new WeakMap();
|
|
181
|
+
|
|
182
|
+
const isDisabled = (tab) => tab.disabled || tab.getAttribute('aria-disabled') === 'true';
|
|
183
|
+
|
|
184
|
+
const getElements = (root) => {
|
|
185
|
+
const tablist = root.querySelector('[role="tablist"]');
|
|
186
|
+
const tabs = tablist ? Array.from(tablist.querySelectorAll('[role="tab"]')) : [];
|
|
187
|
+
const panels = tabs.map(tab => document.getElementById(tab.getAttribute('aria-controls'))).filter(Boolean);
|
|
188
|
+
return { tablist, tabs, panels };
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const refreshTabs = (root) => {
|
|
192
|
+
const state = states.get(root);
|
|
193
|
+
if (!state) return;
|
|
194
|
+
|
|
195
|
+
Object.assign(state, getElements(root));
|
|
196
|
+
if (!state.tablist) return;
|
|
197
|
+
|
|
198
|
+
const selected = state.tabs.find(tab => tab.getAttribute('aria-selected') === 'true' && !isDisabled(tab))
|
|
199
|
+
|| state.tabs.find(tab => !isDisabled(tab));
|
|
200
|
+
if (selected) root.select(selected, false);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const initTabs = (root) => {
|
|
204
|
+
if (root.dataset.tabsInitialized) return;
|
|
205
|
+
|
|
206
|
+
const state = {};
|
|
207
|
+
states.set(root, state);
|
|
208
|
+
root.refresh = () => refreshTabs(root);
|
|
209
|
+
|
|
210
|
+
const selectTab = (tabToSelect, focus = false) => {
|
|
211
|
+
if (!tabToSelect || isDisabled(tabToSelect)) return;
|
|
212
|
+
|
|
213
|
+
state.tabs.forEach((tab) => {
|
|
214
|
+
tab.setAttribute('aria-selected', 'false');
|
|
215
|
+
tab.setAttribute('tabindex', '-1');
|
|
216
|
+
const panel = document.getElementById(tab.getAttribute('aria-controls'));
|
|
217
|
+
if (panel) panel.hidden = true;
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
tabToSelect.setAttribute('aria-selected', 'true');
|
|
221
|
+
tabToSelect.setAttribute('tabindex', '0');
|
|
222
|
+
const activePanel = document.getElementById(tabToSelect.getAttribute('aria-controls'));
|
|
223
|
+
if (activePanel) activePanel.hidden = false;
|
|
224
|
+
if (focus) tabToSelect.focus();
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
root.select = selectTab;
|
|
228
|
+
refreshTabs(root);
|
|
229
|
+
if (!state.tablist) {
|
|
230
|
+
states.delete(root);
|
|
231
|
+
delete root.refresh;
|
|
232
|
+
delete root.select;
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const handleClick = (event) => {
|
|
237
|
+
const clickedTab = event.target.closest('[role="tab"]');
|
|
238
|
+
if (clickedTab) root.select(clickedTab);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const handleKeydown = (event) => {
|
|
242
|
+
const currentTab = event.target;
|
|
243
|
+
if (!state.tabs.includes(currentTab)) return;
|
|
244
|
+
|
|
245
|
+
const enabledTabs = state.tabs.filter(tab => !isDisabled(tab));
|
|
246
|
+
const currentIndex = enabledTabs.indexOf(currentTab);
|
|
247
|
+
const orientation = state.tablist.getAttribute('aria-orientation') || 'horizontal';
|
|
248
|
+
if (currentIndex === -1) return;
|
|
249
|
+
|
|
250
|
+
let nextTab;
|
|
251
|
+
if (event.key === 'ArrowRight' && orientation === 'horizontal') nextTab = enabledTabs[(currentIndex + 1) % enabledTabs.length];
|
|
252
|
+
if (event.key === 'ArrowLeft' && orientation === 'horizontal') nextTab = enabledTabs[(currentIndex - 1 + enabledTabs.length) % enabledTabs.length];
|
|
253
|
+
if (event.key === 'ArrowDown' && orientation === 'vertical') nextTab = enabledTabs[(currentIndex + 1) % enabledTabs.length];
|
|
254
|
+
if (event.key === 'ArrowUp' && orientation === 'vertical') nextTab = enabledTabs[(currentIndex - 1 + enabledTabs.length) % enabledTabs.length];
|
|
255
|
+
if (event.key === 'Home') nextTab = enabledTabs[0];
|
|
256
|
+
if (event.key === 'End') nextTab = enabledTabs[enabledTabs.length - 1];
|
|
257
|
+
if (!nextTab) return;
|
|
258
|
+
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
root.select(nextTab, true);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
state.tablist.addEventListener('click', handleClick);
|
|
264
|
+
state.tablist.addEventListener('keydown', handleKeydown);
|
|
265
|
+
|
|
266
|
+
root._destroy = () => {
|
|
267
|
+
state.tablist.removeEventListener('click', handleClick);
|
|
268
|
+
state.tablist.removeEventListener('keydown', handleKeydown);
|
|
269
|
+
states.delete(root);
|
|
270
|
+
delete root.refresh;
|
|
271
|
+
delete root.select;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
root.dataset.tabsInitialized = 'true';
|
|
275
|
+
root.dispatchEvent(new CustomEvent('basecoat:initialized'));
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
if (window.basecoat) {
|
|
279
|
+
window.basecoat.register('tabs', {
|
|
280
|
+
selector: '.tabs:not([data-tabs-initialized])',
|
|
281
|
+
init: initTabs,
|
|
282
|
+
refresh: refreshTabs,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
})();
|
|
286
|
+
|
|
287
|
+
// Loaded after the DOM is ready: initialize now.
|
|
288
|
+
if (document.readyState !== 'loading') { window.basecoat.initAll(); window.basecoat.start(); }
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* @auvyx/ui textarea | order 34 */
|
|
2
|
+
@layer components {
|
|
3
|
+
.field > textarea, .textarea {
|
|
4
|
+
display: flex;
|
|
5
|
+
field-sizing: content;
|
|
6
|
+
min-height: calc(var(--spacing) * 16);
|
|
7
|
+
width: 100%;
|
|
8
|
+
--tw-outline-style: none;
|
|
9
|
+
outline-style: none;
|
|
10
|
+
&::placeholder {
|
|
11
|
+
color: var(--color-muted-foreground);
|
|
12
|
+
}
|
|
13
|
+
&:disabled {
|
|
14
|
+
cursor: not-allowed;
|
|
15
|
+
}
|
|
16
|
+
&:disabled {
|
|
17
|
+
opacity: 50%;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@layer components {
|
|
23
|
+
.field > textarea, .textarea {
|
|
24
|
+
border-radius: var(--radius-md);
|
|
25
|
+
border-style: var(--tw-border-style);
|
|
26
|
+
border-width: 1px;
|
|
27
|
+
border-color: var(--color-input);
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
30
|
+
padding-block: calc(var(--spacing) * 2);
|
|
31
|
+
font-size: var(--text-base);
|
|
32
|
+
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
33
|
+
--tw-shadow: var(--shadow-xs, 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)));
|
|
34
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
35
|
+
transition-property: color,box-shadow;
|
|
36
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
37
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
38
|
+
&:focus-visible {
|
|
39
|
+
border-color: var(--color-ring);
|
|
40
|
+
}
|
|
41
|
+
&:focus-visible {
|
|
42
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
43
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
44
|
+
}
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
--tw-ring-color: var(--color-ring);
|
|
47
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
48
|
+
--tw-ring-color: color-mix(in oklab, var(--color-ring) 50%, transparent);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
&[aria-invalid="true"] {
|
|
52
|
+
border-color: var(--color-destructive);
|
|
53
|
+
}
|
|
54
|
+
&[aria-invalid="true"] {
|
|
55
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
56
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
57
|
+
}
|
|
58
|
+
&[aria-invalid="true"] {
|
|
59
|
+
--tw-ring-color: var(--color-destructive);
|
|
60
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
61
|
+
--tw-ring-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@media (width >= 48rem) {
|
|
65
|
+
font-size: var(--text-sm);
|
|
66
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
67
|
+
}
|
|
68
|
+
&:is(html.dark *) {
|
|
69
|
+
background-color: var(--color-input);
|
|
70
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
71
|
+
background-color: color-mix(in oklab, var(--color-input) 30%, transparent);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
&:is(html.dark *) {
|
|
75
|
+
&[aria-invalid="true"] {
|
|
76
|
+
border-color: var(--color-destructive);
|
|
77
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
78
|
+
border-color: color-mix(in oklab, var(--color-destructive) 50%, transparent);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&:is(html.dark *) {
|
|
83
|
+
&[aria-invalid="true"] {
|
|
84
|
+
--tw-ring-color: var(--color-destructive);
|
|
85
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
86
|
+
--tw-ring-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* @auvyx/ui toast | order 36 */
|
|
2
|
+
@layer components {
|
|
3
|
+
.toaster {
|
|
4
|
+
pointer-events: none;
|
|
5
|
+
position: fixed;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
z-index: 50;
|
|
8
|
+
display: flex;
|
|
9
|
+
width: 100%;
|
|
10
|
+
flex-direction: column-reverse;
|
|
11
|
+
gap: calc(var(--spacing) * 4);
|
|
12
|
+
padding: calc(var(--spacing) * 4);
|
|
13
|
+
@media (width >= 40rem) {
|
|
14
|
+
max-width: calc(var(--spacing) * 90);
|
|
15
|
+
}
|
|
16
|
+
&:not([data-align]), &[data-align='end'] {
|
|
17
|
+
right: 0;
|
|
18
|
+
}
|
|
19
|
+
&[data-align='start'] {
|
|
20
|
+
left: 0;
|
|
21
|
+
}
|
|
22
|
+
&[data-align='center'] {
|
|
23
|
+
left: calc(1 / 2 * 100%);
|
|
24
|
+
--tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
|
|
25
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
26
|
+
}
|
|
27
|
+
.toast {
|
|
28
|
+
pointer-events: auto;
|
|
29
|
+
display: grid;
|
|
30
|
+
width: 100%;
|
|
31
|
+
animation: toast-up 0.3s ease-in-out;
|
|
32
|
+
grid-template-rows: 1fr;
|
|
33
|
+
transition-property: grid-template-rows,opacity;
|
|
34
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
35
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
36
|
+
--tw-duration: 300ms;
|
|
37
|
+
transition-duration: 300ms;
|
|
38
|
+
--tw-ease: var(--ease-in-out);
|
|
39
|
+
transition-timing-function: var(--ease-in-out);
|
|
40
|
+
.toast-content {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: calc(var(--spacing) * 2.5);
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
padding: calc(var(--spacing) * 3);
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
svg {
|
|
48
|
+
width: calc(var(--spacing) * 4);
|
|
49
|
+
height: calc(var(--spacing) * 4);
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
}
|
|
52
|
+
section {
|
|
53
|
+
h2 {
|
|
54
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
55
|
+
font-weight: var(--font-weight-medium);
|
|
56
|
+
--tw-tracking: var(--tracking-tight);
|
|
57
|
+
letter-spacing: var(--tracking-tight);
|
|
58
|
+
}
|
|
59
|
+
p {
|
|
60
|
+
word-break: break-all;
|
|
61
|
+
color: var(--color-muted-foreground);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
footer {
|
|
65
|
+
margin-inline-start: auto;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: calc(var(--spacing) * 2);
|
|
69
|
+
[data-toast-action], [data-toast-cancel] {
|
|
70
|
+
height: calc(var(--spacing) * 6);
|
|
71
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
72
|
+
font-size: var(--text-xs);
|
|
73
|
+
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
&[aria-hidden='true'] {
|
|
78
|
+
grid-template-rows: 0fr;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
border-style: var(--tw-border-style);
|
|
81
|
+
border-width: 0px;
|
|
82
|
+
padding: 0;
|
|
83
|
+
opacity: 0%;
|
|
84
|
+
.toast-content {
|
|
85
|
+
border-style: var(--tw-border-style);
|
|
86
|
+
border-width: 0px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes toast-up {
|
|
94
|
+
from {
|
|
95
|
+
opacity: 0;
|
|
96
|
+
transform: translateY(100%);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@layer components {
|
|
101
|
+
.toast-content {
|
|
102
|
+
border-radius: var(--radius-2xl);
|
|
103
|
+
border-style: var(--tw-border-style);
|
|
104
|
+
border-width: 1px;
|
|
105
|
+
background-color: var(--color-popover);
|
|
106
|
+
color: var(--color-popover-foreground);
|
|
107
|
+
--tw-shadow: var(--shadow-lg, 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1)));
|
|
108
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
109
|
+
}
|
|
110
|
+
}
|