@hjmds/react-native 1.41.0 → 1.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/choice-row.d.ts +16 -5
- package/dist/choice-row.d.ts.map +1 -1
- package/dist/choice-row.js +8 -5
- package/dist/choice-row.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/package.json +2 -2
package/dist/choice-row.d.ts
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type ChoiceRowItem } from "@hjmds/design-contracts/choice-row";
|
|
3
|
+
import type { ListRowDensity } from "@hjmds/design-contracts/recipes";
|
|
3
4
|
export type { ChoiceRowItem } from "@hjmds/design-contracts/choice-row";
|
|
4
|
-
|
|
5
|
+
/** A synchronous save closes the sheet at once. Only an async save can fail inside the sheet, so only it needs
|
|
6
|
+
* `errorLabel`; a rejected promise keeps the sheet open with that message (2026-10-23 product adoption). */
|
|
7
|
+
export type ChoiceRowSave<Value extends string = string> = Readonly<{
|
|
8
|
+
onValueChange: (value: Value) => void;
|
|
9
|
+
errorLabel?: never;
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
onValueChange: (value: Value) => Promise<void>;
|
|
12
|
+
errorLabel: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type ChoiceRowProps<Value extends string = string> = ChoiceRowSave<Value> & Readonly<{
|
|
5
15
|
title: string;
|
|
6
16
|
items: readonly ChoiceRowItem<Value>[];
|
|
7
17
|
/** The product-confirmed value; update it only after the save succeeds. */
|
|
8
18
|
value: Value | null;
|
|
9
|
-
/** A returned promise keeps the sheet open and busy; rejection keeps it open with `errorLabel`. */
|
|
10
|
-
onValueChange: (value: Value) => void | Promise<void>;
|
|
11
19
|
closeLabel: string;
|
|
12
|
-
errorLabel: string;
|
|
13
20
|
sheetTitle?: string;
|
|
14
21
|
sheetDescription?: string;
|
|
15
22
|
placeholder?: string;
|
|
16
23
|
leading?: ReactNode;
|
|
17
24
|
trailing?: ReactNode;
|
|
25
|
+
/** Spoken result of activating the row, e.g. "Opens the language list". */
|
|
26
|
+
accessibilityHint?: string;
|
|
27
|
+
/** ListRow density, so the row matches the surrounding settings rows. */
|
|
28
|
+
density?: ListRowDensity;
|
|
18
29
|
disabled?: boolean;
|
|
19
30
|
loading?: boolean;
|
|
20
31
|
}>;
|
|
21
|
-
export declare function ChoiceRow<Value extends string = string>(
|
|
32
|
+
export declare function ChoiceRow<Value extends string = string>(props: ChoiceRowProps<Value>): import("react").JSX.Element;
|
|
22
33
|
//# sourceMappingURL=choice-row.d.ts.map
|
package/dist/choice-row.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-row.d.ts","sourceRoot":"","sources":["../src/choice-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"choice-row.d.ts","sourceRoot":"","sources":["../src/choice-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKtE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE;4GAC4G;AAC5G,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IACnD,QAAQ,CAAC;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GACvE,QAAQ,CAAC;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACrF,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;IAC1F,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;IACvC,2EAA2E;IAC3E,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,wBAAgB,SAAS,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,+BA2BpF"}
|
package/dist/choice-row.js
CHANGED
|
@@ -4,9 +4,10 @@ import { resolveChoiceRow } from "@hjmds/design-contracts/choice-row";
|
|
|
4
4
|
import { ListRow } from "./data-display.js";
|
|
5
5
|
import { RadioGroup } from "./inputs.js";
|
|
6
6
|
import { Sheet } from "./overlays.js";
|
|
7
|
-
export function ChoiceRow(
|
|
7
|
+
export function ChoiceRow(props) {
|
|
8
|
+
const { title, items, value, closeLabel, errorLabel, sheetTitle, sheetDescription, placeholder, leading, trailing, accessibilityHint, density, disabled = false, loading = false } = props;
|
|
8
9
|
const { valueLabel } = resolveChoiceRow({ title, items, value, ...(placeholder === undefined ? {} : { placeholder }) });
|
|
9
|
-
if (!closeLabel.trim() || !errorLabel.trim())
|
|
10
|
+
if (!closeLabel.trim() || (errorLabel !== undefined && !errorLabel.trim()))
|
|
10
11
|
throw new TypeError("ChoiceRow text must not be empty");
|
|
11
12
|
const [open, setOpen] = useState(false);
|
|
12
13
|
const [pending, setPending] = useState(false);
|
|
@@ -15,7 +16,7 @@ export function ChoiceRow({ title, items, value, onValueChange, closeLabel, erro
|
|
|
15
16
|
if (next === null || next === value || pending)
|
|
16
17
|
return;
|
|
17
18
|
setFailed(false);
|
|
18
|
-
const result = onValueChange(next);
|
|
19
|
+
const result = props.onValueChange(next);
|
|
19
20
|
if (!result) {
|
|
20
21
|
setOpen(false);
|
|
21
22
|
return;
|
|
@@ -23,7 +24,9 @@ export function ChoiceRow({ title, items, value, onValueChange, closeLabel, erro
|
|
|
23
24
|
setPending(true);
|
|
24
25
|
result.then(() => { setPending(false); setOpen(false); }, () => { setPending(false); setFailed(true); });
|
|
25
26
|
};
|
|
26
|
-
return _jsxs(_Fragment, { children: [_jsx(ListRow, { title: title, description: valueLabel, ...(leading === undefined ? {} : { leading }), ...(trailing === undefined ? {} : { trailing }), disabled: disabled, loading: loading, onPress: () => { setFailed(false); setOpen(true); } }), _jsx(Sheet, { open: open, onOpenChange: (next) => { if (!pending)
|
|
27
|
-
setOpen(next); }, title: sheetTitle ?? title, closeLabel: closeLabel, busy: pending,
|
|
27
|
+
return _jsxs(_Fragment, { children: [_jsx(ListRow, { title: title, description: valueLabel, ...(leading === undefined ? {} : { leading }), ...(trailing === undefined ? {} : { trailing }), ...(density === undefined ? {} : { density }), disabled: disabled, loading: loading, accessibilityState: { expanded: open }, ...(accessibilityHint === undefined ? {} : { accessibilityHint }), onPress: () => { setFailed(false); setOpen(true); } }), _jsx(Sheet, { open: open, onOpenChange: (next) => { if (!pending)
|
|
28
|
+
setOpen(next); }, title: sheetTitle ?? title, closeLabel: closeLabel, busy: pending,
|
|
29
|
+
// Locale and region lists outgrow the screen; the header stays fixed while the choices scroll.
|
|
30
|
+
scrollable: true, ...(sheetDescription === undefined ? {} : { description: sheetDescription }), children: _jsx(RadioGroup, { accessibilityLabel: sheetTitle ?? title, orientation: "vertical", value: value, items: items, disabled: pending, ...(failed && errorLabel !== undefined ? { error: errorLabel } : {}), onValueChange: choose }) })] });
|
|
28
31
|
}
|
|
29
32
|
//# sourceMappingURL=choice-row.js.map
|
package/dist/choice-row.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-row.js","sourceRoot":"","sources":["../src/choice-row.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"choice-row.js","sourceRoot":"","sources":["../src/choice-row.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oCAAoC,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA2BtC,MAAM,UAAU,SAAS,CAAgC,KAA4B;IACnF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAC3L,MAAM,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CA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,aAAa,EAAE,MAAM,GAAI,GAC5F,IACP,CAAC;AACN,CAAC"}
|
package/dist/evidence.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type ReactNativeRendererEvidenceManifest = Readonly<{
|
|
|
32
32
|
export declare const reactNativeRendererEvidence: {
|
|
33
33
|
readonly schemaVersion: 2;
|
|
34
34
|
readonly packageName: "@hjmds/react-native";
|
|
35
|
-
readonly packageVersion: "1.41.
|
|
35
|
+
readonly packageVersion: "1.41.2";
|
|
36
36
|
readonly surface: "native";
|
|
37
37
|
readonly components: Readonly<{
|
|
38
38
|
/** Canonical component id from the design-contracts catalog. */
|
package/dist/evidence.js
CHANGED
|
@@ -112,7 +112,7 @@ const activeNativeEntries = componentCatalog.filter((entry) => {
|
|
|
112
112
|
export const reactNativeRendererEvidence = {
|
|
113
113
|
schemaVersion: reactNativeRendererEvidenceSchemaVersion,
|
|
114
114
|
packageName: "@hjmds/react-native",
|
|
115
|
-
packageVersion: "1.41.
|
|
115
|
+
packageVersion: "1.41.2",
|
|
116
116
|
surface: "native",
|
|
117
117
|
components: activeNativeEntries.map(derivedClaim),
|
|
118
118
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hjmds/react-native",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.2",
|
|
4
4
|
"description": "Expo-independent React Native renderers for HJM design contracts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -735,7 +735,7 @@
|
|
|
735
735
|
"@blobatar/react-native": "2.7.0",
|
|
736
736
|
"lucide-react-native": "1.49.0",
|
|
737
737
|
"vite": "8.3.4",
|
|
738
|
-
"@hjmds/design-contracts": "1.41.
|
|
738
|
+
"@hjmds/design-contracts": "1.41.2"
|
|
739
739
|
},
|
|
740
740
|
"engines": {
|
|
741
741
|
"node": ">=20"
|