astralis-ui 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 +21 -0
- package/README.md +89 -0
- package/dist/components/buttons/button/button.js +83 -0
- package/dist/components/buttons/button/button.styles.js +69 -0
- package/dist/components/buttons/button-group/button-group.context.js +10 -0
- package/dist/components/buttons/button-group/button-group.js +42 -0
- package/dist/components/buttons/button-group/button-group.styles.js +39 -0
- package/dist/components/buttons/theme-toggle/theme-toggle.js +53 -0
- package/dist/components/data-display/avatar/avatar.context.js +10 -0
- package/dist/components/data-display/avatar/avatar.styles.js +40 -0
- package/dist/components/data-display/avatar/components/avatar-badge.js +24 -0
- package/dist/components/data-display/avatar/components/avatar-group.js +30 -0
- package/dist/components/data-display/avatar/components/avatar-root.js +57 -0
- package/dist/components/data-display/avatar/index.js +13 -0
- package/dist/components/data-display/badge/badge.js +12 -0
- package/dist/components/data-display/badge/badge.styles.js +25 -0
- package/dist/components/data-display/calendar/calendar.context.js +13 -0
- package/dist/components/data-display/calendar/components/calendar-cell.js +60 -0
- package/dist/components/data-display/calendar/components/calendar-grid.js +106 -0
- package/dist/components/data-display/calendar/components/calendar-header.js +23 -0
- package/dist/components/data-display/calendar/components/calendar-next-trigger.js +34 -0
- package/dist/components/data-display/calendar/components/calendar-prev-trigger.js +34 -0
- package/dist/components/data-display/calendar/components/calendar-root.js +154 -0
- package/dist/components/data-display/calendar/components/calendar-view-trigger.js +28 -0
- package/dist/components/data-display/calendar/components/calendar-weekdays.js +43 -0
- package/dist/components/data-display/calendar/index.js +30 -0
- package/dist/components/data-display/card/card.context.js +10 -0
- package/dist/components/data-display/card/card.styles.js +30 -0
- package/dist/components/data-display/card/components/card-body.js +19 -0
- package/dist/components/data-display/card/components/card-description.js +25 -0
- package/dist/components/data-display/card/components/card-footer.js +32 -0
- package/dist/components/data-display/card/components/card-header.js +37 -0
- package/dist/components/data-display/card/components/card-root.js +30 -0
- package/dist/components/data-display/card/components/card-title.js +25 -0
- package/dist/components/data-display/card/index.js +24 -0
- package/dist/components/data-display/data-list/components/data-list-item.js +20 -0
- package/dist/components/data-display/data-list/components/data-list-label.js +23 -0
- package/dist/components/data-display/data-list/components/data-list-root.js +11 -0
- package/dist/components/data-display/data-list/components/data-list-value.js +12 -0
- package/dist/components/data-display/data-list/data-list.context.js +12 -0
- package/dist/components/data-display/data-list/index.js +16 -0
- package/dist/components/data-display/image/components/image-group.js +79 -0
- package/dist/components/data-display/image/components/image-lightbox.js +188 -0
- package/dist/components/data-display/image/components/image-root.js +98 -0
- package/dist/components/data-display/image/components/image.constants.js +28 -0
- package/dist/components/data-display/image/index.js +11 -0
- package/dist/components/data-display/marquee/components/marquee-item.js +27 -0
- package/dist/components/data-display/marquee/components/marquee-root.js +130 -0
- package/dist/components/data-display/marquee/index.js +11 -0
- package/dist/components/data-display/qr-code/index.js +7 -0
- package/dist/components/data-display/qr-code/qr-code.js +203 -0
- package/dist/components/data-display/stat/components/stat-help-text.js +9 -0
- package/dist/components/data-display/stat/components/stat-indicator.js +23 -0
- package/dist/components/data-display/stat/components/stat-label.js +9 -0
- package/dist/components/data-display/stat/components/stat-root.js +10 -0
- package/dist/components/data-display/stat/components/stat-value.js +9 -0
- package/dist/components/data-display/stat/index.js +19 -0
- package/dist/components/data-display/stat/stat.context.js +6 -0
- package/dist/components/data-display/table/components/table-body.js +9 -0
- package/dist/components/data-display/table/components/table-caption.js +26 -0
- package/dist/components/data-display/table/components/table-cell.js +12 -0
- package/dist/components/data-display/table/components/table-footer.js +9 -0
- package/dist/components/data-display/table/components/table-head.js +20 -0
- package/dist/components/data-display/table/components/table-header.js +22 -0
- package/dist/components/data-display/table/components/table-root.js +20 -0
- package/dist/components/data-display/table/components/table-row.js +23 -0
- package/dist/components/data-display/table/index.js +28 -0
- package/dist/components/data-display/table/table.context.js +12 -0
- package/dist/components/data-display/table/table.styles.js +9 -0
- package/dist/components/data-display/tag/components/checkable-tag-group.js +37 -0
- package/dist/components/data-display/tag/components/checkable-tag.js +45 -0
- package/dist/components/data-display/tag/components/tag-root.js +52 -0
- package/dist/components/data-display/tag/index.js +14 -0
- package/dist/components/data-display/tag/tag.styles.js +27 -0
- package/dist/components/data-display/timeline/components/timeline-content.js +23 -0
- package/dist/components/data-display/timeline/components/timeline-indicator.js +21 -0
- package/dist/components/data-display/timeline/components/timeline-item.js +23 -0
- package/dist/components/data-display/timeline/components/timeline-root.js +12 -0
- package/dist/components/data-display/timeline/index.js +20 -0
- package/dist/components/data-display/timeline/timeline.context.js +18 -0
- package/dist/components/data-display/timeline/timeline.styles.js +33 -0
- package/dist/components/data-entry/checkbox/checkbox.context.js +12 -0
- package/dist/components/data-entry/checkbox/checkbox.styles.js +14 -0
- package/dist/components/data-entry/checkbox/components/checkbox-group.js +38 -0
- package/dist/components/data-entry/checkbox/components/checkbox.js +86 -0
- package/dist/components/data-entry/checkbox/index.js +11 -0
- package/dist/components/data-entry/combobox/combobox.js +178 -0
- package/dist/components/data-entry/field/components/field-error-text.js +47 -0
- package/dist/components/data-entry/field/components/field-help-text.js +30 -0
- package/dist/components/data-entry/field/components/field-label.js +35 -0
- package/dist/components/data-entry/field/components/field-root.js +45 -0
- package/dist/components/data-entry/field/field.context.js +10 -0
- package/dist/components/data-entry/field/index.js +17 -0
- package/dist/components/data-entry/input/components/input-group.js +15 -0
- package/dist/components/data-entry/input/components/input-password.js +42 -0
- package/dist/components/data-entry/input/components/input-search.js +48 -0
- package/dist/components/data-entry/input/components/input-textarea.js +53 -0
- package/dist/components/data-entry/input/components/input.js +44 -0
- package/dist/components/data-entry/input/index.js +18 -0
- package/dist/components/data-entry/input/input.context.js +13 -0
- package/dist/components/data-entry/input/input.styles.js +48 -0
- package/dist/components/data-entry/multi-select/components/multi-select.js +301 -0
- package/dist/components/data-entry/multi-select/multi-select.styles.js +47 -0
- package/dist/components/data-entry/number-input/number-input.js +97 -0
- package/dist/components/data-entry/pin-input/components/pin-input.js +127 -0
- package/dist/components/data-entry/pin-input/pin-input.styles.js +35 -0
- package/dist/components/data-entry/radio/components/radio-group.js +38 -0
- package/dist/components/data-entry/radio/components/radio.js +80 -0
- package/dist/components/data-entry/radio/index.js +11 -0
- package/dist/components/data-entry/radio/radio.context.js +10 -0
- package/dist/components/data-entry/radio/radio.styles.js +14 -0
- package/dist/components/data-entry/select/components/select.js +208 -0
- package/dist/components/data-entry/select/select.styles.js +35 -0
- package/dist/components/data-entry/shared/options.js +49 -0
- package/dist/components/data-entry/slider/components/slider.js +395 -0
- package/dist/components/data-entry/slider/slider.styles.js +15 -0
- package/dist/components/data-entry/switch/components/switch.js +86 -0
- package/dist/components/data-entry/switch/switch.styles.js +14 -0
- package/dist/components/disclosure/accordion/accordion.context.js +20 -0
- package/dist/components/disclosure/accordion/accordion.styles.js +84 -0
- package/dist/components/disclosure/accordion/components/accordion-content.js +26 -0
- package/dist/components/disclosure/accordion/components/accordion-item.js +30 -0
- package/dist/components/disclosure/accordion/components/accordion-root.js +80 -0
- package/dist/components/disclosure/accordion/components/accordion-trigger.js +49 -0
- package/dist/components/disclosure/accordion/index.js +16 -0
- package/dist/components/disclosure/carousel/carousel.context.js +18 -0
- package/dist/components/disclosure/carousel/carousel.styles.js +77 -0
- package/dist/components/disclosure/carousel/components/carousel-autoplay-trigger.js +25 -0
- package/dist/components/disclosure/carousel/components/carousel-control.js +12 -0
- package/dist/components/disclosure/carousel/components/carousel-indicator.js +22 -0
- package/dist/components/disclosure/carousel/components/carousel-indicators.js +32 -0
- package/dist/components/disclosure/carousel/components/carousel-next.js +24 -0
- package/dist/components/disclosure/carousel/components/carousel-prev.js +24 -0
- package/dist/components/disclosure/carousel/components/carousel-progress-text.js +21 -0
- package/dist/components/disclosure/carousel/components/carousel-root.js +129 -0
- package/dist/components/disclosure/carousel/components/carousel-slide.js +49 -0
- package/dist/components/disclosure/carousel/components/carousel-track.js +74 -0
- package/dist/components/disclosure/carousel/index.js +34 -0
- package/dist/components/disclosure/pagination/components/pagination-controls.js +79 -0
- package/dist/components/disclosure/pagination/components/pagination-ellipsis.js +11 -0
- package/dist/components/disclosure/pagination/components/pagination-item.js +24 -0
- package/dist/components/disclosure/pagination/components/pagination-jumper.js +35 -0
- package/dist/components/disclosure/pagination/components/pagination-list.js +9 -0
- package/dist/components/disclosure/pagination/components/pagination-page-text.js +18 -0
- package/dist/components/disclosure/pagination/components/pagination-pages.js +24 -0
- package/dist/components/disclosure/pagination/components/pagination-root.js +44 -0
- package/dist/components/disclosure/pagination/index.js +34 -0
- package/dist/components/disclosure/pagination/pagination.context.js +12 -0
- package/dist/components/disclosure/pagination/pagination.styles.js +84 -0
- package/dist/components/feedback/alert/alert.js +55 -0
- package/dist/components/feedback/alert/alert.styles.js +23 -0
- package/dist/components/feedback/progress/progress.js +112 -0
- package/dist/components/feedback/progress/progress.styles.js +25 -0
- package/dist/components/feedback/skeleton/skeleton.js +27 -0
- package/dist/components/feedback/skeleton/skeleton.styles.js +20 -0
- package/dist/components/feedback/spinner/spinner.js +32 -0
- package/dist/components/feedback/spinner/spinner.styles.js +17 -0
- package/dist/components/feedback/status.js +18 -0
- package/dist/components/feedback/toast/toast-store.js +35 -0
- package/dist/components/feedback/toast/toast.styles.js +20 -0
- package/dist/components/feedback/toast/toaster.js +65 -0
- package/dist/components/icon/icon.js +47 -0
- package/dist/components/icon/icon.styles.js +20 -0
- package/dist/components/icon/internal-icons.js +143 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.js +32 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.styles.js +18 -0
- package/dist/components/layout/box/box.js +30 -0
- package/dist/components/layout/box/box.styles.js +76 -0
- package/dist/components/layout/center/center.js +31 -0
- package/dist/components/layout/container/container.js +40 -0
- package/dist/components/layout/flex/flex-item.js +35 -0
- package/dist/components/layout/flex/flex.js +32 -0
- package/dist/components/layout/flex/flex.style.js +42 -0
- package/dist/components/layout/flex/index.js +11 -0
- package/dist/components/layout/float/float.js +32 -0
- package/dist/components/layout/float/float.styles.js +29 -0
- package/dist/components/layout/grid/grid-item.js +36 -0
- package/dist/components/layout/grid/grid.js +47 -0
- package/dist/components/layout/grid/grid.styles.js +43 -0
- package/dist/components/layout/grid/index.js +10 -0
- package/dist/components/layout/separator/separator.js +33 -0
- package/dist/components/layout/separator/separator.styles.js +29 -0
- package/dist/components/layout/stack/stack.js +24 -0
- package/dist/components/menu/components/menu-content.js +62 -0
- package/dist/components/menu/components/menu-parts.js +81 -0
- package/dist/components/menu/components/menu-root.js +36 -0
- package/dist/components/menu/index.js +15 -0
- package/dist/components/menu/menu.context.js +12 -0
- package/dist/components/menu/menu.styles.js +12 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.js +50 -0
- package/dist/components/navigation/steps/components/steps-completed.js +12 -0
- package/dist/components/navigation/steps/components/steps-content.js +12 -0
- package/dist/components/navigation/steps/components/steps-description.js +13 -0
- package/dist/components/navigation/steps/components/steps-indicator.js +34 -0
- package/dist/components/navigation/steps/components/steps-item.js +112 -0
- package/dist/components/navigation/steps/components/steps-list.js +21 -0
- package/dist/components/navigation/steps/components/steps-next.js +25 -0
- package/dist/components/navigation/steps/components/steps-prev.js +25 -0
- package/dist/components/navigation/steps/components/steps-root.js +61 -0
- package/dist/components/navigation/steps/components/steps-title.js +13 -0
- package/dist/components/navigation/steps/index.js +34 -0
- package/dist/components/navigation/steps/steps.context.js +20 -0
- package/dist/components/navigation/steps/steps.styles.js +97 -0
- package/dist/components/navigation/tabs/components/tabs-content.js +26 -0
- package/dist/components/navigation/tabs/components/tabs-list.js +45 -0
- package/dist/components/navigation/tabs/components/tabs-root.js +54 -0
- package/dist/components/navigation/tabs/components/tabs-trigger.js +54 -0
- package/dist/components/navigation/tabs/index.js +16 -0
- package/dist/components/navigation/tabs/tabs.context.js +12 -0
- package/dist/components/navigation/tabs/tabs.styles.js +80 -0
- package/dist/components/overlay/drawer/components/drawer-content.js +48 -0
- package/dist/components/overlay/drawer/components/drawer-parts.js +48 -0
- package/dist/components/overlay/drawer/components/drawer-root.js +58 -0
- package/dist/components/overlay/drawer/drawer.context.js +12 -0
- package/dist/components/overlay/drawer/drawer.styles.js +32 -0
- package/dist/components/overlay/drawer/index.js +27 -0
- package/dist/components/overlay/modal/components/modal-content.js +48 -0
- package/dist/components/overlay/modal/components/modal-parts.js +48 -0
- package/dist/components/overlay/modal/components/modal-root.js +58 -0
- package/dist/components/overlay/modal/index.js +27 -0
- package/dist/components/overlay/modal/modal.context.js +12 -0
- package/dist/components/overlay/modal/modal.styles.js +31 -0
- package/dist/components/overlay/popover/components/popover-content.js +76 -0
- package/dist/components/overlay/popover/components/popover-parts.js +17 -0
- package/dist/components/overlay/popover/components/popover-root.js +71 -0
- package/dist/components/overlay/popover/index.js +19 -0
- package/dist/components/overlay/popover/popover.context.js +12 -0
- package/dist/components/overlay/popover/popover.styles.js +6 -0
- package/dist/components/overlay/portal.js +10 -0
- package/dist/components/overlay/tooltip/components/tooltip-content.js +52 -0
- package/dist/components/overlay/tooltip/components/tooltip-root.js +53 -0
- package/dist/components/overlay/tooltip/index.js +12 -0
- package/dist/components/overlay/tooltip/tooltip.context.js +12 -0
- package/dist/components/overlay/tooltip/tooltip.styles.js +6 -0
- package/dist/components/typography/blockquote/blockquote.js +39 -0
- package/dist/components/typography/blockquote/blockquote.styles.js +21 -0
- package/dist/components/typography/code/code.js +35 -0
- package/dist/components/typography/code/code.styles.js +26 -0
- package/dist/components/typography/code-block/code-block.js +57 -0
- package/dist/components/typography/code-block/code-block.styles.js +36 -0
- package/dist/components/typography/heading/heading.js +21 -0
- package/dist/components/typography/highlight/highlight.js +30 -0
- package/dist/components/typography/highlight/highlight.styles.js +18 -0
- package/dist/components/typography/kbd/kbd.js +26 -0
- package/dist/components/typography/link/link.js +48 -0
- package/dist/components/typography/list/index.js +10 -0
- package/dist/components/typography/list/list-item.js +37 -0
- package/dist/components/typography/list/list.js +35 -0
- package/dist/components/typography/list/list.styles.js +35 -0
- package/dist/components/typography/text/text.js +80 -0
- package/dist/components/typography/text/text.styles.js +110 -0
- package/dist/const/color-mappings.js +541 -0
- package/dist/const/color-schemes.js +5 -0
- package/dist/const/common-mappings.js +127 -0
- package/dist/const/layout-mappings.js +446 -0
- package/dist/const/positioning-mappings.js +164 -0
- package/dist/const/rounded-mappings.js +121 -0
- package/dist/const/sizing-mappings.js +1113 -0
- package/dist/const/spacing-mappings.js +508 -0
- package/dist/hooks/use-anchor-position.js +39 -0
- package/dist/hooks/use-controllable-state.js +18 -0
- package/dist/hooks/use-dismiss.js +23 -0
- package/dist/hooks/use-overlay-behavior.js +42 -0
- package/dist/hooks/use-prefers-reduced-motion.js +15 -0
- package/dist/hooks/use-presence.js +18 -0
- package/dist/hooks/use-roving-focus.js +51 -0
- package/dist/index.d.ts +3533 -0
- package/dist/index.js +359 -0
- package/dist/styles.css +2 -0
- package/dist/theme/provider.js +130 -0
- package/dist/utils/astralis-merge.js +31 -0
- package/dist/utils/overlay-stack.js +27 -0
- package/dist/utils/responsive.js +32 -0
- package/dist/utils/split-variant-props.js +13 -0
- package/package.json +107 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { useState as v, useEffect as h, useContext as S, createContext as y } from "react";
|
|
4
|
+
const T = y(void 0);
|
|
5
|
+
function u(e) {
|
|
6
|
+
return e === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
7
|
+
}
|
|
8
|
+
function M(e) {
|
|
9
|
+
const r = e.replace("#", ""), t = /^([a-f\d])([a-f\d])([a-f\d])$/i, n = r.replace(t, (o, c, a, l) => c + c + a + a + l + l), s = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);
|
|
10
|
+
return s ? { r: parseInt(s[1], 16), g: parseInt(s[2], 16), b: parseInt(s[3], 16) } : null;
|
|
11
|
+
}
|
|
12
|
+
const m = (e) => e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4), b = (e) => e <= 31308e-7 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
|
|
13
|
+
function k(e, r, t) {
|
|
14
|
+
const n = m(e / 255), s = m(r / 255), o = m(t / 255), c = Math.cbrt(0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * o), a = Math.cbrt(0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * o), l = Math.cbrt(0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * o), f = 0.2104542553 * c + 0.793617785 * a - 0.0040720468 * l, i = 1.9779984951 * c - 2.428592205 * a + 0.4505937099 * l, d = 0.0259040371 * c + 0.7827717662 * a - 0.808675766 * l;
|
|
15
|
+
return { l: f, c: Math.hypot(i, d), h: Math.atan2(d, i) };
|
|
16
|
+
}
|
|
17
|
+
function p({ l: e, c: r, h: t }) {
|
|
18
|
+
const n = r * Math.cos(t), s = r * Math.sin(t), o = (e + 0.3963377774 * n + 0.2158037573 * s) ** 3, c = (e - 0.1055613458 * n - 0.0638541728 * s) ** 3, a = (e - 0.0894841775 * n - 1.291485548 * s) ** 3;
|
|
19
|
+
return [
|
|
20
|
+
b(4.0767416621 * o - 3.3077115913 * c + 0.2309699292 * a),
|
|
21
|
+
b(-1.2684380046 * o + 2.6097574011 * c - 0.3413193965 * a),
|
|
22
|
+
b(-0.0041960863 * o - 0.7034186147 * c + 1.707614701 * a)
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
function x(e) {
|
|
26
|
+
const r = (n) => n.every((s) => s >= -1e-4 && s <= 1.0001);
|
|
27
|
+
let t = p(e);
|
|
28
|
+
if (!r(t)) {
|
|
29
|
+
let n = 0, s = e.c;
|
|
30
|
+
for (let o = 0; o < 8; o++) {
|
|
31
|
+
const c = (n + s) / 2;
|
|
32
|
+
r(p({ ...e, c })) ? n = c : s = c;
|
|
33
|
+
}
|
|
34
|
+
t = p({ ...e, c: n });
|
|
35
|
+
}
|
|
36
|
+
return "#" + t.map((n) => Math.round(Math.min(1, Math.max(0, n)) * 255).toString(16).padStart(2, "0")).join("");
|
|
37
|
+
}
|
|
38
|
+
function w(e) {
|
|
39
|
+
const r = M(e);
|
|
40
|
+
if (!r) return null;
|
|
41
|
+
const t = k(r.r, r.g, r.b), n = (o, c) => x({ l: t.l + (0.975 - t.l) * o, c: t.c * c, h: t.h }), s = (o, c) => x({ l: t.l * o, c: t.c * c, h: t.h });
|
|
42
|
+
return {
|
|
43
|
+
50: n(0.92, 0.22),
|
|
44
|
+
100: n(0.84, 0.38),
|
|
45
|
+
200: n(0.68, 0.6),
|
|
46
|
+
300: n(0.5, 0.82),
|
|
47
|
+
400: n(0.28, 0.95),
|
|
48
|
+
500: e,
|
|
49
|
+
600: s(0.86, 0.98),
|
|
50
|
+
700: s(0.72, 0.9),
|
|
51
|
+
800: s(0.58, 0.78),
|
|
52
|
+
900: s(0.46, 0.62)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function I(e) {
|
|
56
|
+
const r = M(e);
|
|
57
|
+
return r && k(r.r, r.g, r.b).l >= 0.66 ? "#000000" : "#ffffff";
|
|
58
|
+
}
|
|
59
|
+
function $(e) {
|
|
60
|
+
if (!e) return {};
|
|
61
|
+
const r = w(e);
|
|
62
|
+
if (!r) return { "--astralis-color-brand-500": e };
|
|
63
|
+
const t = {};
|
|
64
|
+
for (const [n, s] of Object.entries(r))
|
|
65
|
+
t[`--astralis-color-brand-${n}`] = s;
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
function E(e, r) {
|
|
69
|
+
if (!e) return {};
|
|
70
|
+
const t = w(e);
|
|
71
|
+
if (!t) return { "--astralis-color-brand-500": e };
|
|
72
|
+
const n = r === "dark" ? { label: t[300], subtle: t[900], muted: t[800], emphasized: t[700], stroke: t[400] } : { label: t[700], subtle: t[100], muted: t[200], emphasized: t[300], stroke: t[500] }, s = {
|
|
73
|
+
solid: t[500],
|
|
74
|
+
contrast: I(t[500]),
|
|
75
|
+
...n,
|
|
76
|
+
ring: t[500]
|
|
77
|
+
}, o = { ...$(e) };
|
|
78
|
+
for (const [c, a] of Object.entries(s))
|
|
79
|
+
o[`--astralis-color-brand-${c}`] = a, o[`--astralis-color-accent-${c}`] = a;
|
|
80
|
+
return o;
|
|
81
|
+
}
|
|
82
|
+
function j({
|
|
83
|
+
children: e,
|
|
84
|
+
defaultTheme: r = "system",
|
|
85
|
+
storageKey: t = "astralis-ui-theme",
|
|
86
|
+
className: n = "",
|
|
87
|
+
tokens: s
|
|
88
|
+
}) {
|
|
89
|
+
const [o, c] = v(r), [a, l] = v("light");
|
|
90
|
+
h(() => {
|
|
91
|
+
const d = localStorage.getItem(t) || r;
|
|
92
|
+
c(d), l(u(d));
|
|
93
|
+
}, [r, t]), h(() => {
|
|
94
|
+
const i = u(o);
|
|
95
|
+
l(i), o !== "system" ? localStorage.setItem(t, o) : localStorage.removeItem(t);
|
|
96
|
+
}, [o, t]), h(() => {
|
|
97
|
+
if (o !== "system") return;
|
|
98
|
+
const i = window.matchMedia("(prefers-color-scheme: dark)"), d = () => l(u("system"));
|
|
99
|
+
return i.addEventListener("change", d), () => i.removeEventListener("change", d);
|
|
100
|
+
}, [o]), h(() => {
|
|
101
|
+
const i = document.documentElement;
|
|
102
|
+
a === "dark" ? i.classList.add("astralis-dark") : i.classList.remove("astralis-dark");
|
|
103
|
+
}, [a]);
|
|
104
|
+
const f = E(s?.brandColor, a);
|
|
105
|
+
return /* @__PURE__ */ g(T.Provider, { value: { theme: o, setTheme: c, resolvedTheme: a, tokens: s }, children: /* @__PURE__ */ g(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: `astralis ${n}`.trim(),
|
|
109
|
+
style: {
|
|
110
|
+
minHeight: "100vh",
|
|
111
|
+
width: "100%",
|
|
112
|
+
...f
|
|
113
|
+
},
|
|
114
|
+
suppressHydrationWarning: !0,
|
|
115
|
+
children: e
|
|
116
|
+
}
|
|
117
|
+
) });
|
|
118
|
+
}
|
|
119
|
+
const L = () => {
|
|
120
|
+
const e = S(T);
|
|
121
|
+
if (!e)
|
|
122
|
+
throw new Error("useTheme must be used inside an AstralisProvider container root.");
|
|
123
|
+
return e;
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
j as AstralisProvider,
|
|
127
|
+
$ as generateBrandShades,
|
|
128
|
+
E as generateBrandTokens,
|
|
129
|
+
L as useTheme
|
|
130
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx as e } from "clsx";
|
|
3
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
4
|
+
const o = t({
|
|
5
|
+
prefix: "astralis",
|
|
6
|
+
extend: {
|
|
7
|
+
classGroups: {
|
|
8
|
+
// Tell tailwind-merge that 'border-<val>' are valid border widths for these custom keys
|
|
9
|
+
"border-w": [{ border: ["normal", "moderate", "thick", "thicker", "thickest"] }],
|
|
10
|
+
// Tell tailwind-merge that 'border-<val>' are valid colors for these custom keys
|
|
11
|
+
"border-color": [{
|
|
12
|
+
border: [
|
|
13
|
+
"stroke-base",
|
|
14
|
+
"stroke-muted",
|
|
15
|
+
"stroke-subtle",
|
|
16
|
+
"stroke-inverted",
|
|
17
|
+
"stroke-warning",
|
|
18
|
+
"stroke-error",
|
|
19
|
+
"stroke-success",
|
|
20
|
+
"stroke-info"
|
|
21
|
+
]
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
function n(...r) {
|
|
27
|
+
return o(e(r));
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
n as astralisMerge
|
|
31
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const l = [];
|
|
3
|
+
let e = 0, t = "";
|
|
4
|
+
function c() {
|
|
5
|
+
const o = /* @__PURE__ */ Symbol("astralis-overlay");
|
|
6
|
+
return l.push(o), o;
|
|
7
|
+
}
|
|
8
|
+
function i(o) {
|
|
9
|
+
const n = l.indexOf(o);
|
|
10
|
+
n !== -1 && l.splice(n, 1);
|
|
11
|
+
}
|
|
12
|
+
function r(o) {
|
|
13
|
+
return l[l.length - 1] === o;
|
|
14
|
+
}
|
|
15
|
+
function u() {
|
|
16
|
+
e === 0 && (t = document.body.style.overflow, document.body.style.overflow = "hidden"), e++;
|
|
17
|
+
}
|
|
18
|
+
function d() {
|
|
19
|
+
e = Math.max(0, e - 1), e === 0 && (document.body.style.overflow = t);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
r as isTopOverlay,
|
|
23
|
+
u as lockBodyScroll,
|
|
24
|
+
i as popOverlay,
|
|
25
|
+
c as pushOverlay,
|
|
26
|
+
d as unlockBodyScroll
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const p = ["sm", "md", "lg", "xl"], a = new Set(p);
|
|
3
|
+
function y(n, t) {
|
|
4
|
+
return n.split(" ").filter(Boolean).map((e) => {
|
|
5
|
+
const o = e.indexOf(":");
|
|
6
|
+
return o === -1 ? `${t}:${e}` : `${e.slice(0, o + 1)}${t}:${e.slice(o + 1)}`;
|
|
7
|
+
}).join(" ");
|
|
8
|
+
}
|
|
9
|
+
function B(n) {
|
|
10
|
+
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
11
|
+
}
|
|
12
|
+
function $(n, { maps: t, variants: e }) {
|
|
13
|
+
const o = {}, c = [];
|
|
14
|
+
for (const r in n) {
|
|
15
|
+
const s = n[r];
|
|
16
|
+
if (s !== void 0)
|
|
17
|
+
if (B(s)) {
|
|
18
|
+
const f = t[r];
|
|
19
|
+
if (!f) continue;
|
|
20
|
+
for (const i in s) {
|
|
21
|
+
const u = s[i], l = f[u];
|
|
22
|
+
l && (i === "base" ? c.push(l) : a.has(i) && c.push(y(l, i)));
|
|
23
|
+
}
|
|
24
|
+
} else
|
|
25
|
+
o[r] = s;
|
|
26
|
+
}
|
|
27
|
+
return [e(o), ...c].filter(Boolean).join(" ");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
p as BREAKPOINTS,
|
|
31
|
+
$ as resolveStyleProps
|
|
32
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function a(n, ...e) {
|
|
3
|
+
const i = e.map((t) => new Set(t)), o = e.map(() => ({})), c = {};
|
|
4
|
+
for (const t in n) {
|
|
5
|
+
if (!Object.prototype.hasOwnProperty.call(n, t)) continue;
|
|
6
|
+
const s = i.findIndex((r) => r.has(t));
|
|
7
|
+
(s === -1 ? c : o[s])[t] = n[t];
|
|
8
|
+
}
|
|
9
|
+
return [...o, c];
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
a as splitVariantProps
|
|
13
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "astralis-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React 19 component library on semantic design tokens — precompiled CSS, runtime brand theming, responsive style props, 62 components.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Paul Andrew",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://astralis-zeta.vercel.app",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/SekiroDev360/astralis-ui.git",
|
|
13
|
+
"directory": "packages/astralis-ui"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/SekiroDev360/astralis-ui/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"react",
|
|
20
|
+
"react19",
|
|
21
|
+
"components",
|
|
22
|
+
"component-library",
|
|
23
|
+
"ui",
|
|
24
|
+
"design-system",
|
|
25
|
+
"design-tokens",
|
|
26
|
+
"theming",
|
|
27
|
+
"dark-mode",
|
|
28
|
+
"tailwind"
|
|
29
|
+
],
|
|
30
|
+
"packageManager": "pnpm@10.15.1",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./styles.css": "./dist/styles.css"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"sideEffects": [
|
|
42
|
+
"**/*.css"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "pnpm storybook",
|
|
46
|
+
"dev:library": "concurrently \"pnpm run dev:types\" \"pnpm run dev:lib\" \"pnpm run dev:css\"",
|
|
47
|
+
"dev:types": "tsc -p tsconfig.build.json --watch",
|
|
48
|
+
"dev:lib": "vite build --watch",
|
|
49
|
+
"gen:safelist": "node scripts/gen-responsive-safelist.mjs",
|
|
50
|
+
"dev:css": "pnpm run gen:safelist && tailwindcss -w -i ./src/tailwind-entry.css -o ./dist/styles.css",
|
|
51
|
+
"build": "vite build && pnpm run build:css",
|
|
52
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
53
|
+
"build:css": "pnpm run gen:safelist && tailwindcss -m -i ./src/tailwind-entry.css -o ./dist/styles.css && node scripts/check-css-coverage.mjs",
|
|
54
|
+
"lint": "eslint .",
|
|
55
|
+
"preview": "vite preview",
|
|
56
|
+
"storybook": "concurrently \"pnpm run storybook:css\" \"storybook dev -p 6006\"",
|
|
57
|
+
"storybook:css": "pnpm run gen:safelist && tailwindcss -w -i ./src/tailwind-entry.css -o ./src/index.css",
|
|
58
|
+
"build-storybook": "concurrently \"pnpm run build-storybook:css\" \"storybook build\"",
|
|
59
|
+
"build-storybook:css": "pnpm run gen:safelist && tailwindcss -m -i ./src/tailwind-entry.css -o ./src/index.css",
|
|
60
|
+
"prepublishOnly": "pnpm run build"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": "^19.1.1",
|
|
64
|
+
"react-dom": "^19.1.1"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
68
|
+
"@eslint/js": "^9.33.0",
|
|
69
|
+
"@storybook/addon-a11y": "^9.1.5",
|
|
70
|
+
"@storybook/addon-docs": "^9.1.5",
|
|
71
|
+
"@storybook/addon-themes": "^9.1.5",
|
|
72
|
+
"@storybook/addon-vitest": "^9.1.5",
|
|
73
|
+
"@storybook/react-vite": "^9.1.5",
|
|
74
|
+
"@tailwindcss/cli": "^4.0.0",
|
|
75
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
76
|
+
"@types/node": "^24.3.3",
|
|
77
|
+
"@types/qrcode": "^1.5.6",
|
|
78
|
+
"@types/react": "^19.1.10",
|
|
79
|
+
"@types/react-dom": "^19.1.7",
|
|
80
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
81
|
+
"@vitest/browser": "^3.2.4",
|
|
82
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
83
|
+
"autoprefixer": "^10.4.21",
|
|
84
|
+
"concurrently": "^9.2.1",
|
|
85
|
+
"eslint": "^9.33.0",
|
|
86
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
87
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
88
|
+
"eslint-plugin-storybook": "^9.1.5",
|
|
89
|
+
"globals": "^16.3.0",
|
|
90
|
+
"lucide-react": "^0.554.0",
|
|
91
|
+
"playwright": "^1.55.0",
|
|
92
|
+
"postcss": "^8.5.6",
|
|
93
|
+
"storybook": "^9.1.5",
|
|
94
|
+
"tailwindcss": "^4.0.0",
|
|
95
|
+
"typescript": "~5.8.3",
|
|
96
|
+
"typescript-eslint": "^8.39.1",
|
|
97
|
+
"vite": "^7.1.2",
|
|
98
|
+
"vite-plugin-dts": "^4.5.4",
|
|
99
|
+
"vitest": "^3.2.4"
|
|
100
|
+
},
|
|
101
|
+
"dependencies": {
|
|
102
|
+
"class-variance-authority": "^0.7.1",
|
|
103
|
+
"clsx": "^2.1.1",
|
|
104
|
+
"qrcode": "^1.5.4",
|
|
105
|
+
"tailwind-merge": "^3.6.0"
|
|
106
|
+
}
|
|
107
|
+
}
|