@hjmds/react-native 1.17.2 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/actions.d.ts +3 -23
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +8 -11
- package/dist/actions.js.map +1 -1
- package/dist/activity-chip.d.ts +29 -0
- package/dist/activity-chip.d.ts.map +1 -0
- package/dist/activity-chip.js +54 -0
- package/dist/activity-chip.js.map +1 -0
- package/dist/agreement.d.ts +1 -7
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +21 -15
- package/dist/agreement.js.map +1 -1
- package/dist/asset.d.ts +2 -13
- package/dist/asset.d.ts.map +1 -1
- package/dist/asset.js +4 -7
- package/dist/asset.js.map +1 -1
- package/dist/bottom-info.d.ts +1 -7
- package/dist/bottom-info.d.ts.map +1 -1
- package/dist/bottom-info.js +2 -4
- package/dist/bottom-info.js.map +1 -1
- package/dist/carousel-motion.d.ts +1 -0
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +5 -3
- package/dist/carousel-motion.js.map +1 -1
- package/dist/carousel.d.ts +1 -7
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +14 -6
- package/dist/carousel.js.map +1 -1
- package/dist/collapsible.d.ts +1 -7
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +4 -4
- package/dist/collapsible.js.map +1 -1
- package/dist/content-transition.d.ts +2 -1
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +3 -3
- package/dist/content-transition.js.map +1 -1
- package/dist/data-display.d.ts +23 -154
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +86 -92
- package/dist/data-display.js.map +1 -1
- package/dist/date-entry.d.ts +1 -0
- package/dist/date-entry.d.ts.map +1 -1
- package/dist/date-entry.js +22 -20
- package/dist/date-entry.js.map +1 -1
- package/dist/date-picker.d.ts +1 -7
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +19 -11
- package/dist/date-picker.js.map +1 -1
- package/dist/duration-field.d.ts +1 -1
- package/dist/duration-field.d.ts.map +1 -1
- package/dist/duration-field.js +11 -9
- 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 +9 -88
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +124 -81
- package/dist/feedback.js.map +1 -1
- package/dist/field-group.d.ts +3 -2
- package/dist/field-group.d.ts.map +1 -1
- package/dist/field-group.js +7 -4
- package/dist/field-group.js.map +1 -1
- package/dist/file-picker.d.ts +1 -7
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +21 -11
- package/dist/file-picker.js.map +1 -1
- package/dist/forms.d.ts +6 -21
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +29 -35
- package/dist/forms.js.map +1 -1
- package/dist/gravity-letters.d.ts.map +1 -1
- package/dist/gravity-letters.js +13 -5
- package/dist/gravity-letters.js.map +1 -1
- package/dist/grid-reveal.d.ts.map +1 -1
- package/dist/grid-reveal.js +10 -2
- package/dist/grid-reveal.js.map +1 -1
- package/dist/heading.d.ts +1 -7
- package/dist/heading.d.ts.map +1 -1
- package/dist/heading.js +1 -4
- package/dist/heading.js.map +1 -1
- package/dist/image-viewer.d.ts.map +1 -1
- package/dist/image-viewer.js +2 -1
- package/dist/image-viewer.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/inline-confirm.d.ts.map +1 -1
- package/dist/inline-confirm.js +5 -1
- package/dist/inline-confirm.js.map +1 -1
- package/dist/inputs.d.ts +4 -71
- package/dist/inputs.d.ts.map +1 -1
- package/dist/inputs.js +52 -67
- package/dist/inputs.js.map +1 -1
- package/dist/internal/accessible-focus.d.ts +3 -0
- package/dist/internal/accessible-focus.d.ts.map +1 -0
- package/dist/internal/accessible-focus.js +15 -0
- package/dist/internal/accessible-focus.js.map +1 -0
- package/dist/internal/diagnostics.d.ts +7 -0
- package/dist/internal/diagnostics.d.ts.map +1 -0
- package/dist/internal/diagnostics.js +20 -0
- package/dist/internal/diagnostics.js.map +1 -0
- package/dist/internal/document-resource.d.ts.map +1 -1
- package/dist/internal/document-resource.js +2 -2
- package/dist/internal/document-resource.js.map +1 -1
- package/dist/internal/recipe-button.js +1 -1
- package/dist/internal/recipe-button.js.map +1 -1
- package/dist/internal/spinner.d.ts +1 -7
- package/dist/internal/spinner.d.ts.map +1 -1
- package/dist/internal/spinner.js +2 -4
- package/dist/internal/spinner.js.map +1 -1
- package/dist/masonry.d.ts.map +1 -1
- package/dist/masonry.js +2 -1
- package/dist/masonry.js.map +1 -1
- package/dist/mentions.d.ts +1 -7
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +11 -7
- package/dist/mentions.js.map +1 -1
- package/dist/navigation.d.ts +4 -74
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +86 -45
- package/dist/navigation.js.map +1 -1
- package/dist/number-field.d.ts +1 -21
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +6 -5
- package/dist/number-field.js.map +1 -1
- package/dist/overlays.d.ts +7 -16
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +220 -213
- package/dist/overlays.js.map +1 -1
- package/dist/primitives.d.ts +3 -18
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +8 -10
- package/dist/primitives.js.map +1 -1
- package/dist/provider-button.d.ts +1 -7
- package/dist/provider-button.d.ts.map +1 -1
- package/dist/provider-button.js +1 -4
- package/dist/provider-button.js.map +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +9 -1
- package/dist/provider.js.map +1 -1
- package/dist/saved-items.d.ts.map +1 -1
- package/dist/saved-items.js +6 -1
- package/dist/saved-items.js.map +1 -1
- package/dist/screen-flows.d.ts +1 -2
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +60 -16
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +1 -1
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +32 -15
- package/dist/screens.js.map +1 -1
- package/dist/sheet-gesture.d.ts.map +1 -1
- package/dist/sheet-gesture.js +6 -3
- package/dist/sheet-gesture.js.map +1 -1
- package/dist/slider.d.ts +1 -21
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +3 -5
- package/dist/slider.js.map +1 -1
- package/dist/sortable.d.ts.map +1 -1
- package/dist/sortable.js +2 -1
- package/dist/sortable.js.map +1 -1
- package/dist/status-text.d.ts +17 -0
- package/dist/status-text.d.ts.map +1 -0
- package/dist/status-text.js +18 -0
- package/dist/status-text.js.map +1 -0
- package/dist/steps.d.ts +1 -7
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +2 -4
- package/dist/steps.js.map +1 -1
- package/dist/swipe-actions.d.ts.map +1 -1
- package/dist/swipe-actions.js +13 -2
- package/dist/swipe-actions.js.map +1 -1
- package/dist/tags-input.d.ts +1 -7
- package/dist/tags-input.d.ts.map +1 -1
- package/dist/tags-input.js +2 -4
- package/dist/tags-input.js.map +1 -1
- package/dist/toggle-group.d.ts +1 -7
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +10 -5
- package/dist/toggle-group.js.map +1 -1
- package/dist/top.d.ts +1 -7
- package/dist/top.d.ts.map +1 -1
- package/dist/top.js +1 -4
- package/dist/top.js.map +1 -1
- package/dist/transfer-list.d.ts +2 -8
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +30 -11
- package/dist/transfer-list.js.map +1 -1
- package/dist/upload-item.d.ts +1 -7
- package/dist/upload-item.d.ts.map +1 -1
- package/dist/upload-item.js +2 -4
- package/dist/upload-item.js.map +1 -1
- package/dist/virtual-list.d.ts.map +1 -1
- package/dist/virtual-list.js +2 -1
- package/dist/virtual-list.js.map +1 -1
- package/docs/liquid-toast.md +20 -0
- package/package.json +17 -4
- package/dist/internal/deprecated-style.d.ts +0 -8
- package/dist/internal/deprecated-style.d.ts.map +0 -1
- package/dist/internal/deprecated-style.js +0 -34
- package/dist/internal/deprecated-style.js.map +0 -1
package/README.md
CHANGED
|
@@ -85,9 +85,9 @@ The package exports include:
|
|
|
85
85
|
|
|
86
86
|
## Composition style boundary
|
|
87
87
|
|
|
88
|
-
The normative [consumer policy](../design-contracts/docs/consumer-policy.md#31
|
|
89
|
-
defines the supported composition boundary.
|
|
90
|
-
|
|
88
|
+
The normative [consumer policy](../design-contracts/docs/consumer-policy.md#31-배치와-시각-값)
|
|
89
|
+
defines the supported composition boundary. The [migration table](../design-contracts/docs/migration-native-legacy-removal.md) lists the removed aliases and raw visual style props. This source removal is a breaking change;
|
|
90
|
+
canonical placement and host/renderer style slots remain supported.
|
|
91
91
|
Source changes do not update already installed npm packages. Upgrade each consumer's dependency
|
|
92
92
|
and lockfile together, and verify its supported surfaces.
|
|
93
93
|
|
|
@@ -113,7 +113,7 @@ const actionPlacement = {
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
If a product needs a new color, type treatment, radius, density, or control size, add a semantic
|
|
116
|
-
theme/recipe axis with renderer evidence.
|
|
116
|
+
theme/recipe axis with renderer evidence. New code must use the canonical props;
|
|
117
117
|
private recipe composition and supported platform host styles are separate APIs.
|
|
118
118
|
|
|
119
119
|
`Image` consumes the same intrinsic descriptor as Web. `width` and `height`
|
|
@@ -146,7 +146,7 @@ import { Image as ExpoImage } from "expo-image";
|
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
Use `sourceAdapter` when the built-in React Native host needs headers, cache
|
|
149
|
-
metadata, or another `ImageSourcePropType`. The old `source` prop
|
|
149
|
+
metadata, or another `ImageSourcePropType`. The old `source` prop was removed in 1.11;
|
|
150
150
|
provide canonical dimensions and use `sourceAdapter` for transport. See
|
|
151
151
|
[the migration guide](../design-contracts/docs/migration-native-legacy-removal.md).
|
|
152
152
|
|
|
@@ -257,10 +257,10 @@ For cross-renderer code, use the canonical collection/state vocabulary:
|
|
|
257
257
|
- `Tabs`, `RadioGroup`, and `SegmentedControl` take `items`; Native's former `options` prop is removed in 1.11.
|
|
258
258
|
- Native `TabItem` uses `id`, matching Web. The former `TabOption.value` and `options` path are removed.
|
|
259
259
|
- `Switch` takes `checked`, `defaultChecked`, and `onCheckedChange`, matching Web. Native's former
|
|
260
|
-
`value`, `defaultValue`, and `onValueChange` aliases
|
|
260
|
+
`value`, `defaultValue`, and `onValueChange` aliases were removed in 1.11.
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
Use only canonical channels. Removed aliases are absent from public types; runtime guards prevent
|
|
263
|
+
removed visual overrides from leaking into forwarded host props.
|
|
264
264
|
|
|
265
265
|
`TextArea` follows the same accessible-name rule as `TextField`: provide either a visible `label`
|
|
266
266
|
or `accessibilityLabel`. `SearchField` can render product icons through `renderLeading`,
|
package/dist/actions.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { SemanticIconName } from "@hjmds/design-contracts/components/icon";
|
|
|
3
3
|
import { type IconButtonTone as ContractIconButtonTone, type IconButtonShape, type IconButtonSize } from "@hjmds/design-contracts/recipes";
|
|
4
4
|
import { type ButtonAlign as ContractButtonAlign, type ButtonShape as ContractButtonShape, type ButtonSize as ContractButtonSize, type ButtonTone as ContractButtonTone } from "@hjmds/design-contracts/recipes/base";
|
|
5
5
|
import { type ReactNode } from "react";
|
|
6
|
-
import { View, type PressableProps
|
|
6
|
+
import { View, type PressableProps } from "react-native";
|
|
7
7
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
8
8
|
import { type NativeIconRenderProps } from "./primitives.js";
|
|
9
9
|
export type ButtonTone = ContractButtonTone;
|
|
@@ -88,11 +88,6 @@ export type IconButtonProps = Omit<PressableProps, "accessibilityLabel" | "acces
|
|
|
88
88
|
disableWhileLoading?: boolean;
|
|
89
89
|
hitSlop?: PressableProps["hitSlop"];
|
|
90
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
|
-
*/
|
|
95
|
-
style?: StyleProp<ViewStyle>;
|
|
96
91
|
renderLoadingIndicator?: (props: Readonly<{
|
|
97
92
|
color: string;
|
|
98
93
|
size: "small";
|
|
@@ -116,11 +111,6 @@ export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<
|
|
|
116
111
|
disableWhileLoading?: boolean;
|
|
117
112
|
hitSlop?: PressableProps["hitSlop"];
|
|
118
113
|
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
|
-
*/
|
|
123
|
-
style?: StyleProp<ViewStyle>;
|
|
124
114
|
renderLoadingIndicator?: (props: Readonly<{
|
|
125
115
|
color: string;
|
|
126
116
|
size: "small";
|
|
@@ -143,13 +133,8 @@ export type LinkProps = Omit<PressableProps, "accessibilityLabel" | "accessibili
|
|
|
143
133
|
accessibilityHint?: string;
|
|
144
134
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
145
135
|
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
|
-
*/
|
|
150
|
-
style?: StyleProp<ViewStyle>;
|
|
151
136
|
}>;
|
|
152
|
-
export declare function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle,
|
|
137
|
+
export declare function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle, ...props }: LinkProps): import("react").JSX.Element;
|
|
153
138
|
export type BottomCTAAction = Readonly<{
|
|
154
139
|
label: string;
|
|
155
140
|
onPress: NonNullable<PressableProps["onPress"]>;
|
|
@@ -170,13 +155,8 @@ export type BottomCTAProps = Readonly<{
|
|
|
170
155
|
safeAreaBottom?: number;
|
|
171
156
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
172
157
|
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
|
-
*/
|
|
177
|
-
style?: StyleProp<ViewStyle>;
|
|
178
158
|
testID?: string;
|
|
179
159
|
}>;
|
|
180
160
|
/** Native sticky-action content; products own its screen-edge positioning. */
|
|
181
|
-
export declare function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom, layoutStyle,
|
|
161
|
+
export declare function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom, layoutStyle, testID, ...removedProps }: BottomCTAProps): import("react").JSX.Element;
|
|
182
162
|
//# 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;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,KAAK,WAAW,IAAI,mBAAmB,EACvC,K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,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,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,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,MAAM,EACN,GAAG,YAAY,EAChB,EAAE,cAAc,+BA6DhB"}
|
package/dist/actions.js
CHANGED
|
@@ -7,7 +7,7 @@ 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 {
|
|
10
|
+
import { assertNoRemovedStyleProps, warnOnce } from "./internal/diagnostics.js";
|
|
11
11
|
import { minimumTargetStyle, resolveNativeShadowElevation } from "./internal/styles.js";
|
|
12
12
|
import { Icon, Text } from "./primitives.js";
|
|
13
13
|
import { useHjmNativeTheme } from "./provider.js";
|
|
@@ -19,9 +19,9 @@ export const Button = forwardRef(function Button(props, ref) {
|
|
|
19
19
|
}
|
|
20
20
|
return _jsx(RecipeButton, { ...props, ref: ref });
|
|
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,
|
|
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, renderLoadingIndicator, onPress, onLongPress, accessibilityState, ...props }, ref) {
|
|
23
23
|
const theme = useHjmNativeTheme();
|
|
24
|
-
|
|
24
|
+
assertNoRemovedStyleProps("IconButton", props, ["style"]);
|
|
25
25
|
const resolvedLabel = label;
|
|
26
26
|
const resolvedIcon = children;
|
|
27
27
|
if (resolvedLabel === undefined || resolvedLabel.trim().length === 0) {
|
|
@@ -51,7 +51,7 @@ export const IconButton = forwardRef(function IconButton({ label, children, tone
|
|
|
51
51
|
backgroundColor: presentation.background ?? "transparent",
|
|
52
52
|
borderColor: presentation.border ?? "transparent",
|
|
53
53
|
borderRadius: theme.tokens.radius[iconButtonRecipe.shapes[shape]],
|
|
54
|
-
borderWidth: 1,
|
|
54
|
+
borderWidth: selected === true ? 0 : 1,
|
|
55
55
|
height: visibleDiameter,
|
|
56
56
|
justifyContent: "center",
|
|
57
57
|
minHeight: visibleDiameter,
|
|
@@ -65,7 +65,6 @@ export const IconButton = forwardRef(function IconButton({ label, children, tone
|
|
|
65
65
|
: 1,
|
|
66
66
|
width: visibleDiameter,
|
|
67
67
|
},
|
|
68
|
-
style,
|
|
69
68
|
layoutStyle,
|
|
70
69
|
], children: loading ? (renderLoadingIndicator?.({ color: presentation.content, size: "small" }) ?? (_jsx(ActivityIndicator, { color: presentation.content, size: "small" }))) : (_jsx(View, { accessible: false, style: {
|
|
71
70
|
alignItems: "center",
|
|
@@ -75,10 +74,10 @@ export const IconButton = forwardRef(function IconButton({ label, children, tone
|
|
|
75
74
|
}, children: resolvedIcon })) }));
|
|
76
75
|
});
|
|
77
76
|
// UI control labels keep the ui font even when their metric variant is body; content still uses reading.
|
|
78
|
-
export function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle,
|
|
77
|
+
export function Link({ descriptor, onNavigate, leading, trailing, renderIcon, accessibilityHint, layoutStyle, ...props }) {
|
|
79
78
|
const { colors, environment } = useHjmNativeTheme();
|
|
80
79
|
const resolved = resolveLinkDescriptor(descriptor);
|
|
81
|
-
|
|
80
|
+
assertNoRemovedStyleProps("Link", props, ["style"]);
|
|
82
81
|
// Until 1.12 the resolver validated leadingIcon/trailingIcon but Native never drew them, so a
|
|
83
82
|
// descriptor shared with Web silently lost its chevron. A missing renderIcon now warns instead of
|
|
84
83
|
// throwing: throwing would crash apps that already passed icons which were simply invisible.
|
|
@@ -106,7 +105,6 @@ export function Link({ descriptor, onNavigate, leading, trailing, renderIcon, ac
|
|
|
106
105
|
gap: spacing.xs,
|
|
107
106
|
opacity: pressed ? 0.72 : 1,
|
|
108
107
|
},
|
|
109
|
-
style,
|
|
110
108
|
layoutStyle,
|
|
111
109
|
], children: [leadingNode ? _jsx(View, { accessible: false, children: leadingNode }) : null, _jsx(Text, { fontRole: "ui", style: { color: colors.contentBrand, textDecorationLine: "underline" }, variant: "bodyLarge", children: resolved.label }), trailingNode ? _jsx(View, { accessible: false, children: trailingNode }) : null] }));
|
|
112
110
|
}
|
|
@@ -122,8 +120,8 @@ function isBottomCTAAction(value) {
|
|
|
122
120
|
&& typeof value.onPress === "function";
|
|
123
121
|
}
|
|
124
122
|
/** Native sticky-action content; products own its screen-edge positioning. */
|
|
125
|
-
export function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0, layoutStyle,
|
|
126
|
-
|
|
123
|
+
export function BottomCTA({ primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0, layoutStyle, testID, ...removedProps }) {
|
|
124
|
+
assertNoRemovedStyleProps("BottomCTA", removedProps, ["style"]);
|
|
127
125
|
if (!Number.isFinite(safeAreaBottom) || safeAreaBottom < 0) {
|
|
128
126
|
throw new RangeError("BottomCTA safeAreaBottom must be non-negative");
|
|
129
127
|
}
|
|
@@ -156,7 +154,6 @@ export function BottomCTA({ primaryAction, secondaryAction, description, accessi
|
|
|
156
154
|
shadowOpacity: surfaceShadow.opacity,
|
|
157
155
|
shadowRadius: surfaceShadow.radius,
|
|
158
156
|
},
|
|
159
|
-
style,
|
|
160
157
|
layoutStyle,
|
|
161
158
|
], children: [description ? _jsx(Text, { tone: "muted", variant: "caption", children: description }) : null, _jsxs(View, { style: {
|
|
162
159
|
direction: environment.direction,
|
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;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACrE,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,
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAo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AE,aAAa,CAAC,OAAO;gBACpC,YAAY,EAAE,aAAa,CAAC,MAAM;aACnC;YACD,WAAW;SACZ,aAEA,WAAW,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type GestureResponderEvent } from "react-native";
|
|
3
|
+
import { type ActivityChipEmphasis } from "@hjmds/design-contracts/activity-chip";
|
|
4
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
5
|
+
export type { ActivityChipEmphasis } from "@hjmds/design-contracts/activity-chip";
|
|
6
|
+
export type ActivityChipProps = Readonly<{
|
|
7
|
+
/** Short visible status, for example "Polishing". */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Full spoken status; defaults to `label`. */
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
accessibilityHint?: string;
|
|
12
|
+
/** `emphasis` marks a result waiting for the user. */
|
|
13
|
+
emphasis?: ActivityChipEmphasis;
|
|
14
|
+
/** Whether the panel this chip toggles is open (`accessibilityState.expanded`). */
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
/** Decorative leading visual (mascot, avatar); hidden from assistive technology. */
|
|
17
|
+
media?: ReactNode;
|
|
18
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
21
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
22
|
+
testID?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Pressable status of one running task. It is a disclosure trigger for the matching panel toast
|
|
26
|
+
* (composition `activity-status`), so it reports `expanded` instead of Chip's selection roles.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ActivityChip({ label, accessibilityLabel, accessibilityHint, emphasis, expanded, media, onPress, disabled, layoutStyle, testID, }: ActivityChipProps): import("react").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=activity-chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-chip.d.ts","sourceRoot":"","sources":["../src/activity-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAG/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAgB,EAChB,WAAW,EACX,MAAM,GACP,EAAE,iBAAiB,+BAuEnB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
import { resolveColorReference } from "@hjmds/design-contracts/color-references";
|
|
4
|
+
import { activityChipRecipe, resolveActivityChipDescriptor, } from "@hjmds/design-contracts/activity-chip";
|
|
5
|
+
import { Text } from "./primitives.js";
|
|
6
|
+
import { useHjmNativeTheme } from "./provider.js";
|
|
7
|
+
/**
|
|
8
|
+
* Pressable status of one running task. It is a disclosure trigger for the matching panel toast
|
|
9
|
+
* (composition `activity-status`), so it reports `expanded` instead of Chip's selection roles.
|
|
10
|
+
*/
|
|
11
|
+
export function ActivityChip({ label, accessibilityLabel, accessibilityHint, emphasis, expanded, media, onPress, disabled = false, layoutStyle, testID, }) {
|
|
12
|
+
const theme = useHjmNativeTheme();
|
|
13
|
+
const resolved = resolveActivityChipDescriptor({
|
|
14
|
+
label,
|
|
15
|
+
...(accessibilityLabel === undefined ? {} : { accessibilityLabel }),
|
|
16
|
+
...(emphasis === undefined ? {} : { emphasis }),
|
|
17
|
+
...(expanded === undefined ? {} : { expanded }),
|
|
18
|
+
});
|
|
19
|
+
const { root } = activityChipRecipe;
|
|
20
|
+
const colors = activityChipRecipe.emphasis[resolved.emphasis];
|
|
21
|
+
return (_jsxs(Pressable, { accessibilityHint: accessibilityHint, accessibilityLabel: resolved.accessibilityLabel, accessibilityRole: "button", accessibilityState: { expanded: resolved.expanded, disabled }, disabled: disabled, onPress: onPress, testID: testID, style: ({ pressed }) => [
|
|
22
|
+
{
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
alignSelf: "flex-start",
|
|
25
|
+
backgroundColor: resolveColorReference(colors.background, theme.palette),
|
|
26
|
+
borderColor: resolveColorReference(colors.border, theme.palette),
|
|
27
|
+
borderRadius: theme.tokens.radius[root.radius],
|
|
28
|
+
borderWidth: root.borderWidth,
|
|
29
|
+
direction: theme.environment.direction,
|
|
30
|
+
flexDirection: "row",
|
|
31
|
+
gap: root.gap,
|
|
32
|
+
maxWidth: root.maxWidth,
|
|
33
|
+
// A floor, not a fixed height, so large text grows the pill instead of clipping it (as Chip does).
|
|
34
|
+
minHeight: root.minHeight,
|
|
35
|
+
opacity: pressed ? root.pressedOpacity : 1,
|
|
36
|
+
paddingEnd: root.paddingEnd,
|
|
37
|
+
paddingStart: media === undefined || media === null ? root.paddingEnd : root.paddingStart,
|
|
38
|
+
},
|
|
39
|
+
layoutStyle,
|
|
40
|
+
], children: [media === undefined || media === null ? null : (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: {
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
borderRadius: theme.tokens.radius[activityChipRecipe.media.radius],
|
|
43
|
+
flexShrink: 0,
|
|
44
|
+
height: activityChipRecipe.media.size,
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
width: activityChipRecipe.media.size,
|
|
48
|
+
}, children: media })), _jsx(Text, { fontRole: "ui", numberOfLines: activityChipRecipe.label.maxLines, style: {
|
|
49
|
+
color: resolveColorReference(colors.foreground, theme.palette),
|
|
50
|
+
flexShrink: 1,
|
|
51
|
+
fontWeight: activityChipRecipe.label.fontWeight,
|
|
52
|
+
}, variant: activityChipRecipe.label.textVariant, children: resolved.label })] }));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=activity-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-chip.js","sourceRoot":"","sources":["../src/activity-chip.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAA8B,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,6BAA6B,GAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAwBlD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,MAAM,GACY;IAClB,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;QAC7C,KAAK;QACL,GAAG,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC;QACnE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC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,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY;aAC1F;YACD,WAAW;SACZ,aAEA,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9C,KAAC,IAAI,IACH,2BAA2B,QAC3B,yBAAyB,EAAC,qBAAqB,EAC/C,KAAK,EAAE;oBACL,UAAU,EAAE,QAAQ;oBACpB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC;oBAClE,UAAU,EAAE,CAAC;oBACb,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,IAAI;oBACrC,cAAc,EAAE,QAAQ;oBACxB,QAAQ,EAAE,QAAQ;oBAClB,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,IAAI;iBACrC,YAEA,KAAK,GACD,CACR,EACD,KAAC,IAAI,IACH,QAAQ,EAAC,IAAI,EACb,aAAa,EAAE,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAChD,KAAK,EAAE;oBACL,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC;oBAC9D,UAAU,EAAE,CAAC;oBACb,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC,UAAU;iBAChD,EACD,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,WAAW,YAE5C,QAAQ,CAAC,KAAK,GACV,IACG,CACb,CAAC;AACJ,CAAC"}
|
package/dist/agreement.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type AgreementDescriptor, type AgreementState } from "@hjmds/design-contracts/components/agreement";
|
|
2
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
2
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
4
3
|
export type AgreementProps<Id extends string = string> = Readonly<{
|
|
5
4
|
descriptor: AgreementDescriptor<Id>;
|
|
@@ -15,11 +14,6 @@ export type AgreementProps<Id extends string = string> = Readonly<{
|
|
|
15
14
|
optionalLabel: string;
|
|
16
15
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
17
16
|
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
|
-
*/
|
|
22
|
-
style?: StyleProp<ViewStyle>;
|
|
23
17
|
}>;
|
|
24
|
-
export declare function Agreement<Id extends string = string>({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle,
|
|
18
|
+
export declare function Agreement<Id extends string = string>({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle, }: AgreementProps<Id>): import("react").JSX.Element;
|
|
25
19
|
//# 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;
|
|
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;AAOtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,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;CACvC,CAAC,CAAC;AAIH,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,GACZ,EAAE,cAAc,CAAC,EAAE,CAAC,+BA8JpB"}
|
package/dist/agreement.js
CHANGED
|
@@ -6,35 +6,41 @@ 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";
|
|
10
9
|
import { useHjmNativeTheme } from "./provider.js";
|
|
11
10
|
// UI control labels keep the ui font even when their metric variant is body; content still uses reading.
|
|
12
|
-
export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle,
|
|
13
|
-
warnDeprecatedStyleProps("Agreement", { style }, "layoutStyle for placement; agreementRecipe owns appearance");
|
|
11
|
+
export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCheckedIds, onCheckedIdsChange, onStateChange, onDetail, requiredLabel, optionalLabel, layoutStyle, }) {
|
|
14
12
|
validateAgreementDescriptor(descriptor);
|
|
15
13
|
const theme = useHjmNativeTheme();
|
|
16
14
|
const [internal, setInternal] = useState(defaultCheckedIds ?? new Set());
|
|
17
15
|
const raw = controlledChecked ?? internal;
|
|
18
16
|
const checked = useMemo(() => reconcileAgreementSelection(descriptor, raw), [descriptor, raw]);
|
|
19
17
|
const state = resolveAgreementState(descriptor, checked);
|
|
20
|
-
//
|
|
21
|
-
// `defaultCheckedIds`/`checkedIds` that already satisfied every required item never produced a
|
|
22
|
-
// first `satisfied: true` and a submit button wired to this callback stayed disabled. Mount-only
|
|
23
|
-
// (not on every derived change) keeps the callback count to "initial + one per toggle"; StrictMode
|
|
24
|
-
// may repeat the same snapshot, which is idempotent for a consumer that stores it.
|
|
25
|
-
const initialStateRef = useRef(state);
|
|
26
|
-
const onStateChangeRef = useRef(onStateChange);
|
|
27
|
-
onStateChangeRef.current = onStateChange;
|
|
18
|
+
// Persist removed consent IDs so reinserting a row cannot silently consent again.
|
|
28
19
|
useEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
if (controlledChecked === undefined && checked !== raw) {
|
|
21
|
+
setInternal(checked);
|
|
22
|
+
onCheckedIdsChange?.(checked);
|
|
23
|
+
}
|
|
24
|
+
}, [checked, controlledChecked, raw, onCheckedIdsChange]);
|
|
25
|
+
// Report accepted state, including external value/required-item changes. A rejected
|
|
26
|
+
// controlled request must not enable the product's submit button optimistically.
|
|
27
|
+
const reported = useRef(undefined);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const previous = reported.current;
|
|
30
|
+
if (previous && previous.state.all === state.all && previous.state.satisfied === state.satisfied
|
|
31
|
+
&& previous.state.missingRequiredIds.length === state.missingRequiredIds.length
|
|
32
|
+
&& previous.state.missingRequiredIds.every((id, index) => id === state.missingRequiredIds[index])
|
|
33
|
+
&& previous.checked.size === checked.size && [...checked].every(id => previous.checked.has(id)))
|
|
34
|
+
return;
|
|
35
|
+
reported.current = { checked, state };
|
|
36
|
+
onStateChange?.(state);
|
|
37
|
+
});
|
|
31
38
|
const commit = (next) => {
|
|
32
39
|
if (descriptor.disabled)
|
|
33
40
|
return;
|
|
34
41
|
if (controlledChecked === undefined)
|
|
35
42
|
setInternal(next);
|
|
36
43
|
onCheckedIdsChange?.(next);
|
|
37
|
-
onStateChange?.(resolveAgreementState(descriptor, next));
|
|
38
44
|
};
|
|
39
45
|
const markColor = resolveColorReference(agreementRecipe.item.selectedIndicator, theme.palette);
|
|
40
46
|
const borderColor = resolveColorReference(agreementRecipe.item.focus.color, theme.palette);
|
|
@@ -59,7 +65,7 @@ export function Agreement({ descriptor, checkedIds: controlledChecked, defaultCh
|
|
|
59
65
|
_jsx(View, { accessible: false, style: value === "mixed"
|
|
60
66
|
? { width: 10, height: 2, backgroundColor: glyphColor }
|
|
61
67
|
: { width: 8, height: 4, borderLeftWidth: 2, borderBottomWidth: 2, borderColor: glyphColor, transform: [{ rotate: "-45deg" }] } })) }));
|
|
62
|
-
return (_jsxs(View, { accessibilityLabel: descriptor.accessibilityLabel, accessibilityRole: "none", style: [{ gap: agreementRecipe.gap },
|
|
68
|
+
return (_jsxs(View, { accessibilityLabel: descriptor.accessibilityLabel, accessibilityRole: "none", style: [{ gap: agreementRecipe.gap }, layoutStyle], children: [_jsxs(Pressable, { accessibilityLabel: descriptor.allLabel, accessibilityRole: "checkbox", accessibilityState: { ...mixedCheckboxState(state.all), disabled: descriptor.disabled === true }, disabled: descriptor.disabled === true, onPress: () => commit(toggleAgreementAll(descriptor, checked)), style: {
|
|
63
69
|
alignItems: "center",
|
|
64
70
|
opacity: descriptor.disabled ? agreementRecipe.states.disabledOpacity : 1,
|
|
65
71
|
backgroundColor: resolveColorReference(agreementRecipe.all.background, theme.palette),
|
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,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,IAAI,
|
|
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,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAmBlD,yGAAyG;AACzG,MAAM,UAAU,SAAS,CAA6B,EACpD,UAAU,EACV,UAAU,EAAE,iBAAiB,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,aAA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ANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type AssetDescriptor } from "@hjmds/design-contracts/components/asset";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
3
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
5
4
|
export type AssetProps = Readonly<{
|
|
6
5
|
descriptor: AssetDescriptor;
|
|
@@ -15,13 +14,8 @@ export type AssetProps = Readonly<{
|
|
|
15
14
|
accessory?: ReactNode;
|
|
16
15
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
17
16
|
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
|
-
*/
|
|
22
|
-
style?: StyleProp<ViewStyle>;
|
|
23
17
|
}>;
|
|
24
|
-
export declare function Asset({ descriptor, children, accessory, layoutStyle
|
|
18
|
+
export declare function Asset({ descriptor, children, accessory, layoutStyle }: AssetProps): import("react").JSX.Element;
|
|
25
19
|
export type AssetGroupProps = Readonly<{
|
|
26
20
|
/** Accessible name for the group; the overlap alone does not say what it is. */
|
|
27
21
|
label: string;
|
|
@@ -29,12 +23,7 @@ export type AssetGroupProps = Readonly<{
|
|
|
29
23
|
children: ReactNode;
|
|
30
24
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
31
25
|
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
|
-
*/
|
|
36
|
-
style?: StyleProp<ViewStyle>;
|
|
37
26
|
}>;
|
|
38
27
|
/** Overlaps assets with the same ratio Avatar uses — they share a row on purpose. */
|
|
39
|
-
export declare function AssetGroup({ label, size, children, layoutStyle
|
|
28
|
+
export declare function AssetGroup({ label, size, children, layoutStyle }: AssetGroupProps): import("react").JSX.Element;
|
|
40
29
|
//# 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;
|
|
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;AAEvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,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;CACvC,CAAC,CAAC;AAEH,wBAAgB,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,UAAU,+BA8CjF;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;CACvC,CAAC,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAgC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,+BAW7G"}
|
package/dist/asset.js
CHANGED
|
@@ -2,10 +2,8 @@ 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";
|
|
6
5
|
import { useHjmNativeTheme } from "./provider.js";
|
|
7
|
-
export function Asset({ descriptor, children, accessory, layoutStyle
|
|
8
|
-
warnDeprecatedStyleProps("Asset", { style }, "layoutStyle for placement; assetRecipe owns appearance");
|
|
6
|
+
export function Asset({ descriptor, children, accessory, layoutStyle }) {
|
|
9
7
|
validateAssetDescriptor(descriptor);
|
|
10
8
|
const { palette, environment, tokens } = useHjmNativeTheme();
|
|
11
9
|
const size = assetRecipe.sizes[descriptor.size ?? assetRecipe.defaults.size];
|
|
@@ -17,7 +15,7 @@ export function Asset({ descriptor, children, accessory, layoutStyle, style }) {
|
|
|
17
15
|
// The frame freezes nothing itself — it has no player. It hands the one
|
|
18
16
|
// answer to the slot so the product does not re-derive the preference.
|
|
19
17
|
const animate = shouldAnimateAsset(descriptor.kind, environment.reducedMotion);
|
|
20
|
-
return (_jsxs(View, { style: [{ position: "relative" },
|
|
18
|
+
return (_jsxs(View, { style: [{ position: "relative" }, layoutStyle], accessible: !decorative, accessibilityRole: decorative ? "none" : "image", ...(decorative
|
|
21
19
|
? { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" }
|
|
22
20
|
: { accessibilityLabel: descriptor.accessibilityLabel }), children: [_jsx(View, { style: {
|
|
23
21
|
width: size,
|
|
@@ -36,10 +34,9 @@ export function Asset({ descriptor, children, accessory, layoutStyle, style }) {
|
|
|
36
34
|
style: { position: "absolute", bottom: -assetRecipe.accessory.offset, right: -assetRecipe.accessory.offset }, children: accessory })) : null] }));
|
|
37
35
|
}
|
|
38
36
|
/** Overlaps assets with the same ratio Avatar uses — they share a row on purpose. */
|
|
39
|
-
export function AssetGroup({ label, size = assetRecipe.defaults.size, children, layoutStyle
|
|
40
|
-
warnDeprecatedStyleProps("AssetGroup", { style }, "layoutStyle for placement; assetRecipe owns appearance");
|
|
37
|
+
export function AssetGroup({ label, size = assetRecipe.defaults.size, children, layoutStyle }) {
|
|
41
38
|
const overlap = -Math.round(assetRecipe.sizes[size] * assetRecipe.overlapRatio);
|
|
42
|
-
return (_jsx(View, { accessibilityRole: "none", accessible: true, accessibilityLabel: label, style: [{ flexDirection: "row", alignItems: "center" },
|
|
39
|
+
return (_jsx(View, { accessibilityRole: "none", accessible: true, accessibilityLabel: label, style: [{ flexDirection: "row", alignItems: "center" }, layoutStyle], children: Array.isArray(children)
|
|
43
40
|
? children.map((child, index) => (_jsx(View, { style: index === 0 ? undefined : { marginStart: overlap }, children: child }, index)))
|
|
44
41
|
: children }));
|
|
45
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,
|
|
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,OAA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AAC,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,WAAW,CAAC,YACtI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YACtB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,KAAC,IAAI,IAAa,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,YAAG,KAAK,IAAxE,KAAK,CAA2E,CAC5F,CAAC;YACJ,CAAC,CAAC,QAAQ,GACP,CACR,CAAC;AACJ,CAAC"}
|
package/dist/bottom-info.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { type BottomInfoDescriptor } from "@hjmds/design-contracts/components/bottom-info";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
3
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
5
4
|
export type BottomInfoProps = BottomInfoDescriptor & Readonly<{
|
|
6
5
|
renderItem?: (item: string, index: number) => ReactNode;
|
|
7
6
|
/** Canonical layout-only placement. Controlled visual keys are excluded. */
|
|
8
7
|
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
|
-
*/
|
|
13
|
-
style?: StyleProp<ViewStyle>;
|
|
14
8
|
}>;
|
|
15
|
-
export declare function BottomInfo({ items, tone, renderItem, layoutStyle
|
|
9
|
+
export declare function BottomInfo({ items, tone, renderItem, layoutStyle }: BottomInfoProps): import("react").JSX.Element;
|
|
16
10
|
//# sourceMappingURL=bottom-info.d.ts.map
|