@atom63/ui-react 0.2.0-beta.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/README.md +121 -0
- package/dist/button-sktq-nvV.d.ts +13 -0
- package/dist/chunk-7VSPECOH.js +73 -0
- package/dist/chunk-7VSPECOH.js.map +1 -0
- package/dist/chunk-AJLHJRK6.js +11 -0
- package/dist/chunk-AJLHJRK6.js.map +1 -0
- package/dist/chunk-MXNO63TC.js +2745 -0
- package/dist/chunk-MXNO63TC.js.map +1 -0
- package/dist/chunk-STCXERLM.js +354 -0
- package/dist/chunk-STCXERLM.js.map +1 -0
- package/dist/destination-link-C9NKeKLe.d.ts +34 -0
- package/dist/index.d.ts +1605 -0
- package/dist/index.js +7337 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +196 -0
- package/dist/layout/index.js +500 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/media/index.d.ts +208 -0
- package/dist/media/index.js +1498 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/media-lightbox/parts/index.d.ts +284 -0
- package/dist/media/media-lightbox/parts/index.js +5 -0
- package/dist/media/media-lightbox/parts/index.js.map +1 -0
- package/dist/theme/index.d.ts +350 -0
- package/dist/theme/index.js +1173 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types-Dxe5IzjE.d.ts +145 -0
- package/package.json +188 -0
- package/src/components/accordion/accordion.css +196 -0
- package/src/components/alert/alert.css +189 -0
- package/src/components/alert-dialog/alert-dialog.css +205 -0
- package/src/components/autocomplete/autocomplete.css +240 -0
- package/src/components/avatar/avatar.css +147 -0
- package/src/components/badge/badge.css +223 -0
- package/src/components/breadcrumb/breadcrumb.css +99 -0
- package/src/components/button/button.css +594 -0
- package/src/components/button-group/button-group.css +412 -0
- package/src/components/calendar/calendar.css +271 -0
- package/src/components/card/card.css +421 -0
- package/src/components/carousel/carousel.css +163 -0
- package/src/components/checkbox/checkbox.css +113 -0
- package/src/components/collapsible/collapsible.css +59 -0
- package/src/components/command/command.css +226 -0
- package/src/components/connected-panel/connected-panel.css +437 -0
- package/src/components/copy-button/copy-button.css +57 -0
- package/src/components/dialog/dialog.css +221 -0
- package/src/components/drawer/drawer.css +265 -0
- package/src/components/empty/empty.css +145 -0
- package/src/components/feedback-state/feedback-state.css +141 -0
- package/src/components/field/field.css +260 -0
- package/src/components/form/form.css +32 -0
- package/src/components/frame/frame.css +115 -0
- package/src/components/hover-card/hover-card.css +80 -0
- package/src/components/input/input.css +291 -0
- package/src/components/input-otp/input-otp.css +145 -0
- package/src/components/item/item.css +216 -0
- package/src/components/kbd/kbd.css +72 -0
- package/src/components/label/label.css +37 -0
- package/src/components/load-more-trigger/load-more-trigger.css +109 -0
- package/src/components/marquee/marquee.css +79 -0
- package/src/components/menu/menu.css +216 -0
- package/src/components/menubar/menubar.css +67 -0
- package/src/components/navigation-menu/navigation-menu.css +275 -0
- package/src/components/pagination/pagination.css +86 -0
- package/src/components/panel-setting-button/panel-setting-button.css +76 -0
- package/src/components/popover/popover.css +89 -0
- package/src/components/preview-card/preview-card.css +69 -0
- package/src/components/progress/progress.css +70 -0
- package/src/components/radio/radio.css +115 -0
- package/src/components/resizable/resizable.css +99 -0
- package/src/components/scroll-area/scroll-area.css +130 -0
- package/src/components/scrollable-list/scrollable-list.css +144 -0
- package/src/components/segmented-control/segmented-control.css +235 -0
- package/src/components/select/select.css +261 -0
- package/src/components/separator/separator.css +43 -0
- package/src/components/sheet/sheet.css +209 -0
- package/src/components/sidebar/sidebar.css +728 -0
- package/src/components/sidebar-nav-tree/sidebar-nav-tree.css +179 -0
- package/src/components/skeleton/skeleton.css +42 -0
- package/src/components/slider/slider.css +124 -0
- package/src/components/switch/switch.css +149 -0
- package/src/components/table/table.css +183 -0
- package/src/components/tabs/tabs.css +416 -0
- package/src/components/text-ticker/text-ticker.css +139 -0
- package/src/components/textarea/textarea.css +122 -0
- package/src/components/toggle/toggle.css +185 -0
- package/src/components/toggle-group/toggle-group.css +102 -0
- package/src/components/tooltip/tooltip.css +133 -0
- package/src/media/media-lightbox/media-lightbox.css +171 -0
- package/src/styles/index.css +3 -0
- package/src/styles/recipes.css +70 -0
- package/src/styles/reset.css +22 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type ContainerMaxWidth = 'fluid' | 'widest' | 'wider' | 'wide' | 'default' | 'narrow' | 'narrower' | 'narrowest';
|
|
5
|
+
/** Shared max-width class map for Container and GridChrome. */
|
|
6
|
+
declare const containerMaxWidthStyles: Record<ContainerMaxWidth, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Centered max-width frame (no Tailwind `container` padding).
|
|
9
|
+
* Used for fixed rails / guides so edges align with content chrome.
|
|
10
|
+
*/
|
|
11
|
+
declare function containerFrameClassName(maxWidth?: ContainerMaxWidth): string;
|
|
12
|
+
|
|
13
|
+
type ContainerPadding = 'all' | 'x' | 'none';
|
|
14
|
+
type ContainerChrome = 'none' | 'grid';
|
|
15
|
+
interface ContainerProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* In-flow vertical rails (`border-x`). Skipped automatically when nested under
|
|
19
|
+
* {@link GridChrome} with `fixedRails` so lines don’t double up.
|
|
20
|
+
* @default 'none'
|
|
21
|
+
*/
|
|
22
|
+
chrome?: ContainerChrome;
|
|
23
|
+
className?: string;
|
|
24
|
+
maxWidth?: ContainerMaxWidth;
|
|
25
|
+
padding?: ContainerPadding;
|
|
26
|
+
}
|
|
27
|
+
declare function Container({ children, chrome, maxWidth, padding, className, }: ContainerProps): React.JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare const GRID_CHROME_VARS: {
|
|
30
|
+
readonly lineColor: "--a63-grid-line-color";
|
|
31
|
+
readonly guideColor: "--a63-grid-guide-color";
|
|
32
|
+
readonly crosshairColor: "--a63-grid-crosshair-color";
|
|
33
|
+
readonly hairlineWidth: "--a63-grid-hairline-width";
|
|
34
|
+
readonly lineStyle: "--a63-grid-line-style";
|
|
35
|
+
};
|
|
36
|
+
type GridChromeLineStyle = 'solid' | 'dashed';
|
|
37
|
+
type GridChromeTone = 'subtle' | 'default' | 'strong';
|
|
38
|
+
type GridChromeCssVars = Partial<Record<(typeof GRID_CHROME_VARS)[keyof typeof GRID_CHROME_VARS], string>>;
|
|
39
|
+
type GridChromeStyle = CSSProperties & GridChromeCssVars;
|
|
40
|
+
declare function gridChromeStyle({ lineStyle, style, tone, }: {
|
|
41
|
+
lineStyle: GridChromeLineStyle;
|
|
42
|
+
style?: GridChromeStyle;
|
|
43
|
+
tone: GridChromeTone;
|
|
44
|
+
}): GridChromeStyle;
|
|
45
|
+
|
|
46
|
+
interface GridChromeContextValue {
|
|
47
|
+
crosshairs: boolean;
|
|
48
|
+
/** True when page rails are painted by {@link GridChrome}. */
|
|
49
|
+
fixedRails: boolean;
|
|
50
|
+
lineStyle: GridChromeLineStyle;
|
|
51
|
+
maxWidth: ContainerMaxWidth;
|
|
52
|
+
}
|
|
53
|
+
declare function useGridChrome(): GridChromeContextValue | null;
|
|
54
|
+
interface GridChromeProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Default sparkle crosshairs on nested `GridRule`s.
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
crosshairs?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Full-height vertical rails matching `maxWidth`. Absolute inside the chrome
|
|
63
|
+
* (not `position: fixed` / sticky-on-self) so `max-w-*` + `mx-auto` keep working
|
|
64
|
+
* and edges stay symmetric with the scroll container.
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
fixedRails?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Stroke style shared by rails, rules, and guides.
|
|
70
|
+
* @default 'dashed'
|
|
71
|
+
*/
|
|
72
|
+
lineStyle?: GridChromeLineStyle;
|
|
73
|
+
maxWidth?: ContainerMaxWidth;
|
|
74
|
+
/**
|
|
75
|
+
* Central color preset for rails, rules, guides, and crosshairs.
|
|
76
|
+
* Override individual values with CSS variables on `style`.
|
|
77
|
+
* @default 'default'
|
|
78
|
+
*/
|
|
79
|
+
tone?: GridChromeTone;
|
|
80
|
+
style?: GridChromeStyle;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Firecrawl-style page frame: continuous column rails + crosshair context.
|
|
84
|
+
*
|
|
85
|
+
* Wrap the **entire scroll document** (header, main, footer) so one pair of
|
|
86
|
+
* rails meets every band. Nesting `GridChrome` only around a page body leaves
|
|
87
|
+
* the footer as a floating card — the opposite of Firecrawl’s T-junctions.
|
|
88
|
+
*/
|
|
89
|
+
declare function GridChrome({ children, className, crosshairs, fixedRails, lineStyle, maxWidth, style, tone, ...props }: GridChromeProps): React.JSX.Element;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Four-point sparkle at a rail / crossbar junction (Firecrawl-style).
|
|
93
|
+
* Decorative — parent should set `aria-hidden`.
|
|
94
|
+
*/
|
|
95
|
+
declare function GridCrosshair({ className, ...props }: Omit<ComponentPropsWithoutRef<'svg'>, 'children' | 'viewBox'>): React.JSX.Element;
|
|
96
|
+
|
|
97
|
+
type GridGuidesColumns = 2 | 3 | 4;
|
|
98
|
+
interface GridGuidesProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
99
|
+
/**
|
|
100
|
+
* Number of equal inset vertical columns (draws columns − 1 inner hairlines).
|
|
101
|
+
* @default 3
|
|
102
|
+
*/
|
|
103
|
+
columns?: GridGuidesColumns;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Nested vertical guides inside the chrome width for denser compositions.
|
|
107
|
+
* Hidden below `md` to avoid noise on narrow viewports.
|
|
108
|
+
*/
|
|
109
|
+
declare function GridGuides({ className, columns, ...props }: GridGuidesProps): React.JSX.Element;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Shared hairline metrics for grid chrome rails / rules / sparkles.
|
|
113
|
+
* Must stay in sync with Tailwind `border` (1px) on rail + rule strokes.
|
|
114
|
+
*/
|
|
115
|
+
declare const GRID_HAIRLINE_PX = 1;
|
|
116
|
+
/** Distance from the frame’s outer edge to the stroke’s optical center. */
|
|
117
|
+
declare const GRID_HAIRLINE_CENTER_PX: number;
|
|
118
|
+
|
|
119
|
+
interface GridRuleProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
120
|
+
/**
|
|
121
|
+
* Stretch the hairline across the full scrollport width (crosshairs still sit on the rails).
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
bleed?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Sparkle marks at each rail intersection. Defaults to {@link GridChrome} context, else true.
|
|
127
|
+
*/
|
|
128
|
+
crosshairs?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Horizontal section hairline. Optional sparkle crosshairs at the left/right rails.
|
|
132
|
+
*/
|
|
133
|
+
declare function GridRule({ bleed, className, crosshairs: crosshairsProp, style, ...props }: GridRuleProps): React.JSX.Element;
|
|
134
|
+
|
|
135
|
+
interface PageProps {
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
className?: string;
|
|
138
|
+
id?: string;
|
|
139
|
+
noPadding?: boolean;
|
|
140
|
+
}
|
|
141
|
+
declare function Page({ children, className, id, noPadding }: PageProps): React.JSX.Element;
|
|
142
|
+
|
|
143
|
+
declare const DEFAULT_PAGE_SKELETON_COUNT = 6;
|
|
144
|
+
interface PageSkeletonProps {
|
|
145
|
+
className?: string;
|
|
146
|
+
count?: number;
|
|
147
|
+
showFilters?: boolean;
|
|
148
|
+
showHeader?: boolean;
|
|
149
|
+
variant?: 'list' | 'card' | 'grid';
|
|
150
|
+
}
|
|
151
|
+
declare function PageSkeleton({ variant, count, className, showFilters, showHeader, }: PageSkeletonProps): React.JSX.Element;
|
|
152
|
+
|
|
153
|
+
interface SectionProps {
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
className?: string;
|
|
156
|
+
gap?: boolean;
|
|
157
|
+
id?: string;
|
|
158
|
+
removeTopSpacing?: boolean;
|
|
159
|
+
spacing?: 'tight' | 'default' | 'loose' | 'generous' | 'spacious';
|
|
160
|
+
}
|
|
161
|
+
declare function Section({ children, className, id, spacing, removeTopSpacing, gap, }: SectionProps): React.JSX.Element;
|
|
162
|
+
|
|
163
|
+
/** Typography for index-style page heroes (projects, resources, …). */
|
|
164
|
+
declare const pageIndexHeroTitleClassName = "text-balance font-secondary text-4xl tracking-tight md:text-6xl";
|
|
165
|
+
declare const pageIndexHeroDescriptionClassName = "text-lg";
|
|
166
|
+
type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
167
|
+
type SectionHeaderVariant = 'display' | 'primary' | 'secondary' | 'muted' | 'subtle' | 'label';
|
|
168
|
+
interface SectionHeaderProps {
|
|
169
|
+
align?: 'left' | 'center' | 'right';
|
|
170
|
+
className?: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
descriptionClassName?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Semantic heading level for the title. Visual scale is still controlled by
|
|
175
|
+
* `variant`; use this when the surrounding page hierarchy needs a different
|
|
176
|
+
* heading level than the variant default.
|
|
177
|
+
*/
|
|
178
|
+
level?: SectionHeaderLevel;
|
|
179
|
+
title: string;
|
|
180
|
+
titleClassName?: string;
|
|
181
|
+
variant?: SectionHeaderVariant;
|
|
182
|
+
}
|
|
183
|
+
declare function SectionHeader({ title, description, className, titleClassName, descriptionClassName, level, variant, align, }: SectionHeaderProps): React.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface ReaderLayoutProps {
|
|
186
|
+
aside?: ReactNode;
|
|
187
|
+
asideClassName?: string;
|
|
188
|
+
children: ReactNode;
|
|
189
|
+
className?: string;
|
|
190
|
+
contentClassName?: string;
|
|
191
|
+
/** Keep the aside column even with no aside, so the content measure holds across pages. */
|
|
192
|
+
reserveAside?: boolean;
|
|
193
|
+
}
|
|
194
|
+
declare function ReaderLayout({ aside, asideClassName, children, className, contentClassName, reserveAside, }: ReaderLayoutProps): React.JSX.Element;
|
|
195
|
+
|
|
196
|
+
export { Container, type ContainerChrome, type ContainerMaxWidth, type ContainerPadding, type ContainerProps, DEFAULT_PAGE_SKELETON_COUNT, GRID_CHROME_VARS, GRID_HAIRLINE_CENTER_PX, GRID_HAIRLINE_PX, GridChrome, type GridChromeContextValue, type GridChromeCssVars, type GridChromeLineStyle, type GridChromeProps, type GridChromeStyle, type GridChromeTone, GridCrosshair, GridGuides, type GridGuidesColumns, type GridGuidesProps, GridRule, type GridRuleProps, Page, type PageProps, PageSkeleton, type PageSkeletonProps, ReaderLayout, type ReaderLayoutProps, Section, SectionHeader, type SectionHeaderLevel, type SectionHeaderProps, type SectionHeaderVariant, type SectionProps, containerFrameClassName, containerMaxWidthStyles, gridChromeStyle, pageIndexHeroDescriptionClassName, pageIndexHeroTitleClassName, useGridChrome };
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import { cn } from '../chunk-AJLHJRK6.js';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/layout/max-width.ts
|
|
6
|
+
var containerMaxWidthStyles = {
|
|
7
|
+
fluid: "max-w-full",
|
|
8
|
+
widest: "max-w-8xl",
|
|
9
|
+
wider: "max-w-7xl",
|
|
10
|
+
wide: "max-w-6xl",
|
|
11
|
+
default: "max-w-5xl",
|
|
12
|
+
narrow: "max-w-4xl",
|
|
13
|
+
narrower: "max-w-2xl",
|
|
14
|
+
narrowest: "max-w-xl"
|
|
15
|
+
};
|
|
16
|
+
function containerFrameClassName(maxWidth = "default") {
|
|
17
|
+
return `mx-auto w-full min-w-0 ${containerMaxWidthStyles[maxWidth]}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/layout/grid/hairline.ts
|
|
21
|
+
var GRID_HAIRLINE_PX = 1;
|
|
22
|
+
var GRID_HAIRLINE_CENTER_PX = GRID_HAIRLINE_PX / 2;
|
|
23
|
+
|
|
24
|
+
// src/layout/grid/style.ts
|
|
25
|
+
var GRID_CHROME_VARS = {
|
|
26
|
+
lineColor: "--a63-grid-line-color",
|
|
27
|
+
guideColor: "--a63-grid-guide-color",
|
|
28
|
+
crosshairColor: "--a63-grid-crosshair-color",
|
|
29
|
+
hairlineWidth: "--a63-grid-hairline-width",
|
|
30
|
+
lineStyle: "--a63-grid-line-style"
|
|
31
|
+
};
|
|
32
|
+
var GRID_CHROME_TONE_STYLES = {
|
|
33
|
+
subtle: {
|
|
34
|
+
[GRID_CHROME_VARS.lineColor]: "color-mix(in oklch, var(--a63-border-subtle) 34%, transparent)",
|
|
35
|
+
[GRID_CHROME_VARS.guideColor]: "color-mix(in oklch, var(--a63-border-subtle) 16%, transparent)",
|
|
36
|
+
[GRID_CHROME_VARS.crosshairColor]: "color-mix(in oklch, var(--a63-border-subtle) 42%, transparent)"
|
|
37
|
+
},
|
|
38
|
+
default: {
|
|
39
|
+
[GRID_CHROME_VARS.lineColor]: "color-mix(in oklch, var(--a63-border-subtle) 50%, transparent)",
|
|
40
|
+
[GRID_CHROME_VARS.guideColor]: "color-mix(in oklch, var(--a63-border-subtle) 24%, transparent)",
|
|
41
|
+
[GRID_CHROME_VARS.crosshairColor]: "color-mix(in oklch, var(--a63-border-subtle) 58%, transparent)"
|
|
42
|
+
},
|
|
43
|
+
strong: {
|
|
44
|
+
[GRID_CHROME_VARS.lineColor]: "var(--a63-border-control)",
|
|
45
|
+
[GRID_CHROME_VARS.guideColor]: "var(--a63-border-subtle)",
|
|
46
|
+
[GRID_CHROME_VARS.crosshairColor]: "var(--a63-border-control)"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function gridChromeStyle({
|
|
50
|
+
lineStyle,
|
|
51
|
+
style,
|
|
52
|
+
tone
|
|
53
|
+
}) {
|
|
54
|
+
return {
|
|
55
|
+
[GRID_CHROME_VARS.hairlineWidth]: `${GRID_HAIRLINE_PX}px`,
|
|
56
|
+
[GRID_CHROME_VARS.lineStyle]: lineStyle,
|
|
57
|
+
...GRID_CHROME_TONE_STYLES[tone],
|
|
58
|
+
...style
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
var GridChromeContext = createContext(null);
|
|
62
|
+
function useGridChrome() {
|
|
63
|
+
return useContext(GridChromeContext);
|
|
64
|
+
}
|
|
65
|
+
function GridChrome({
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
crosshairs = true,
|
|
69
|
+
fixedRails = true,
|
|
70
|
+
lineStyle = "dashed",
|
|
71
|
+
maxWidth = "default",
|
|
72
|
+
style,
|
|
73
|
+
tone = "default",
|
|
74
|
+
...props
|
|
75
|
+
}) {
|
|
76
|
+
return /* @__PURE__ */ jsx(GridChromeContext.Provider, { value: { crosshairs, fixedRails, lineStyle, maxWidth }, children: /* @__PURE__ */ jsxs(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: cn("relative isolate flex min-h-svh flex-col", className),
|
|
80
|
+
"data-slot": "grid-chrome",
|
|
81
|
+
style: gridChromeStyle({ lineStyle, style, tone }),
|
|
82
|
+
...props,
|
|
83
|
+
children: [
|
|
84
|
+
fixedRails ? /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": true,
|
|
88
|
+
className: "pointer-events-none absolute inset-0 z-[60]",
|
|
89
|
+
"data-slot": "grid-chrome-rails-root",
|
|
90
|
+
children: /* @__PURE__ */ jsx(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: cn(
|
|
94
|
+
"h-full min-h-svh border-y-0 border-[color:var(--a63-grid-line-color)]",
|
|
95
|
+
lineStyle === "solid" ? "border-solid" : "border-dashed",
|
|
96
|
+
containerFrameClassName(maxWidth)
|
|
97
|
+
),
|
|
98
|
+
"data-slot": "grid-chrome-rails",
|
|
99
|
+
style: {
|
|
100
|
+
borderLeftWidth: "var(--a63-grid-hairline-width)",
|
|
101
|
+
borderRightWidth: "var(--a63-grid-hairline-width)"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
) : null,
|
|
107
|
+
/* @__PURE__ */ jsx("div", { className: "relative z-1 flex min-h-svh flex-1 flex-col", children })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
) });
|
|
111
|
+
}
|
|
112
|
+
function GridCrosshair({
|
|
113
|
+
className,
|
|
114
|
+
...props
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"svg",
|
|
118
|
+
{
|
|
119
|
+
className: cn(
|
|
120
|
+
"size-3 text-[color:var(--a63-grid-crosshair-color,var(--input,var(--a63-border-subtle)))]",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
fill: "currentColor",
|
|
124
|
+
overflow: "visible",
|
|
125
|
+
viewBox: "0 0 24 24",
|
|
126
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
127
|
+
...props,
|
|
128
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 0C12.8 7.2 7.2 12.8 0 12C7.2 12.8 12.8 16.8 12 24C11.2 16.8 16.8 12.8 24 12C16.8 11.2 12.8 7.2 12 0Z" })
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
function GridGuides({ className, columns = 3, ...props }) {
|
|
133
|
+
const chrome = useGridChrome();
|
|
134
|
+
const lineStyle = chrome?.lineStyle ?? "dashed";
|
|
135
|
+
const maxWidth = chrome?.maxWidth ?? "default";
|
|
136
|
+
const innerLines = Math.max(columns - 1, 0);
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
"aria-hidden": true,
|
|
141
|
+
className: cn("pointer-events-none absolute inset-0 z-0 hidden md:block", className),
|
|
142
|
+
"data-slot": "grid-guides",
|
|
143
|
+
...props,
|
|
144
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("relative h-full", containerFrameClassName(maxWidth)), children: Array.from({ length: innerLines }, (_, index) => {
|
|
145
|
+
const position = (index + 1) / columns * 100;
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
"span",
|
|
148
|
+
{
|
|
149
|
+
className: cn(
|
|
150
|
+
"absolute inset-y-0 border-l border-[color:var(--a63-grid-guide-color,var(--input,var(--a63-border-subtle)))]",
|
|
151
|
+
lineStyle === "solid" ? "border-solid" : "border-dashed"
|
|
152
|
+
),
|
|
153
|
+
"data-slot": "grid-guide",
|
|
154
|
+
style: {
|
|
155
|
+
borderLeftWidth: "var(--a63-grid-hairline-width, 1px)",
|
|
156
|
+
left: `${position}%`
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
position
|
|
160
|
+
);
|
|
161
|
+
}) })
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function GridRule({
|
|
166
|
+
bleed = false,
|
|
167
|
+
className,
|
|
168
|
+
crosshairs: crosshairsProp,
|
|
169
|
+
style,
|
|
170
|
+
...props
|
|
171
|
+
}) {
|
|
172
|
+
const chrome = useGridChrome();
|
|
173
|
+
const crosshairs = crosshairsProp ?? chrome?.crosshairs ?? true;
|
|
174
|
+
const lineStyle = chrome?.lineStyle ?? "dashed";
|
|
175
|
+
const maxWidth = chrome?.maxWidth ?? "default";
|
|
176
|
+
return /* @__PURE__ */ jsxs(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
"aria-hidden": true,
|
|
180
|
+
className: cn("relative w-full", className),
|
|
181
|
+
"data-slot": "grid-rule",
|
|
182
|
+
style: { height: "var(--a63-grid-hairline-width, 1px)", ...style },
|
|
183
|
+
...props,
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: cn(
|
|
189
|
+
"absolute inset-x-0 top-0 border-t border-[color:var(--a63-grid-line-color,var(--input,var(--a63-border-subtle)))]",
|
|
190
|
+
lineStyle === "solid" ? "border-solid" : "border-dashed",
|
|
191
|
+
bleed ? null : cn("mx-auto w-full", containerMaxWidthStyles[maxWidth])
|
|
192
|
+
),
|
|
193
|
+
"data-slot": "grid-rule-line",
|
|
194
|
+
style: {
|
|
195
|
+
borderTopWidth: "var(--a63-grid-hairline-width, 1px)"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
crosshairs ? /* @__PURE__ */ jsxs(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
className: cn(
|
|
203
|
+
"pointer-events-none absolute inset-x-0 inset-y-0",
|
|
204
|
+
containerFrameClassName(maxWidth)
|
|
205
|
+
),
|
|
206
|
+
"data-slot": "grid-rule-crosshairs",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
209
|
+
GridCrosshair,
|
|
210
|
+
{
|
|
211
|
+
className: "absolute z-1 -translate-x-1/2 -translate-y-1/2",
|
|
212
|
+
style: { left: GRID_HAIRLINE_CENTER_PX, top: GRID_HAIRLINE_CENTER_PX }
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ jsx(
|
|
216
|
+
GridCrosshair,
|
|
217
|
+
{
|
|
218
|
+
className: "absolute z-1 translate-x-1/2 -translate-y-1/2",
|
|
219
|
+
style: { right: GRID_HAIRLINE_CENTER_PX, top: GRID_HAIRLINE_CENTER_PX }
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
) : null
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
var paddingStyles = {
|
|
230
|
+
all: "p-6",
|
|
231
|
+
x: "px-6",
|
|
232
|
+
none: "p-0"
|
|
233
|
+
};
|
|
234
|
+
function Container({
|
|
235
|
+
children,
|
|
236
|
+
chrome = "none",
|
|
237
|
+
maxWidth = "default",
|
|
238
|
+
padding = "all",
|
|
239
|
+
className
|
|
240
|
+
}) {
|
|
241
|
+
const grid = useGridChrome();
|
|
242
|
+
const showGridBorder = chrome === "grid" && !grid?.fixedRails;
|
|
243
|
+
return /* @__PURE__ */ jsx(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: cn(
|
|
247
|
+
"flex min-w-0 flex-col gap-8",
|
|
248
|
+
containerFrameClassName(maxWidth),
|
|
249
|
+
paddingStyles[padding],
|
|
250
|
+
showGridBorder && "relative border-y-0 border-[color:var(--a63-grid-line-color,var(--a63-border-subtle))]",
|
|
251
|
+
showGridBorder && (grid?.lineStyle === "solid" ? "border-solid" : "border-dashed"),
|
|
252
|
+
className
|
|
253
|
+
),
|
|
254
|
+
"data-chrome": showGridBorder ? "grid" : void 0,
|
|
255
|
+
"data-slot": "container",
|
|
256
|
+
style: showGridBorder ? {
|
|
257
|
+
borderLeftWidth: "var(--a63-grid-hairline-width, 1px)",
|
|
258
|
+
borderRightWidth: "var(--a63-grid-hairline-width, 1px)"
|
|
259
|
+
} : void 0,
|
|
260
|
+
children
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function Page({ children, className, id, noPadding = false }) {
|
|
265
|
+
return /* @__PURE__ */ jsx(
|
|
266
|
+
"main",
|
|
267
|
+
{
|
|
268
|
+
className: cn("min-h-full", !noPadding && "pt-8 pb-20", className),
|
|
269
|
+
"data-slot": "page",
|
|
270
|
+
id,
|
|
271
|
+
children
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
function Skeleton({ className }) {
|
|
276
|
+
return /* @__PURE__ */ jsx("div", { className: cn("bg-muted animate-pulse rounded-md", className) });
|
|
277
|
+
}
|
|
278
|
+
var DEFAULT_PAGE_SKELETON_COUNT = 6;
|
|
279
|
+
function PageSkeleton({
|
|
280
|
+
variant = "list",
|
|
281
|
+
count = DEFAULT_PAGE_SKELETON_COUNT,
|
|
282
|
+
className,
|
|
283
|
+
showFilters = true,
|
|
284
|
+
showHeader = true
|
|
285
|
+
}) {
|
|
286
|
+
const skeletonItems = Array.from({ length: count }, (_, index) => ({
|
|
287
|
+
id: `${variant}-${index + 1}`
|
|
288
|
+
}));
|
|
289
|
+
const renderSkeletonItem = (id) => {
|
|
290
|
+
switch (variant) {
|
|
291
|
+
case "card":
|
|
292
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
293
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-sm" }),
|
|
294
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
295
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-3/4 rounded" }),
|
|
296
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full rounded" }),
|
|
297
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3 rounded" }),
|
|
298
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
299
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-16 rounded" }),
|
|
300
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20 rounded" })
|
|
301
|
+
] })
|
|
302
|
+
] })
|
|
303
|
+
] }, `skeleton-card-${id}`);
|
|
304
|
+
case "grid":
|
|
305
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
306
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "aspect-square w-full rounded-sm" }),
|
|
307
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
308
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4 rounded" }),
|
|
309
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/2 rounded" })
|
|
310
|
+
] })
|
|
311
|
+
] }, `skeleton-grid-${id}`);
|
|
312
|
+
default:
|
|
313
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
314
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-12 rounded-sm" }),
|
|
315
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-3", children: [
|
|
316
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full rounded" }),
|
|
317
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4 rounded" })
|
|
318
|
+
] })
|
|
319
|
+
] }, `skeleton-list-${id}`);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
return /* @__PURE__ */ jsxs("div", { "aria-busy": "true", className, "data-slot": "page-skeleton", children: [
|
|
323
|
+
showHeader && /* @__PURE__ */ jsxs("div", { className: "mb-8 space-y-4", children: [
|
|
324
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" }),
|
|
325
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-96" })
|
|
326
|
+
] }),
|
|
327
|
+
showFilters && /* @__PURE__ */ jsxs("div", { className: "mb-8 space-y-4", children: [
|
|
328
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
329
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-16" }),
|
|
330
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-32" }),
|
|
331
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-48" }),
|
|
332
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24" })
|
|
333
|
+
] }),
|
|
334
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
335
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-64" }),
|
|
336
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32" })
|
|
337
|
+
] })
|
|
338
|
+
] }),
|
|
339
|
+
/* @__PURE__ */ jsx(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
className: variant === "grid" ? "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3" : "space-y-6",
|
|
343
|
+
children: skeletonItems.map((item) => renderSkeletonItem(item.id))
|
|
344
|
+
}
|
|
345
|
+
)
|
|
346
|
+
] });
|
|
347
|
+
}
|
|
348
|
+
function Section({
|
|
349
|
+
children,
|
|
350
|
+
className,
|
|
351
|
+
id,
|
|
352
|
+
spacing = "default",
|
|
353
|
+
removeTopSpacing = true,
|
|
354
|
+
gap = true
|
|
355
|
+
}) {
|
|
356
|
+
const paddingClasses = {
|
|
357
|
+
tight: "py-8",
|
|
358
|
+
default: "py-16",
|
|
359
|
+
loose: "py-16 md:py-20",
|
|
360
|
+
generous: "py-20 sm:py-28 md:py-32",
|
|
361
|
+
spacious: "py-24 sm:py-32 md:py-40"
|
|
362
|
+
};
|
|
363
|
+
const gapClasses = {
|
|
364
|
+
tight: "space-y-4",
|
|
365
|
+
default: "space-y-6",
|
|
366
|
+
loose: "space-y-8",
|
|
367
|
+
generous: "space-y-6",
|
|
368
|
+
spacious: "space-y-8"
|
|
369
|
+
};
|
|
370
|
+
return /* @__PURE__ */ jsx(
|
|
371
|
+
"section",
|
|
372
|
+
{
|
|
373
|
+
className: cn(
|
|
374
|
+
paddingClasses[spacing],
|
|
375
|
+
gap && gapClasses[spacing],
|
|
376
|
+
removeTopSpacing && "pt-0 md:pt-0",
|
|
377
|
+
className
|
|
378
|
+
),
|
|
379
|
+
"data-slot": "section",
|
|
380
|
+
id,
|
|
381
|
+
children
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
var pageIndexHeroTitleClassName = "text-balance font-secondary text-4xl tracking-tight md:text-6xl";
|
|
386
|
+
var pageIndexHeroDescriptionClassName = "text-lg";
|
|
387
|
+
var headingTags = {
|
|
388
|
+
1: "h1",
|
|
389
|
+
2: "h2",
|
|
390
|
+
3: "h3",
|
|
391
|
+
4: "h4",
|
|
392
|
+
5: "h5",
|
|
393
|
+
6: "h6"
|
|
394
|
+
};
|
|
395
|
+
function SectionHeader({
|
|
396
|
+
title,
|
|
397
|
+
description,
|
|
398
|
+
className,
|
|
399
|
+
titleClassName,
|
|
400
|
+
descriptionClassName,
|
|
401
|
+
level,
|
|
402
|
+
variant = "primary",
|
|
403
|
+
align = "left"
|
|
404
|
+
}) {
|
|
405
|
+
const variantConfig = {
|
|
406
|
+
display: {
|
|
407
|
+
DescTag: "p",
|
|
408
|
+
titleClass: "max-w-3xl text-balance font-heading font-semibold text-5xl leading-none md:text-6xl",
|
|
409
|
+
descClass: "mt-4 max-w-2xl text-balance text-lg text-muted-foreground leading-relaxed md:text-xl",
|
|
410
|
+
defaultLevel: 1
|
|
411
|
+
},
|
|
412
|
+
primary: {
|
|
413
|
+
DescTag: "p",
|
|
414
|
+
titleClass: "max-w-2xl text-balance font-heading font-semibold text-3xl leading-tight",
|
|
415
|
+
descClass: "mt-2 max-w-2xl text-balance text-muted-foreground text-base leading-7",
|
|
416
|
+
defaultLevel: 1
|
|
417
|
+
},
|
|
418
|
+
secondary: {
|
|
419
|
+
DescTag: "p",
|
|
420
|
+
titleClass: "max-w-2xl text-balance font-heading font-semibold text-2xl leading-tight",
|
|
421
|
+
descClass: "mt-2 max-w-xl text-balance text-muted-foreground text-sm leading-6",
|
|
422
|
+
defaultLevel: 2
|
|
423
|
+
},
|
|
424
|
+
muted: {
|
|
425
|
+
DescTag: "p",
|
|
426
|
+
titleClass: "max-w-xl text-balance font-heading font-medium text-lg leading-snug",
|
|
427
|
+
descClass: "mt-1.5 max-w-lg text-balance text-muted-foreground text-sm leading-6",
|
|
428
|
+
defaultLevel: 3
|
|
429
|
+
},
|
|
430
|
+
subtle: {
|
|
431
|
+
DescTag: "p",
|
|
432
|
+
titleClass: "max-w-lg text-balance font-medium text-base leading-snug text-foreground",
|
|
433
|
+
descClass: "mt-1 max-w-md text-balance text-muted-foreground text-sm leading-5",
|
|
434
|
+
defaultLevel: 4
|
|
435
|
+
},
|
|
436
|
+
label: {
|
|
437
|
+
DescTag: "p",
|
|
438
|
+
titleClass: "font-medium text-muted-foreground text-xs uppercase tracking-[0.16em]",
|
|
439
|
+
descClass: "mt-1 max-w-md text-balance text-muted-foreground text-sm leading-5",
|
|
440
|
+
defaultLevel: void 0
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const { DescTag, titleClass, descClass, defaultLevel } = variantConfig[variant];
|
|
444
|
+
const titleLevel = level ?? defaultLevel;
|
|
445
|
+
const TitleTag = titleLevel ? headingTags[titleLevel] : "p";
|
|
446
|
+
const alignClasses = {
|
|
447
|
+
center: "mx-auto text-center",
|
|
448
|
+
right: "ml-auto text-right",
|
|
449
|
+
left: ""
|
|
450
|
+
};
|
|
451
|
+
return /* @__PURE__ */ jsxs(
|
|
452
|
+
"div",
|
|
453
|
+
{
|
|
454
|
+
className: cn(
|
|
455
|
+
align === "center" && "text-center",
|
|
456
|
+
align === "right" && "text-right",
|
|
457
|
+
className
|
|
458
|
+
),
|
|
459
|
+
children: [
|
|
460
|
+
/* @__PURE__ */ jsx(TitleTag, { className: cn(titleClass, alignClasses[align], titleClassName), children: title }),
|
|
461
|
+
description && /* @__PURE__ */ jsx(DescTag, { className: cn(descClass, alignClasses[align], descriptionClassName), children: description })
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
function ReaderLayout({
|
|
467
|
+
aside,
|
|
468
|
+
asideClassName,
|
|
469
|
+
children,
|
|
470
|
+
className,
|
|
471
|
+
contentClassName,
|
|
472
|
+
reserveAside = false
|
|
473
|
+
}) {
|
|
474
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("mx-auto flex w-full max-w-5xl", className), "data-slot": "reader-layout", children: [
|
|
475
|
+
/* @__PURE__ */ jsx(
|
|
476
|
+
"article",
|
|
477
|
+
{
|
|
478
|
+
className: cn(
|
|
479
|
+
"min-w-0 flex-1 space-y-8 px-4 pt-8 pb-8 sm:px-6 lg:px-8 xl:max-w-4xl",
|
|
480
|
+
contentClassName
|
|
481
|
+
),
|
|
482
|
+
"data-slot": "reader-layout-content",
|
|
483
|
+
children
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
aside || reserveAside ? /* @__PURE__ */ jsx(
|
|
487
|
+
"div",
|
|
488
|
+
{
|
|
489
|
+
"aria-hidden": aside ? void 0 : true,
|
|
490
|
+
className: cn("hidden w-64 shrink-0 px-4 pt-8 xl:block", asideClassName),
|
|
491
|
+
"data-slot": "reader-layout-aside",
|
|
492
|
+
children: aside
|
|
493
|
+
}
|
|
494
|
+
) : null
|
|
495
|
+
] });
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export { Container, DEFAULT_PAGE_SKELETON_COUNT, GRID_CHROME_VARS, GRID_HAIRLINE_CENTER_PX, GRID_HAIRLINE_PX, GridChrome, GridCrosshair, GridGuides, GridRule, Page, PageSkeleton, ReaderLayout, Section, SectionHeader, containerFrameClassName, containerMaxWidthStyles, gridChromeStyle, pageIndexHeroDescriptionClassName, pageIndexHeroTitleClassName, useGridChrome };
|
|
499
|
+
//# sourceMappingURL=index.js.map
|
|
500
|
+
//# sourceMappingURL=index.js.map
|