@hjmds/react 0.9.1 → 0.9.3
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/dist/actions.d.ts +9 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +4 -4
- package/dist/actions.js.map +1 -1
- package/dist/composition-style.d.ts +26 -0
- package/dist/composition-style.d.ts.map +1 -0
- package/dist/composition-style.js +34 -0
- package/dist/composition-style.js.map +1 -0
- package/dist/display.d.ts +13 -0
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +7 -5
- package/dist/display.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +22 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +11 -5
- package/dist/layout.js.map +1 -1
- package/dist/selection.d.ts +5 -0
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +2 -2
- package/dist/selection.js.map +1 -1
- package/dist/supplemental-display.d.ts +5 -0
- package/dist/supplemental-display.d.ts.map +1 -1
- package/dist/supplemental-display.js +2 -2
- package/dist/supplemental-display.js.map +1 -1
- package/package.json +2 -2
package/dist/layout.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type SurfacePadding, type SurfaceRadius, type SurfaceTone } from "@hjmd
|
|
|
6
6
|
import { type StackAlign, type StackAxis, type StackGap, type StackJustify, type TextEmphasis, type TextTone } from "@hjmds/design-contracts/recipes";
|
|
7
7
|
import type { TextVariant } from "@hjmds/design-contracts/foundations";
|
|
8
8
|
import { type AnchorHTMLAttributes, type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
9
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
9
10
|
export type { SurfacePadding, SurfaceRadius, SurfaceTone, } from "@hjmds/design-contracts/recipes/base";
|
|
10
11
|
export type { StackAlign, StackAxis, StackGap, StackJustify, TextEmphasis, TextTone, } from "@hjmds/design-contracts/recipes";
|
|
11
12
|
type LayoutRegionProps = Omit<HTMLAttributes<HTMLElement>, "children" | "role">;
|
|
@@ -63,6 +64,8 @@ export type TextProps = Omit<HTMLAttributes<HTMLElement>, "children"> & Readonly
|
|
|
63
64
|
variant?: TextVariant;
|
|
64
65
|
tone?: TextTone;
|
|
65
66
|
emphasis?: TextEmphasis;
|
|
67
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
68
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
66
69
|
}>;
|
|
67
70
|
export declare const Text: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & Readonly<{
|
|
68
71
|
children: ReactNode;
|
|
@@ -70,6 +73,8 @@ export declare const Text: import("react").ForwardRefExoticComponent<Omit<HTMLAt
|
|
|
70
73
|
variant?: TextVariant;
|
|
71
74
|
tone?: TextTone;
|
|
72
75
|
emphasis?: TextEmphasis;
|
|
76
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
77
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
73
78
|
}> & import("react").RefAttributes<HTMLElement>>;
|
|
74
79
|
export type SurfaceProps = HTMLAttributes<HTMLElement> & Readonly<{
|
|
75
80
|
as?: "div" | "section" | "article";
|
|
@@ -77,6 +82,8 @@ export type SurfaceProps = HTMLAttributes<HTMLElement> & Readonly<{
|
|
|
77
82
|
bordered?: boolean;
|
|
78
83
|
padding?: SurfacePadding;
|
|
79
84
|
radius?: SurfaceRadius;
|
|
85
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
86
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
80
87
|
}>;
|
|
81
88
|
export declare const Surface: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & Readonly<{
|
|
82
89
|
as?: "div" | "section" | "article";
|
|
@@ -84,6 +91,8 @@ export declare const Surface: import("react").ForwardRefExoticComponent<HTMLAttr
|
|
|
84
91
|
bordered?: boolean;
|
|
85
92
|
padding?: SurfacePadding;
|
|
86
93
|
radius?: SurfaceRadius;
|
|
94
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
95
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
87
96
|
}> & import("react").RefAttributes<HTMLElement>>;
|
|
88
97
|
export type StackProps = HTMLAttributes<HTMLDivElement> & Readonly<{
|
|
89
98
|
axis?: StackAxis;
|
|
@@ -91,6 +100,8 @@ export type StackProps = HTMLAttributes<HTMLDivElement> & Readonly<{
|
|
|
91
100
|
align?: StackAlign;
|
|
92
101
|
justify?: StackJustify;
|
|
93
102
|
wrap?: boolean;
|
|
103
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
104
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
94
105
|
}>;
|
|
95
106
|
export declare const Stack: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & Readonly<{
|
|
96
107
|
axis?: StackAxis;
|
|
@@ -98,17 +109,23 @@ export declare const Stack: import("react").ForwardRefExoticComponent<HTMLAttrib
|
|
|
98
109
|
align?: StackAlign;
|
|
99
110
|
justify?: StackJustify;
|
|
100
111
|
wrap?: boolean;
|
|
112
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
113
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
101
114
|
}> & import("react").RefAttributes<HTMLDivElement>>;
|
|
102
115
|
export type ContainerProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & Readonly<{
|
|
103
116
|
children?: ReactNode;
|
|
104
117
|
size?: ContainerSize;
|
|
105
118
|
gutter?: ContainerGutter;
|
|
119
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
120
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
106
121
|
}>;
|
|
107
122
|
/** A centered, token-guttered content boundary shared with Native large screens. */
|
|
108
123
|
export declare const Container: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & Readonly<{
|
|
109
124
|
children?: ReactNode;
|
|
110
125
|
size?: ContainerSize;
|
|
111
126
|
gutter?: ContainerGutter;
|
|
127
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
128
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
112
129
|
}> & import("react").RefAttributes<HTMLDivElement>>;
|
|
113
130
|
export type AspectRatioProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & Readonly<{
|
|
114
131
|
children?: ReactNode;
|
|
@@ -132,17 +149,21 @@ export type GridProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & Pick<
|
|
|
132
149
|
windowWidth?: number;
|
|
133
150
|
/** Container measurement override; ResizeObserver is used when omitted. */
|
|
134
151
|
availableWidth?: number;
|
|
152
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
153
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
135
154
|
}>;
|
|
136
155
|
export declare const Grid: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & Pick<Readonly<{
|
|
137
156
|
columns: import("@hjmds/design-contracts/responsive").ResponsiveValue<number>;
|
|
138
157
|
gap?: import("@hjmds/design-contracts/responsive").ResponsiveValue<GridGap>;
|
|
139
158
|
minColumnWidth?: import("@hjmds/design-contracts/responsive").ResponsiveValue<number>;
|
|
140
|
-
}>, "
|
|
159
|
+
}>, "columns" | "gap" | "minColumnWidth"> & Readonly<{
|
|
141
160
|
children?: ReactNode;
|
|
142
161
|
/** Test/SSR override. Browser renderers otherwise observe window.innerWidth. */
|
|
143
162
|
windowWidth?: number;
|
|
144
163
|
/** Container measurement override; ResizeObserver is used when omitted. */
|
|
145
164
|
availableWidth?: number;
|
|
165
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
166
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
146
167
|
}> & import("react").RefAttributes<HTMLDivElement>>;
|
|
147
168
|
export type SectionProps = Omit<HTMLAttributes<HTMLElement>, "children" | "title"> & Readonly<{
|
|
148
169
|
title?: ReactNode;
|
package/dist/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,8CAA8C,CAAC;AACtD,OAA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AG,gBAAgB,CAAC,GAC1D,QAAQ,CAAC;IACP,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC9E,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;eATF,SAAS;IACpB,gFAAgF;kBAClE,MAAM;IACpB,2EAA2E;qBAC1D,MAAM;IACrB,4EAA4E;kBAChE,uBAAuB;mDAyDvC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAChF,QAAQ,CAAC;IACP,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAClC,CAAC,CAAC;AAEL,+EAA+E;AAC/E,eAAO,MAAM,OAAO;YARR,SAAS;kBACH,SAAS;aACd,SAAS;cACR,SAAS;mBACJ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;gDAqClC,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,CAAC;AACxB,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/layout.js
CHANGED
|
@@ -89,7 +89,7 @@ export const Layout = forwardRef(function Layout({ children, header, footer, sid
|
|
|
89
89
|
...mainStyle,
|
|
90
90
|
}, children: children }), hasFooter ? (_jsx("footer", { ...restFooterProps, className: classNames("hjm-layout__footer", footerClassName), children: footer })) : null] }));
|
|
91
91
|
});
|
|
92
|
-
export const Text = forwardRef(function Text({ as = "span", variant = textRecipe.defaults.variant, tone = textRecipe.defaults.tone, emphasis = textRecipe.defaults.emphasis, className, ...props }, ref) {
|
|
92
|
+
export const Text = forwardRef(function Text({ as = "span", variant = textRecipe.defaults.variant, tone = textRecipe.defaults.tone, emphasis = textRecipe.defaults.emphasis, className, layoutStyle, style, ...props }, ref) {
|
|
93
93
|
return createElement(as, {
|
|
94
94
|
...props,
|
|
95
95
|
ref,
|
|
@@ -97,9 +97,11 @@ export const Text = forwardRef(function Text({ as = "span", variant = textRecipe
|
|
|
97
97
|
"data-variant": variant,
|
|
98
98
|
"data-tone": tone,
|
|
99
99
|
"data-emphasis": emphasis,
|
|
100
|
+
// Placement wins over the legacy `style`, matching Surface's ordering.
|
|
101
|
+
style: { ...style, ...layoutStyle },
|
|
100
102
|
});
|
|
101
103
|
});
|
|
102
|
-
export const Surface = forwardRef(function Surface({ as = "div", tone = surfaceDefaults.tone, bordered = surfaceDefaults.bordered, padding = surfaceDefaults.padding, radius = surfaceDefaults.radius, className, style, ...props }, ref) {
|
|
104
|
+
export const Surface = forwardRef(function Surface({ as = "div", tone = surfaceDefaults.tone, bordered = surfaceDefaults.bordered, padding = surfaceDefaults.padding, radius = surfaceDefaults.radius, className, layoutStyle, style, ...props }, ref) {
|
|
103
105
|
const contract = surfaceRecipe[tone];
|
|
104
106
|
return createElement(as, {
|
|
105
107
|
...props,
|
|
@@ -114,6 +116,7 @@ export const Surface = forwardRef(function Surface({ as = "div", tone = surfaceD
|
|
|
114
116
|
padding: surfaceGeometry.paddings[padding],
|
|
115
117
|
borderRadius: surfaceGeometry.radii[radius],
|
|
116
118
|
...style,
|
|
119
|
+
...layoutStyle,
|
|
117
120
|
},
|
|
118
121
|
});
|
|
119
122
|
});
|
|
@@ -123,7 +126,7 @@ const justifyValues = {
|
|
|
123
126
|
end: "flex-end",
|
|
124
127
|
between: "space-between",
|
|
125
128
|
};
|
|
126
|
-
export const Stack = forwardRef(function Stack({ axis = stackRecipe.defaults.axis, gap = stackRecipe.defaults.gap, align = stackRecipe.defaults.align, justify = stackRecipe.defaults.justify, wrap = stackRecipe.defaults.wrap, className, style, ...props }, ref) {
|
|
129
|
+
export const Stack = forwardRef(function Stack({ axis = stackRecipe.defaults.axis, gap = stackRecipe.defaults.gap, align = stackRecipe.defaults.align, justify = stackRecipe.defaults.justify, wrap = stackRecipe.defaults.wrap, className, layoutStyle, style, ...props }, ref) {
|
|
127
130
|
return (_jsx("div", { ...props, ref: ref, className: classNames("hjm-stack", className), "data-axis": axis, "data-gap": gap, style: {
|
|
128
131
|
display: "flex",
|
|
129
132
|
flexDirection: stackRecipe.axes[axis],
|
|
@@ -132,10 +135,11 @@ export const Stack = forwardRef(function Stack({ axis = stackRecipe.defaults.axi
|
|
|
132
135
|
justifyContent: justifyValues[justify],
|
|
133
136
|
flexWrap: wrap ? "wrap" : "nowrap",
|
|
134
137
|
...style,
|
|
138
|
+
...layoutStyle,
|
|
135
139
|
} }));
|
|
136
140
|
});
|
|
137
141
|
/** A centered, token-guttered content boundary shared with Native large screens. */
|
|
138
|
-
export const Container = forwardRef(function Container({ size, gutter, className, style, ...props }, ref) {
|
|
142
|
+
export const Container = forwardRef(function Container({ size, gutter, className, layoutStyle, style, ...props }, ref) {
|
|
139
143
|
const resolved = resolveContainerDescriptor({
|
|
140
144
|
...(size === undefined ? {} : { size }),
|
|
141
145
|
...(gutter === undefined ? {} : { gutter }),
|
|
@@ -144,6 +148,7 @@ export const Container = forwardRef(function Container({ size, gutter, className
|
|
|
144
148
|
maxInlineSize: resolved.maxWidth ?? undefined,
|
|
145
149
|
paddingInline: resolved.paddingInline,
|
|
146
150
|
...style,
|
|
151
|
+
...layoutStyle,
|
|
147
152
|
} }));
|
|
148
153
|
});
|
|
149
154
|
/** Responsive media frame. Products retain object-fit, crop, and content semantics. */
|
|
@@ -155,7 +160,7 @@ export const AspectRatio = forwardRef(function AspectRatio({ ratio, className, s
|
|
|
155
160
|
export const VisuallyHidden = forwardRef(function VisuallyHidden({ className, ...props }, ref) {
|
|
156
161
|
return (_jsx("span", { ...props, ref: ref, className: classNames("hjm-visually-hidden", className) }));
|
|
157
162
|
});
|
|
158
|
-
export const Grid = forwardRef(function Grid({ columns, gap, minColumnWidth, windowWidth, availableWidth, className, style, ...props }, forwardedRef) {
|
|
163
|
+
export const Grid = forwardRef(function Grid({ columns, gap, minColumnWidth, windowWidth, availableWidth, className, layoutStyle, style, ...props }, forwardedRef) {
|
|
159
164
|
const browserWindowWidth = useWindowWidth();
|
|
160
165
|
const [measuredWidth, gridRef] = useElementWidth(forwardedRef);
|
|
161
166
|
const compactSsrWidth = 320;
|
|
@@ -180,6 +185,7 @@ export const Grid = forwardRef(function Grid({ columns, gap, minColumnWidth, win
|
|
|
180
185
|
rowGap: layout.rowGap,
|
|
181
186
|
columnGap: layout.columnGap,
|
|
182
187
|
...style,
|
|
188
|
+
...layoutStyle,
|
|
183
189
|
} }));
|
|
184
190
|
});
|
|
185
191
|
/** Large-text-safe semantic content section with an optional header action. */
|
package/dist/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,GAGlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,GAE7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,0BAA0B,GAG3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,2BAA2B,GAG5B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,eAAe,EACf,eAAe,EACf,aAAa,GAId,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,UAAU,GAOX,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,UAAU,EACV,KAAK,EACL,MAAM,GAOP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,c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AC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAClC,cAAK,SAAS,EAAC,0BAA0B,YAAE,WAAW,GAAO,CAC9D,IACG,EACL,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,qBAAqB,YAAE,MAAM,GAAO,IAC3E,CACV,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAO,IAC9C,CACX,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import {\n resolveGridLayout,\n type GridDescriptor,\n type GridGap,\n} from \"@hjmds/design-contracts/grid\";\nimport {\n resolveAspectRatioDescriptor,\n type AspectRatioValue,\n} from \"@hjmds/design-contracts/components/aspect-ratio\";\nimport {\n resolveContainerDescriptor,\n type ContainerGutter,\n type ContainerSize,\n} from \"@hjmds/design-contracts/components/container\";\nimport {\n layoutRecipe,\n validateLayoutWebDescriptor,\n type LayoutSidebarDescriptor,\n type LayoutSidebarRole,\n} from \"@hjmds/design-contracts/components/layout\";\nimport {\n surfaceDefaults,\n surfaceGeometry,\n surfaceRecipe,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n stackRecipe,\n textRecipe,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type TextEmphasis,\n type TextTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { TextVariant } from \"@hjmds/design-contracts/foundations\";\nimport {\n createElement,\n forwardRef,\n useId,\n useRef,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n classNames,\n composeRefs,\n useElementWidth,\n useWindowWidth,\n} from \"./internal.js\";\n\nexport type {\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nexport type {\n StackAlign,\n StackAxis,\n StackGap,\n StackJustify,\n TextEmphasis,\n TextTone,\n} from \"@hjmds/design-contracts/recipes\";\n\ntype LayoutRegionProps = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\" | \"role\"\n>;\n\ntype LayoutSidebarBase = Readonly<{\n children: ReactNode;\n role: LayoutSidebarRole;\n label: string;\n landmarkProps?: Omit<LayoutRegionProps, \"aria-label\">;\n landmarkRef?: Ref<HTMLElement>;\n}>;\n\n/**\n * A persistent sidebar is rendered in the shell grid. An overlay sidebar is\n * deliberately handed to the product's SidePanel (or equivalent) through\n * `renderOverlay`; Layout never owns a second open/dismiss lifecycle.\n */\nexport type LayoutSidebar =\n | (LayoutSidebarBase &\n Readonly<{\n mode: \"persistent\";\n renderOverlay?: never;\n }>)\n | (LayoutSidebarBase &\n Readonly<{\n mode: \"overlay\";\n renderOverlay(sidebarLandmark: ReactElement): ReactNode;\n }>);\n\nexport type LayoutProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children: ReactNode;\n header?: ReactNode;\n footer?: ReactNode;\n sidebar?: LayoutSidebar;\n skipLinkLabel?: string;\n /** Stable product id for deep links; a hydration-safe id is generated when omitted. */\n mainId?: string;\n mainRef?: Ref<HTMLElement>;\n headerProps?: LayoutRegionProps;\n mainProps?: Omit<LayoutRegionProps, \"id\" | \"tabIndex\">;\n footerProps?: LayoutRegionProps;\n skipLinkProps?: Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"children\" | \"href\"\n >;\n }>;\n\nfunction hasRegionContent(content: ReactNode | undefined): boolean {\n return content !== undefined && content !== null && content !== false;\n}\n\nfunction assertMainId(id: string): void {\n if (id.trim().length === 0) {\n throw new TypeError(\"Layout mainId must not be empty\");\n }\n if (/\\s/u.test(id)) {\n throw new TypeError(\"Layout mainId must not contain whitespace\");\n }\n}\n\n/** Accessible Web app shell with real landmarks and bypass navigation. */\nexport const Layout = forwardRef<HTMLDivElement, LayoutProps>(function Layout(\n {\n children,\n header,\n footer,\n sidebar,\n skipLinkLabel,\n mainId: mainIdProp,\n mainRef: forwardedMainRef,\n headerProps,\n mainProps,\n footerProps,\n skipLinkProps,\n className,\n ...props\n },\n ref,\n) {\n const generatedId = `hjm-main-${useId().replaceAll(\":\", \"\")}`;\n const internalMainRef = useRef<HTMLElement>(null);\n const mainId = mainIdProp ?? generatedId;\n assertMainId(mainId);\n\n const hasHeader = hasRegionContent(header);\n const hasFooter = hasRegionContent(footer);\n const descriptor = {\n ...(hasHeader ? { hasHeader: true } : {}),\n ...(hasFooter ? { hasFooter: true } : {}),\n ...(sidebar === undefined\n ? {}\n : {\n sidebar: {\n role: sidebar.role,\n mode: sidebar.mode,\n label: sidebar.label,\n } satisfies LayoutSidebarDescriptor,\n }),\n ...(skipLinkLabel === undefined ? {} : { skipLinkLabel }),\n };\n validateLayoutWebDescriptor(descriptor);\n\n if (\n sidebar?.mode === \"overlay\" &&\n typeof sidebar.renderOverlay !== \"function\"\n ) {\n throw new TypeError(\n \"Layout overlay sidebar requires renderOverlay so SidePanel owns its lifecycle\",\n );\n }\n\n const {\n className: headerClassName,\n ...restHeaderProps\n } = headerProps ?? {};\n const {\n className: mainClassName,\n style: mainStyle,\n ...restMainProps\n } = mainProps ?? {};\n const {\n className: footerClassName,\n ...restFooterProps\n } = footerProps ?? {};\n const {\n className: skipLinkClassName,\n onClick: onSkipLinkClick,\n ...restSkipLinkProps\n } = skipLinkProps ?? {};\n\n let sidebarNode: ReactNode;\n if (sidebar !== undefined) {\n const {\n className: sidebarClassName,\n style: sidebarStyle,\n ...restSidebarProps\n } = sidebar.landmarkProps ?? {};\n const sidebarLandmark = createElement(\n sidebar.role === \"navigation\" ? \"nav\" : \"aside\",\n {\n ...restSidebarProps,\n ref: sidebar.landmarkRef,\n className: classNames(\"hjm-layout__sidebar\", sidebarClassName),\n \"aria-label\": sidebar.label,\n \"data-mode\": sidebar.mode,\n style: {\n ...(sidebar.mode === \"persistent\"\n ? { inlineSize: layoutRecipe.sidebar.width }\n : {}),\n ...sidebarStyle,\n },\n },\n sidebar.children,\n );\n sidebarNode = sidebar.mode === \"overlay\"\n ? sidebar.renderOverlay(sidebarLandmark)\n : sidebarLandmark;\n }\n\n const moveFocusToMain = (event: MouseEvent<HTMLAnchorElement>) => {\n onSkipLinkClick?.(event);\n if (event.defaultPrevented) return;\n const main = internalMainRef.current;\n if (main === null) return;\n event.preventDefault();\n const url = new URL(window.location.href);\n url.hash = mainId;\n window.history.replaceState(window.history.state, \"\", url);\n main.focus({ preventScroll: true });\n main.scrollIntoView?.({ block: \"start\" });\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-layout\", className)}\n data-hjm-component=\"Layout\"\n data-sidebar-mode={sidebar?.mode ?? \"none\"}\n >\n {skipLinkLabel === undefined ? null : (\n <a\n {...restSkipLinkProps}\n href={`#${mainId}`}\n className={classNames(\n \"hjm-layout__skip-link\",\n skipLinkClassName,\n )}\n onClick={moveFocusToMain}\n >\n {skipLinkLabel}\n </a>\n )}\n {hasHeader ? (\n <header\n {...restHeaderProps}\n className={classNames(\"hjm-layout__header\", headerClassName)}\n >\n {header}\n </header>\n ) : null}\n {sidebarNode}\n <main\n {...restMainProps}\n ref={composeRefs(internalMainRef, forwardedMainRef)}\n id={mainId}\n className={classNames(\"hjm-layout__main\", mainClassName)}\n tabIndex={-1}\n style={{\n maxInlineSize: layoutRecipe.main.maxWidth,\n paddingInline: layoutRecipe.main.paddingHorizontal,\n ...mainStyle,\n }}\n >\n {children}\n </main>\n {hasFooter ? (\n <footer\n {...restFooterProps}\n className={classNames(\"hjm-layout__footer\", footerClassName)}\n >\n {footer}\n </footer>\n ) : null}\n </div>\n );\n});\n\nexport type TextProps = Omit<HTMLAttributes<HTMLElement>, \"children\"> &\n Readonly<{\n children: ReactNode;\n as?: \"span\" | \"p\" | \"div\" | \"strong\" | \"small\";\n variant?: TextVariant;\n tone?: TextTone;\n emphasis?: TextEmphasis;\n }>;\n\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n {\n as = \"span\",\n variant = textRecipe.defaults.variant,\n tone = textRecipe.defaults.tone,\n emphasis = textRecipe.defaults.emphasis,\n className,\n ...props\n },\n ref,\n) {\n return createElement(as, {\n ...props,\n ref,\n className: classNames(\"hjm-text\", className),\n \"data-variant\": variant,\n \"data-tone\": tone,\n \"data-emphasis\": emphasis,\n });\n});\n\nexport type SurfaceProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n as?: \"div\" | \"section\" | \"article\";\n tone?: SurfaceTone;\n bordered?: boolean;\n padding?: SurfacePadding;\n radius?: SurfaceRadius;\n }>;\n\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(function Surface(\n {\n as = \"div\",\n tone = surfaceDefaults.tone,\n bordered = surfaceDefaults.bordered,\n padding = surfaceDefaults.padding,\n radius = surfaceDefaults.radius,\n className,\n style,\n ...props\n },\n ref,\n) {\n const contract = surfaceRecipe[tone];\n return createElement(as, {\n ...props,\n ref,\n className: classNames(\"hjm-surface\", className),\n \"data-tone\": tone,\n \"data-bordered\": bordered || contract.borderAlways,\n \"data-elevated\": contract.elevated,\n \"data-padding\": padding,\n \"data-radius\": radius,\n style: {\n padding: surfaceGeometry.paddings[padding],\n borderRadius: surfaceGeometry.radii[radius],\n ...style,\n },\n });\n});\n\nexport type StackProps = HTMLAttributes<HTMLDivElement> &\n Readonly<{\n axis?: StackAxis;\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n wrap?: boolean;\n }>;\n\nconst justifyValues = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n} as const;\n\nexport const Stack = forwardRef<HTMLDivElement, StackProps>(function Stack(\n {\n axis = stackRecipe.defaults.axis,\n gap = stackRecipe.defaults.gap,\n align = stackRecipe.defaults.align,\n justify = stackRecipe.defaults.justify,\n wrap = stackRecipe.defaults.wrap,\n className,\n style,\n ...props\n },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-stack\", className)}\n data-axis={axis}\n data-gap={gap}\n style={{\n display: \"flex\",\n flexDirection: stackRecipe.axes[axis],\n gap: stackRecipe.gaps[gap],\n alignItems: align === \"start\" || align === \"end\" ? `flex-${align}` : align,\n justifyContent: justifyValues[justify],\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n }}\n />\n );\n});\n\nexport type ContainerProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children?: ReactNode;\n size?: ContainerSize;\n gutter?: ContainerGutter;\n }>;\n\n/** A centered, token-guttered content boundary shared with Native large screens. */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(function Container(\n { size, gutter, className, style, ...props },\n ref,\n) {\n const resolved = resolveContainerDescriptor({\n ...(size === undefined ? {} : { size }),\n ...(gutter === undefined ? {} : { gutter }),\n });\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-container\", className)}\n data-size={resolved.size}\n data-gutter={resolved.gutter}\n style={{\n maxInlineSize: resolved.maxWidth ?? undefined,\n paddingInline: resolved.paddingInline,\n ...style,\n }}\n />\n );\n});\n\nexport type AspectRatioProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children?: ReactNode;\n ratio?: AspectRatioValue;\n }>;\n\n/** Responsive media frame. Products retain object-fit, crop, and content semantics. */\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { ratio, className, style, ...props },\n ref,\n) {\n const resolved = resolveAspectRatioDescriptor(\n ratio === undefined ? {} : { ratio },\n );\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-aspect-ratio\", className)}\n data-ratio={resolved.source}\n style={{ aspectRatio: resolved.ratio, ...style }}\n />\n );\n});\n\nexport type VisuallyHiddenProps = HTMLAttributes<HTMLSpanElement> &\n Readonly<{ children: ReactNode }>;\n\n/** Keeps meaningful copy available to assistive technology without visible layout. */\nexport const VisuallyHidden = forwardRef<HTMLSpanElement, VisuallyHiddenProps>(\n function VisuallyHidden({ className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-visually-hidden\", className)}\n />\n );\n },\n);\n\nexport type GridProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Pick<GridDescriptor, \"columns\" | \"gap\" | \"minColumnWidth\"> &\n Readonly<{\n children?: ReactNode;\n /** Test/SSR override. Browser renderers otherwise observe window.innerWidth. */\n windowWidth?: number;\n /** Container measurement override; ResizeObserver is used when omitted. */\n availableWidth?: number;\n }>;\n\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(\n {\n columns,\n gap,\n minColumnWidth,\n windowWidth,\n availableWidth,\n className,\n style,\n ...props\n },\n forwardedRef,\n) {\n const browserWindowWidth = useWindowWidth();\n const [measuredWidth, gridRef] = useElementWidth(forwardedRef);\n const compactSsrWidth = 320;\n const effectiveWindowWidth =\n windowWidth ??\n (browserWindowWidth > 0 ? browserWindowWidth : compactSsrWidth);\n const effectiveAvailableWidth =\n availableWidth ??\n (measuredWidth !== undefined && measuredWidth > 0\n ? measuredWidth\n : effectiveWindowWidth);\n const descriptor: GridDescriptor = {\n columns,\n ...(gap === undefined ? {} : { gap }),\n ...(minColumnWidth === undefined ? {} : { minColumnWidth }),\n };\n const layout = resolveGridLayout(descriptor, {\n windowWidth: effectiveWindowWidth,\n availableWidth: effectiveAvailableWidth,\n });\n\n return (\n <div\n {...props}\n ref={gridRef}\n className={classNames(\"hjm-grid\", className)}\n data-window-class={layout.windowClass}\n data-columns={layout.columns}\n data-requested-columns={layout.requestedColumns}\n data-state={layout.columns < layout.requestedColumns ? \"collapsed\" : \"resolved\"}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${layout.columns}, minmax(0, 1fr))`,\n rowGap: layout.rowGap,\n columnGap: layout.columnGap,\n ...style,\n }}\n />\n );\n});\n\nexport type SectionProps = Omit<HTMLAttributes<HTMLElement>, \"children\" | \"title\"> &\n Readonly<{\n title?: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n children: ReactNode;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\n/** Large-text-safe semantic content section with an optional header action. */\nexport const Section = forwardRef<HTMLElement, SectionProps>(function Section(\n {\n title,\n description,\n action,\n children,\n headingLevel = 2,\n className,\n ...props\n },\n ref,\n) {\n const hasHeader = title !== undefined || description !== undefined || action !== undefined;\n return (\n <section {...props} ref={ref} className={classNames(\"hjm-section\", className)}>\n {hasHeader ? (\n <header className=\"hjm-section__header\">\n <div className=\"hjm-section__copy\">\n {title === undefined ? null : createElement(\n `h${headingLevel}`,\n { className: \"hjm-section__title\" },\n title,\n )}\n {description === undefined ? null : (\n <div className=\"hjm-section__description\">{description}</div>\n )}\n </div>\n {action === undefined ? null : <div className=\"hjm-section__action\">{action}</div>}\n </header>\n ) : null}\n <div className=\"hjm-section__content\">{children}</div>\n </section>\n );\n});\n\nexport type { GridGap };\nexport type { AspectRatioValue, ContainerGutter, ContainerSize };\n"]}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,GAGlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,GAE7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,0BAA0B,GAG3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,2BAA2B,GAG5B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,eAAe,EACf,eAAe,EACf,aAAa,GAId,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,UAAU,GAOX,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,UAAU,EACV,KAAK,EACL,MAAM,GAOP,MAAM,OAAO,CAAC;AACf,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AAkEvB,SAAS,gBAAgB,CAAC,OAA8B;IACtD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AC,IAAI,CAAC,CAAC,CAAC,aAAa,CACzC,IAAI,YAAY,EAAE,EAClB,EAAE,SAAS,EAAE,oBAAoB,EAAE,EACnC,KAAK,CACN,EACA,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAClC,cAAK,SAAS,EAAC,0BAA0B,YAAE,WAAW,GAAO,CAC9D,IACG,EACL,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,qBAAqB,YAAE,MAAM,GAAO,IAC3E,CACV,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAO,IAC9C,CACX,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import {\n resolveGridLayout,\n type GridDescriptor,\n type GridGap,\n} from \"@hjmds/design-contracts/grid\";\nimport {\n resolveAspectRatioDescriptor,\n type AspectRatioValue,\n} from \"@hjmds/design-contracts/components/aspect-ratio\";\nimport {\n resolveContainerDescriptor,\n type ContainerGutter,\n type ContainerSize,\n} from \"@hjmds/design-contracts/components/container\";\nimport {\n layoutRecipe,\n validateLayoutWebDescriptor,\n type LayoutSidebarDescriptor,\n type LayoutSidebarRole,\n} from \"@hjmds/design-contracts/components/layout\";\nimport {\n surfaceDefaults,\n surfaceGeometry,\n surfaceRecipe,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n stackRecipe,\n textRecipe,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type TextEmphasis,\n type TextTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { TextVariant } from \"@hjmds/design-contracts/foundations\";\nimport {\n createElement,\n forwardRef,\n useId,\n useRef,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n classNames,\n composeRefs,\n useElementWidth,\n useWindowWidth,\n} from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type {\n SurfacePadding,\n SurfaceRadius,\n SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nexport type {\n StackAlign,\n StackAxis,\n StackGap,\n StackJustify,\n TextEmphasis,\n TextTone,\n} from \"@hjmds/design-contracts/recipes\";\n\ntype LayoutRegionProps = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\" | \"role\"\n>;\n\ntype LayoutSidebarBase = Readonly<{\n children: ReactNode;\n role: LayoutSidebarRole;\n label: string;\n landmarkProps?: Omit<LayoutRegionProps, \"aria-label\">;\n landmarkRef?: Ref<HTMLElement>;\n}>;\n\n/**\n * A persistent sidebar is rendered in the shell grid. An overlay sidebar is\n * deliberately handed to the product's SidePanel (or equivalent) through\n * `renderOverlay`; Layout never owns a second open/dismiss lifecycle.\n */\nexport type LayoutSidebar =\n | (LayoutSidebarBase &\n Readonly<{\n mode: \"persistent\";\n renderOverlay?: never;\n }>)\n | (LayoutSidebarBase &\n Readonly<{\n mode: \"overlay\";\n renderOverlay(sidebarLandmark: ReactElement): ReactNode;\n }>);\n\nexport type LayoutProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children: ReactNode;\n header?: ReactNode;\n footer?: ReactNode;\n sidebar?: LayoutSidebar;\n skipLinkLabel?: string;\n /** Stable product id for deep links; a hydration-safe id is generated when omitted. */\n mainId?: string;\n mainRef?: Ref<HTMLElement>;\n headerProps?: LayoutRegionProps;\n mainProps?: Omit<LayoutRegionProps, \"id\" | \"tabIndex\">;\n footerProps?: LayoutRegionProps;\n skipLinkProps?: Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"children\" | \"href\"\n >;\n }>;\n\nfunction hasRegionContent(content: ReactNode | undefined): boolean {\n return content !== undefined && content !== null && content !== false;\n}\n\nfunction assertMainId(id: string): void {\n if (id.trim().length === 0) {\n throw new TypeError(\"Layout mainId must not be empty\");\n }\n if (/\\s/u.test(id)) {\n throw new TypeError(\"Layout mainId must not contain whitespace\");\n }\n}\n\n/** Accessible Web app shell with real landmarks and bypass navigation. */\nexport const Layout = forwardRef<HTMLDivElement, LayoutProps>(function Layout(\n {\n children,\n header,\n footer,\n sidebar,\n skipLinkLabel,\n mainId: mainIdProp,\n mainRef: forwardedMainRef,\n headerProps,\n mainProps,\n footerProps,\n skipLinkProps,\n className,\n ...props\n },\n ref,\n) {\n const generatedId = `hjm-main-${useId().replaceAll(\":\", \"\")}`;\n const internalMainRef = useRef<HTMLElement>(null);\n const mainId = mainIdProp ?? generatedId;\n assertMainId(mainId);\n\n const hasHeader = hasRegionContent(header);\n const hasFooter = hasRegionContent(footer);\n const descriptor = {\n ...(hasHeader ? { hasHeader: true } : {}),\n ...(hasFooter ? { hasFooter: true } : {}),\n ...(sidebar === undefined\n ? {}\n : {\n sidebar: {\n role: sidebar.role,\n mode: sidebar.mode,\n label: sidebar.label,\n } satisfies LayoutSidebarDescriptor,\n }),\n ...(skipLinkLabel === undefined ? {} : { skipLinkLabel }),\n };\n validateLayoutWebDescriptor(descriptor);\n\n if (\n sidebar?.mode === \"overlay\" &&\n typeof sidebar.renderOverlay !== \"function\"\n ) {\n throw new TypeError(\n \"Layout overlay sidebar requires renderOverlay so SidePanel owns its lifecycle\",\n );\n }\n\n const {\n className: headerClassName,\n ...restHeaderProps\n } = headerProps ?? {};\n const {\n className: mainClassName,\n style: mainStyle,\n ...restMainProps\n } = mainProps ?? {};\n const {\n className: footerClassName,\n ...restFooterProps\n } = footerProps ?? {};\n const {\n className: skipLinkClassName,\n onClick: onSkipLinkClick,\n ...restSkipLinkProps\n } = skipLinkProps ?? {};\n\n let sidebarNode: ReactNode;\n if (sidebar !== undefined) {\n const {\n className: sidebarClassName,\n style: sidebarStyle,\n ...restSidebarProps\n } = sidebar.landmarkProps ?? {};\n const sidebarLandmark = createElement(\n sidebar.role === \"navigation\" ? \"nav\" : \"aside\",\n {\n ...restSidebarProps,\n ref: sidebar.landmarkRef,\n className: classNames(\"hjm-layout__sidebar\", sidebarClassName),\n \"aria-label\": sidebar.label,\n \"data-mode\": sidebar.mode,\n style: {\n ...(sidebar.mode === \"persistent\"\n ? { inlineSize: layoutRecipe.sidebar.width }\n : {}),\n ...sidebarStyle,\n },\n },\n sidebar.children,\n );\n sidebarNode = sidebar.mode === \"overlay\"\n ? sidebar.renderOverlay(sidebarLandmark)\n : sidebarLandmark;\n }\n\n const moveFocusToMain = (event: MouseEvent<HTMLAnchorElement>) => {\n onSkipLinkClick?.(event);\n if (event.defaultPrevented) return;\n const main = internalMainRef.current;\n if (main === null) return;\n event.preventDefault();\n const url = new URL(window.location.href);\n url.hash = mainId;\n window.history.replaceState(window.history.state, \"\", url);\n main.focus({ preventScroll: true });\n main.scrollIntoView?.({ block: \"start\" });\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-layout\", className)}\n data-hjm-component=\"Layout\"\n data-sidebar-mode={sidebar?.mode ?? \"none\"}\n >\n {skipLinkLabel === undefined ? null : (\n <a\n {...restSkipLinkProps}\n href={`#${mainId}`}\n className={classNames(\n \"hjm-layout__skip-link\",\n skipLinkClassName,\n )}\n onClick={moveFocusToMain}\n >\n {skipLinkLabel}\n </a>\n )}\n {hasHeader ? (\n <header\n {...restHeaderProps}\n className={classNames(\"hjm-layout__header\", headerClassName)}\n >\n {header}\n </header>\n ) : null}\n {sidebarNode}\n <main\n {...restMainProps}\n ref={composeRefs(internalMainRef, forwardedMainRef)}\n id={mainId}\n className={classNames(\"hjm-layout__main\", mainClassName)}\n tabIndex={-1}\n style={{\n maxInlineSize: layoutRecipe.main.maxWidth,\n paddingInline: layoutRecipe.main.paddingHorizontal,\n ...mainStyle,\n }}\n >\n {children}\n </main>\n {hasFooter ? (\n <footer\n {...restFooterProps}\n className={classNames(\"hjm-layout__footer\", footerClassName)}\n >\n {footer}\n </footer>\n ) : null}\n </div>\n );\n});\n\nexport type TextProps = Omit<HTMLAttributes<HTMLElement>, \"children\"> &\n Readonly<{\n children: ReactNode;\n as?: \"span\" | \"p\" | \"div\" | \"strong\" | \"small\";\n variant?: TextVariant;\n tone?: TextTone;\n emphasis?: TextEmphasis;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n {\n as = \"span\",\n variant = textRecipe.defaults.variant,\n tone = textRecipe.defaults.tone,\n emphasis = textRecipe.defaults.emphasis,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n return createElement(as, {\n ...props,\n ref,\n className: classNames(\"hjm-text\", className),\n \"data-variant\": variant,\n \"data-tone\": tone,\n \"data-emphasis\": emphasis,\n // Placement wins over the legacy `style`, matching Surface's ordering.\n style: { ...style, ...layoutStyle },\n });\n});\n\nexport type SurfaceProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n as?: \"div\" | \"section\" | \"article\";\n tone?: SurfaceTone;\n bordered?: boolean;\n padding?: SurfacePadding;\n radius?: SurfaceRadius;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(function Surface(\n {\n as = \"div\",\n tone = surfaceDefaults.tone,\n bordered = surfaceDefaults.bordered,\n padding = surfaceDefaults.padding,\n radius = surfaceDefaults.radius,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n const contract = surfaceRecipe[tone];\n return createElement(as, {\n ...props,\n ref,\n className: classNames(\"hjm-surface\", className),\n \"data-tone\": tone,\n \"data-bordered\": bordered || contract.borderAlways,\n \"data-elevated\": contract.elevated,\n \"data-padding\": padding,\n \"data-radius\": radius,\n style: {\n padding: surfaceGeometry.paddings[padding],\n borderRadius: surfaceGeometry.radii[radius],\n ...style,\n ...layoutStyle,\n },\n });\n});\n\nexport type StackProps = HTMLAttributes<HTMLDivElement> &\n Readonly<{\n axis?: StackAxis;\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n wrap?: boolean;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nconst justifyValues = {\n start: \"flex-start\",\n center: \"center\",\n end: \"flex-end\",\n between: \"space-between\",\n} as const;\n\nexport const Stack = forwardRef<HTMLDivElement, StackProps>(function Stack(\n {\n axis = stackRecipe.defaults.axis,\n gap = stackRecipe.defaults.gap,\n align = stackRecipe.defaults.align,\n justify = stackRecipe.defaults.justify,\n wrap = stackRecipe.defaults.wrap,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-stack\", className)}\n data-axis={axis}\n data-gap={gap}\n style={{\n display: \"flex\",\n flexDirection: stackRecipe.axes[axis],\n gap: stackRecipe.gaps[gap],\n alignItems: align === \"start\" || align === \"end\" ? `flex-${align}` : align,\n justifyContent: justifyValues[justify],\n flexWrap: wrap ? \"wrap\" : \"nowrap\",\n ...style,\n ...layoutStyle,\n }}\n />\n );\n});\n\nexport type ContainerProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children?: ReactNode;\n size?: ContainerSize;\n gutter?: ContainerGutter;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** A centered, token-guttered content boundary shared with Native large screens. */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(function Container(\n { size, gutter, className, layoutStyle, style, ...props },\n ref,\n) {\n const resolved = resolveContainerDescriptor({\n ...(size === undefined ? {} : { size }),\n ...(gutter === undefined ? {} : { gutter }),\n });\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-container\", className)}\n data-size={resolved.size}\n data-gutter={resolved.gutter}\n style={{\n maxInlineSize: resolved.maxWidth ?? undefined,\n paddingInline: resolved.paddingInline,\n ...style,\n ...layoutStyle,\n }}\n />\n );\n});\n\nexport type AspectRatioProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n children?: ReactNode;\n ratio?: AspectRatioValue;\n }>;\n\n/** Responsive media frame. Products retain object-fit, crop, and content semantics. */\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { ratio, className, style, ...props },\n ref,\n) {\n const resolved = resolveAspectRatioDescriptor(\n ratio === undefined ? {} : { ratio },\n );\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-aspect-ratio\", className)}\n data-ratio={resolved.source}\n style={{ aspectRatio: resolved.ratio, ...style }}\n />\n );\n});\n\nexport type VisuallyHiddenProps = HTMLAttributes<HTMLSpanElement> &\n Readonly<{ children: ReactNode }>;\n\n/** Keeps meaningful copy available to assistive technology without visible layout. */\nexport const VisuallyHidden = forwardRef<HTMLSpanElement, VisuallyHiddenProps>(\n function VisuallyHidden({ className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-visually-hidden\", className)}\n />\n );\n },\n);\n\nexport type GridProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Pick<GridDescriptor, \"columns\" | \"gap\" | \"minColumnWidth\"> &\n Readonly<{\n children?: ReactNode;\n /** Test/SSR override. Browser renderers otherwise observe window.innerWidth. */\n windowWidth?: number;\n /** Container measurement override; ResizeObserver is used when omitted. */\n availableWidth?: number;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(\n {\n columns,\n gap,\n minColumnWidth,\n windowWidth,\n availableWidth,\n className,\n layoutStyle,\n style,\n ...props\n },\n forwardedRef,\n) {\n const browserWindowWidth = useWindowWidth();\n const [measuredWidth, gridRef] = useElementWidth(forwardedRef);\n const compactSsrWidth = 320;\n const effectiveWindowWidth =\n windowWidth ??\n (browserWindowWidth > 0 ? browserWindowWidth : compactSsrWidth);\n const effectiveAvailableWidth =\n availableWidth ??\n (measuredWidth !== undefined && measuredWidth > 0\n ? measuredWidth\n : effectiveWindowWidth);\n const descriptor: GridDescriptor = {\n columns,\n ...(gap === undefined ? {} : { gap }),\n ...(minColumnWidth === undefined ? {} : { minColumnWidth }),\n };\n const layout = resolveGridLayout(descriptor, {\n windowWidth: effectiveWindowWidth,\n availableWidth: effectiveAvailableWidth,\n });\n\n return (\n <div\n {...props}\n ref={gridRef}\n className={classNames(\"hjm-grid\", className)}\n data-window-class={layout.windowClass}\n data-columns={layout.columns}\n data-requested-columns={layout.requestedColumns}\n data-state={layout.columns < layout.requestedColumns ? \"collapsed\" : \"resolved\"}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${layout.columns}, minmax(0, 1fr))`,\n rowGap: layout.rowGap,\n columnGap: layout.columnGap,\n ...style,\n ...layoutStyle,\n }}\n />\n );\n});\n\nexport type SectionProps = Omit<HTMLAttributes<HTMLElement>, \"children\" | \"title\"> &\n Readonly<{\n title?: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n children: ReactNode;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\n/** Large-text-safe semantic content section with an optional header action. */\nexport const Section = forwardRef<HTMLElement, SectionProps>(function Section(\n {\n title,\n description,\n action,\n children,\n headingLevel = 2,\n className,\n ...props\n },\n ref,\n) {\n const hasHeader = title !== undefined || description !== undefined || action !== undefined;\n return (\n <section {...props} ref={ref} className={classNames(\"hjm-section\", className)}>\n {hasHeader ? (\n <header className=\"hjm-section__header\">\n <div className=\"hjm-section__copy\">\n {title === undefined ? null : createElement(\n `h${headingLevel}`,\n { className: \"hjm-section__title\" },\n title,\n )}\n {description === undefined ? null : (\n <div className=\"hjm-section__description\">{description}</div>\n )}\n </div>\n {action === undefined ? null : <div className=\"hjm-section__action\">{action}</div>}\n </header>\n ) : null}\n <div className=\"hjm-section__content\">{children}</div>\n </section>\n );\n});\n\nexport type { GridGap };\nexport type { AspectRatioValue, ContainerGutter, ContainerSize };\n"]}
|
package/dist/selection.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { chipRecipe, type SegmentedControlSize, type SelectionControlPresentation, type SelectionControlSize, type SelectionGroupOrientation, type SelectionGroupPresentation } from "@hjmds/design-contracts/recipes";
|
|
2
2
|
import { type CheckboxGroupSelection, type SelectionItemDescriptor } from "@hjmds/design-contracts/behaviors";
|
|
3
3
|
import { type ButtonHTMLAttributes, type ChangeEvent, type FieldsetHTMLAttributes, type InputHTMLAttributes, type MouseEvent, type ReactElement, type ReactNode, type RefAttributes } from "react";
|
|
4
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
4
5
|
export type ChoiceLeadingRenderProps = Readonly<{
|
|
5
6
|
selected: boolean;
|
|
6
7
|
color: "currentColor";
|
|
@@ -126,12 +127,16 @@ export type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "role" |
|
|
|
126
127
|
checked?: boolean;
|
|
127
128
|
defaultChecked?: boolean;
|
|
128
129
|
onCheckedChange?: (checked: boolean) => void;
|
|
130
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
131
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
129
132
|
}>;
|
|
130
133
|
export declare const Switch: import("react").ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange" | "role"> & Readonly<{
|
|
131
134
|
label: ReactNode;
|
|
132
135
|
checked?: boolean;
|
|
133
136
|
defaultChecked?: boolean;
|
|
134
137
|
onCheckedChange?: (checked: boolean) => void;
|
|
138
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
139
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
135
140
|
}> & RefAttributes<HTMLButtonElement>>;
|
|
136
141
|
export type SegmentedControlItem = Readonly<{
|
|
137
142
|
value: string;
|
package/dist/selection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,KAAK,aAAa,GAAG,IAAI,CACvB,oBA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AM,CAAC;IACd,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEL,eAAO,MAAM,gBAAgB;WATlB,MAAM;WACN,SAAS,oBAAoB,EAAE;YAC9B,MAAM;mBACC,MAAM;oBACL,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;WAChC,oBAAoB;WACpB,MAAM;wCAkFf,CAAC"}
|
package/dist/selection.js
CHANGED
|
@@ -175,13 +175,13 @@ export const RadioGroup = forwardRef(function RadioGroup({ label, accessibilityL
|
|
|
175
175
|
}) })) : null, _jsxs("span", { className: "hjm-choice__copy", children: [_jsx("span", { children: item.label }), item.description ? (_jsx("span", { className: "hjm-choice__description", children: item.description })) : null] })] }, item.value));
|
|
176
176
|
}) }), error ? _jsx("div", { id: errorId, className: "hjm-field__error", children: error }) : null] }));
|
|
177
177
|
});
|
|
178
|
-
export const Switch = forwardRef(function Switch({ label, checked: checkedProp, defaultChecked = false, onCheckedChange, disabled, type = "button", className, onClick, ...props }, ref) {
|
|
178
|
+
export const Switch = forwardRef(function Switch({ label, checked: checkedProp, defaultChecked = false, onCheckedChange, disabled, type = "button", className, onClick, layoutStyle, style, ...props }, ref) {
|
|
179
179
|
const [checked, setChecked] = useControllableState({
|
|
180
180
|
...(checkedProp === undefined ? {} : { value: checkedProp }),
|
|
181
181
|
defaultValue: defaultChecked,
|
|
182
182
|
...(onCheckedChange === undefined ? {} : { onChange: onCheckedChange }),
|
|
183
183
|
});
|
|
184
|
-
return (_jsxs("button", { ...props, ref: ref, type: type, role: "switch", className: classNames("hjm-switch", className), "data-state": checked ? "checked" : "unchecked", "aria-checked": checked, disabled: disabled, onClick: (event) => {
|
|
184
|
+
return (_jsxs("button", { ...props, style: { ...style, ...layoutStyle }, ref: ref, type: type, role: "switch", className: classNames("hjm-switch", className), "data-state": checked ? "checked" : "unchecked", "aria-checked": checked, disabled: disabled, onClick: (event) => {
|
|
185
185
|
setChecked((current) => !current);
|
|
186
186
|
onClick?.(event);
|
|
187
187
|
}, children: [_jsx("span", { className: "hjm-switch__track", "aria-hidden": "true", children: _jsx("span", { className: "hjm-switch__thumb" }) }), _jsx("span", { children: label })] }));
|