@gridui/grid 0.0.0-stage → 0.1.1

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 CHANGED
@@ -1,3 +1,75 @@
1
- # Temporary Holding Version
1
+ # Grid foundation
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ See the usage handbook and
4
+ pages and grids guide for practical usage.
5
+
6
+ `@gridui/grid` owns Container, Grid, GridItem, Stack, Row, responsive
7
+ spacing, PageFrame, FrameSections, FrameSection, frame chrome, rails, textures,
8
+ and structural boundaries. It does not know website routes or domain state.
9
+ Load its explicit `styles.css` export after theme styles and before Layout.
10
+
11
+ FrameSection and FrameFooter accept `tone="neutral" | "brand" | "warning" | "danger"`.
12
+ Non-neutral tones scope background, foreground, muted text, borders, controls,
13
+ and focus colors to that region. Theme owns the paired light/dark tokens;
14
+ Grid owns their inherited application. Nested non-neutral tones establish their own palette; neutral inherits its surroundings.
15
+
16
+ FrameSection owns its leading separator and inline frame edges. Use
17
+ `boundary="none"` and `edges="none"` when an enclosing region owns them.
18
+ Both FrameSection and FrameFooter accept these leading boundary styles:
19
+
20
+ | `boundary` | Appearance |
21
+ | --- | --- |
22
+ | `line` (default) | One thin rule |
23
+ | `band` | Theme-tinted 12px band with top and bottom rules |
24
+ | `stripe` | The same band geometry with continuous 135-degree brand-colored stripes |
25
+ | `space` | Transparent 40px spacing with no rules or fill |
26
+ | `none` | No boundary element or extra spacing |
27
+
28
+ `--gridui-band-size` owns band and stripe height; `--gridui-boundary-space-size`
29
+ owns whitespace height. Stripe and space default to no edge decoration.
30
+ Band still defaults to nodes. Set `decoration` explicitly to choose an edge treatment.
31
+
32
+ ```tsx
33
+ <FrameSection boundary="stripe">Next chapter</FrameSection>
34
+ <FrameSection boundary="space">Related reading</FrameSection>
35
+ ```
36
+
37
+ At a section seam, a non-neutral tone takes precedence over neutral; between
38
+ two non-neutral tones, the lower section supplies the color. The lower section
39
+ still draws the only separator. This works across Astro islands and section
40
+ groups without changing either region's content palette. The page filler uses
41
+ the final section's tone for its leading line.
42
+ Grid `frame="cells"` owns outer and cell edges; `frame="internal"` owns seams
43
+ inside an existing frame. Use `fillLastRow` with direct GridItem children to
44
+ fill incomplete rows at every breakpoint. Explicit gaps are disallowed in
45
+ framed grids. Hover/focus outlines paint above neighboring seams and page lines.
46
+ Table cell lines remain Data-owned and control borders remain Controls-owned.
47
+
48
+ See the [Grid contract](docs/README.md#grid-foundation) for geometry and API.
49
+
50
+ ## Source organization
51
+
52
+ The package root `src/index.ts` declares the public API, and `src/styles.css`
53
+ imports component styles. Neither entry point contains component implementation.
54
+
55
+ - `primitives/` groups Container, Grid/GridItem with track planning, Stack, and
56
+ Row with their own styles. Shared `responsive.ts` and `types.ts` remain at the
57
+ primitive level. `geometry.css` owns the shared Container/frame-rail tracks.
58
+ - `frame/` groups page hosts, chrome, rails, boundaries, decorations, and
59
+ textures with their CSS and variants. `section.tsx` composes those groups.
60
+ Only shared content styles and tone variants remain in `frame/style.ts`;
61
+ `tone.css` owns inherited region colors. Primitives never import Frame.
62
+
63
+ Browser boundary checks live in `test/browser/frame-boundaries.tsx`. The shared
64
+ Layout browser fixture calls them through the explicit test-only
65
+ `@gridui/grid/testing/frame-boundaries` export; production consumers
66
+ use the component and stylesheet exports.
67
+
68
+ Unit tests mirror these owners under `test/unit/primitives/` and
69
+ `test/unit/frame/`. Tests can combine public primitives to protect their
70
+ collaboration. Keep ordinary presentation in the owner's CVA `style.ts`. Retain
71
+ track resolution, seams, and decorative geometry in colocated CSS imported by
72
+ the root stylesheet. See the shared
73
+ style organization contract.
74
+ Consumers use the package root and explicit stylesheet export; internal file
75
+ paths are private, and moved implementations have no forwarding aliases.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Boundary
5
+ * @description Boundary
6
+ */
7
+ import type { FC } from "react";
8
+ export type FrameBoundaryStyle = "none" | "line" | "band" | "stripe" | "space";
9
+ export type FrameBoundaryProps = {
10
+ readonly boundary: FrameBoundaryStyle;
11
+ };
12
+ export declare const FrameBoundary: FC<FrameBoundaryProps>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Chrome
5
+ * @description Chrome
6
+ */
7
+ import type { Responsive, Space } from "../../primitives/responsive";
8
+ import type { FrameBoundaryStyle } from "../boundary/boundary";
9
+ import type { FrameDecorationStyle } from "../decoration/decoration";
10
+ import type { FrameTone } from "../style";
11
+ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
12
+ export type ChromeProps = {
13
+ readonly padding?: Responsive<Space>;
14
+ };
15
+ export type FrameHeaderProps = ComponentPropsWithRef<"header"> & ChromeProps & {
16
+ readonly wrap?: boolean;
17
+ readonly gap?: Space;
18
+ };
19
+ export declare const FrameHeader: FC<FrameHeaderProps>;
20
+ export type FrameFooterProps = ComponentPropsWithRef<"footer"> & ChromeProps & {
21
+ readonly tone?: FrameTone;
22
+ readonly boundary?: FrameBoundaryStyle;
23
+ readonly decoration?: FrameDecorationStyle;
24
+ readonly signature?: ReactNode;
25
+ readonly signatureAppearance?: "standard" | "cropped";
26
+ };
27
+ export declare const FrameFooter: FC<FrameFooterProps>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Chrome
5
+ * @description Style
6
+ */
7
+ export declare const frameChromeStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ export declare const frameSignatureStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ export declare const frameSignatureCroppedStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Decoration
5
+ * @description Decoration
6
+ */
7
+ import type { FrameBoundaryStyle } from "../boundary/boundary";
8
+ import type { FC } from "react";
9
+ export type FrameDecorationStyle = "none" | "nodes" | "marks" | "corners" | "ticks";
10
+ export declare const resolveFrameDecoration: (boundary: FrameBoundaryStyle, decoration?: FrameDecorationStyle) => FrameDecorationStyle;
11
+ export type FrameDecorationProps = {
12
+ readonly decoration: FrameDecorationStyle;
13
+ };
14
+ export declare const FrameDecoration: FC<FrameDecorationProps>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame
5
+ * @description Export
6
+ */
7
+ export type { FrameBoundaryStyle } from "./boundary/boundary";
8
+ export type { FrameFooterProps, FrameHeaderProps } from "./chrome/chrome";
9
+ export { FrameFooter, FrameHeader } from "./chrome/chrome";
10
+ export type { FrameDecorationStyle } from "./decoration/decoration";
11
+ export type { FrameSectionsProps, PageFrameProps } from "./page/page";
12
+ export { FrameSections, PageFrame } from "./page/page";
13
+ export type { FrameRailGroupProps, FrameRailProps } from "./rail/rail";
14
+ export { FrameRail, FrameRailGroup } from "./rail/rail";
15
+ export type { FrameSectionProps } from "./section";
16
+ export { FrameSection } from "./section";
17
+ export type { FrameTone } from "./style";
18
+ export type { FrameTextureStyle } from "./texture/texture";
19
+ export { FrameTexture } from "./texture/texture";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Page
5
+ * @description Page
6
+ */
7
+ import type { ContainerProps } from "../../primitives/container/container";
8
+ import type { Responsive, Space } from "../../primitives/responsive";
9
+ import type { FrameRailGroupProps } from "../rail/rail";
10
+ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
11
+ export type PageFrameProps = FrameRailGroupProps & {
12
+ readonly width?: ContainerProps["width"];
13
+ readonly header?: ReactNode;
14
+ readonly footer?: ReactNode;
15
+ readonly railScope?: "page" | "main";
16
+ readonly mainGutterStart?: Responsive<Space>;
17
+ };
18
+ export type FrameSectionsProps = ComponentPropsWithRef<"div">;
19
+ export declare const FrameSections: FC<FrameSectionsProps>;
20
+ export declare const PageFrame: FC<PageFrameProps>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Page
5
+ * @description Style
6
+ */
7
+ export declare const pageFrameVariants: (props?: ({
8
+ width?: "standard" | "narrow" | "wide" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Rail
5
+ * @description Rail
6
+ */
7
+ import type { Responsive, Space } from "../../primitives/responsive";
8
+ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
9
+ export type FrameRailProps = ComponentPropsWithRef<"div"> & {
10
+ readonly placement?: "start" | "sticky-bottom";
11
+ };
12
+ export declare const FrameRail: FC<FrameRailProps>;
13
+ export type FrameRailGroupProps = ComponentPropsWithRef<"div"> & {
14
+ readonly rail?: ReactNode;
15
+ readonly railWidth?: Responsive<Space>;
16
+ };
17
+ export declare const FrameRailGroup: FC<FrameRailGroupProps>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Rail
5
+ * @description Style
6
+ */
7
+ export declare const frameRailStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ export declare const frameRailContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ export declare const frameRailStickyBottomStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame
5
+ * @description Section
6
+ */
7
+ import type { FrameBoundaryStyle } from "./boundary/boundary";
8
+ import type { FrameDecorationStyle } from "./decoration/decoration";
9
+ import type { FrameTone } from "./style";
10
+ import type { FrameTextureStyle } from "./texture/texture";
11
+ import type { ComponentPropsWithRef, FC } from "react";
12
+ export type FrameSectionProps = ComponentPropsWithRef<"section"> & {
13
+ readonly tone?: FrameTone;
14
+ readonly boundary?: FrameBoundaryStyle;
15
+ readonly decoration?: FrameDecorationStyle;
16
+ readonly texture?: FrameTextureStyle;
17
+ readonly edges?: "frame" | "none";
18
+ };
19
+ export declare const FrameSection: FC<FrameSectionProps>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame
5
+ * @description Style
6
+ */
7
+ export type FrameTone = "neutral" | "brand" | "warning" | "danger";
8
+ export declare const frameToneStyles: (props?: ({
9
+ tone?: "neutral" | "brand" | "warning" | "danger" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ export declare const frameContentStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Frame_Texture
5
+ * @description Texture
6
+ */
7
+ import type { FC } from "react";
8
+ export type FrameTextureStyle = "none" | "grid" | "dots" | "lines";
9
+ export type FrameTextureProps = {
10
+ readonly texture: FrameTextureStyle;
11
+ };
12
+ export declare const FrameTexture: FC<FrameTextureProps>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Grid
4
+ * @namespace Root
5
+ * @description Index
6
+ */
7
+ export * from "./frame/export";
8
+ export * from "./primitives/export";