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 f, jsxs as L } from "react/jsx-runtime";
|
|
3
|
+
import { useId as z, useRef as C, useState as m, useEffect as F } from "react";
|
|
4
|
+
import { usePrefersReducedMotion as K } from "../../../../hooks/use-prefers-reduced-motion.js";
|
|
5
|
+
let p = !1;
|
|
6
|
+
function T() {
|
|
7
|
+
if (p || typeof document > "u") return;
|
|
8
|
+
p = !0;
|
|
9
|
+
const a = document.createElement("style");
|
|
10
|
+
a.textContent = `
|
|
11
|
+
@keyframes astralis-marquee-x {
|
|
12
|
+
from { transform: translateX(0); }
|
|
13
|
+
to { transform: translateX(-50%); }
|
|
14
|
+
}
|
|
15
|
+
@keyframes astralis-marquee-x-rev {
|
|
16
|
+
from { transform: translateX(-50%); }
|
|
17
|
+
to { transform: translateX(0); }
|
|
18
|
+
}
|
|
19
|
+
@keyframes astralis-marquee-y {
|
|
20
|
+
from { transform: translateY(0); }
|
|
21
|
+
to { transform: translateY(-50%); }
|
|
22
|
+
}
|
|
23
|
+
@keyframes astralis-marquee-y-rev {
|
|
24
|
+
from { transform: translateY(-50%); }
|
|
25
|
+
to { transform: translateY(0); }
|
|
26
|
+
}
|
|
27
|
+
`, document.head.appendChild(a);
|
|
28
|
+
}
|
|
29
|
+
function V({
|
|
30
|
+
direction: a = "left",
|
|
31
|
+
speed: c = 50,
|
|
32
|
+
gap: l = "1rem",
|
|
33
|
+
pauseOnHover: u = !1,
|
|
34
|
+
pauseOnFocus: d = !1,
|
|
35
|
+
reverse: $ = !1,
|
|
36
|
+
gradient: v = !1,
|
|
37
|
+
gradientColor: q,
|
|
38
|
+
gradientWidth: t = "10%",
|
|
39
|
+
loopCount: r = 0,
|
|
40
|
+
className: w = "",
|
|
41
|
+
style: S,
|
|
42
|
+
children: i,
|
|
43
|
+
ref: b,
|
|
44
|
+
...h
|
|
45
|
+
}) {
|
|
46
|
+
const M = z(), y = C(null), [g, D] = m(8), [I, s] = m(!1), [R, j] = m(0), N = K(), e = a === "up" || a === "down", x = $ || a === "right" || a === "down", k = r > 0 && R >= r;
|
|
47
|
+
T(), F(() => {
|
|
48
|
+
const n = y.current;
|
|
49
|
+
if (!n) return;
|
|
50
|
+
const B = e ? n.scrollHeight / 2 : n.scrollWidth / 2;
|
|
51
|
+
D(B / c);
|
|
52
|
+
}, [c, e, i]);
|
|
53
|
+
const X = e ? x ? "astralis-marquee-y-rev" : "astralis-marquee-y" : x ? "astralis-marquee-x-rev" : "astralis-marquee-x", Y = {
|
|
54
|
+
position: "relative",
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
...e ? { display: "flex", flexDirection: "column" } : {},
|
|
57
|
+
...S
|
|
58
|
+
}, E = {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: e ? "column" : "row",
|
|
61
|
+
gap: l,
|
|
62
|
+
// Longhands only — mixing the `animation` shorthand with
|
|
63
|
+
// `animationPlayState` makes React warn on rerender and can drop styles.
|
|
64
|
+
animationName: k ? "none" : X,
|
|
65
|
+
animationDuration: `${g}s`,
|
|
66
|
+
animationTimingFunction: "linear",
|
|
67
|
+
animationIterationCount: r > 0 ? String(r) : "infinite",
|
|
68
|
+
animationPlayState: I || N ? "paused" : "running",
|
|
69
|
+
willChange: "transform"
|
|
70
|
+
}, o = q ?? "var(--astralis-color-surface-base, #fff)", P = v ? {
|
|
71
|
+
maskImage: e ? `linear-gradient(to bottom, transparent, ${o} ${t}, ${o} calc(100% - ${t}), transparent)` : `linear-gradient(to right, transparent, ${o} ${t}, ${o} calc(100% - ${t}), transparent)`,
|
|
72
|
+
WebkitMaskImage: e ? `linear-gradient(to bottom, transparent, black ${t}, black calc(100% - ${t}), transparent)` : `linear-gradient(to right, transparent, black ${t}, black calc(100% - ${t}), transparent)`
|
|
73
|
+
} : {}, A = () => {
|
|
74
|
+
r > 0 && j((n) => n + 1);
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ f(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
ref: b,
|
|
80
|
+
id: `astralis-marquee-${M}`,
|
|
81
|
+
className: ["astralis:overflow-hidden astralis:w-full", w].filter(Boolean).join(" "),
|
|
82
|
+
style: { ...Y, ...P },
|
|
83
|
+
onMouseEnter: () => u && s(!0),
|
|
84
|
+
onMouseLeave: () => u && s(!1),
|
|
85
|
+
onFocus: () => d && s(!0),
|
|
86
|
+
onBlur: () => d && s(!1),
|
|
87
|
+
...h,
|
|
88
|
+
children: /* @__PURE__ */ L(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
ref: y,
|
|
92
|
+
style: E,
|
|
93
|
+
onAnimationIteration: A,
|
|
94
|
+
"aria-hidden": k,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ f(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
style: {
|
|
100
|
+
display: "flex",
|
|
101
|
+
flexDirection: e ? "column" : "row",
|
|
102
|
+
gap: l,
|
|
103
|
+
flexShrink: 0
|
|
104
|
+
},
|
|
105
|
+
children: i
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ f(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
"aria-hidden": !0,
|
|
112
|
+
style: {
|
|
113
|
+
display: "flex",
|
|
114
|
+
flexDirection: e ? "column" : "row",
|
|
115
|
+
gap: l,
|
|
116
|
+
flexShrink: 0
|
|
117
|
+
},
|
|
118
|
+
children: i
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
V.displayName = "Marquee.Root";
|
|
128
|
+
export {
|
|
129
|
+
V as MarqueeRoot
|
|
130
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { MarqueeItem as e } from "./components/marquee-item.js";
|
|
3
|
+
import { MarqueeRoot as t } from "./components/marquee-root.js";
|
|
4
|
+
const m = Object.assign(t, {
|
|
5
|
+
Item: e
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
m as Marquee,
|
|
9
|
+
e as MarqueeItem,
|
|
10
|
+
t as MarqueeRoot
|
|
11
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as q, useState as b, useEffect as y, useCallback as O } from "react";
|
|
4
|
+
import Q from "qrcode";
|
|
5
|
+
const U = {
|
|
6
|
+
sm: 96,
|
|
7
|
+
md: 160,
|
|
8
|
+
lg: 220,
|
|
9
|
+
xl: 280
|
|
10
|
+
};
|
|
11
|
+
function z({ size: i }) {
|
|
12
|
+
return /* @__PURE__ */ s(
|
|
13
|
+
"svg",
|
|
14
|
+
{
|
|
15
|
+
width: i * 0.25,
|
|
16
|
+
height: i * 0.25,
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "none",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "2",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round",
|
|
23
|
+
style: { animation: "astralis-qr-spin 0.8s linear infinite" },
|
|
24
|
+
children: /* @__PURE__ */ s("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function I({
|
|
29
|
+
value: i,
|
|
30
|
+
size: k = "md",
|
|
31
|
+
pixelSize: w,
|
|
32
|
+
errorLevel: c = "M",
|
|
33
|
+
color: f = "#000000",
|
|
34
|
+
bgColor: n = "transparent",
|
|
35
|
+
overlay: m,
|
|
36
|
+
overlaySize: j = 20,
|
|
37
|
+
status: a = "active",
|
|
38
|
+
onRefresh: h,
|
|
39
|
+
downloadable: L = !1,
|
|
40
|
+
downloadFileName: N = "qrcode",
|
|
41
|
+
className: S = "",
|
|
42
|
+
style: C
|
|
43
|
+
}) {
|
|
44
|
+
const t = w ?? U[k], R = q(null), [l, B] = b(""), [u, x] = b(null);
|
|
45
|
+
y(() => {
|
|
46
|
+
if (typeof document > "u" || document.getElementById("astralis-qr-keyframes")) return;
|
|
47
|
+
const e = document.createElement("style");
|
|
48
|
+
e.id = "astralis-qr-keyframes", e.textContent = "@keyframes astralis-qr-spin { to { transform: rotate(360deg); } }", document.head.appendChild(e);
|
|
49
|
+
}, []);
|
|
50
|
+
const g = O(async () => {
|
|
51
|
+
if (i)
|
|
52
|
+
try {
|
|
53
|
+
const e = await Q.toString(i, {
|
|
54
|
+
type: "svg",
|
|
55
|
+
errorCorrectionLevel: c,
|
|
56
|
+
color: {
|
|
57
|
+
dark: f,
|
|
58
|
+
light: n === "transparent" ? "#ffffff00" : n
|
|
59
|
+
},
|
|
60
|
+
width: t,
|
|
61
|
+
margin: 1
|
|
62
|
+
});
|
|
63
|
+
B(e), x(null);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
x(String(e));
|
|
66
|
+
}
|
|
67
|
+
}, [i, c, f, n, t]);
|
|
68
|
+
y(() => {
|
|
69
|
+
g();
|
|
70
|
+
}, [g]);
|
|
71
|
+
const E = () => {
|
|
72
|
+
if (!l) return;
|
|
73
|
+
const e = new Blob([l], { type: "image/svg+xml" }), v = URL.createObjectURL(e), d = document.createElement("a");
|
|
74
|
+
d.href = v, d.download = `${N}.svg`, d.click(), URL.revokeObjectURL(v);
|
|
75
|
+
}, o = t * j / 100, p = (t - o) / 2, M = a === "loading" || a === "expired" || a === "scanned";
|
|
76
|
+
return /* @__PURE__ */ r(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: [
|
|
80
|
+
"astralis:inline-flex astralis:flex-col astralis:items-center astralis:gap-3",
|
|
81
|
+
S
|
|
82
|
+
].filter(Boolean).join(" "),
|
|
83
|
+
style: C,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ r(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: "astralis:relative astralis:rounded-lg astralis:border astralis:border-stroke-subtle astralis:bg-white astralis:overflow-hidden",
|
|
89
|
+
style: { width: t, height: t },
|
|
90
|
+
children: [
|
|
91
|
+
!u && l && /* @__PURE__ */ s(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
ref: R,
|
|
95
|
+
style: {
|
|
96
|
+
position: "absolute",
|
|
97
|
+
inset: 0,
|
|
98
|
+
filter: M ? "blur(5px)" : "none",
|
|
99
|
+
transition: "filter 0.3s"
|
|
100
|
+
},
|
|
101
|
+
dangerouslySetInnerHTML: { __html: l }
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
u && /* @__PURE__ */ s("div", { className: "astralis:absolute astralis:inset-0 astralis:flex astralis:items-center astralis:justify-center astralis:text-label-error astralis:text-xs astralis:p-2 astralis:text-center", children: "Failed to generate QR code" }),
|
|
105
|
+
a === "loading" && /* @__PURE__ */ r("div", { className: "astralis:absolute astralis:inset-0 astralis:flex astralis:flex-col astralis:items-center astralis:justify-center astralis:gap-2 astralis:text-label-muted", children: [
|
|
106
|
+
/* @__PURE__ */ s(z, { size: t }),
|
|
107
|
+
/* @__PURE__ */ s("span", { className: "astralis:text-xs astralis:font-medium", children: "Loading…" })
|
|
108
|
+
] }),
|
|
109
|
+
a === "expired" && /* @__PURE__ */ r("div", { className: "astralis:absolute astralis:inset-0 astralis:flex astralis:flex-col astralis:items-center astralis:justify-center astralis:gap-2 astralis:text-label-muted", children: [
|
|
110
|
+
/* @__PURE__ */ s(
|
|
111
|
+
"svg",
|
|
112
|
+
{
|
|
113
|
+
width: t * 0.22,
|
|
114
|
+
height: t * 0.22,
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
fill: "none",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
strokeWidth: "1.5",
|
|
119
|
+
children: /* @__PURE__ */ s(
|
|
120
|
+
"path",
|
|
121
|
+
{
|
|
122
|
+
strokeLinecap: "round",
|
|
123
|
+
strokeLinejoin: "round",
|
|
124
|
+
d: "M12 6v6l4 2m6-2a10 10 0 1 1-20 0 10 10 0 0 1 20 0z"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ s("span", { className: "astralis:text-xs astralis:font-medium", children: "Expired" }),
|
|
130
|
+
h && /* @__PURE__ */ s(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
onClick: h,
|
|
134
|
+
className: "astralis:text-xs astralis:px-2 astralis:py-1 astralis:rounded astralis:bg-brand-solid astralis:text-brand-contrast astralis:hover:opacity-higher astralis:transition-colors",
|
|
135
|
+
children: "Refresh"
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] }),
|
|
139
|
+
a === "scanned" && /* @__PURE__ */ r("div", { className: "astralis:absolute astralis:inset-0 astralis:flex astralis:flex-col astralis:items-center astralis:justify-center astralis:gap-2 astralis:text-green-solid", children: [
|
|
140
|
+
/* @__PURE__ */ s(
|
|
141
|
+
"svg",
|
|
142
|
+
{
|
|
143
|
+
width: t * 0.25,
|
|
144
|
+
height: t * 0.25,
|
|
145
|
+
viewBox: "0 0 24 24",
|
|
146
|
+
fill: "none",
|
|
147
|
+
stroke: "currentColor",
|
|
148
|
+
strokeWidth: "2",
|
|
149
|
+
children: /* @__PURE__ */ s(
|
|
150
|
+
"path",
|
|
151
|
+
{
|
|
152
|
+
strokeLinecap: "round",
|
|
153
|
+
strokeLinejoin: "round",
|
|
154
|
+
d: "M9 12l2 2 4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ s("span", { className: "astralis:text-xs astralis:font-semibold", children: "Scanned!" })
|
|
160
|
+
] }),
|
|
161
|
+
m && a === "active" && /* @__PURE__ */ s(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
className: "astralis:absolute astralis:flex astralis:items-center astralis:justify-center astralis:bg-white astralis:rounded-md astralis:shadow-sm astralis:border astralis:border-stroke-subtle astralis:overflow-hidden",
|
|
165
|
+
style: {
|
|
166
|
+
width: o,
|
|
167
|
+
height: o,
|
|
168
|
+
top: p,
|
|
169
|
+
left: p
|
|
170
|
+
},
|
|
171
|
+
children: m
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
L && a === "active" && /* @__PURE__ */ r(
|
|
178
|
+
"button",
|
|
179
|
+
{
|
|
180
|
+
onClick: E,
|
|
181
|
+
className: [
|
|
182
|
+
"astralis:inline-flex astralis:items-center astralis:gap-1.5 astralis:text-xs astralis:font-medium",
|
|
183
|
+
"astralis:px-3 astralis:py-1.5 astralis:rounded-lg astralis:border astralis:border-stroke-subtle",
|
|
184
|
+
"astralis:bg-surface-base astralis:hover:bg-surface-muted astralis:text-label-muted",
|
|
185
|
+
"astralis:transition-colors astralis:duration-150"
|
|
186
|
+
].join(" "),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
189
|
+
/* @__PURE__ */ s("path", { d: "M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z" }),
|
|
190
|
+
/* @__PURE__ */ s("path", { d: "M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.97a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.779a.749.749 0 1 1 1.06-1.06l1.97 1.97Z" })
|
|
191
|
+
] }),
|
|
192
|
+
"Download SVG"
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
I.displayName = "QrCode.Root";
|
|
201
|
+
export {
|
|
202
|
+
I as QrCodeRoot
|
|
203
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as a } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function i({ children: t, className: e = "" }) {
|
|
5
|
+
return /* @__PURE__ */ s("span", { className: a("astralis:text-sm astralis:text-label-muted", e), children: t });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as StatHelpText
|
|
9
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as r, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as n } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function o({ type: e = "increase", children: a, className: t = "" }) {
|
|
5
|
+
const s = e === "increase";
|
|
6
|
+
return /* @__PURE__ */ r(
|
|
7
|
+
"span",
|
|
8
|
+
{
|
|
9
|
+
className: n(
|
|
10
|
+
"astralis:inline-flex astralis:items-center astralis:gap-1 astralis:text-sm astralis:font-medium",
|
|
11
|
+
s ? "astralis:text-green-solid" : "astralis:text-red-solid",
|
|
12
|
+
t
|
|
13
|
+
),
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ i("span", { "aria-hidden": !0, children: s ? "▲" : "▼" }),
|
|
16
|
+
a
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
o as StatIndicator
|
|
23
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as e } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function l({ children: t, className: a = "" }) {
|
|
5
|
+
return /* @__PURE__ */ s("span", { className: e("astralis:text-sm astralis:font-medium astralis:text-label-muted", a), children: t });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
l as StatLabel
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { StatContext as e } from "../stat.context.js";
|
|
4
|
+
import { astralisMerge as o } from "../../../../utils/astralis-merge.js";
|
|
5
|
+
function m({ children: r, className: a = "" }) {
|
|
6
|
+
return /* @__PURE__ */ t(e.Provider, { value: {}, children: /* @__PURE__ */ t("div", { className: o("astralis:flex astralis:flex-col astralis:gap-1", a), children: r }) });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
m as StatRoot
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as r } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function i({ children: a, className: t = "" }) {
|
|
5
|
+
return /* @__PURE__ */ s("span", { className: r("astralis:text-3xl astralis:font-semibold astralis:text-label-base astralis:tabular-nums", t), children: a });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as StatValue
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { StatRoot as t } from "./components/stat-root.js";
|
|
3
|
+
import { StatLabel as o } from "./components/stat-label.js";
|
|
4
|
+
import { StatValue as a } from "./components/stat-value.js";
|
|
5
|
+
import { StatHelpText as r } from "./components/stat-help-text.js";
|
|
6
|
+
import { StatIndicator as e } from "./components/stat-indicator.js";
|
|
7
|
+
const c = Object.assign(t, {
|
|
8
|
+
Label: o,
|
|
9
|
+
Value: a,
|
|
10
|
+
HelpText: r,
|
|
11
|
+
Indicator: e
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
c as Stat,
|
|
15
|
+
r as StatHelpText,
|
|
16
|
+
e as StatIndicator,
|
|
17
|
+
o as StatLabel,
|
|
18
|
+
a as StatValue
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as i } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function l({ children: e, className: r = "", ...s }) {
|
|
5
|
+
return /* @__PURE__ */ t("tbody", { className: i("astralis:divide-y astralis:divide-stroke-subtle", r), ...s, children: e });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
l as TableBody
|
|
9
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as e } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function r({
|
|
5
|
+
className: t = "",
|
|
6
|
+
placement: a = "bottom",
|
|
7
|
+
ref: s,
|
|
8
|
+
...o
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ i(
|
|
11
|
+
"caption",
|
|
12
|
+
{
|
|
13
|
+
ref: s,
|
|
14
|
+
className: e(
|
|
15
|
+
"astralis:text-sm astralis:text-label-muted astralis:py-2",
|
|
16
|
+
a === "top" ? "astralis:caption-top" : "astralis:caption-bottom",
|
|
17
|
+
t
|
|
18
|
+
),
|
|
19
|
+
...o
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
r.displayName = "Table.Caption";
|
|
24
|
+
export {
|
|
25
|
+
r as TableCaption
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useTable as a } from "../table.context.js";
|
|
4
|
+
import { tableCellSize as o } from "../table.styles.js";
|
|
5
|
+
import { astralisMerge as i } from "../../../../utils/astralis-merge.js";
|
|
6
|
+
function p({ children: e, className: t = "", ...r }) {
|
|
7
|
+
const { size: l } = a();
|
|
8
|
+
return /* @__PURE__ */ s("td", { className: i("astralis:text-label-base", o[l], t), ...r, children: e });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
p as TableCell
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { astralisMerge as a } from "../../../../utils/astralis-merge.js";
|
|
4
|
+
function l({ children: r, className: t = "", ...s }) {
|
|
5
|
+
return /* @__PURE__ */ e("tfoot", { className: a("astralis:bg-surface-muted astralis:border-t astralis:border-stroke-base astralis:font-medium", t), ...s, children: r });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
l as TableFooter
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { useTable as i } from "../table.context.js";
|
|
4
|
+
import { tableCellSize as o } from "../table.styles.js";
|
|
5
|
+
import { astralisMerge as m } from "../../../../utils/astralis-merge.js";
|
|
6
|
+
function u({ children: t, className: e = "", scope: a = "col", ...r }) {
|
|
7
|
+
const { size: s } = i();
|
|
8
|
+
return /* @__PURE__ */ l(
|
|
9
|
+
"th",
|
|
10
|
+
{
|
|
11
|
+
scope: a,
|
|
12
|
+
className: m("astralis:text-left astralis:font-medium astralis:text-label-muted astralis:whitespace-nowrap", o[s], e),
|
|
13
|
+
...r,
|
|
14
|
+
children: t
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
u as TableHead
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useTable as i } from "../table.context.js";
|
|
4
|
+
import { astralisMerge as o } from "../../../../utils/astralis-merge.js";
|
|
5
|
+
function c({ children: r, className: s = "", ...a }) {
|
|
6
|
+
const { stickyHeader: e } = i();
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
8
|
+
"thead",
|
|
9
|
+
{
|
|
10
|
+
className: o(
|
|
11
|
+
"astralis:bg-surface-muted astralis:border-b astralis:border-stroke-base",
|
|
12
|
+
e ? "astralis:sticky astralis:top-0 astralis:z-10" : "",
|
|
13
|
+
s
|
|
14
|
+
),
|
|
15
|
+
...a,
|
|
16
|
+
children: r
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
c as TableHeader
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { TableContext as f } from "../table.context.js";
|
|
4
|
+
import { astralisMerge as u } from "../../../../utils/astralis-merge.js";
|
|
5
|
+
function p({
|
|
6
|
+
children: r,
|
|
7
|
+
variant: e = "line",
|
|
8
|
+
size: a = "md",
|
|
9
|
+
striped: s = !1,
|
|
10
|
+
interactive: t = !1,
|
|
11
|
+
stickyHeader: o = !1,
|
|
12
|
+
className: i = "",
|
|
13
|
+
...d
|
|
14
|
+
}) {
|
|
15
|
+
const n = e === "outline" ? "astralis:border-normal astralis:border-stroke-subtle astralis:rounded-lg astralis:overflow-hidden" : "";
|
|
16
|
+
return /* @__PURE__ */ l(f.Provider, { value: { size: a, variant: e, striped: s, interactive: t, stickyHeader: o }, children: /* @__PURE__ */ l("div", { className: u("astralis:w-full astralis:overflow-x-auto", n, i), children: /* @__PURE__ */ l("table", { className: "astralis:w-full astralis:border-collapse astralis:text-label-base", ...d, children: r }) }) });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
p as TableRoot
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { useTable as o } from "../table.context.js";
|
|
4
|
+
import { astralisMerge as l } from "../../../../utils/astralis-merge.js";
|
|
5
|
+
function u({ children: r, className: e = "", ...s }) {
|
|
6
|
+
const { striped: t, interactive: a } = o();
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
8
|
+
"tr",
|
|
9
|
+
{
|
|
10
|
+
className: l(
|
|
11
|
+
"astralis:transition-colors",
|
|
12
|
+
t ? "astralis:even:bg-surface-subtle" : "",
|
|
13
|
+
a ? "astralis:hover:bg-surface-muted" : "",
|
|
14
|
+
e
|
|
15
|
+
),
|
|
16
|
+
...s,
|
|
17
|
+
children: r
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
u as TableRow
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TableRoot as o } from "./components/table-root.js";
|
|
3
|
+
import { TableHeader as e } from "./components/table-header.js";
|
|
4
|
+
import { TableBody as r } from "./components/table-body.js";
|
|
5
|
+
import { TableFooter as t } from "./components/table-footer.js";
|
|
6
|
+
import { TableRow as a } from "./components/table-row.js";
|
|
7
|
+
import { TableHead as m } from "./components/table-head.js";
|
|
8
|
+
import { TableCell as l } from "./components/table-cell.js";
|
|
9
|
+
import { TableCaption as i } from "./components/table-caption.js";
|
|
10
|
+
const H = Object.assign(o, {
|
|
11
|
+
Header: e,
|
|
12
|
+
Body: r,
|
|
13
|
+
Footer: t,
|
|
14
|
+
Row: a,
|
|
15
|
+
Head: m,
|
|
16
|
+
Cell: l,
|
|
17
|
+
Caption: i
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
H as Table,
|
|
21
|
+
r as TableBody,
|
|
22
|
+
i as TableCaption,
|
|
23
|
+
l as TableCell,
|
|
24
|
+
t as TableFooter,
|
|
25
|
+
m as TableHead,
|
|
26
|
+
e as TableHeader,
|
|
27
|
+
a as TableRow
|
|
28
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext as t, createContext as n } from "react";
|
|
3
|
+
const o = n(null);
|
|
4
|
+
function s() {
|
|
5
|
+
const e = t(o);
|
|
6
|
+
if (!e) throw new Error("Table sub-components must be used within <Table>");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
o as TableContext,
|
|
11
|
+
s as useTable
|
|
12
|
+
};
|