@hjmds/react-native 1.12.1 → 1.13.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 +15 -0
- package/dist/actions.d.ts +30 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +28 -5
- package/dist/actions.js.map +1 -1
- package/dist/agreement.d.ts +8 -1
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +16 -3
- package/dist/agreement.js.map +1 -1
- package/dist/asset.d.ts +15 -2
- package/dist/asset.d.ts.map +1 -1
- package/dist/asset.js +7 -4
- package/dist/asset.js.map +1 -1
- package/dist/bottom-info.d.ts +8 -1
- package/dist/bottom-info.d.ts.map +1 -1
- package/dist/bottom-info.js +4 -2
- package/dist/bottom-info.js.map +1 -1
- package/dist/calendar.d.ts +3 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +2 -2
- package/dist/calendar.js.map +1 -1
- package/dist/carousel.d.ts +8 -1
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +4 -2
- package/dist/carousel.js.map +1 -1
- package/dist/collapsible.d.ts +8 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +9 -3
- package/dist/collapsible.js.map +1 -1
- package/dist/data-display.d.ts +146 -13
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +58 -29
- package/dist/data-display.js.map +1 -1
- package/dist/date-picker.d.ts +8 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +10 -3
- package/dist/date-picker.js.map +1 -1
- package/dist/duration-field.d.ts +4 -1
- package/dist/duration-field.d.ts.map +1 -1
- package/dist/duration-field.js +2 -2
- package/dist/duration-field.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/feedback.d.ts +89 -14
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +25 -16
- package/dist/feedback.js.map +1 -1
- package/dist/file-picker.d.ts +8 -1
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +4 -2
- package/dist/file-picker.js.map +1 -1
- package/dist/forms.d.ts +28 -4
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +19 -8
- package/dist/forms.js.map +1 -1
- package/dist/heading.d.ts +8 -1
- package/dist/heading.d.ts.map +1 -1
- package/dist/heading.js +4 -2
- package/dist/heading.js.map +1 -1
- package/dist/image-viewer.d.ts.map +1 -1
- package/dist/image-viewer.js +11 -3
- package/dist/image-viewer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inputs.d.ts +66 -3
- package/dist/inputs.d.ts.map +1 -1
- package/dist/inputs.js +142 -51
- package/dist/inputs.js.map +1 -1
- package/dist/internal/deprecated-style.d.ts +8 -0
- package/dist/internal/deprecated-style.d.ts.map +1 -0
- package/dist/internal/deprecated-style.js +34 -0
- package/dist/internal/deprecated-style.js.map +1 -0
- package/dist/internal/field-frame.d.ts +2 -1
- package/dist/internal/field-frame.d.ts.map +1 -1
- package/dist/internal/field-frame.js +4 -2
- package/dist/internal/field-frame.js.map +1 -1
- package/dist/internal/field-private.d.ts +11 -0
- package/dist/internal/field-private.d.ts.map +1 -0
- package/dist/internal/field-private.js +2 -0
- package/dist/internal/field-private.js.map +1 -0
- package/dist/internal/list-row-private.d.ts +10 -0
- package/dist/internal/list-row-private.d.ts.map +1 -0
- package/dist/internal/list-row-private.js +2 -0
- package/dist/internal/list-row-private.js.map +1 -0
- package/dist/internal/message-reactions.d.ts +21 -0
- package/dist/internal/message-reactions.d.ts.map +1 -0
- package/dist/internal/message-reactions.js +49 -0
- package/dist/internal/message-reactions.js.map +1 -0
- package/dist/internal/recipe-button.d.ts +6 -5
- package/dist/internal/recipe-button.d.ts.map +1 -1
- package/dist/internal/recipe-button.js +22 -7
- package/dist/internal/recipe-button.js.map +1 -1
- package/dist/internal/spinner.d.ts +15 -0
- package/dist/internal/spinner.d.ts.map +1 -0
- package/dist/internal/spinner.js +12 -0
- package/dist/internal/spinner.js.map +1 -0
- package/dist/masonry.d.ts +3 -1
- package/dist/masonry.d.ts.map +1 -1
- package/dist/masonry.js +3 -3
- package/dist/masonry.js.map +1 -1
- package/dist/mentions.d.ts +4 -0
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +8 -2
- package/dist/mentions.js.map +1 -1
- package/dist/navigation.d.ts +72 -4
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +39 -21
- package/dist/navigation.js.map +1 -1
- package/dist/number-field.d.ts +21 -0
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +7 -2
- package/dist/number-field.js.map +1 -1
- package/dist/overlays.d.ts +30 -2
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +108 -19
- package/dist/overlays.js.map +1 -1
- package/dist/primitives.d.ts +19 -3
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +12 -6
- package/dist/primitives.js.map +1 -1
- package/dist/provider-button.d.ts +8 -1
- package/dist/provider-button.d.ts.map +1 -1
- package/dist/provider-button.js +4 -1
- package/dist/provider-button.js.map +1 -1
- package/dist/qr-code.d.ts +4 -1
- package/dist/qr-code.d.ts.map +1 -1
- package/dist/qr-code.js +2 -2
- package/dist/qr-code.js.map +1 -1
- package/dist/reaction-picker.d.ts +4 -2
- package/dist/reaction-picker.d.ts.map +1 -1
- package/dist/reaction-picker.js +18 -6
- package/dist/reaction-picker.js.map +1 -1
- package/dist/saved-items.d.ts +21 -0
- package/dist/saved-items.d.ts.map +1 -0
- package/dist/saved-items.js +16 -0
- package/dist/saved-items.js.map +1 -0
- package/dist/screen-flows.d.ts +303 -0
- package/dist/screen-flows.d.ts.map +1 -0
- package/dist/screen-flows.js +172 -0
- package/dist/screen-flows.js.map +1 -0
- package/dist/screens.d.ts +114 -0
- package/dist/screens.d.ts.map +1 -0
- package/dist/screens.js +80 -0
- package/dist/screens.js.map +1 -0
- package/dist/slider.d.ts +21 -0
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +6 -2
- package/dist/slider.js.map +1 -1
- package/dist/steps.d.ts +8 -1
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +4 -2
- package/dist/steps.js.map +1 -1
- package/dist/tags-input.d.ts +8 -1
- package/dist/tags-input.d.ts.map +1 -1
- package/dist/tags-input.js +11 -5
- package/dist/tags-input.js.map +1 -1
- package/dist/toggle-group.d.ts +8 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +4 -2
- package/dist/toggle-group.js.map +1 -1
- package/dist/top.d.ts +8 -1
- package/dist/top.d.ts.map +1 -1
- package/dist/top.js +4 -1
- package/dist/top.js.map +1 -1
- package/dist/transfer-list.d.ts +8 -1
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +4 -2
- package/dist/transfer-list.js.map +1 -1
- package/dist/upload-item.d.ts +8 -1
- package/dist/upload-item.d.ts.map +1 -1
- package/dist/upload-item.js +4 -2
- package/dist/upload-item.js.map +1 -1
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -41,6 +41,10 @@ export function Screen() {
|
|
|
41
41
|
`value`) switches those controls to deterministic scaling and disables OS multiplication, so the
|
|
42
42
|
requested scale is applied exactly once. A nested Provider inherits that absolute scale; its own
|
|
43
43
|
`textScale` replaces rather than multiplies the parent value.
|
|
44
|
+
Persistent `BottomNavigation` visual labels use their existing recipe limit of 1.4× in both
|
|
45
|
+
OS and controlled Provider modes. The full destination name and sibling body text retain
|
|
46
|
+
their ordinary accessibility contract. This fixes controlled-scale labels ignoring the
|
|
47
|
+
native multiplier limit (BurnTok BT-QA-021); no consumer prop change is needed.
|
|
44
48
|
- Motion uses React Native's built-in `Animated` API and canonical recipe durations/easing; there
|
|
45
49
|
is no third-party animation dependency. Reduced motion removes spatial exit movement and retains
|
|
46
50
|
only the recipe-permitted enter opacity fallback.
|
|
@@ -263,6 +267,12 @@ or `accessibilityLabel`. `SearchField` can render product icons through `renderL
|
|
|
263
267
|
`renderClearIcon`, and `renderBusyIndicator`; its trailing precedence is busy, then clear, then the
|
|
264
268
|
passive `trailing` slot. `SegmentedControl` items can render their own leading visual.
|
|
265
269
|
|
|
270
|
+
Single-line `TextField` and `SearchField` frames grow with the effective input text scale and
|
|
271
|
+
shrink when it returns to normal. This prevents the OS large-text overflow observed in BurnTok
|
|
272
|
+
folder names (BT-QA-020). Keep the recipe-owned minimum height; stack adjacent product actions
|
|
273
|
+
when space is narrow. Do not override the frame with a fixed height to contain enlarged text.
|
|
274
|
+
Explicit native font-scaling options still determine the same text and frame scale.
|
|
275
|
+
|
|
266
276
|
`Checkbox` supports boolean and `"mixed"` state, read-only semantics, plain/card presentation,
|
|
267
277
|
compact/default sizing, and replaceable leading/indicator visuals. `CheckboxGroup` validates unique
|
|
268
278
|
enabled option keys and exposes controlled or uncontrolled immutable `ReadonlySet` selection.
|
|
@@ -418,3 +428,8 @@ with negative margins.
|
|
|
418
428
|
with an opaque semantic surface and adaptive slots, without a required blur dependency.
|
|
419
429
|
Existing [BottomNavigation](../design-contracts/docs/bottom-navigation.md) accepts the
|
|
420
430
|
`capsule` presentation with an adjacent action and large-text label fallback.
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
iOS TextArea의 실제 글자 배율이 바뀌면 기존 attributed 본문도 갱신한다(BT-QA-025). Native editor만 교체하고 초안·외부 ref·포커스·선택 영역을 보존하며, 같은 배율·Android·한 줄 입력은 재마운트하지 않는다. 공개 API 변경은 없다. 실제 Android 입력 동작 검증과 정식 게시/소비 버전 반영은 별도다.
|
|
434
|
+
|
|
435
|
+
Dialog/AlertDialog viewport candidate BT-QA-027 keeps copy in an internal shrinking scroll body and actions outside it, with provider safe-area padding. Host contracts and normal-size BurnTok iOS confirmation/cancel pass; long-content device geometry remains pending after the user stopped enlarged-text QA. No public API migration or published-version claim.
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type LinkDescriptor, type LinkDestination } from "@hjmds/design-contracts/components/link";
|
|
2
|
+
import type { SemanticIconName } from "@hjmds/design-contracts/components/icon";
|
|
2
3
|
import { type IconButtonTone as ContractIconButtonTone, type IconButtonShape, type IconButtonSize } from "@hjmds/design-contracts/recipes";
|
|
3
4
|
import { type ButtonAlign as ContractButtonAlign, type ButtonShape as ContractButtonShape, type ButtonSize as ContractButtonSize, type ButtonTone as ContractButtonTone } from "@hjmds/design-contracts/recipes/base";
|
|
4
5
|
import { type ReactNode } from "react";
|
|
5
6
|
import { View, type PressableProps, type StyleProp, type ViewStyle } from "react-native";
|
|
6
7
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
8
|
+
import { type NativeIconRenderProps } from "./primitives.js";
|
|
7
9
|
export type ButtonTone = ContractButtonTone;
|
|
8
10
|
export type ButtonSize = ContractButtonSize;
|
|
9
11
|
export type ButtonShape = ContractButtonShape;
|
|
@@ -86,6 +88,10 @@ export type IconButtonProps = Omit<PressableProps, "accessibilityLabel" | "acces
|
|
|
86
88
|
disableWhileLoading?: boolean;
|
|
87
89
|
hitSlop?: PressableProps["hitSlop"];
|
|
88
90
|
accessibilityState?: PressableProps["accessibilityState"];
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement and
|
|
93
|
+
* `tone`/`size`/`shape`/`selected` for appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
94
|
+
*/
|
|
89
95
|
style?: StyleProp<ViewStyle>;
|
|
90
96
|
renderLoadingIndicator?: (props: Readonly<{
|
|
91
97
|
color: string;
|
|
@@ -110,6 +116,10 @@ export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<
|
|
|
110
116
|
disableWhileLoading?: boolean;
|
|
111
117
|
hitSlop?: PressableProps["hitSlop"];
|
|
112
118
|
accessibilityState?: PressableProps["accessibilityState"];
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement and
|
|
121
|
+
* `tone`/`size`/`shape`/`selected` for appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
122
|
+
*/
|
|
113
123
|
style?: StyleProp<ViewStyle>;
|
|
114
124
|
renderLoadingIndicator?: (props: Readonly<{
|
|
115
125
|
color: string;
|
|
@@ -124,10 +134,22 @@ export type LinkProps = Omit<PressableProps, "accessibilityLabel" | "accessibili
|
|
|
124
134
|
onNavigate: (destination: LinkDestination) => void | Promise<void>;
|
|
125
135
|
leading?: ReactNode;
|
|
126
136
|
trailing?: ReactNode;
|
|
137
|
+
/**
|
|
138
|
+
* Product glyph boundary for `descriptor.leadingIcon` / `trailingIcon`. HJM resolves size
|
|
139
|
+
* (`linkRecipe.icon.glyph`), the link tone, decorative semantics and RTL mirroring through `Icon`,
|
|
140
|
+
* so the caller only maps a semantic name to a glyph (for example `createLucideGlyph`).
|
|
141
|
+
*/
|
|
142
|
+
renderIcon?: (props: NativeIconRenderProps<SemanticIconName>) => ReactNode;
|
|
127
143
|
accessibilityHint?: string;
|
|
144
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
145
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement; link
|
|
148
|
+
* color, underline and target size belong to `linkRecipe`. Removed in the next major (consumer-policy.md §3.1).
|
|
149
|
+
*/
|
|
128
150
|
style?: StyleProp<ViewStyle>;
|
|
129
151
|
}>;
|
|
130
|
-
export declare function Link({ descriptor, onNavigate, leading, trailing, accessibilityHint, style, ...props }: LinkProps): import("react").JSX.Element;
|
|
152
|
+
export declare function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle, style, ...props }: LinkProps): import("react").JSX.Element;
|
|
131
153
|
export type BottomCTAAction = Readonly<{
|
|
132
154
|
label: string;
|
|
133
155
|
onPress: NonNullable<PressableProps["onPress"]>;
|
|
@@ -146,9 +168,15 @@ export type BottomCTAProps = Readonly<{
|
|
|
146
168
|
description?: string;
|
|
147
169
|
accessibilityLabel?: string;
|
|
148
170
|
safeAreaBottom?: number;
|
|
171
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
172
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement;
|
|
175
|
+
* surface, border and shadow belong to `bottomCtaRecipe`. Removed in the next major (consumer-policy.md §3.1).
|
|
176
|
+
*/
|
|
149
177
|
style?: StyleProp<ViewStyle>;
|
|
150
178
|
testID?: string;
|
|
151
179
|
}>;
|
|
152
180
|
/** Native sticky-action content; products own its screen-edge positioning. */
|
|
153
|
-
export declare function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom, style, testID, }: BottomCTAProps): import("react").JSX.Element;
|
|
181
|
+
export declare function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom, layoutStyle, style, testID, }: BottomCTAProps): import("react").JSX.Element;
|
|
154
182
|
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,OAAO,EAKL,KAAK,cAAc,IAAI,sBAAsB,EAC7C,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,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AClB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,aAAa,EAAE,eAAe,CAAC;IAC/B,gFAAgF;IAChF,eAAe,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAgCH,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,EACxB,aAAa,EACb,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,cAAkB,EAClB,WAAW,EACX,KAAK,EACL,MAAM,GACP,EAAE,cAAc,+BAwDhB"}
|
package/dist/actions.js
CHANGED
|
@@ -2,13 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { visibleControlHeight } from "@hjmds/design-contracts/components/design-system-provider";
|
|
3
3
|
import { resolveLinkDescriptor, } from "@hjmds/design-contracts/components/link";
|
|
4
4
|
import { glyph, radius, spacing } from "@hjmds/design-contracts/foundations";
|
|
5
|
-
import { bottomCtaRecipe, iconButtonRecipe, resolveIconButtonPresentation, } from "@hjmds/design-contracts/recipes";
|
|
5
|
+
import { bottomCtaRecipe, linkRecipe, iconButtonRecipe, resolveIconButtonPresentation, } from "@hjmds/design-contracts/recipes";
|
|
6
6
|
import {} from "@hjmds/design-contracts/recipes/base";
|
|
7
7
|
import { forwardRef } from "react";
|
|
8
8
|
import { ActivityIndicator, Pressable, View, } from "react-native";
|
|
9
9
|
import { RecipeButton } from "./internal/recipe-button.js";
|
|
10
|
+
import { warnDeprecatedStyleProps, warnOnce } from "./internal/deprecated-style.js";
|
|
10
11
|
import { minimumTargetStyle } from "./internal/styles.js";
|
|
11
|
-
import { Text } from "./primitives.js";
|
|
12
|
+
import { Icon, Text } from "./primitives.js";
|
|
12
13
|
import { useHjmNativeTheme } from "./provider.js";
|
|
13
14
|
// Public callers compose placement through layoutStyle; visual overrides stay inside HJM recipes.
|
|
14
15
|
export const Button = forwardRef(function Button(props, ref) {
|
|
@@ -20,6 +21,7 @@ export const Button = forwardRef(function Button(props, ref) {
|
|
|
20
21
|
});
|
|
21
22
|
export const IconButton = forwardRef(function IconButton({ label, children, tone = iconButtonRecipe.defaults.tone, size = iconButtonRecipe.defaults.size, shape = iconButtonRecipe.defaults.shape, selected, disabled = false, loading = false, disableWhileLoading = false, hitSlop, layoutStyle, style, renderLoadingIndicator, onPress, onLongPress, accessibilityState, ...props }, ref) {
|
|
22
23
|
const theme = useHjmNativeTheme();
|
|
24
|
+
warnDeprecatedStyleProps("IconButton", { style }, "layoutStyle for placement and tone/size/shape/selected for appearance");
|
|
23
25
|
const resolvedLabel = label;
|
|
24
26
|
const resolvedIcon = children;
|
|
25
27
|
if (resolvedLabel === undefined || resolvedLabel.trim().length === 0) {
|
|
@@ -72,9 +74,27 @@ export const IconButton = forwardRef(function IconButton({ label, children, tone
|
|
|
72
74
|
width: glyphSize,
|
|
73
75
|
}, children: resolvedIcon })) }));
|
|
74
76
|
});
|
|
75
|
-
export function Link({ descriptor, onNavigate, leading, trailing, accessibilityHint, style, ...props }) {
|
|
77
|
+
export function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle, style, ...props }) {
|
|
76
78
|
const { colors, environment } = useHjmNativeTheme();
|
|
77
79
|
const resolved = resolveLinkDescriptor(descriptor);
|
|
80
|
+
warnDeprecatedStyleProps("Link", { style }, "layoutStyle for placement; linkRecipe owns link appearance");
|
|
81
|
+
// Until 1.12 the resolver validated leadingIcon/trailingIcon but Native never drew them, so a
|
|
82
|
+
// descriptor shared with Web silently lost its chevron. A missing renderIcon now warns instead of
|
|
83
|
+
// throwing: throwing would crash apps that already passed icons which were simply invisible.
|
|
84
|
+
const renderDescriptorIcon = (icon, slot, fallback) => {
|
|
85
|
+
if (icon === null)
|
|
86
|
+
return fallback;
|
|
87
|
+
if (fallback !== undefined && fallback !== null && fallback !== false) {
|
|
88
|
+
warnOnce(`Link.${slot}.conflict`, `Link received both descriptor.${slot} and a ${slot === "leadingIcon" ? "leading" : "trailing"} node; the descriptor icon wins.`);
|
|
89
|
+
}
|
|
90
|
+
if (renderIcon === undefined) {
|
|
91
|
+
warnOnce(`Link.${slot}.renderIcon`, `Link descriptor.${slot} needs renderIcon to draw a glyph; the icon is not rendered.`);
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return (_jsx(Icon, { descriptor: { name: icon.name, size: linkRecipe.icon.glyph, tone: "brand", decorative: true }, renderGlyph: renderIcon }));
|
|
95
|
+
};
|
|
96
|
+
const leadingNode = renderDescriptorIcon(resolved.leadingIcon, "leadingIcon", leading);
|
|
97
|
+
const trailingNode = renderDescriptorIcon(resolved.trailingIcon, "trailingIcon", trailing);
|
|
78
98
|
return (_jsxs(Pressable, { ...props, accessibilityHint: accessibilityHint, accessibilityLabel: resolved.resolvedAccessibilityLabel, accessibilityRole: "link", onPress: () => void onNavigate(resolved.destination), style: ({ pressed }) => [
|
|
79
99
|
minimumTargetStyle,
|
|
80
100
|
{
|
|
@@ -86,7 +106,8 @@ export function Link({ descriptor, onNavigate, leading, trailing, accessibilityH
|
|
|
86
106
|
opacity: pressed ? 0.72 : 1,
|
|
87
107
|
},
|
|
88
108
|
style,
|
|
89
|
-
|
|
109
|
+
layoutStyle,
|
|
110
|
+
], children: [leadingNode ? _jsx(View, { accessible: false, children: leadingNode }) : null, _jsx(Text, { style: { color: colors.contentBrand, textDecorationLine: "underline" }, variant: "bodyLarge", children: resolved.label }), trailingNode ? _jsx(View, { accessible: false, children: trailingNode }) : null] }));
|
|
90
111
|
}
|
|
91
112
|
function BottomCTAButton({ action, fallbackTone, }) {
|
|
92
113
|
return (_jsx(Button, { ...(action.accessibilityLabel === undefined ? {} : { accessibilityLabel: action.accessibilityLabel }), ...(action.accessibilityHint === undefined ? {} : { accessibilityHint: action.accessibilityHint }), ...(action.disabled === undefined ? {} : { disabled: action.disabled }), ...(action.loading === undefined ? {} : { loading: action.loading }), ...(action.loadingLabel === undefined ? {} : { loadingLabel: action.loadingLabel }), fullWidth: true, onPress: action.onPress, ...(action.size === undefined ? {} : { size: action.size }), tone: action.tone ?? fallbackTone, children: action.label }));
|
|
@@ -100,7 +121,8 @@ function isBottomCTAAction(value) {
|
|
|
100
121
|
&& typeof value.onPress === "function";
|
|
101
122
|
}
|
|
102
123
|
/** Native sticky-action content; products own its screen-edge positioning. */
|
|
103
|
-
export function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0, style, testID, }) {
|
|
124
|
+
export function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0, layoutStyle, style, testID, }) {
|
|
125
|
+
warnDeprecatedStyleProps("BottomCTA", { style }, "layoutStyle for placement; bottomCtaRecipe owns appearance");
|
|
104
126
|
if (!Number.isFinite(safeAreaBottom) || safeAreaBottom < 0) {
|
|
105
127
|
throw new RangeError("BottomCTA safeAreaBottom must be non-negative");
|
|
106
128
|
}
|
|
@@ -128,6 +150,7 @@ export function BottomCTA({ primaryAction, secondaryAction, description, accessi
|
|
|
128
150
|
shadowRadius: bottomCtaRecipe.shadow.radius,
|
|
129
151
|
},
|
|
130
152
|
style,
|
|
153
|
+
layoutStyle,
|
|
131
154
|
], children: [description ? _jsx(Text, { tone: "muted", variant: "caption", children: description }) : null, _jsxs(View, { style: {
|
|
132
155
|
direction: environment.direction,
|
|
133
156
|
flexDirection: stackActions ? "column-reverse" : "row",
|
package/dist/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AACjG,OAAO,EACL,qBAAqB,GAGtB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AACjG,OAAO,EACL,qBAAqB,GAGtB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,6BAA6B,GAI9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAKN,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,IAAI,GAKL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAA8B,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA0ClD,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAA0B,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG;IAClF,kFAAkF;IAClF,IAAI,OAAO,IAAI,KAAK,IAAI,YAAY,IAAI,KAAK,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CAAC,0EAA0E,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,KAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,G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AAO,EAAC,SAAS,YAAE,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,EAC/E,MAAC,IAAI,IACH,KAAK,EAAE;oBACL,SAAS,EAAE,WAAW,CAAC,SAAS;oBAChC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;oBACtD,GAAG,EAAE,eAAe,CAAC,GAAG;iBACzB,aAEA,iBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,CAC5B,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YAChD,iBAAiB,GACb,CACR,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YACjD,KAAC,eAAe,IAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAC,SAAS,GAAG,GAC5D,IACF,IACF,CACR,CAAC;AACJ,CAAC"}
|
package/dist/agreement.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AgreementDescriptor, type AgreementState } from "@hjmds/design-contracts/components/agreement";
|
|
2
2
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
3
4
|
export type AgreementProps<Id extends string = string> = Readonly<{
|
|
4
5
|
descriptor: AgreementDescriptor<Id>;
|
|
5
6
|
checkedIds?: ReadonlySet<Id>;
|
|
@@ -12,7 +13,13 @@ export type AgreementProps<Id extends string = string> = Readonly<{
|
|
|
12
13
|
requiredLabel: string;
|
|
13
14
|
/** Localized suffix marking an optional row, supplied by the product. */
|
|
14
15
|
optionalLabel: string;
|
|
16
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
17
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement;
|
|
20
|
+
* `agreementRecipe` owns appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
21
|
+
*/
|
|
15
22
|
style?: StyleProp<ViewStyle>;
|
|
16
23
|
}>;
|
|
17
|
-
export declare function Agreement<Id extends string = string>({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, style, }: AgreementProps<Id>): import("react").JSX.Element;
|
|
24
|
+
export declare function Agreement<Id extends string = string>({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle, style, }: AgreementProps<Id>): import("react").JSX.Element;
|
|
18
25
|
//# sourceMappingURL=agreement.d.ts.map
|
package/dist/agreement.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement.d.ts","sourceRoot":"","sources":["../src/agreement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,8CAA8C,CAAC;AAItD,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"agreement.d.ts","sourceRoot":"","sources":["../src/agreement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,8CAA8C,CAAC;AAItD,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,MAAM,cAAc,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAChE,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IAC7B,iBAAiB,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IACpC,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACpD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACpD,gFAAgF;IAChF,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;IAC5B,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,wBAAgB,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EACpD,UAAU,EACV,UAAU,EAAE,iBAAiB,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,GACN,EAAE,cAAc,CAAC,EAAE,CAAC,+BA0IpB"}
|
package/dist/agreement.js
CHANGED
|
@@ -2,18 +2,31 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { agreementRecipe, reconcileAgreementSelection, resolveAgreementState, toggleAgreementAll, toggleAgreementItem, validateAgreementDescriptor, } from "@hjmds/design-contracts/components/agreement";
|
|
3
3
|
import { resolveColorReference } from "@hjmds/design-contracts/color-references";
|
|
4
4
|
import { radius, spacing } from "@hjmds/design-contracts/foundations";
|
|
5
|
-
import { useMemo, useState } from "react";
|
|
5
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Pressable, View } from "react-native";
|
|
7
7
|
import { mixedCheckboxState } from "./internal/state.js";
|
|
8
8
|
import { Text } from "./primitives.js";
|
|
9
|
+
import { warnDeprecatedStyleProps } from "./internal/deprecated-style.js";
|
|
9
10
|
import { useHjmNativeTheme } from "./provider.js";
|
|
10
|
-
export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, style, }) {
|
|
11
|
+
export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle, style, }) {
|
|
12
|
+
warnDeprecatedStyleProps("Agreement", { style }, "layoutStyle for placement; agreementRecipe owns appearance");
|
|
11
13
|
validateAgreementDescriptor(descriptor);
|
|
12
14
|
const theme = useHjmNativeTheme();
|
|
13
15
|
const [internal, setInternal] = useState(defaultCheckedIds ?? new Set());
|
|
14
16
|
const raw = controlledChecked ?? internal;
|
|
15
17
|
const checked = useMemo(() => reconcileAgreementSelection(descriptor, raw), [descriptor, raw]);
|
|
16
18
|
const state = resolveAgreementState(descriptor, checked);
|
|
19
|
+
// Report the initial state once on mount. Until 2026-10-06 only user toggles reported, so
|
|
20
|
+
// `defaultCheckedIds`/`checkedIds` that already satisfied every required item never produced a
|
|
21
|
+
// first `satisfied: true` and a submit button wired to this callback stayed disabled. Mount-only
|
|
22
|
+
// (not on every derived change) keeps the callback count to "initial + one per toggle"; StrictMode
|
|
23
|
+
// may repeat the same snapshot, which is idempotent for a consumer that stores it.
|
|
24
|
+
const initialStateRef = useRef(state);
|
|
25
|
+
const onStateChangeRef = useRef(onStateChange);
|
|
26
|
+
onStateChangeRef.current = onStateChange;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onStateChangeRef.current?.(initialStateRef.current);
|
|
29
|
+
}, []);
|
|
17
30
|
const commit = (next) => {
|
|
18
31
|
if (controlledChecked === undefined)
|
|
19
32
|
setInternal(next);
|
|
@@ -37,7 +50,7 @@ export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCh
|
|
|
37
50
|
justifyContent: "center",
|
|
38
51
|
width: spacing.md,
|
|
39
52
|
}, children: value === false ? null : (_jsx(Text, { accessible: false, style: { color: glyphColor }, variant: "caption", children: value === "mixed" ? "–" : "✓" })) }));
|
|
40
|
-
return (_jsxs(View, { accessibilityLabel: descriptor.accessibilityLabel, accessibilityRole: "none", style: [{ gap: agreementRecipe.gap }, style], children: [_jsxs(Pressable, { accessibilityLabel: descriptor.allLabel, accessibilityRole: "checkbox", accessibilityState: mixedCheckboxState(state.all), onPress: () => commit(toggleAgreementAll(descriptor, checked)), style: {
|
|
53
|
+
return (_jsxs(View, { accessibilityLabel: descriptor.accessibilityLabel, accessibilityRole: "none", style: [{ gap: agreementRecipe.gap }, style, layoutStyle], children: [_jsxs(Pressable, { accessibilityLabel: descriptor.allLabel, accessibilityRole: "checkbox", accessibilityState: mixedCheckboxState(state.all), onPress: () => commit(toggleAgreementAll(descriptor, checked)), style: {
|
|
41
54
|
alignItems: "center",
|
|
42
55
|
backgroundColor: resolveColorReference(agreementRecipe.all.background, theme.palette),
|
|
43
56
|
borderRadius: radius.md,
|
package/dist/agreement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../src/agreement.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,GAG5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"agreement.js","sourceRoot":"","sources":["../src/agreement.tsx"],"names":[],"mappings":";AAAA,OAAO,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I,CAAC,WAAW,CAAC,WAAW,YAEpD,IAAI,CAAC,WAAW,GACZ,CACR,CAAC,CAAC,CAAC,IAAI,KAjDC,IAAI,CAAC,EAAE,CAkDX,CACR,CAAC,IACG,CACR,CAAC;AACJ,CAAC"}
|
package/dist/asset.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AssetDescriptor } from "@hjmds/design-contracts/components/asset";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
4
5
|
export type AssetProps = Readonly<{
|
|
5
6
|
descriptor: AssetDescriptor;
|
|
6
7
|
/**
|
|
@@ -12,16 +13,28 @@ export type AssetProps = Readonly<{
|
|
|
12
13
|
}>) => ReactNode);
|
|
13
14
|
/** A small mark on the frame's outer corner (play, status dot). */
|
|
14
15
|
accessory?: ReactNode;
|
|
16
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
17
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement;
|
|
20
|
+
* `assetRecipe` owns appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
21
|
+
*/
|
|
15
22
|
style?: StyleProp<ViewStyle>;
|
|
16
23
|
}>;
|
|
17
|
-
export declare function Asset({ descriptor, children, accessory, style }: AssetProps): import("react").JSX.Element;
|
|
24
|
+
export declare function Asset({ descriptor, children, accessory, layoutStyle, style }: AssetProps): import("react").JSX.Element;
|
|
18
25
|
export type AssetGroupProps = Readonly<{
|
|
19
26
|
/** Accessible name for the group; the overlap alone does not say what it is. */
|
|
20
27
|
label: string;
|
|
21
28
|
size?: AssetDescriptor["size"];
|
|
22
29
|
children: ReactNode;
|
|
30
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
31
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement;
|
|
34
|
+
* `assetRecipe` owns appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
35
|
+
*/
|
|
23
36
|
style?: StyleProp<ViewStyle>;
|
|
24
37
|
}>;
|
|
25
38
|
/** Overlaps assets with the same ratio Avatar uses — they share a row on purpose. */
|
|
26
|
-
export declare function AssetGroup({ label, size, children, style }: AssetGroupProps): import("react").JSX.Element;
|
|
39
|
+
export declare function AssetGroup({ label, size, children, layoutStyle, style }: AssetGroupProps): import("react").JSX.Element;
|
|
27
40
|
//# sourceMappingURL=asset.d.ts.map
|
package/dist/asset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../src/asset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../src/asset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,UAAU,EAAE,eAAe,CAAC;IAC5B;;;OAGG;IACH,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,SAAS,CAAC,CAAC;IAC7E,mEAAmE;IACnE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,wBAAgB,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,UAAU,+BA4CxF;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAgC,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,eAAe,+BAYpH"}
|
package/dist/asset.js
CHANGED
|
@@ -2,8 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { assetRecipe, shouldAnimateAsset, validateAssetDescriptor, } from "@hjmds/design-contracts/components/asset";
|
|
3
3
|
import { resolveColorReference } from "@hjmds/design-contracts/color-references";
|
|
4
4
|
import { View } from "react-native";
|
|
5
|
+
import { warnDeprecatedStyleProps } from "./internal/deprecated-style.js";
|
|
5
6
|
import { useHjmNativeTheme } from "./provider.js";
|
|
6
|
-
export function Asset({ descriptor, children, accessory, style }) {
|
|
7
|
+
export function Asset({ descriptor, children, accessory, layoutStyle, style }) {
|
|
8
|
+
warnDeprecatedStyleProps("Asset", { style }, "layoutStyle for placement; assetRecipe owns appearance");
|
|
7
9
|
validateAssetDescriptor(descriptor);
|
|
8
10
|
const { palette, environment } = useHjmNativeTheme();
|
|
9
11
|
const size = assetRecipe.sizes[descriptor.size ?? assetRecipe.defaults.size];
|
|
@@ -12,7 +14,7 @@ export function Asset({ descriptor, children, accessory, style }) {
|
|
|
12
14
|
// The frame freezes nothing itself — it has no player. It hands the one
|
|
13
15
|
// answer to the slot so the product does not re-derive the preference.
|
|
14
16
|
const animate = shouldAnimateAsset(descriptor.kind, environment.reducedMotion);
|
|
15
|
-
return (_jsxs(View, { style: [{ position: "relative" }, style], accessible: !decorative, accessibilityRole: decorative ? "none" : "image", ...(decorative
|
|
17
|
+
return (_jsxs(View, { style: [{ position: "relative" }, style, layoutStyle], accessible: !decorative, accessibilityRole: decorative ? "none" : "image", ...(decorative
|
|
16
18
|
? { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" }
|
|
17
19
|
: { accessibilityLabel: descriptor.accessibilityLabel }), children: [_jsx(View, { style: {
|
|
18
20
|
width: size,
|
|
@@ -31,9 +33,10 @@ export function Asset({ descriptor, children, accessory, style }) {
|
|
|
31
33
|
style: { position: "absolute", bottom: -assetRecipe.accessory.offset, right: -assetRecipe.accessory.offset }, children: accessory })) : null] }));
|
|
32
34
|
}
|
|
33
35
|
/** Overlaps assets with the same ratio Avatar uses — they share a row on purpose. */
|
|
34
|
-
export function AssetGroup({ label, size = assetRecipe.defaults.size, children, style }) {
|
|
36
|
+
export function AssetGroup({ label, size = assetRecipe.defaults.size, children, layoutStyle, style }) {
|
|
37
|
+
warnDeprecatedStyleProps("AssetGroup", { style }, "layoutStyle for placement; assetRecipe owns appearance");
|
|
35
38
|
const overlap = -Math.round(assetRecipe.sizes[size] * assetRecipe.overlapRatio);
|
|
36
|
-
return (_jsx(View, { accessibilityRole: "none", accessible: true, accessibilityLabel: label, style: [{ flexDirection: "row", alignItems: "center" }, style], children: Array.isArray(children)
|
|
39
|
+
return (_jsx(View, { accessibilityRole: "none", accessible: true, accessibilityLabel: label, style: [{ flexDirection: "row", alignItems: "center" }, style, layoutStyle], children: Array.isArray(children)
|
|
37
40
|
? children.map((child, index) => (_jsx(View, { style: index === 0 ? undefined : { marginStart: overlap }, children: child }, index)))
|
|
38
41
|
: children }));
|
|
39
42
|
}
|
package/dist/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../src/asset.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../src/asset.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAoBlD,MAAM,UAAU,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAc;IACvF,wBAAwB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,wDAAwD,CAAC,CAAC;IACvG,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,IAAI,WAAW,CAAC,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9 +1,16 @@
|
|
|
1
1
|
import { type BottomInfoDescriptor } from "@hjmds/design-contracts/components/bottom-info";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
4
5
|
export type BottomInfoProps = BottomInfoDescriptor & Readonly<{
|
|
5
6
|
renderItem?: (item: string, index: number) => ReactNode;
|
|
7
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
8
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Raw visual style bypasses the HJM recipe. Use `layoutStyle` for placement;
|
|
11
|
+
* `bottomInfoRecipe` owns appearance. Removed in the next major (consumer-policy.md §3.1).
|
|
12
|
+
*/
|
|
6
13
|
style?: StyleProp<ViewStyle>;
|
|
7
14
|
}>;
|
|
8
|
-
export declare function BottomInfo({ items, tone, renderItem, style }: BottomInfoProps): import("react").JSX.Element;
|
|
15
|
+
export declare function BottomInfo({ items, tone, renderItem, layoutStyle, style }: BottomInfoProps): import("react").JSX.Element;
|
|
9
16
|
//# sourceMappingURL=bottom-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-info.d.ts","sourceRoot":"","sources":["../src/bottom-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"bottom-info.d.ts","sourceRoot":"","sources":["../src/bottom-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAChD,QAAQ,CAAC;IACP,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACxD,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEL,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAqC,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,eAAe,+BAoB3H"}
|
package/dist/bottom-info.js
CHANGED
|
@@ -3,14 +3,16 @@ import { bottomInfoRecipe, validateBottomInfoDescriptor, } from "@hjmds/design-c
|
|
|
3
3
|
import { resolveColorReference } from "@hjmds/design-contracts/color-references";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { Text } from "./primitives.js";
|
|
6
|
+
import { warnDeprecatedStyleProps } from "./internal/deprecated-style.js";
|
|
6
7
|
import { useHjmNativeTheme } from "./provider.js";
|
|
7
|
-
export function BottomInfo({ items, tone = bottomInfoRecipe.defaults.tone, renderItem, style }) {
|
|
8
|
+
export function BottomInfo({ items, tone = bottomInfoRecipe.defaults.tone, renderItem, layoutStyle, style }) {
|
|
9
|
+
warnDeprecatedStyleProps("BottomInfo", { style }, "layoutStyle for placement; bottomInfoRecipe owns appearance");
|
|
8
10
|
validateBottomInfoDescriptor({ items, tone });
|
|
9
11
|
const theme = useHjmNativeTheme();
|
|
10
12
|
const color = resolveColorReference(bottomInfoRecipe.tones[tone], theme.palette);
|
|
11
13
|
// One line reads as a sentence; several read as a list. A bullet on a single
|
|
12
14
|
// line is noise, which is why the threshold lives in the recipe.
|
|
13
15
|
const asList = items.length >= bottomInfoRecipe.listMarkerFrom;
|
|
14
|
-
return (_jsx(View, { style: [{ gap: bottomInfoRecipe.gap, paddingTop: bottomInfoRecipe.paddingTop }, style], children: items.map((item, index) => (_jsxs(View, { style: { flexDirection: "row", gap: 4 }, children: [asList ? _jsx(Text, { style: { color }, variant: bottomInfoRecipe.textVariant, children: "\u00B7" }) : null, _jsx(Text, { style: { color, flex: 1 }, variant: bottomInfoRecipe.textVariant, children: renderItem?.(item, index) ?? item })] }, item))) }));
|
|
16
|
+
return (_jsx(View, { style: [{ gap: bottomInfoRecipe.gap, paddingTop: bottomInfoRecipe.paddingTop }, style, layoutStyle], children: items.map((item, index) => (_jsxs(View, { style: { flexDirection: "row", gap: 4 }, children: [asList ? _jsx(Text, { style: { color }, variant: bottomInfoRecipe.textVariant, children: "\u00B7" }) : null, _jsx(Text, { style: { color, flex: 1 }, variant: bottomInfoRecipe.textVariant, children: renderItem?.(item, index) ?? item })] }, item))) }));
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=bottom-info.js.map
|
package/dist/bottom-info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-info.js","sourceRoot":"","sources":["../src/bottom-info.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,4BAA4B,GAE7B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"bottom-info.js","sourceRoot":"","sources":["../src/bottom-info.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,4BAA4B,GAE7B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AA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AAC,IAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,WAAW,YACnE,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,GAC7B,KAJE,IAAI,CAKR,CACR,CAAC,GACG,CACR,CAAC;AACJ,CAAC"}
|
package/dist/calendar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type CalendarDescriptor, type CalendarSize, type ComposeCalendarAccessibleName, type ResolvedCalendarDateCell } from "@hjmds/design-contracts/components/calendar";
|
|
3
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
3
4
|
export type CalendarMonthAction = Readonly<{
|
|
4
5
|
month: string;
|
|
5
6
|
label: string;
|
|
@@ -15,7 +16,8 @@ export type CalendarProps<Content = unknown> = Readonly<{
|
|
|
15
16
|
renderCellContent?: (cell: ResolvedCalendarDateCell<Content>) => ReactNode;
|
|
16
17
|
size?: CalendarSize;
|
|
17
18
|
ref?: Ref<CalendarHandle>;
|
|
19
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
18
20
|
}>;
|
|
19
21
|
/** Inline dates stay individually accessible; Native month paging uses explicit buttons. */
|
|
20
|
-
export declare function Calendar<Content>({ descriptor, composeAccessibleName, previousMonth, nextMonth, renderCellContent, size, ref }: CalendarProps<Content>): import("react").JSX.Element;
|
|
22
|
+
export declare function Calendar<Content>({ descriptor, composeAccessibleName, previousMonth, nextMonth, renderCellContent, size, ref, layoutStyle }: CalendarProps<Content>): import("react").JSX.Element;
|
|
21
23
|
//# sourceMappingURL=calendar.d.ts.map
|
package/dist/calendar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../src/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoD,KAAK,SAAS,EAAE,K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AAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAE,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AACzE,MAAM,MAAM,aAAa,CAAC,OAAO,GAAG,OAAO,IAAI,QAAQ,CAAC;IACtD,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,qBAAqB,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC9D,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;IAC3E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,4FAA4F;AAC5F,wBAAgB,QAAQ,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,aAAa,EAAE,SAAS,EAC7F,iBAAiB,EAAE,IAAe,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,+BAwE/E"}
|
package/dist/calendar.js
CHANGED
|
@@ -10,7 +10,7 @@ import { minimumTargetStyle } from "./internal/styles.js";
|
|
|
10
10
|
import { Text } from "./primitives.js";
|
|
11
11
|
import { useHjmNativeTheme } from "./provider.js";
|
|
12
12
|
/** Inline dates stay individually accessible; Native month paging uses explicit buttons. */
|
|
13
|
-
export function Calendar({ descriptor, composeAccessibleName, previousMonth, nextMonth, renderCellContent, size = "medium", ref }) {
|
|
13
|
+
export function Calendar({ descriptor, composeAccessibleName, previousMonth, nextMonth, renderCellContent, size = "medium", ref, layoutStyle }) {
|
|
14
14
|
validateCalendarDescriptor(descriptor);
|
|
15
15
|
for (const action of [previousMonth, nextMonth]) {
|
|
16
16
|
if (!action)
|
|
@@ -53,7 +53,7 @@ export function Calendar({ descriptor, composeAccessibleName, previousMonth, nex
|
|
|
53
53
|
const columnStyle = { flex: 1, minWidth: diameter };
|
|
54
54
|
const nav = (action, reason) => action
|
|
55
55
|
? _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: action.label, disabled: !descriptor.onFocusedMonthChange, accessibilityState: { disabled: !descriptor.onFocusedMonthChange }, onPress: () => descriptor.onFocusedMonthChange?.(action.month, reason), style: [minimumTargetStyle, { alignItems: "center", justifyContent: "center" }], children: _jsx(Text, { accessible: false, children: (reason === "previous") !== (environment.direction === "rtl") ? "‹" : "›" }) }) : _jsx(View, { accessible: false, style: minimumTargetStyle });
|
|
56
|
-
return _jsxs(View, { style: { gap: recipe.header.gap, direction: environment.direction }, children: [_jsxs(View, { style: { flexDirection: "row", alignItems: "center", gap: recipe.header.gap }, children: [nav(previousMonth, "previous"), _jsx(Text, { accessibilityRole: "header", accessibilityLiveRegion: "polite", variant: recipe.header.monthLabel.textVariant, emphasis: "strong", align: "center", style: { flex: 1 }, children: descriptor.monthLabel }), nav(nextMonth, "next")] }), _jsx(ScrollView, { horizontal: true, contentContainerStyle: { flexGrow: 1 }, children: _jsxs(View, { style: { flex: 1, minWidth: diameter * 7 }, children: [_jsx(View, { accessible: false, style: { flexDirection: "row" }, children: descriptor.grid.weekdayLabels.map((label, index) => _jsx(Text, { accessible: false, align: "center", tone: "muted", variant: recipe.weekdayLabel.textVariant, style: columnStyle, children: label }, index)) }), Array.from({ length: cells.length / 7 }, (_, row) => _jsx(View, { style: { flexDirection: "row" }, children: cells.slice(row * 7, row * 7 + 7).map((cell, column) => "filler" in cell
|
|
56
|
+
return _jsxs(View, { style: [layoutStyle, { gap: recipe.header.gap, direction: environment.direction }], children: [_jsxs(View, { style: { flexDirection: "row", alignItems: "center", gap: recipe.header.gap }, children: [nav(previousMonth, "previous"), _jsx(Text, { accessibilityRole: "header", accessibilityLiveRegion: "polite", variant: recipe.header.monthLabel.textVariant, emphasis: "strong", align: "center", style: { flex: 1 }, children: descriptor.monthLabel }), nav(nextMonth, "next")] }), _jsx(ScrollView, { horizontal: true, contentContainerStyle: { flexGrow: 1 }, children: _jsxs(View, { style: { flex: 1, minWidth: diameter * 7 }, children: [_jsx(View, { accessible: false, style: { flexDirection: "row" }, children: descriptor.grid.weekdayLabels.map((label, index) => _jsx(Text, { accessible: false, align: "center", tone: "muted", variant: recipe.weekdayLabel.textVariant, style: columnStyle, children: label }, index)) }), Array.from({ length: cells.length / 7 }, (_, row) => _jsx(View, { style: { flexDirection: "row" }, children: cells.slice(row * 7, row * 7 + 7).map((cell, column) => "filler" in cell
|
|
57
57
|
? _jsx(View, { accessible: false, style: { ...columnStyle, minHeight: diameter } }, `filler-${column}`)
|
|
58
58
|
: _jsxs(Pressable, { ref: (node) => { if (node)
|
|
59
59
|
targets.current.set(cell.date, node);
|