@hjmds/react 1.37.2 → 1.38.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/dist/actions.d.ts +8 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +4 -4
- package/dist/actions.js.map +1 -1
- package/dist/authoring-tools.js +1 -1
- package/dist/authoring-tools.js.map +1 -1
- package/dist/bottom-cta.d.ts.map +1 -1
- package/dist/bottom-cta.js +2 -1
- package/dist/bottom-cta.js.map +1 -1
- package/dist/carousel-motion.js +1 -1
- package/dist/carousel-motion.js.map +1 -1
- package/dist/collection-editing.js +4 -4
- package/dist/collection-editing.js.map +1 -1
- package/dist/collection-rail.d.ts +3 -1
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js +2 -2
- package/dist/collection-rail.js.map +1 -1
- package/dist/display.d.ts +4 -0
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +2 -2
- package/dist/display.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/inline-confirm.js +1 -1
- package/dist/inline-confirm.js.map +1 -1
- package/dist/internal/document-resource.js +1 -1
- package/dist/internal/document-resource.js.map +1 -1
- package/dist/internal/screen-exit.js +2 -2
- package/dist/internal/screen-exit.js.map +1 -1
- package/dist/notification-bell.js +1 -1
- package/dist/notification-bell.js.map +1 -1
- package/dist/screen-flows.d.ts +1 -0
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +3 -3
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +5 -1
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +7 -3
- package/dist/screens.js.map +1 -1
- package/dist/selection.d.ts +4 -0
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +2 -2
- package/dist/selection.js.map +1 -1
- package/dist/sortable.js +1 -1
- package/dist/sortable.js.map +1 -1
- package/dist/step-player.js +1 -1
- package/dist/step-player.js.map +1 -1
- package/dist/steps.js +1 -1
- package/dist/steps.js.map +1 -1
- package/dist/streaming-answer.js +1 -1
- package/dist/streaming-answer.js.map +1 -1
- package/dist/styles.css +36 -22
- package/dist/styles.layered.css +36 -22
- package/dist/task-controls.js +2 -2
- package/dist/task-controls.js.map +1 -1
- package/dist/transfer-task.js +1 -1
- package/dist/transfer-task.js.map +1 -1
- package/dist/voice-note.js +1 -1
- package/dist/voice-note.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-editing.js","sourceRoot":"","sources":["../src/collection-editing.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAyF,MAAM,4CAA4C,CAAC;AAC/Q,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAgD,MAAM,kBAAkB,CAAC;AAG5F,SAAS,YAAY,CAAC,EAAE,QAAQ,EAA2B;IACzD,OAAO,cAAK,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAE,KAAC,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,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GAAa,KAHlN,MAAM,CAAC,EAAE,CAI1C,CAAC,IACH,CAAC;AACX,CAAC","sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\nimport { assertDistinctIds, changeColumnSettings, collectionEditingRecipe, focusAfterRemoval, recoverableFilters, snapshotSelection, type ColumnSetting, type FilterRecoveryOption, type FocusTarget, type SelectionAction } from \"@hjmds/design-contracts/collection-editing\";\nimport { Button, IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { TextField } from \"./forms.js\";\nimport { Checkbox } from \"./selection.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { FieldGroup, type FieldGroupBinding, type FieldGroupProps } from \"./field-group.js\";\n\n\nfunction ErrorMessage({ children }: { children: ReactNode }) {\n return <div role=\"alert\" style={{ display: \"grid\", placeItems: \"center\", textAlign: \"center\" }}><Text tone=\"danger\">{children}</Text></div>;\n}\n\nexport type InlineEditProps = Readonly<{\n id: string; value: string; label: string; editLabel: string; saveLabel: string; cancelLabel: string; errorLabel: string;\n disabled?: boolean; validate?: (draft: string) => string | undefined;\n /** Resolve only after confirming and updating the product value; reject to preserve the draft. */\n onSave: (draft: string) => void | Promise<void>;\n}>;\nexport function InlineEdit(props: InlineEditProps) { return <InlineEditBody key={props.id} {...props} />; }\nfunction InlineEditBody(props: InlineEditProps) {\n const [editing, setEditing] = useState(false), [draft, setDraft] = useState(props.value);\n const action = useCompositionAction(props.disabled);\n const input = useRef<HTMLInputElement>(null), trigger = useRef<HTMLButtonElement>(null), group = useRef<HTMLDivElement>(null);\n const restore = useRef(false);\n useLayoutEffect(() => {\n if (editing) input.current?.focus();\n else if (restore.current) { restore.current = false; trigger.current?.focus(); }\n }, [editing]);\n const error = props.validate?.(draft);\n const close = () => {\n restore.current = group.current?.contains(document.activeElement) ?? false;\n setEditing(false);\n };\n const save = async () => {\n if (props.disabled || error || action.pending || action.session.getSnapshot().status === \"pending\") return;\n const result = await action.run(\"save\", () => props.onSave(draft));\n if (result.status === \"success\") close();\n };\n return <div ref={group} role=\"group\" aria-label={props.label}>\n {/* Read state names the value with its label and edits through a pencil tool at the row end; a bare value beside a\n text \"Edit title\" button lost the label (2026-10-17 review). */}\n {!editing ? <Stack axis=\"inline\" gap=\"sm\" align=\"center\">\n <Stack gap=\"xxs\" layoutStyle={{ flex: 1, minInlineSize: 0 }}><Text variant=\"caption\" tone=\"muted\">{props.label}</Text><Text emphasis=\"strong\">{props.value}</Text></Stack>\n <IconButton ref={trigger} label={props.editLabel} tone=\"ghost\" edge=\"end\" disabled={props.disabled ?? false} onClick={() => { setDraft(props.value); action.session.reset(null); setEditing(true); }}><Icon name=\"edit\" /></IconButton>\n </Stack>\n : <Stack gap={collectionEditingRecipe.actionGap}>\n <TextField ref={input} label={props.label} value={draft} disabled={props.disabled ?? false} readOnly={action.pending}\n {...(error ? { error, \"aria-invalid\": true } : {})} onValueChange={setDraft}\n onKeyDown={event => {\n // Enter during IME composition confirms a character, not the title.\n if (event.nativeEvent.isComposing || event.keyCode === 229) return;\n if (event.key === \"Enter\") { event.preventDefault(); void save(); }\n if (event.key === \"Escape\" && !action.pending) { event.preventDefault(); event.stopPropagation(); close(); }\n }} />\n <Stack axis=\"inline\" gap=\"sm\" wrap><Button tone=\"ghost\" disabled={action.pending} onClick={close}>{props.cancelLabel}</Button>\n <Button loading={action.pending} disabled={props.disabled === true || !!error} onClick={() => void save()}>{props.saveLabel}</Button></Stack>\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack>}\n </div>;\n}\n\nexport type RepeatableFieldGroupProps = Omit<FieldGroupProps, \"renderField\"> & Readonly<{\n renderField: (binding: FieldGroupBinding & { focusRef: (target: FocusTarget | null) => void }) => ReactNode;\n addLabel: string; removeLabel: (id: string) => string; minFields?: number; maxFields?: number;\n /** A referenced row may stay editable while removal is unavailable (Utilverse expense participants). */\n isRemoveDisabled?: (id: string) => boolean;\n /** Return the new stable id to focus after the controlled descriptor includes it. */\n onAdd: () => string | undefined; onRemove: (id: string) => void;\n}>;\nexport function RepeatableFieldGroup({ renderField, addLabel, removeLabel, minFields = 0, maxFields = Infinity, isRemoveDisabled, onAdd, onRemove, ...props }: RepeatableFieldGroupProps) {\n const targets = useRef(new Map<string, FocusTarget>()), add = useRef<HTMLButtonElement>(null);\n const focus = useRef<string | null | undefined>(undefined);\n useLayoutEffect(() => {\n if (focus.current === undefined) return;\n if (focus.current === null) { add.current?.focus(); focus.current = undefined; }\n else if (targets.current.has(focus.current)) { targets.current.get(focus.current)?.focus(); focus.current = undefined; }\n });\n const fields = props.descriptor.fields;\n const live = useRef(true), policy = useRef({ fields, minFields, maxFields, isRemoveDisabled, onAdd, onRemove, disabled: props.descriptor.disabled });\n policy.current = { fields, minFields, maxFields, isRemoveDisabled, onAdd, onRemove, disabled: props.descriptor.disabled };\n useEffect(() => { live.current = true; return () => { live.current = false; }; }, []);\n return <Stack gap={collectionEditingRecipe.gap}>\n {/* Remove is a row tool: a trash IconButton at the field's end whose label names the row (icon-button.md), not a\n full-width ghost text button under the field (2026-10-17 review). End-aligned so it sits beside the input. */}\n <FieldGroup {...props} renderField={binding => <Stack axis=\"inline\" gap=\"xs\" align=\"end\">\n <div style={{ flex: 1, minInlineSize: 0 }}>{renderField({ ...binding, focusRef: target => { if (target) targets.current.set(binding.id, target); else targets.current.delete(binding.id); } })}</div>\n <IconButton label={removeLabel(binding.id)} tone=\"ghost\" edge=\"end\" disabled={binding.controlProps.disabled || fields.length <= minFields || isRemoveDisabled?.(binding.id) === true} onClick={binding.guardChange(() => {\n const current = policy.current;\n if (!live.current || current.disabled || current.fields.length <= current.minFields || current.isRemoveDisabled?.(binding.id)) return;\n focus.current = focusAfterRemoval(current.fields.map(field => field.id), binding.id, current.fields.filter(field => field.disabled).map(field => field.id)) ?? null;\n current.onRemove(binding.id);\n })}><Icon name=\"delete\" /></IconButton>\n </Stack>} />\n <Button ref={add} tone=\"secondary\" disabled={props.descriptor.disabled === true || fields.length >= maxFields} onClick={() => {\n const current = policy.current;\n if (!live.current || current.disabled || current.fields.length >= current.maxFields) return;\n const id = current.onAdd(); if (id !== undefined) focus.current = id;\n }}>{addLabel}</Button>\n </Stack>;\n}\n\nexport type SelectionActionBarProps = Readonly<{\n selectedIds: readonly string[]; selectionLabel: (count: number) => string;\n clearLabel: string; onClear: () => void; actions: readonly SelectionAction[];\n onAction: (actionId: string, selectedIds: readonly string[]) => void | Promise<void>; errorLabel: string; disabled?: boolean;\n /** Product supplies the exact confirmed operation to undo; never restore an entire collection. */\n recovery?: Readonly<{ label: string; onUndo: () => void | Promise<void> }>;\n}>;\nexport function SelectionActionBar(props: SelectionActionBarProps) {\n const action = useCompositionAction(props.disabled);\n assertDistinctIds(props.actions); snapshotSelection(props.selectedIds);\n if (!props.selectedIds.length && !props.recovery && !action.pending && !action.failed) return null;\n return <div role=\"group\" aria-label={props.selectionLabel(props.selectedIds.length)}><Stack gap=\"sm\">\n <Text role=\"status\">{props.selectionLabel(props.selectedIds.length)}</Text>\n <Stack axis=\"inline\" gap=\"sm\" wrap>\n {props.actions.map(item => <Button key={item.id} tone={item.destructive ? \"danger\" : \"secondary\"} loading={action.active === `action:${item.id}`} disabled={props.disabled === true || (action.pending && action.active !== `action:${item.id}`) || !props.selectedIds.length} onClick={() => {\n if (props.disabled) return;\n const scope = snapshotSelection(props.selectedIds);\n if (scope.length) void action.run(`action:${item.id}`, () => props.onAction(item.id, scope));\n }}>{item.label}</Button>)}\n <Button tone=\"ghost\" disabled={props.disabled === true || action.pending || !props.selectedIds.length} onClick={props.onClear}>{props.clearLabel}</Button>\n {props.recovery ? <Button tone=\"ghost\" loading={action.active === \"undo\"} disabled={props.disabled === true || (action.pending && action.active !== \"undo\")} onClick={() => {\n if (!props.disabled) void action.run(\"undo\", () => props.recovery!.onUndo());\n }}>{props.recovery.label}</Button> : null}\n </Stack>\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack></div>;\n}\n\nexport type FilterRecoveryProps = Readonly<{\n title: string; description?: string; options: readonly FilterRecoveryOption[];\n optionLabel: (option: FilterRecoveryOption) => string; onApply: (id: string) => void | Promise<void>;\n errorLabel: string; disabled?: boolean;\n}>;\nexport function FilterRecovery(props: FilterRecoveryProps) {\n const action = useCompositionAction(props.disabled), options = recoverableFilters(props.options);\n // Fills the result area its host gives it (flex parent) and centers there, like Native.\n return <div role=\"group\" aria-label={props.title} style={{ display: \"grid\", placeItems: \"center\", flexGrow: 1, textAlign: \"center\" }}><Stack gap=\"sm\" align=\"center\">\n <Text emphasis=\"strong\">{props.title}</Text>{props.description ? <Text tone=\"muted\">{props.description}</Text> : null}\n {options.map(option => <Button key={option.id} tone=\"secondary\" loading={action.active === option.id} disabled={props.disabled === true || (action.pending && action.active !== option.id)}\n onClick={() => { if (!props.disabled) void action.run(option.id, () => props.onApply(option.id)); }}>{props.optionLabel(option)}</Button>)}\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack></div>;\n}\n\nexport type TableColumnSettingsProps = Readonly<{\n label: string; columns: readonly ColumnSetting[]; disabled?: boolean;\n earlierLabel: (column: ColumnSetting) => string; laterLabel: (column: ColumnSetting) => string;\n onColumnsChange: (columns: readonly ColumnSetting[]) => void;\n}>;\nexport function TableColumnSettings(props: TableColumnSettingsProps) {\n assertDistinctIds(props.columns);\n const change = (id: string, kind: \"toggle\" | \"earlier\" | \"later\") => {\n if (props.disabled) return;\n const next = changeColumnSettings(props.columns, id, kind); if (next !== props.columns) props.onColumnsChange(next);\n };\n const labelId = useId(), disabled = props.disabled === true;\n // One row per column: visibility checkbox, then reorder as icon tools (labels stay the accessible names); the last\n // tool takes edge=\"end\" so its glyph slot ends on the group's edge like the checkbox starts on it (2026-10-17 audit).\n // The group label is HJM Text like Native; a browser-default <legend> rendered differently (2026-10-17 review).\n return <Stack gap=\"sm\" role=\"group\" aria-labelledby={labelId}><Text id={labelId} emphasis=\"strong\">{props.label}</Text>\n {props.columns.map(column => <Stack key={column.id} axis=\"inline\" gap=\"xs\" align=\"center\">\n <Checkbox label={column.label} checked={column.visible} layoutStyle={{ flex: 1, minInlineSize: 0 }} disabled={disabled || column.locked === true || (column.visible && props.columns.filter(item => item.visible).length === 1)} onCheckedChange={() => change(column.id, \"toggle\")} />\n <IconButton label={props.earlierLabel(column)} tone=\"ghost\" disabled={disabled || changeColumnSettings(props.columns, column.id, \"earlier\") === props.columns} onClick={() => change(column.id, \"earlier\")}><Icon name=\"chevronUp\" /></IconButton>\n <IconButton label={props.laterLabel(column)} tone=\"ghost\" edge=\"end\" disabled={disabled || changeColumnSettings(props.columns, column.id, \"later\") === props.columns} onClick={() => change(column.id, \"later\")}><Icon name=\"chevronDown\" /></IconButton>\n </Stack>)}\n </Stack>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collection-editing.js","sourceRoot":"","sources":["../src/collection-editing.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAyF,MAAM,4CAA4C,CAAC;AAC/Q,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,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,IAAI,IAAC,IAAI,EAAC,WAAW,GAAG,GAAa,EAClP,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,KAAK,EAAC,QAAQ,EAAE,QAAQ,IAAI,oBAAoB,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GAAa,KAHlN,MAAM,CAAC,EAAE,CAI1C,CAAC,IACH,CAAC;AACX,CAAC","sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\nimport { assertDistinctIds, changeColumnSettings, collectionEditingRecipe, focusAfterRemoval, recoverableFilters, snapshotSelection, type ColumnSetting, type FilterRecoveryOption, type FocusTarget, type SelectionAction } from \"@hjmds/design-contracts/collection-editing\";\nimport { Button, IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { TextField } from \"./forms.js\";\nimport { Checkbox } from \"./selection.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { FieldGroup, type FieldGroupBinding, type FieldGroupProps } from \"./field-group.js\";\n\n\nfunction ErrorMessage({ children }: { children: ReactNode }) {\n return <div role=\"alert\" style={{ display: \"grid\", placeItems: \"center\", textAlign: \"center\" }}><Text tone=\"danger\">{children}</Text></div>;\n}\n\nexport type InlineEditProps = Readonly<{\n id: string; value: string; label: string; editLabel: string; saveLabel: string; cancelLabel: string; errorLabel: string;\n disabled?: boolean; validate?: (draft: string) => string | undefined;\n /** Resolve only after confirming and updating the product value; reject to preserve the draft. */\n onSave: (draft: string) => void | Promise<void>;\n}>;\nexport function InlineEdit(props: InlineEditProps) { return <InlineEditBody key={props.id} {...props} />; }\nfunction InlineEditBody(props: InlineEditProps) {\n const [editing, setEditing] = useState(false), [draft, setDraft] = useState(props.value);\n const action = useCompositionAction(props.disabled);\n const input = useRef<HTMLInputElement>(null), trigger = useRef<HTMLButtonElement>(null), group = useRef<HTMLDivElement>(null);\n const restore = useRef(false);\n useLayoutEffect(() => {\n if (editing) input.current?.focus();\n else if (restore.current) { restore.current = false; trigger.current?.focus(); }\n }, [editing]);\n const error = props.validate?.(draft);\n const close = () => {\n restore.current = group.current?.contains(document.activeElement) ?? false;\n setEditing(false);\n };\n const save = async () => {\n if (props.disabled || error || action.pending || action.session.getSnapshot().status === \"pending\") return;\n const result = await action.run(\"save\", () => props.onSave(draft));\n if (result.status === \"success\") close();\n };\n return <div ref={group} role=\"group\" aria-label={props.label}>\n {/* Read state names the value with its label and edits through a pencil tool at the row end; a bare value beside a\n text \"Edit title\" button lost the label (2026-10-17 review). */}\n {!editing ? <Stack axis=\"inline\" gap=\"sm\" align=\"center\">\n <Stack gap=\"xxs\" layoutStyle={{ flex: 1, minInlineSize: 0 }}><Text variant=\"caption\" tone=\"muted\">{props.label}</Text><Text emphasis=\"strong\">{props.value}</Text></Stack>\n <IconButton ref={trigger} label={props.editLabel} tone=\"ghost\" edge=\"end\" disabled={props.disabled ?? false} onClick={() => { setDraft(props.value); action.session.reset(null); setEditing(true); }}><Icon name=\"edit\" /></IconButton>\n </Stack>\n : <Stack gap={collectionEditingRecipe.actionGap}>\n <TextField ref={input} label={props.label} value={draft} disabled={props.disabled ?? false} readOnly={action.pending}\n {...(error ? { error, \"aria-invalid\": true } : {})} onValueChange={setDraft}\n onKeyDown={event => {\n // Enter during IME composition confirms a character, not the title.\n if (event.nativeEvent.isComposing || event.keyCode === 229) return;\n if (event.key === \"Enter\") { event.preventDefault(); void save(); }\n if (event.key === \"Escape\" && !action.pending) { event.preventDefault(); event.stopPropagation(); close(); }\n }} />\n <Stack axis=\"inline\" gap=\"xs\" wrap><Button tone=\"ghost\" disabled={action.pending} onClick={close}>{props.cancelLabel}</Button>\n <Button loading={action.pending} disabled={props.disabled === true || !!error} onClick={() => void save()}>{props.saveLabel}</Button></Stack>\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack>}\n </div>;\n}\n\nexport type RepeatableFieldGroupProps = Omit<FieldGroupProps, \"renderField\"> & Readonly<{\n renderField: (binding: FieldGroupBinding & { focusRef: (target: FocusTarget | null) => void }) => ReactNode;\n addLabel: string; removeLabel: (id: string) => string; minFields?: number; maxFields?: number;\n /** A referenced row may stay editable while removal is unavailable (Utilverse expense participants). */\n isRemoveDisabled?: (id: string) => boolean;\n /** Return the new stable id to focus after the controlled descriptor includes it. */\n onAdd: () => string | undefined; onRemove: (id: string) => void;\n}>;\nexport function RepeatableFieldGroup({ renderField, addLabel, removeLabel, minFields = 0, maxFields = Infinity, isRemoveDisabled, onAdd, onRemove, ...props }: RepeatableFieldGroupProps) {\n const targets = useRef(new Map<string, FocusTarget>()), add = useRef<HTMLButtonElement>(null);\n const focus = useRef<string | null | undefined>(undefined);\n useLayoutEffect(() => {\n if (focus.current === undefined) return;\n if (focus.current === null) { add.current?.focus(); focus.current = undefined; }\n else if (targets.current.has(focus.current)) { targets.current.get(focus.current)?.focus(); focus.current = undefined; }\n });\n const fields = props.descriptor.fields;\n const live = useRef(true), policy = useRef({ fields, minFields, maxFields, isRemoveDisabled, onAdd, onRemove, disabled: props.descriptor.disabled });\n policy.current = { fields, minFields, maxFields, isRemoveDisabled, onAdd, onRemove, disabled: props.descriptor.disabled };\n useEffect(() => { live.current = true; return () => { live.current = false; }; }, []);\n return <Stack gap={collectionEditingRecipe.gap}>\n {/* Remove is a row tool: a trash IconButton at the field's end whose label names the row (icon-button.md), not a\n full-width ghost text button under the field (2026-10-17 review). End-aligned so it sits beside the input. */}\n <FieldGroup {...props} renderField={binding => <Stack axis=\"inline\" gap=\"xs\" align=\"end\">\n <div style={{ flex: 1, minInlineSize: 0 }}>{renderField({ ...binding, focusRef: target => { if (target) targets.current.set(binding.id, target); else targets.current.delete(binding.id); } })}</div>\n <IconButton label={removeLabel(binding.id)} tone=\"ghost\" edge=\"end\" disabled={binding.controlProps.disabled || fields.length <= minFields || isRemoveDisabled?.(binding.id) === true} onClick={binding.guardChange(() => {\n const current = policy.current;\n if (!live.current || current.disabled || current.fields.length <= current.minFields || current.isRemoveDisabled?.(binding.id)) return;\n focus.current = focusAfterRemoval(current.fields.map(field => field.id), binding.id, current.fields.filter(field => field.disabled).map(field => field.id)) ?? null;\n current.onRemove(binding.id);\n })}><Icon name=\"delete\" /></IconButton>\n </Stack>} />\n <Button ref={add} tone=\"secondary\" disabled={props.descriptor.disabled === true || fields.length >= maxFields} onClick={() => {\n const current = policy.current;\n if (!live.current || current.disabled || current.fields.length >= current.maxFields) return;\n const id = current.onAdd(); if (id !== undefined) focus.current = id;\n }}>{addLabel}</Button>\n </Stack>;\n}\n\nexport type SelectionActionBarProps = Readonly<{\n selectedIds: readonly string[]; selectionLabel: (count: number) => string;\n clearLabel: string; onClear: () => void; actions: readonly SelectionAction[];\n onAction: (actionId: string, selectedIds: readonly string[]) => void | Promise<void>; errorLabel: string; disabled?: boolean;\n /** Product supplies the exact confirmed operation to undo; never restore an entire collection. */\n recovery?: Readonly<{ label: string; onUndo: () => void | Promise<void> }>;\n}>;\nexport function SelectionActionBar(props: SelectionActionBarProps) {\n const action = useCompositionAction(props.disabled);\n assertDistinctIds(props.actions); snapshotSelection(props.selectedIds);\n if (!props.selectedIds.length && !props.recovery && !action.pending && !action.failed) return null;\n return <div role=\"group\" aria-label={props.selectionLabel(props.selectedIds.length)}><Stack gap=\"sm\">\n <Text role=\"status\">{props.selectionLabel(props.selectedIds.length)}</Text>\n <Stack axis=\"inline\" gap=\"xs\" wrap>\n {props.actions.map(item => <Button key={item.id} tone={item.destructive ? \"danger\" : \"secondary\"} loading={action.active === `action:${item.id}`} disabled={props.disabled === true || (action.pending && action.active !== `action:${item.id}`) || !props.selectedIds.length} onClick={() => {\n if (props.disabled) return;\n const scope = snapshotSelection(props.selectedIds);\n if (scope.length) void action.run(`action:${item.id}`, () => props.onAction(item.id, scope));\n }}>{item.label}</Button>)}\n <Button tone=\"ghost\" disabled={props.disabled === true || action.pending || !props.selectedIds.length} onClick={props.onClear}>{props.clearLabel}</Button>\n {props.recovery ? <Button tone=\"ghost\" loading={action.active === \"undo\"} disabled={props.disabled === true || (action.pending && action.active !== \"undo\")} onClick={() => {\n if (!props.disabled) void action.run(\"undo\", () => props.recovery!.onUndo());\n }}>{props.recovery.label}</Button> : null}\n </Stack>\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack></div>;\n}\n\nexport type FilterRecoveryProps = Readonly<{\n title: string; description?: string; options: readonly FilterRecoveryOption[];\n optionLabel: (option: FilterRecoveryOption) => string; onApply: (id: string) => void | Promise<void>;\n errorLabel: string; disabled?: boolean;\n}>;\nexport function FilterRecovery(props: FilterRecoveryProps) {\n const action = useCompositionAction(props.disabled), options = recoverableFilters(props.options);\n // Fills the result area its host gives it (flex parent) and centers there, like Native.\n return <div role=\"group\" aria-label={props.title} style={{ display: \"grid\", placeItems: \"center\", flexGrow: 1, textAlign: \"center\" }}><Stack gap=\"sm\" align=\"center\">\n <Text emphasis=\"strong\">{props.title}</Text>{props.description ? <Text tone=\"muted\">{props.description}</Text> : null}\n <Stack gap=\"xs\">{options.map(option => <Button key={option.id} tone=\"secondary\" loading={action.active === option.id} disabled={props.disabled === true || (action.pending && action.active !== option.id)}\n onClick={() => { if (!props.disabled) void action.run(option.id, () => props.onApply(option.id)); }}>{props.optionLabel(option)}</Button>)}</Stack>\n {action.failed ? <ErrorMessage>{props.errorLabel}</ErrorMessage> : null}\n </Stack></div>;\n}\n\nexport type TableColumnSettingsProps = Readonly<{\n label: string; columns: readonly ColumnSetting[]; disabled?: boolean;\n earlierLabel: (column: ColumnSetting) => string; laterLabel: (column: ColumnSetting) => string;\n onColumnsChange: (columns: readonly ColumnSetting[]) => void;\n}>;\nexport function TableColumnSettings(props: TableColumnSettingsProps) {\n assertDistinctIds(props.columns);\n const change = (id: string, kind: \"toggle\" | \"earlier\" | \"later\") => {\n if (props.disabled) return;\n const next = changeColumnSettings(props.columns, id, kind); if (next !== props.columns) props.onColumnsChange(next);\n };\n const labelId = useId(), disabled = props.disabled === true;\n // One row per column: visibility checkbox, then reorder as icon tools (labels stay the accessible names); the last\n // tool takes edge=\"end\" so its glyph slot ends on the group's edge like the checkbox starts on it (2026-10-17 audit).\n // The group label is HJM Text like Native; a browser-default <legend> rendered differently (2026-10-17 review).\n return <Stack gap=\"sm\" role=\"group\" aria-labelledby={labelId}><Text id={labelId} emphasis=\"strong\">{props.label}</Text>\n {props.columns.map(column => <Stack key={column.id} axis=\"inline\" gap=\"xs\" align=\"center\">\n <Checkbox label={column.label} checked={column.visible} layoutStyle={{ flex: 1, minInlineSize: 0 }} disabled={disabled || column.locked === true || (column.visible && props.columns.filter(item => item.visible).length === 1)} onCheckedChange={() => change(column.id, \"toggle\")} />\n <IconButton label={props.earlierLabel(column)} tone=\"ghost\" disabled={disabled || changeColumnSettings(props.columns, column.id, \"earlier\") === props.columns} onClick={() => change(column.id, \"earlier\")}><Icon name=\"chevronUp\" /></IconButton>\n <IconButton label={props.laterLabel(column)} tone=\"ghost\" edge=\"end\" disabled={disabled || changeColumnSettings(props.columns, column.id, \"later\") === props.columns} onClick={() => change(column.id, \"later\")}><Icon name=\"chevronDown\" /></IconButton>\n </Stack>)}\n </Stack>;\n}\n"]}
|
|
@@ -23,8 +23,10 @@ export type CollectionRailProps<Item extends CollectionRailItem = CollectionRail
|
|
|
23
23
|
* `body-edge` + per-section gutter, spint home 2026-10-17). Place the rail directly in the body.
|
|
24
24
|
*/
|
|
25
25
|
bleed?: boolean;
|
|
26
|
+
/** Hide the button row when touch scrolling is the intended navigation. */
|
|
27
|
+
showNavigation?: boolean;
|
|
26
28
|
layoutStyle?: HjmCompositionStyleProp;
|
|
27
29
|
}>;
|
|
28
30
|
/** Finite all-mounted list placement; Card, inputs and Dialog keep their own state. */
|
|
29
|
-
export declare function CollectionRail<Item extends CollectionRailItem = CollectionRailItem>({ label, items, renderItem, labels, density, emptyContent, defaultStartKey, onStartKeyChange, bleed, layoutStyle, ...props }: CollectionRailProps<Item>): import("react").JSX.Element;
|
|
31
|
+
export declare function CollectionRail<Item extends CollectionRailItem = CollectionRailItem>({ label, items, renderItem, labels, density, emptyContent, defaultStartKey, onStartKeyChange, bleed, showNavigation, layoutStyle, ...props }: CollectionRailProps<Item>): import("react").JSX.Element;
|
|
30
32
|
//# sourceMappingURL=collection-rail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-rail.d.ts","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,EAG4B,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EACrF,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACpG,MAAM,MAAM,mBAAmB,CAAC,IAAI,SAAS,kBAAkB,GAAG,kBAAkB,IAAI,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC;IAClJ,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAAC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;IAC7E,MAAM,EAAE,oBAAoB,CAAC;IAAC,OAAO,CA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AS,IAAI,EAAE,CAAC;IAAC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;IAC7E,MAAM,EAAE,oBAAoB,CAAC;IAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,CAAC;IACxF,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAA+C,EACtK,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAa,EAAE,cAAqB,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,+BA8H1I"}
|
package/dist/collection-rail.js
CHANGED
|
@@ -5,7 +5,7 @@ import { IconButton } from "./actions.js";
|
|
|
5
5
|
import { Icon } from "./supplemental-display.js";
|
|
6
6
|
import { useOptionalHjmTheme } from "./provider.js";
|
|
7
7
|
/** Finite all-mounted list placement; Card, inputs and Dialog keep their own state. */
|
|
8
|
-
export function CollectionRail({ label, items, renderItem, labels, density = collectionRailRecipe.defaults.density, emptyContent, defaultStartKey, onStartKeyChange, bleed = false, layoutStyle, ...props }) {
|
|
8
|
+
export function CollectionRail({ label, items, renderItem, labels, density = collectionRailRecipe.defaults.density, emptyContent, defaultStartKey, onStartKeyChange, bleed = false, showNavigation = true, layoutStyle, ...props }) {
|
|
9
9
|
validateCollectionRail(items);
|
|
10
10
|
if (!label.trim() || Object.values(labels).some(value => !value.trim()))
|
|
11
11
|
throw new TypeError("CollectionRail labels must not be empty");
|
|
@@ -126,6 +126,6 @@ export function CollectionRail({ label, items, renderItem, labels, density = col
|
|
|
126
126
|
if (active instanceof HTMLElement && node.contains(active))
|
|
127
127
|
detachedFocus.current = active;
|
|
128
128
|
};
|
|
129
|
-
}, style: { flex: "0 0 auto", width: position.layout.itemWidth || "auto", minWidth: 0 }, onFocusCapture: () => scrollToOffset(getCollectionRailRevealOffset(current.current.layout, current.current.offset, index), false), children: renderItem(item) }, item.id)) }), items.length === 0 ? emptyContent : null] }), _jsxs("div", { "data-collection-rail-controls": true, role: "group", "aria-label": labels.navigation, style: { display: "flex", flexWrap: "wrap", justifyContent: "flex-end", gap: "var(--hjm-space-
|
|
129
|
+
}, style: { flex: "0 0 auto", width: position.layout.itemWidth || "auto", minWidth: 0 }, onFocusCapture: () => scrollToOffset(getCollectionRailRevealOffset(current.current.layout, current.current.offset, index), false), children: renderItem(item) }, item.id)) }), items.length === 0 ? emptyContent : null] }), showNavigation && _jsxs("div", { "data-collection-rail-controls": true, role: "group", "aria-label": labels.navigation, style: { display: "flex", flexWrap: "wrap", justifyContent: "flex-end", gap: "var(--hjm-space-xs)", marginBlockStart: "var(--hjm-space-sm)" }, children: [_jsx(IconButton, { label: labels.previous, tone: "ghost", "aria-disabled": resolved.atStart, onClick: () => navigate("previous"), children: _jsx(Icon, { name: "chevronStart" }) }), _jsx(IconButton, { label: labels.next, tone: "ghost", "aria-disabled": resolved.atEnd, onClick: () => navigate("next"), children: _jsx(Icon, { name: "chevronEnd" }) })] })] });
|
|
130
130
|
}
|
|
131
131
|
//# sourceMappingURL=collection-rail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-rail.js","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAuC,M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AC;AACT,CAAC","sourcesContent":["import { useLayoutEffect, useRef, useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n collectionRailRecipe, validateCollectionRail, resolveCollectionRailLayout, resolveCollectionRailViewport,\n getCollectionRailTargetOffset, getCollectionRailItemOffset, getCollectionRailRevealOffset,\n getCollectionRailKeyboardIntent, type CollectionRailItem, type CollectionRailDensity, type CollectionRailLayout,\n} from \"@hjmds/design-contracts/collection-rail\";\nimport { IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CollectionRailLabels = Readonly<{ previous: string; next: string; navigation: string }>;\nexport type CollectionRailProps<Item extends CollectionRailItem = CollectionRailItem> = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & Readonly<{\n label: string; items: readonly Item[]; renderItem: (item: Item) => ReactNode;\n labels: CollectionRailLabels; density?: CollectionRailDensity; emptyContent?: ReactNode;\n /** Initial scroll anchor, not selection. Later collection changes reconcile by stable ID. */\n defaultStartKey?: string;\n /** Observed leading item, independent of product selection/detail state. Empty lists report null. */\n onStartKeyChange?: (key: string | null) => void;\n /**\n * Scroll to the screen edges from inside the default inset ScreenLayout body: the viewport reaches past the body\n * gutter (`--hjm-screen-body-inline`) and pads it back, so the first and last items rest on the gutter (no\n * `body-edge` + per-section gutter, spint home 2026-10-17). Place the rail directly in the body.\n */\n bleed?: boolean;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Finite all-mounted list placement; Card, inputs and Dialog keep their own state. */\nexport function CollectionRail<Item extends CollectionRailItem = CollectionRailItem>({ label, items, renderItem, labels, density = collectionRailRecipe.defaults.density,\n emptyContent, defaultStartKey, onStartKeyChange, bleed = false, layoutStyle, ...props }: CollectionRailProps<Item>) {\n validateCollectionRail(items);\n if (!label.trim() || Object.values(labels).some(value => !value.trim())) throw new TypeError(\"CollectionRail labels must not be empty\");\n const theme = useOptionalHjmTheme(), direction = theme?.environment.direction ?? \"ltr\";\n const gap = collectionRailRecipe.gap;\n const viewportRef = useRef<HTMLDivElement>(null);\n const detachedFocus = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n const old = detachedFocus.current;\n detachedFocus.current = null;\n // A removed card must leave a keyboard origin in this collection, without\n // moving focus away from a surviving input or an external control.\n if (old && !old.isConnected && old.ownerDocument.activeElement === old.ownerDocument.body) {\n viewportRef.current?.focus({ preventScroll: true });\n }\n });\n const anchor = useRef<string | null>(defaultStartKey ?? items[0]?.id ?? null);\n const initialized = useRef(false);\n if (!initialized.current) { validateCollectionRail(items, defaultStartKey); initialized.current = true; }\n const callback = useRef(onStartKeyChange); callback.current = onStartKeyChange;\n const current = useRef({ layout: resolveCollectionRailLayout(items.length, 0, density, gap), offset: 0 });\n const pendingOffset = useRef<number | null>(null);\n const [position, setPosition] = useState(current.current);\n const identity = JSON.stringify(items.map(item => item.id));\n const itemsRef = useRef(items); itemsRef.current = items;\n\n function publish(layout: CollectionRailLayout, offset: number) {\n const resolved = resolveCollectionRailViewport(layout, offset);\n const key = itemsRef.current[resolved.startIndex]?.id ?? null;\n if (key !== anchor.current) { anchor.current = key; callback.current?.(key); }\n current.current = { layout, offset: resolved.offset };\n setPosition(current.current);\n }\n function scrollToOffset(offset: number, animated: boolean) {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const resolved = resolveCollectionRailViewport(current.current.layout, offset);\n // CSS RTL scrollLeft is negative; clamp Safari rubber-banding through the\n // shared logical resolver rather than reversing data or selection keys.\n viewport.scrollTo({ left: direction === \"rtl\" ? -resolved.offset : resolved.offset,\n behavior: animated && !theme?.environment.reducedMotion ? \"smooth\" : \"instant\" });\n pendingOffset.current = animated && !theme?.environment.reducedMotion ? resolved.offset : null;\n // Smooth scroll is a request, not an observed viewport. Publishing its\n // destination now would disable the end action and report an unseen anchor.\n publish(current.current.layout, direction === \"rtl\" ? -viewport.scrollLeft : viewport.scrollLeft);\n }\n useLayoutEffect(() => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n let initialMeasurement = true;\n function measure() {\n // clientWidth includes the bleed padding; item geometry uses the gutter-aligned box inside it.\n const style = getComputedStyle(viewport!);\n const room = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);\n const next = resolveCollectionRailLayout(itemsRef.current.length, Math.max(0, viewport!.clientWidth - room), density, gap);\n // ResizeObserver also delivers an initial unchanged box. Re-aligning then\n // would undo a focus reveal that happened after the layout effect.\n if (!initialMeasurement && next.viewport === current.current.layout.viewport) return;\n initialMeasurement = false;\n pendingOffset.current = null;\n const index = Math.max(0, itemsRef.current.findIndex(item => item.id === anchor.current));\n let offset = next.count ? getCollectionRailItemOffset(next, index) : 0;\n const focused = document.activeElement?.closest(\"[data-collection-rail-item]\");\n const focusedIndex = focused && viewport!.contains(focused)\n ? itemsRef.current.findIndex(item => item.id === focused.getAttribute(\"data-collection-rail-item\")) : -1;\n // A narrower viewport cannot keep a distant focused action and the old\n // leading item visible together; focus exposure takes priority over anchor alignment.\n if (focusedIndex >= 0) offset = getCollectionRailRevealOffset(next, offset, focusedIndex);\n current.current = { layout: next, offset };\n // Width/direction changes keep the leading item's identity, and never\n // key/remount its input or detail owner (docs/collection-rail.md).\n viewport!.scrollTo({ left: direction === \"rtl\" ? -offset : offset, behavior: \"instant\" });\n publish(next, offset);\n }\n measure();\n const observer = new ResizeObserver(measure); observer.observe(viewport);\n return () => observer.disconnect();\n }, [identity, density, gap, direction, bleed]);\n\n function navigate(intent: \"previous\" | \"next\" | \"first\" | \"last\") {\n scrollToOffset(getCollectionRailTargetOffset(current.current.layout, pendingOffset.current ?? current.current.offset, intent), true);\n }\n const resolved = resolveCollectionRailViewport(position.layout, position.offset);\n return <div {...props} style={{ ...props.style, ...layoutStyle, minWidth: 0 }}\n data-collection-rail data-start-key={items[resolved.startIndex]?.id} dir={direction}\n onKeyDown={event => {\n props.onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n // Item widgets own arrows/Home/End. Rail navigation belongs only to its\n // viewport and explicit controls, not an input nested in a visible card.\n if (event.target !== viewportRef.current && !(event.target instanceof Element && event.target.closest(\"[data-collection-rail-controls]\"))) return;\n const intent = getCollectionRailKeyboardIntent(event.key, direction);\n if (intent) { event.preventDefault(); navigate(intent); }\n }}>\n <div ref={viewportRef} role=\"list\" aria-label={label} tabIndex={0} data-collection-rail-viewport data-bleed={bleed || undefined}\n className=\"hjm-collection-rail__viewport\"\n style={{ overflowX: \"auto\", overscrollBehaviorX: \"contain\", minWidth: 0 }}\n onPointerDown={() => { pendingOffset.current = null; }} onWheel={() => { pendingOffset.current = null; }}\n onScroll={event => {\n const offset = direction === \"rtl\" ? -event.currentTarget.scrollLeft : event.currentTarget.scrollLeft;\n if (pendingOffset.current !== null && Math.abs(offset - pendingOffset.current) <= 0.5) pendingOffset.current = null;\n publish(current.current.layout, offset);\n }}>\n <div style={{ display: \"flex\", gap, width: \"max-content\", minWidth: \"100%\", paddingBlock: \"var(--hjm-space-xs)\" }}>\n {items.map((item, index) => <div key={item.id} role=\"listitem\" data-collection-rail-item={item.id}\n ref={node => {\n if (!node) return;\n return () => {\n const active = node.ownerDocument.activeElement;\n if (active instanceof HTMLElement && node.contains(active)) detachedFocus.current = active;\n };\n }}\n style={{ flex: \"0 0 auto\", width: position.layout.itemWidth || \"auto\", minWidth: 0 }}\n onFocusCapture={() => scrollToOffset(getCollectionRailRevealOffset(current.current.layout, current.current.offset, index), false)}>\n {renderItem(item)}\n </div>)}\n </div>\n {items.length === 0 ? emptyContent : null}\n </div>\n <div data-collection-rail-controls role=\"group\" aria-label={labels.navigation}\n style={{ display: \"flex\", flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: \"var(--hjm-space-sm)\", marginBlockStart: \"var(--hjm-space-sm)\" }}>\n {/* Tool actions: icon buttons named by the localized label, as Carousel (2026-10-17 review E9). */}\n <IconButton label={labels.previous} tone=\"ghost\" aria-disabled={resolved.atStart} onClick={() => navigate(\"previous\")}><Icon name=\"chevronStart\" /></IconButton>\n <IconButton label={labels.next} tone=\"ghost\" aria-disabled={resolved.atEnd} onClick={() => navigate(\"next\")}><Icon name=\"chevronEnd\" /></IconButton>\n </div>\n </div>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collection-rail.js","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAC;AAC/F,OAAO,EACL,oBAAoB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,6BAA6B,EACxG,6BAA6B,EAAE,2BAA2B,EAAE,6BAA6B,EACzF,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAsBpD,uFAAuF;AACvF,MAAM,UAAU,cAAc,CAAuD,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAG,oBAAoB,CAAC,QAAQ,CAAC,OAAO,EACtK,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,GAAG,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,EAA6B;IACzI,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;IACxI,MAAM,KAAK,GAAG,mBAAmB,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,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O,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,GAAG,GAAa,EAChK,KAAC,UAAU,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,OAAO,mBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GAAa,IAChJ,IACF,CAAC;AACT,CAAC","sourcesContent":["import { useLayoutEffect, useRef, useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n collectionRailRecipe, validateCollectionRail, resolveCollectionRailLayout, resolveCollectionRailViewport,\n getCollectionRailTargetOffset, getCollectionRailItemOffset, getCollectionRailRevealOffset,\n getCollectionRailKeyboardIntent, type CollectionRailItem, type CollectionRailDensity, type CollectionRailLayout,\n} from \"@hjmds/design-contracts/collection-rail\";\nimport { IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CollectionRailLabels = Readonly<{ previous: string; next: string; navigation: string }>;\nexport type CollectionRailProps<Item extends CollectionRailItem = CollectionRailItem> = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & Readonly<{\n label: string; items: readonly Item[]; renderItem: (item: Item) => ReactNode;\n labels: CollectionRailLabels; density?: CollectionRailDensity; emptyContent?: ReactNode;\n /** Initial scroll anchor, not selection. Later collection changes reconcile by stable ID. */\n defaultStartKey?: string;\n /** Observed leading item, independent of product selection/detail state. Empty lists report null. */\n onStartKeyChange?: (key: string | null) => void;\n /**\n * Scroll to the screen edges from inside the default inset ScreenLayout body: the viewport reaches past the body\n * gutter (`--hjm-screen-body-inline`) and pads it back, so the first and last items rest on the gutter (no\n * `body-edge` + per-section gutter, spint home 2026-10-17). Place the rail directly in the body.\n */\n bleed?: boolean;\n /** Hide the button row when touch scrolling is the intended navigation. */\n showNavigation?: boolean;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Finite all-mounted list placement; Card, inputs and Dialog keep their own state. */\nexport function CollectionRail<Item extends CollectionRailItem = CollectionRailItem>({ label, items, renderItem, labels, density = collectionRailRecipe.defaults.density,\n emptyContent, defaultStartKey, onStartKeyChange, bleed = false, showNavigation = true, layoutStyle, ...props }: CollectionRailProps<Item>) {\n validateCollectionRail(items);\n if (!label.trim() || Object.values(labels).some(value => !value.trim())) throw new TypeError(\"CollectionRail labels must not be empty\");\n const theme = useOptionalHjmTheme(), direction = theme?.environment.direction ?? \"ltr\";\n const gap = collectionRailRecipe.gap;\n const viewportRef = useRef<HTMLDivElement>(null);\n const detachedFocus = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n const old = detachedFocus.current;\n detachedFocus.current = null;\n // A removed card must leave a keyboard origin in this collection, without\n // moving focus away from a surviving input or an external control.\n if (old && !old.isConnected && old.ownerDocument.activeElement === old.ownerDocument.body) {\n viewportRef.current?.focus({ preventScroll: true });\n }\n });\n const anchor = useRef<string | null>(defaultStartKey ?? items[0]?.id ?? null);\n const initialized = useRef(false);\n if (!initialized.current) { validateCollectionRail(items, defaultStartKey); initialized.current = true; }\n const callback = useRef(onStartKeyChange); callback.current = onStartKeyChange;\n const current = useRef({ layout: resolveCollectionRailLayout(items.length, 0, density, gap), offset: 0 });\n const pendingOffset = useRef<number | null>(null);\n const [position, setPosition] = useState(current.current);\n const identity = JSON.stringify(items.map(item => item.id));\n const itemsRef = useRef(items); itemsRef.current = items;\n\n function publish(layout: CollectionRailLayout, offset: number) {\n const resolved = resolveCollectionRailViewport(layout, offset);\n const key = itemsRef.current[resolved.startIndex]?.id ?? null;\n if (key !== anchor.current) { anchor.current = key; callback.current?.(key); }\n current.current = { layout, offset: resolved.offset };\n setPosition(current.current);\n }\n function scrollToOffset(offset: number, animated: boolean) {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const resolved = resolveCollectionRailViewport(current.current.layout, offset);\n // CSS RTL scrollLeft is negative; clamp Safari rubber-banding through the\n // shared logical resolver rather than reversing data or selection keys.\n viewport.scrollTo({ left: direction === \"rtl\" ? -resolved.offset : resolved.offset,\n behavior: animated && !theme?.environment.reducedMotion ? \"smooth\" : \"instant\" });\n pendingOffset.current = animated && !theme?.environment.reducedMotion ? resolved.offset : null;\n // Smooth scroll is a request, not an observed viewport. Publishing its\n // destination now would disable the end action and report an unseen anchor.\n publish(current.current.layout, direction === \"rtl\" ? -viewport.scrollLeft : viewport.scrollLeft);\n }\n useLayoutEffect(() => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n let initialMeasurement = true;\n function measure() {\n // clientWidth includes the bleed padding; item geometry uses the gutter-aligned box inside it.\n const style = getComputedStyle(viewport!);\n const room = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);\n const next = resolveCollectionRailLayout(itemsRef.current.length, Math.max(0, viewport!.clientWidth - room), density, gap);\n // ResizeObserver also delivers an initial unchanged box. Re-aligning then\n // would undo a focus reveal that happened after the layout effect.\n if (!initialMeasurement && next.viewport === current.current.layout.viewport) return;\n initialMeasurement = false;\n pendingOffset.current = null;\n const index = Math.max(0, itemsRef.current.findIndex(item => item.id === anchor.current));\n let offset = next.count ? getCollectionRailItemOffset(next, index) : 0;\n const focused = document.activeElement?.closest(\"[data-collection-rail-item]\");\n const focusedIndex = focused && viewport!.contains(focused)\n ? itemsRef.current.findIndex(item => item.id === focused.getAttribute(\"data-collection-rail-item\")) : -1;\n // A narrower viewport cannot keep a distant focused action and the old\n // leading item visible together; focus exposure takes priority over anchor alignment.\n if (focusedIndex >= 0) offset = getCollectionRailRevealOffset(next, offset, focusedIndex);\n current.current = { layout: next, offset };\n // Width/direction changes keep the leading item's identity, and never\n // key/remount its input or detail owner (docs/collection-rail.md).\n viewport!.scrollTo({ left: direction === \"rtl\" ? -offset : offset, behavior: \"instant\" });\n publish(next, offset);\n }\n measure();\n const observer = new ResizeObserver(measure); observer.observe(viewport);\n return () => observer.disconnect();\n }, [identity, density, gap, direction, bleed]);\n\n function navigate(intent: \"previous\" | \"next\" | \"first\" | \"last\") {\n scrollToOffset(getCollectionRailTargetOffset(current.current.layout, pendingOffset.current ?? current.current.offset, intent), true);\n }\n const resolved = resolveCollectionRailViewport(position.layout, position.offset);\n return <div {...props} style={{ ...props.style, ...layoutStyle, minWidth: 0 }}\n data-collection-rail data-start-key={items[resolved.startIndex]?.id} dir={direction}\n onKeyDown={event => {\n props.onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n // Item widgets own arrows/Home/End. Rail navigation belongs only to its\n // viewport and explicit controls, not an input nested in a visible card.\n if (event.target !== viewportRef.current && !(event.target instanceof Element && event.target.closest(\"[data-collection-rail-controls]\"))) return;\n const intent = getCollectionRailKeyboardIntent(event.key, direction);\n if (intent) { event.preventDefault(); navigate(intent); }\n }}>\n <div ref={viewportRef} role=\"list\" aria-label={label} tabIndex={0} data-collection-rail-viewport data-bleed={bleed || undefined}\n className=\"hjm-collection-rail__viewport\"\n style={{ overflowX: \"auto\", overscrollBehaviorX: \"contain\", minWidth: 0 }}\n onPointerDown={() => { pendingOffset.current = null; }} onWheel={() => { pendingOffset.current = null; }}\n onScroll={event => {\n const offset = direction === \"rtl\" ? -event.currentTarget.scrollLeft : event.currentTarget.scrollLeft;\n if (pendingOffset.current !== null && Math.abs(offset - pendingOffset.current) <= 0.5) pendingOffset.current = null;\n publish(current.current.layout, offset);\n }}>\n <div style={{ display: \"flex\", gap, width: \"max-content\", minWidth: \"100%\", paddingBlock: \"var(--hjm-space-xs)\" }}>\n {items.map((item, index) => <div key={item.id} role=\"listitem\" data-collection-rail-item={item.id}\n ref={node => {\n if (!node) return;\n return () => {\n const active = node.ownerDocument.activeElement;\n if (active instanceof HTMLElement && node.contains(active)) detachedFocus.current = active;\n };\n }}\n style={{ flex: \"0 0 auto\", width: position.layout.itemWidth || \"auto\", minWidth: 0 }}\n onFocusCapture={() => scrollToOffset(getCollectionRailRevealOffset(current.current.layout, current.current.offset, index), false)}>\n {renderItem(item)}\n </div>)}\n </div>\n {items.length === 0 ? emptyContent : null}\n </div>\n {showNavigation && <div data-collection-rail-controls role=\"group\" aria-label={labels.navigation}\n style={{ display: \"flex\", flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: \"var(--hjm-space-xs)\", marginBlockStart: \"var(--hjm-space-sm)\" }}>\n {/* Tool actions: icon buttons named by the localized label, as Carousel (2026-10-17 review E9). */}\n <IconButton label={labels.previous} tone=\"ghost\" aria-disabled={resolved.atStart} onClick={() => navigate(\"previous\")}><Icon name=\"chevronStart\" /></IconButton>\n <IconButton label={labels.next} tone=\"ghost\" aria-disabled={resolved.atEnd} onClick={() => navigate(\"next\")}><Icon name=\"chevronEnd\" /></IconButton>\n </div>}\n </div>;\n}\n"]}
|
package/dist/display.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export type CardProps = Omit<HTMLAttributes<HTMLElement>, "title"> & Readonly<{
|
|
|
49
49
|
/** Non-interactive cover classification at the shared top/end inset. Requires backgroundMedia. */
|
|
50
50
|
mediaBadges?: ReactNode;
|
|
51
51
|
badges?: ReactNode;
|
|
52
|
+
/** Centre short metadata beneath artwork without product-owned badge layout. */
|
|
53
|
+
badgesAlign?: "start" | "center";
|
|
52
54
|
/** Activate only the passive cover; other card content/actions keep independent targets. */
|
|
53
55
|
mediaAction?: Readonly<{
|
|
54
56
|
label: string;
|
|
@@ -92,6 +94,8 @@ export declare const Card: import("react").ForwardRefExoticComponent<Omit<HTMLAt
|
|
|
92
94
|
/** Non-interactive cover classification at the shared top/end inset. Requires backgroundMedia. */
|
|
93
95
|
mediaBadges?: ReactNode;
|
|
94
96
|
badges?: ReactNode;
|
|
97
|
+
/** Centre short metadata beneath artwork without product-owned badge layout. */
|
|
98
|
+
badgesAlign?: "start" | "center";
|
|
95
99
|
/** Activate only the passive cover; other card content/actions keep independent targets. */
|
|
96
100
|
mediaAction?: Readonly<{
|
|
97
101
|
label: string;
|
package/dist/display.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../src/display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,IAAI,oBAAoB,EACzC,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,OAAO,EACb,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,YAAY,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACtE,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,eAAe,CAAC,GACtD,QAAQ,CAAC;IACP,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,qBAAqB,KAAK,SAAS,CAAC,CAAC;IACtE,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,qBAAqB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AAE,uBAAuB,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO;WA7BT,SAAS;kBACF,SAAS;cACb,SAAS;eACR,SAAS;IACpB,+DAA+D;qBAC9C,SAAS;IAC1B,uEAAuE;iBAC1D,CAAC,KAAK,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,SAAS;cACzD,cAAc;IACxB,mFAAmF;WAC5E,MAAM,OAAO,aAAa,CAAC,KAAK;IACvC,2EAA2E;mBAC5D,mBAAmB;eACvB,OAAO;eACP,OAAO;IAClB;;;;OAIG;cACO,OAAO;IACjB,uDAAuD;mBACxC,MAAM;WACd,MAAM;cACH,iBAAiB,CAAC,WAAW,CAAC;IACtC,4EAA4E;kBAChE,uBAAuB;gDAsHvC,CAAC"}
|
package/dist/display.js
CHANGED
|
@@ -18,7 +18,7 @@ export const Tag = forwardRef(function Tag({ children, tone, className, layoutSt
|
|
|
18
18
|
});
|
|
19
19
|
return (_jsx("span", { ...props, style: { ...style, ...layoutStyle }, ref: ref, className: classNames("hjm-tag", className), "data-tone": descriptor.tone, children: _jsx("span", { className: "hjm-tag__label", children: descriptor.label }) }));
|
|
20
20
|
});
|
|
21
|
-
export const Card = forwardRef(function Card({ title, description, leading, media, backgroundMedia, backgroundInteraction, mediaBadges, badges, mediaAction, actions, headerActions, headingLevel = cardRecipe.defaults.headingLevel,
|
|
21
|
+
export const Card = forwardRef(function Card({ title, description, leading, media, backgroundMedia, backgroundInteraction, mediaBadges, badges, badgesAlign = cardRecipe.defaults.badgesAlign, mediaAction, actions, headerActions, headingLevel = cardRecipe.defaults.headingLevel,
|
|
22
22
|
// An omitted selection is an ordinary action, not an unpressed toggle.
|
|
23
23
|
selected, onActivate, href, renderLink, disabled = false, tone = cardRecipe.defaults.tone, bordered = cardRecipe.defaults.bordered, padding = cardRecipe.defaults.padding, radius, className, children, ...props }, ref) {
|
|
24
24
|
if (href !== undefined && (!href.trim() || onActivate))
|
|
@@ -52,7 +52,7 @@ selected, onActivate, href, renderLink, disabled = false, tone = cardRecipe.defa
|
|
|
52
52
|
"data-interactive": true, onClick: activate,
|
|
53
53
|
} : {}), ...(overlay ? { "data-activation": "overlay" } : {}), tone: selected ? cardRecipe.selectedTone : tone, bordered: bordered, ...(radius === undefined ? {} : { radius }), className: classNames("hjm-card", className), "data-background-media": backgroundMedia ? true : undefined, "data-state": (onActivate || href !== undefined || mediaAction) && disabled ? "disabled" : selected ? "selected" : "idle", style: { "--hjm-card-background-scrim": cardRecipe.backgroundMedia.scrim, "--hjm-card-background-foreground": cardRecipe.backgroundMedia.foreground, "--hjm-card-disabled-opacity": cardRecipe.interaction.disabledOpacity,
|
|
54
54
|
"--hjm-card-pressed-opacity": cardRecipe.interaction.pressedOpacity, ...props.style }, children: [backgroundMedia ? _jsxs("div", { className: "hjm-card__background", "aria-hidden": "true", children: [backgroundMedia, _jsx("span", { className: "hjm-card__scrim" })] }) : null, backgroundInteraction === undefined ? null : _jsx("div", { className: "hjm-card__background-interaction", "data-slot": "background-interaction", children: backgroundInteraction }), mediaBadges === undefined ? null : _jsx("div", { className: "hjm-card__media-badges", "data-slot": "media-badges", children: mediaBadges }), media ? _jsx("div", { className: "hjm-card__media", "data-slot": "media", children: mediaAction ? _jsxs("button", { type: "button", className: "hjm-card__media-action", "aria-label": mediaAction.label, disabled: disabled, onClick: () => { if (!disabled)
|
|
55
|
-
mediaAction.onActivate(); }, children: [media, mediaAction.icon ? _jsx("span", { className: "hjm-card__media-icon", "aria-hidden": "true", style: { insetInlineEnd: cardRecipe.mediaAction.inset, insetBlockEnd: cardRecipe.mediaAction.inset, width: cardRecipe.mediaAction.diameter, height: cardRecipe.mediaAction.diameter }, children: mediaAction.icon({ color: "currentColor", size: cardRecipe.mediaAction.iconSize }) }) : null] }) : media }) : null, _jsxs("div", { className: "hjm-card__body", "data-slot": "body", style: { padding: surfaceGeometry.paddings[padding] }, children: [badges === undefined ? null : _jsx("div", { className: "hjm-card__badges", "data-slot": "badges", children: badges }), hasHeader ? (_jsxs("div", { className: "hjm-card__header", "data-slot": "header", children: [leading === undefined ? null : (_jsx("span", { className: "hjm-card__leading", "data-slot": "leading", children: leading })), _jsxs("div", { className: "hjm-card__copy", children: [title === undefined
|
|
55
|
+
mediaAction.onActivate(); }, children: [media, mediaAction.icon ? _jsx("span", { className: "hjm-card__media-icon", "aria-hidden": "true", style: { insetInlineEnd: cardRecipe.mediaAction.inset, insetBlockEnd: cardRecipe.mediaAction.inset, width: cardRecipe.mediaAction.diameter, height: cardRecipe.mediaAction.diameter }, children: mediaAction.icon({ color: "currentColor", size: cardRecipe.mediaAction.iconSize }) }) : null] }) : media }) : null, _jsxs("div", { className: "hjm-card__body", "data-slot": "body", style: { padding: surfaceGeometry.paddings[padding] }, children: [badges === undefined ? null : _jsx("div", { className: "hjm-card__badges", "data-slot": "badges", "data-align": badgesAlign, children: badges }), hasHeader ? (_jsxs("div", { className: "hjm-card__header", "data-slot": "header", children: [leading === undefined ? null : (_jsx("span", { className: "hjm-card__leading", "data-slot": "leading", children: leading })), _jsxs("div", { className: "hjm-card__copy", children: [title === undefined
|
|
56
56
|
? null
|
|
57
57
|
: createElement(`h${headingLevel}`, { className: "hjm-card__title", "data-slot": "title" }, title), description === undefined ? null : (_jsx(Text, { as: "p", tone: "muted", className: "hjm-card__description", "data-slot": "description", children: description }))] }), headerActions === undefined ? null : _jsx("div", { className: "hjm-card__header-actions", "data-slot": "header-actions", children: headerActions })] })) : null, children === undefined ? null : (_jsx("div", { className: "hjm-card__content", "data-slot": "content", children: children }))] }), destination, overlay && href === undefined ? (_jsx("button", { type: "button", className: "hjm-card__activator", "data-slot": "activator", "aria-label": activationLabel, "aria-pressed": selected, disabled: disabled, onClick: activate })) : null, actions ? _jsx("div", { className: "hjm-card__actions", "data-slot": "actions", children: actions }) : null] }));
|
|
58
58
|
});
|
package/dist/display.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display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n type BadgeAdornmentContext,\n type BadgeSize,\n type BadgeTone,\n type BadgeVariant as ContractBadgeVariant,\n type ListRowDensity,\n type ListRowLeadingShape,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n resolveTagDescriptor,\n type TagTone,\n} from \"@hjmds/design-contracts/components/tag\";\nimport {\n cardRecipe,\n type CardHeadingLevel,\n} from \"@hjmds/design-contracts/components/card\";\nimport {\n surfaceGeometry,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n createElement,\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { useHjmDensityDefault } from \"./provider.js\";\nimport { Surface, Text } from \"./layout.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type { CardHeadingLevel } from \"@hjmds/design-contracts/components/card\";\nexport type { TagTone } from \"@hjmds/design-contracts/components/tag\";\nexport type BadgeVariant = ContractBadgeVariant;\n\nexport type BadgeProps = HTMLAttributes<HTMLSpanElement> &\n Readonly<{\n tone?: BadgeTone;\n size?: BadgeSize;\n variant?: BadgeVariant;\n leading?: ReactNode | ((context: BadgeAdornmentContext) => ReactNode);\n trailing?: ReactNode | ((context: BadgeAdornmentContext) => ReactNode);\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n {\n tone = badgeRecipe.defaults.tone,\n size = badgeRecipe.defaults.size,\n variant = badgeRecipe.defaults.variant,\n leading,\n trailing,\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n const iconContext = { color: \"currentColor\", size: badgeRecipe.sizes[size].iconSize };\n return (\n <span\n {...props}\n style={{ ...style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-badge\", className)}\n data-tone={tone}\n data-size={size}\n data-variant={variant}\n >\n {leading === undefined ? null : (\n <span aria-hidden=\"true\" className=\"hjm-badge__icon\">\n {typeof leading === \"function\" ? leading(iconContext) : leading}\n </span>\n )}\n <span className=\"hjm-badge__label\">{children}</span>\n {trailing === undefined ? null : (\n <span aria-hidden=\"true\" className=\"hjm-badge__icon\">{typeof trailing === \"function\" ? trailing(iconContext) : trailing}</span>\n )}\n </span>\n );\n});\n\nexport type TagProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n children: string;\n tone?: TagTone;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Tag = forwardRef<HTMLSpanElement, TagProps>(function Tag(\n { children, tone, className, layoutStyle, style, ...props },\n ref,\n) {\n const descriptor = resolveTagDescriptor({\n label: children,\n ...(tone === undefined ? {} : { tone }),\n });\n return (\n <span\n {...props}\n style={{ ...style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-tag\", className)}\n data-tone={descriptor.tone}\n >\n <span className=\"hjm-tag__label\">{descriptor.label}</span>\n </span>\n );\n});\n\nexport type CardProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> &\n Readonly<{\n title?: ReactNode;\n description?: ReactNode;\n leading?: ReactNode;\n media?: ReactNode;\n /** Decorative artwork behind the shared body/actions; its host determines the available height. */\n backgroundMedia?: ReactNode;\n /** Platform gesture/accessibility host behind content. Requires backgroundMedia; never put metadata/actions here. */\n backgroundInteraction?: ReactNode;\n /** Non-interactive cover classification at the shared top/end inset. Requires backgroundMedia. */\n mediaBadges?: ReactNode;\n badges?: ReactNode;\n /** Activate only the passive cover; other card content/actions keep independent targets. */\n mediaAction?: Readonly<{ label: string; onActivate(): void; icon?: (context: Readonly<{ color: string; size: number }>) => ReactNode }>;\n actions?: ReactNode;\n /** Independent commands at the header end; never nested in whole-card activation. */\n headerActions?: ReactNode;\n headingLevel?: CardHeadingLevel;\n selected?: boolean;\n /**\n * Whole-card activation. With `actions`, the card stays an article and a separate full-card button sits under the\n * action region, so actions remain independent buttons (never a button inside a button). Keep other children passive.\n */\n onActivate?: () => void;\n /** A native anchor preserves new-tab, copy-link and browser previews; it is exclusive with onActivate. */\n href?: string;\n /** Framework routing and product effects can wrap the shared anchor without replacing its placement. */\n renderLink?: (props: React.ComponentPropsWithRef<\"a\">) => ReactNode;\n disabled?: boolean;\n tone?: SurfaceTone;\n bordered?: boolean;\n padding?: SurfacePadding;\n radius?: SurfaceRadius;\n /** Canonical layout-only placement; forwarded to the root Surface, which applies it. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card(\n {\n title,\n description,\n leading,\n media,\n backgroundMedia,\n backgroundInteraction,\n mediaBadges,\n badges,\n mediaAction,\n actions,\n headerActions,\n headingLevel = cardRecipe.defaults.headingLevel,\n // An omitted selection is an ordinary action, not an unpressed toggle.\n selected,\n onActivate, href, renderLink,\n disabled = false,\n tone = cardRecipe.defaults.tone,\n bordered = cardRecipe.defaults.bordered,\n padding = cardRecipe.defaults.padding,\n radius,\n className,\n children,\n ...props\n },\n ref,\n) {\n if (href !== undefined && (!href.trim() || onActivate)) throw new TypeError(\"Card href requires a destination and cannot combine with onActivate\");\n if (renderLink && href === undefined) throw new TypeError(\"Card renderLink requires href\");\n if ((onActivate || href !== undefined) && !props[\"aria-label\"]?.trim()) {\n throw new TypeError(\"Interactive Card requires aria-label\");\n }\n if (mediaAction && (onActivate || href !== undefined || !media || !mediaAction.label.trim())) throw new TypeError(\"Card mediaAction requires passive media, a label, and no whole-card activation\");\n if (backgroundMedia && (media || mediaAction || onActivate || href !== undefined)) throw new TypeError(\"Card backgroundMedia is decorative and cannot combine with media, mediaAction, onActivate or href\");\n if ((backgroundInteraction !== undefined || mediaBadges !== undefined) && !backgroundMedia) throw new TypeError(\"Card backgroundInteraction/mediaBadges require backgroundMedia\");\n const hasHeader =\n leading !== undefined || title !== undefined || description !== undefined || headerActions !== undefined;\n // Whole-card open plus separate commands (2026-10-18 unairplane journey card: open + delete). A root button cannot\n // contain the action buttons, so the root stays an article and an overlay button carries the card's name and state.\n const overlay = href !== undefined || (onActivate !== undefined && Boolean(actions || headerActions));\n const { \"aria-label\": activationLabel, ...rootProps } = props;\n const activate = () => { if (!disabled) onActivate?.(); };\n\n const linkProps: React.ComponentPropsWithRef<\"a\"> = {\n href: disabled ? undefined : href, role: \"link\", className: \"hjm-card__activator\",\n \"aria-label\": activationLabel, \"aria-disabled\": disabled || undefined, tabIndex: disabled ? -1 : undefined,\n };\n // Link activation belongs to the shared card; a product-owned stretched link was its own second layout (Diairy).\n const destination = href === undefined ? null : !disabled && renderLink ? renderLink(linkProps) : <a {...linkProps} />;\n return (\n <Surface\n {...(overlay ? rootProps : props)}\n ref={ref}\n as={onActivate && !overlay ? \"button\" : \"article\"}\n {...(onActivate && !overlay ? {\n type: \"button\" as const, disabled, \"aria-pressed\": selected,\n \"data-interactive\": true, onClick: activate,\n } : {})}\n {...(overlay ? { \"data-activation\": \"overlay\" } : {})}\n tone={selected ? cardRecipe.selectedTone : tone}\n bordered={bordered}\n {...(radius === undefined ? {} : { radius })}\n className={classNames(\"hjm-card\", className)}\n data-background-media={backgroundMedia ? true : undefined}\n data-state={(onActivate || href !== undefined || mediaAction) && disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"}\n style={{ \"--hjm-card-background-scrim\": cardRecipe.backgroundMedia.scrim, \"--hjm-card-background-foreground\": cardRecipe.backgroundMedia.foreground, \"--hjm-card-disabled-opacity\": cardRecipe.interaction.disabledOpacity,\n \"--hjm-card-pressed-opacity\": cardRecipe.interaction.pressedOpacity, ...props.style } as CSSProperties}\n >\n {backgroundMedia ? <div className=\"hjm-card__background\" aria-hidden=\"true\">{backgroundMedia}<span className=\"hjm-card__scrim\" /></div> : null}\n {backgroundInteraction === undefined ? null : <div className=\"hjm-card__background-interaction\" data-slot=\"background-interaction\">{backgroundInteraction}</div>}\n {mediaBadges === undefined ? null : <div className=\"hjm-card__media-badges\" data-slot=\"media-badges\">{mediaBadges}</div>}\n {media ? <div className=\"hjm-card__media\" data-slot=\"media\">{mediaAction ? <button type=\"button\" className=\"hjm-card__media-action\" aria-label={mediaAction.label} disabled={disabled} onClick={() => { if (!disabled) mediaAction.onActivate(); }}>\n {media}\n {mediaAction.icon ? <span className=\"hjm-card__media-icon\" aria-hidden=\"true\" style={{ insetInlineEnd: cardRecipe.mediaAction.inset, insetBlockEnd: cardRecipe.mediaAction.inset, width: cardRecipe.mediaAction.diameter, height: cardRecipe.mediaAction.diameter }}>{mediaAction.icon({ color: \"currentColor\", size: cardRecipe.mediaAction.iconSize })}</span> : null}\n </button> : media}</div> : null}\n <div\n className=\"hjm-card__body\"\n data-slot=\"body\"\n style={{ padding: surfaceGeometry.paddings[padding] }}\n >\n {badges === undefined ? null : <div className=\"hjm-card__badges\" data-slot=\"badges\">{badges}</div>}\n {hasHeader ? (\n <div className=\"hjm-card__header\" data-slot=\"header\">\n {leading === undefined ? null : (\n <span className=\"hjm-card__leading\" data-slot=\"leading\">\n {leading}\n </span>\n )}\n <div className=\"hjm-card__copy\">\n {title === undefined\n ? null\n : createElement(\n `h${headingLevel}`,\n { className: \"hjm-card__title\", \"data-slot\": \"title\" },\n title,\n )}\n {description === undefined ? null : (\n <Text\n as=\"p\"\n tone=\"muted\"\n className=\"hjm-card__description\"\n data-slot=\"description\"\n >\n {description}\n </Text>\n )}\n </div>\n {headerActions === undefined ? null : <div className=\"hjm-card__header-actions\" data-slot=\"header-actions\">{headerActions}</div>}\n </div>\n ) : null}\n {children === undefined ? null : (\n <div className=\"hjm-card__content\" data-slot=\"content\">{children}</div>\n )}\n </div>\n {destination}\n {overlay && href === undefined ? (\n <button\n type=\"button\"\n className=\"hjm-card__activator\"\n data-slot=\"activator\"\n aria-label={activationLabel}\n aria-pressed={selected}\n disabled={disabled}\n onClick={activate}\n />\n ) : null}\n {actions ? <div className=\"hjm-card__actions\" data-slot=\"actions\">{actions}</div> : null}\n </Surface>\n );\n});\n\n/** An attributed quotation reuses Card material while keeping quotation semantics and its caption together. */\nexport type QuoteCardProps = Omit<HTMLAttributes<HTMLElement>, \"children\" | \"title\"> & Readonly<{\n children: ReactNode;\n attribution?: string;\n renderMark?: (context: { color: string; size: number }) => ReactNode;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function QuoteCard({ children, attribution, renderMark, ...props }: QuoteCardProps) {\n return <Card {...props} leading={<span className=\"hjm-quote-card__mark\" aria-hidden=\"true\">{renderMark?.({ color: \"currentColor\", size: cardRecipe.quotation.markSize }) ?? \"“\"}</span>}>\n <blockquote className=\"hjm-quote-card__body\">\n {children}\n {attribution === undefined ? null : <footer><Text variant=\"caption\" tone=\"muted\">{attribution}</Text></footer>}\n </blockquote>\n </Card>;\n}\n\nexport type ListRowProps = Omit<HTMLAttributes<HTMLElement>, \"title\" | \"onClick\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Independent command outside the row's navigation target. */\n trailingAction?: ReactNode;\n /** Supply a framework Link without replacing the shared row layout. */\n renderLink?: (props: React.ComponentPropsWithRef<\"a\">) => ReactNode;\n density?: ListRowDensity;\n /** Semantic emphasis for destructive destinations; selection stays independent. */\n tone?: keyof typeof listRowRecipe.tones;\n /** Frame the ListRow paints around `leading`; the recipe owns its size. */\n leadingShape?: ListRowLeadingShape;\n selected?: boolean;\n disabled?: boolean;\n /**\n * Placeholder row while the real one loads. It keeps the row's own height\n * and slot geometry, so a list does not jump when the content arrives —\n * which is exactly what a product-owned skeleton next to the list cannot do.\n */\n loading?: boolean;\n /** Localized status text announced while `loading`. */\n loadingLabel?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLElement>;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const ListRow = forwardRef<HTMLElement, ListRowProps>(function ListRow(\n {\n title,\n description,\n leading,\n trailing,\n trailingAction,\n renderLink,\n density: densityProp,\n tone = listRowRecipe.defaults.tone,\n leadingShape = \"square\",\n selected,\n disabled = false,\n loading = false,\n loadingLabel,\n href,\n onClick,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n // The hook runs unconditionally — `??` would short-circuit it and break the\n // rules of hooks on the very first row that passes `density`.\n const densityDefault = useHjmDensityDefault({\n comfortable: listRowRecipe.defaults.density,\n compact: \"compact\",\n });\n const density = densityProp ?? densityDefault;\n if (loading) {\n // A loading row is never interactive: there is nothing to activate yet.\n return (\n <div\n {...props}\n ref={ref as React.Ref<HTMLDivElement>}\n role={loadingLabel ? \"status\" : undefined}\n aria-busy={loadingLabel ? true : undefined}\n aria-hidden={loadingLabel ? undefined : true}\n aria-label={loadingLabel}\n className={classNames(\"hjm-list-row\", \"hjm-list-row--loading\", className)}\n data-density={density}\n data-leading={leading ? \"\" : undefined}\n data-lines={description ? \"two\" : \"one\"}\n data-state=\"loading\"\n style={{ ...style, ...layoutStyle }}\n >\n {leading ? <span className=\"hjm-list-row__leading\" data-shape={leadingShape} data-placeholder=\"\" /> : null}\n <span className=\"hjm-list-row__content\">\n <span className=\"hjm-list-row__title\" data-placeholder=\"\" style={{ width: `${listRowRecipe.loading.titleWidthPercent}%` }} />\n {description ? <span className=\"hjm-list-row__description\" data-placeholder=\"\" style={{ width: `${listRowRecipe.loading.descriptionWidthPercent}%` }} /> : null}\n </span>\n {trailing ? <span className=\"hjm-list-row__trailing\" data-placeholder=\"\" style={{ width: listRowRecipe.loading.trailingWidth }} /> : null}\n </div>\n );\n }\n const element = href ? \"a\" : onClick ? \"button\" : \"div\";\n const interactiveProps = href\n ? {\n href: disabled ? undefined : href,\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-disabled\": disabled || undefined,\n tabIndex: disabled ? -1 : undefined,\n }\n : onClick\n ? {\n type: \"button\" as const,\n onClick: disabled ? undefined : onClick,\n disabled,\n \"aria-pressed\": selected,\n }\n : {};\n\n const row = createElement(\n element,\n {\n ...props,\n ...interactiveProps,\n ref,\n className: classNames(\"hjm-list-row\", className),\n \"data-density\": density,\n // Exposes the text column to the enclosing List: its indented separator starts after the leading frame\n // (listRecipe.separators.indented.leadingInsetStart) only when this row has one.\n \"data-leading\": leading ? \"\" : undefined,\n \"data-tone\": tone,\n // One- and two-line rows have different minimum heights in the recipe;\n // the web renderer used a single hardcoded value until now.\n \"data-lines\": description ? \"two\" : \"one\",\n \"data-state\": disabled ? \"disabled\" : selected ? \"selected\" : \"idle\",\n // Placement wins over the legacy `style`, matching Surface's ordering.\n // With trailingAction the frame is the placed root, as Native's outer View.\n style: trailingAction ? style : { ...style, ...layoutStyle },\n },\n leading\n ? <span className=\"hjm-list-row__leading\" data-shape={leadingShape}>{leading}</span>\n : null,\n <span className=\"hjm-list-row__content\">\n <span className=\"hjm-list-row__title\">{title}</span>\n {description ? (\n <span className=\"hjm-list-row__description\">{description}</span>\n ) : null}\n </span>,\n trailing ? <span className=\"hjm-list-row__trailing\">{trailing}</span> : null,\n );\n const linked = href && renderLink ? renderLink(row.props as React.ComponentPropsWithRef<\"a\">) : row;\n // The frame owns the row surface and its bleed so the command and the separate action share one fill, as Native;\n // the action stays outside the link/button (styles.css `.hjm-list-row-frame`).\n return trailingAction ? (\n <div className=\"hjm-list-row-frame\" data-density={density} data-leading={leading ? \"\" : undefined}\n data-state={disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"} style={layoutStyle}>\n {linked}\n <div className=\"hjm-list-row__action\">{trailingAction}</div>\n </div>\n ) : linked;\n});\n"]}
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,aAAa,GAOd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,oBAAoB,GAErB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,UAAU,GAEX,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,GAIhB,MAAM,sCA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C,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE;KAC7D,EACD,OAAO;QACL,CAAC,CAAC,eAAM,SAAS,EAAC,uBAAuB,gBAAa,YAAY,YAAG,OAAO,GAAQ;QACpF,CAAC,CAAC,IAAI,EACR,gBAAM,SAAS,EAAC,uBAAuB,aACrC,eAAM,SAAS,EAAC,qBAAqB,YAAE,KAAK,GAAQ,EACnD,WAAW,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,2BAA2B,YAAE,WAAW,GAAQ,CACjE,CAAC,CAAC,CAAC,IAAI,IACH,EACP,QAAQ,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,wBAAwB,YAAE,QAAQ,GAAQ,CAAC,CAAC,CAAC,IAAI,CAC7E,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,KAAyC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpG,iHAAiH;IACjH,+EAA+E;IAC/E,OAAO,cAAc,CAAC,CAAC,CAAC,CACtB,eAAK,SAAS,EAAC,oBAAoB,kBAAe,OAAO,kBAAgB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,gBACnF,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,aACrF,MAAM,EACP,cAAK,SAAS,EAAC,sBAAsB,YAAE,cAAc,GAAO,IACxD,CACP,CAAC,CAAC,CAAC,MAAM,CAAC;AACb,CAAC,CAAC,CAAC","sourcesContent":["import {\n badgeRecipe,\n listRowRecipe,\n type BadgeAdornmentContext,\n type BadgeSize,\n type BadgeTone,\n type BadgeVariant as ContractBadgeVariant,\n type ListRowDensity,\n type ListRowLeadingShape,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n resolveTagDescriptor,\n type TagTone,\n} from \"@hjmds/design-contracts/components/tag\";\nimport {\n cardRecipe,\n type CardHeadingLevel,\n} from \"@hjmds/design-contracts/components/card\";\nimport {\n surfaceGeometry,\n type SurfacePadding,\n type SurfaceRadius,\n type SurfaceTone,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n createElement,\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { useHjmDensityDefault } from \"./provider.js\";\nimport { Surface, Text } from \"./layout.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type { CardHeadingLevel } from \"@hjmds/design-contracts/components/card\";\nexport type { TagTone } from \"@hjmds/design-contracts/components/tag\";\nexport type BadgeVariant = ContractBadgeVariant;\n\nexport type BadgeProps = HTMLAttributes<HTMLSpanElement> &\n Readonly<{\n tone?: BadgeTone;\n size?: BadgeSize;\n variant?: BadgeVariant;\n leading?: ReactNode | ((context: BadgeAdornmentContext) => ReactNode);\n trailing?: ReactNode | ((context: BadgeAdornmentContext) => ReactNode);\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n {\n tone = badgeRecipe.defaults.tone,\n size = badgeRecipe.defaults.size,\n variant = badgeRecipe.defaults.variant,\n leading,\n trailing,\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n const iconContext = { color: \"currentColor\", size: badgeRecipe.sizes[size].iconSize };\n return (\n <span\n {...props}\n style={{ ...style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-badge\", className)}\n data-tone={tone}\n data-size={size}\n data-variant={variant}\n >\n {leading === undefined ? null : (\n <span aria-hidden=\"true\" className=\"hjm-badge__icon\">\n {typeof leading === \"function\" ? leading(iconContext) : leading}\n </span>\n )}\n <span className=\"hjm-badge__label\">{children}</span>\n {trailing === undefined ? null : (\n <span aria-hidden=\"true\" className=\"hjm-badge__icon\">{typeof trailing === \"function\" ? trailing(iconContext) : trailing}</span>\n )}\n </span>\n );\n});\n\nexport type TagProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n children: string;\n tone?: TagTone;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Tag = forwardRef<HTMLSpanElement, TagProps>(function Tag(\n { children, tone, className, layoutStyle, style, ...props },\n ref,\n) {\n const descriptor = resolveTagDescriptor({\n label: children,\n ...(tone === undefined ? {} : { tone }),\n });\n return (\n <span\n {...props}\n style={{ ...style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-tag\", className)}\n data-tone={descriptor.tone}\n >\n <span className=\"hjm-tag__label\">{descriptor.label}</span>\n </span>\n );\n});\n\nexport type CardProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> &\n Readonly<{\n title?: ReactNode;\n description?: ReactNode;\n leading?: ReactNode;\n media?: ReactNode;\n /** Decorative artwork behind the shared body/actions; its host determines the available height. */\n backgroundMedia?: ReactNode;\n /** Platform gesture/accessibility host behind content. Requires backgroundMedia; never put metadata/actions here. */\n backgroundInteraction?: ReactNode;\n /** Non-interactive cover classification at the shared top/end inset. Requires backgroundMedia. */\n mediaBadges?: ReactNode;\n badges?: ReactNode;\n /** Centre short metadata beneath artwork without product-owned badge layout. */\n badgesAlign?: \"start\" | \"center\";\n /** Activate only the passive cover; other card content/actions keep independent targets. */\n mediaAction?: Readonly<{ label: string; onActivate(): void; icon?: (context: Readonly<{ color: string; size: number }>) => ReactNode }>;\n actions?: ReactNode;\n /** Independent commands at the header end; never nested in whole-card activation. */\n headerActions?: ReactNode;\n headingLevel?: CardHeadingLevel;\n selected?: boolean;\n /**\n * Whole-card activation. With `actions`, the card stays an article and a separate full-card button sits under the\n * action region, so actions remain independent buttons (never a button inside a button). Keep other children passive.\n */\n onActivate?: () => void;\n /** A native anchor preserves new-tab, copy-link and browser previews; it is exclusive with onActivate. */\n href?: string;\n /** Framework routing and product effects can wrap the shared anchor without replacing its placement. */\n renderLink?: (props: React.ComponentPropsWithRef<\"a\">) => ReactNode;\n disabled?: boolean;\n tone?: SurfaceTone;\n bordered?: boolean;\n padding?: SurfacePadding;\n radius?: SurfaceRadius;\n /** Canonical layout-only placement; forwarded to the root Surface, which applies it. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card(\n {\n title,\n description,\n leading,\n media,\n backgroundMedia,\n backgroundInteraction,\n mediaBadges,\n badges,\n badgesAlign = cardRecipe.defaults.badgesAlign,\n mediaAction,\n actions,\n headerActions,\n headingLevel = cardRecipe.defaults.headingLevel,\n // An omitted selection is an ordinary action, not an unpressed toggle.\n selected,\n onActivate, href, renderLink,\n disabled = false,\n tone = cardRecipe.defaults.tone,\n bordered = cardRecipe.defaults.bordered,\n padding = cardRecipe.defaults.padding,\n radius,\n className,\n children,\n ...props\n },\n ref,\n) {\n if (href !== undefined && (!href.trim() || onActivate)) throw new TypeError(\"Card href requires a destination and cannot combine with onActivate\");\n if (renderLink && href === undefined) throw new TypeError(\"Card renderLink requires href\");\n if ((onActivate || href !== undefined) && !props[\"aria-label\"]?.trim()) {\n throw new TypeError(\"Interactive Card requires aria-label\");\n }\n if (mediaAction && (onActivate || href !== undefined || !media || !mediaAction.label.trim())) throw new TypeError(\"Card mediaAction requires passive media, a label, and no whole-card activation\");\n if (backgroundMedia && (media || mediaAction || onActivate || href !== undefined)) throw new TypeError(\"Card backgroundMedia is decorative and cannot combine with media, mediaAction, onActivate or href\");\n if ((backgroundInteraction !== undefined || mediaBadges !== undefined) && !backgroundMedia) throw new TypeError(\"Card backgroundInteraction/mediaBadges require backgroundMedia\");\n const hasHeader =\n leading !== undefined || title !== undefined || description !== undefined || headerActions !== undefined;\n // Whole-card open plus separate commands (2026-10-18 unairplane journey card: open + delete). A root button cannot\n // contain the action buttons, so the root stays an article and an overlay button carries the card's name and state.\n const overlay = href !== undefined || (onActivate !== undefined && Boolean(actions || headerActions));\n const { \"aria-label\": activationLabel, ...rootProps } = props;\n const activate = () => { if (!disabled) onActivate?.(); };\n\n const linkProps: React.ComponentPropsWithRef<\"a\"> = {\n href: disabled ? undefined : href, role: \"link\", className: \"hjm-card__activator\",\n \"aria-label\": activationLabel, \"aria-disabled\": disabled || undefined, tabIndex: disabled ? -1 : undefined,\n };\n // Link activation belongs to the shared card; a product-owned stretched link was its own second layout (Diairy).\n const destination = href === undefined ? null : !disabled && renderLink ? renderLink(linkProps) : <a {...linkProps} />;\n return (\n <Surface\n {...(overlay ? rootProps : props)}\n ref={ref}\n as={onActivate && !overlay ? \"button\" : \"article\"}\n {...(onActivate && !overlay ? {\n type: \"button\" as const, disabled, \"aria-pressed\": selected,\n \"data-interactive\": true, onClick: activate,\n } : {})}\n {...(overlay ? { \"data-activation\": \"overlay\" } : {})}\n tone={selected ? cardRecipe.selectedTone : tone}\n bordered={bordered}\n {...(radius === undefined ? {} : { radius })}\n className={classNames(\"hjm-card\", className)}\n data-background-media={backgroundMedia ? true : undefined}\n data-state={(onActivate || href !== undefined || mediaAction) && disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"}\n style={{ \"--hjm-card-background-scrim\": cardRecipe.backgroundMedia.scrim, \"--hjm-card-background-foreground\": cardRecipe.backgroundMedia.foreground, \"--hjm-card-disabled-opacity\": cardRecipe.interaction.disabledOpacity,\n \"--hjm-card-pressed-opacity\": cardRecipe.interaction.pressedOpacity, ...props.style } as CSSProperties}\n >\n {backgroundMedia ? <div className=\"hjm-card__background\" aria-hidden=\"true\">{backgroundMedia}<span className=\"hjm-card__scrim\" /></div> : null}\n {backgroundInteraction === undefined ? null : <div className=\"hjm-card__background-interaction\" data-slot=\"background-interaction\">{backgroundInteraction}</div>}\n {mediaBadges === undefined ? null : <div className=\"hjm-card__media-badges\" data-slot=\"media-badges\">{mediaBadges}</div>}\n {media ? <div className=\"hjm-card__media\" data-slot=\"media\">{mediaAction ? <button type=\"button\" className=\"hjm-card__media-action\" aria-label={mediaAction.label} disabled={disabled} onClick={() => { if (!disabled) mediaAction.onActivate(); }}>\n {media}\n {mediaAction.icon ? <span className=\"hjm-card__media-icon\" aria-hidden=\"true\" style={{ insetInlineEnd: cardRecipe.mediaAction.inset, insetBlockEnd: cardRecipe.mediaAction.inset, width: cardRecipe.mediaAction.diameter, height: cardRecipe.mediaAction.diameter }}>{mediaAction.icon({ color: \"currentColor\", size: cardRecipe.mediaAction.iconSize })}</span> : null}\n </button> : media}</div> : null}\n <div\n className=\"hjm-card__body\"\n data-slot=\"body\"\n style={{ padding: surfaceGeometry.paddings[padding] }}\n >\n {badges === undefined ? null : <div className=\"hjm-card__badges\" data-slot=\"badges\" data-align={badgesAlign}>{badges}</div>}\n {hasHeader ? (\n <div className=\"hjm-card__header\" data-slot=\"header\">\n {leading === undefined ? null : (\n <span className=\"hjm-card__leading\" data-slot=\"leading\">\n {leading}\n </span>\n )}\n <div className=\"hjm-card__copy\">\n {title === undefined\n ? null\n : createElement(\n `h${headingLevel}`,\n { className: \"hjm-card__title\", \"data-slot\": \"title\" },\n title,\n )}\n {description === undefined ? null : (\n <Text\n as=\"p\"\n tone=\"muted\"\n className=\"hjm-card__description\"\n data-slot=\"description\"\n >\n {description}\n </Text>\n )}\n </div>\n {headerActions === undefined ? null : <div className=\"hjm-card__header-actions\" data-slot=\"header-actions\">{headerActions}</div>}\n </div>\n ) : null}\n {children === undefined ? null : (\n <div className=\"hjm-card__content\" data-slot=\"content\">{children}</div>\n )}\n </div>\n {destination}\n {overlay && href === undefined ? (\n <button\n type=\"button\"\n className=\"hjm-card__activator\"\n data-slot=\"activator\"\n aria-label={activationLabel}\n aria-pressed={selected}\n disabled={disabled}\n onClick={activate}\n />\n ) : null}\n {actions ? <div className=\"hjm-card__actions\" data-slot=\"actions\">{actions}</div> : null}\n </Surface>\n );\n});\n\n/** An attributed quotation reuses Card material while keeping quotation semantics and its caption together. */\nexport type QuoteCardProps = Omit<HTMLAttributes<HTMLElement>, \"children\" | \"title\"> & Readonly<{\n children: ReactNode;\n attribution?: string;\n renderMark?: (context: { color: string; size: number }) => ReactNode;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function QuoteCard({ children, attribution, renderMark, ...props }: QuoteCardProps) {\n return <Card {...props} leading={<span className=\"hjm-quote-card__mark\" aria-hidden=\"true\">{renderMark?.({ color: \"currentColor\", size: cardRecipe.quotation.markSize }) ?? \"“\"}</span>}>\n <blockquote className=\"hjm-quote-card__body\">\n {children}\n {attribution === undefined ? null : <footer><Text variant=\"caption\" tone=\"muted\">{attribution}</Text></footer>}\n </blockquote>\n </Card>;\n}\n\nexport type ListRowProps = Omit<HTMLAttributes<HTMLElement>, \"title\" | \"onClick\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Independent command outside the row's navigation target. */\n trailingAction?: ReactNode;\n /** Supply a framework Link without replacing the shared row layout. */\n renderLink?: (props: React.ComponentPropsWithRef<\"a\">) => ReactNode;\n density?: ListRowDensity;\n /** Semantic emphasis for destructive destinations; selection stays independent. */\n tone?: keyof typeof listRowRecipe.tones;\n /** Frame the ListRow paints around `leading`; the recipe owns its size. */\n leadingShape?: ListRowLeadingShape;\n selected?: boolean;\n disabled?: boolean;\n /**\n * Placeholder row while the real one loads. It keeps the row's own height\n * and slot geometry, so a list does not jump when the content arrives —\n * which is exactly what a product-owned skeleton next to the list cannot do.\n */\n loading?: boolean;\n /** Localized status text announced while `loading`. */\n loadingLabel?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLElement>;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const ListRow = forwardRef<HTMLElement, ListRowProps>(function ListRow(\n {\n title,\n description,\n leading,\n trailing,\n trailingAction,\n renderLink,\n density: densityProp,\n tone = listRowRecipe.defaults.tone,\n leadingShape = \"square\",\n selected,\n disabled = false,\n loading = false,\n loadingLabel,\n href,\n onClick,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n // The hook runs unconditionally — `??` would short-circuit it and break the\n // rules of hooks on the very first row that passes `density`.\n const densityDefault = useHjmDensityDefault({\n comfortable: listRowRecipe.defaults.density,\n compact: \"compact\",\n });\n const density = densityProp ?? densityDefault;\n if (loading) {\n // A loading row is never interactive: there is nothing to activate yet.\n return (\n <div\n {...props}\n ref={ref as React.Ref<HTMLDivElement>}\n role={loadingLabel ? \"status\" : undefined}\n aria-busy={loadingLabel ? true : undefined}\n aria-hidden={loadingLabel ? undefined : true}\n aria-label={loadingLabel}\n className={classNames(\"hjm-list-row\", \"hjm-list-row--loading\", className)}\n data-density={density}\n data-leading={leading ? \"\" : undefined}\n data-lines={description ? \"two\" : \"one\"}\n data-state=\"loading\"\n style={{ ...style, ...layoutStyle }}\n >\n {leading ? <span className=\"hjm-list-row__leading\" data-shape={leadingShape} data-placeholder=\"\" /> : null}\n <span className=\"hjm-list-row__content\">\n <span className=\"hjm-list-row__title\" data-placeholder=\"\" style={{ width: `${listRowRecipe.loading.titleWidthPercent}%` }} />\n {description ? <span className=\"hjm-list-row__description\" data-placeholder=\"\" style={{ width: `${listRowRecipe.loading.descriptionWidthPercent}%` }} /> : null}\n </span>\n {trailing ? <span className=\"hjm-list-row__trailing\" data-placeholder=\"\" style={{ width: listRowRecipe.loading.trailingWidth }} /> : null}\n </div>\n );\n }\n const element = href ? \"a\" : onClick ? \"button\" : \"div\";\n const interactiveProps = href\n ? {\n href: disabled ? undefined : href,\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-disabled\": disabled || undefined,\n tabIndex: disabled ? -1 : undefined,\n }\n : onClick\n ? {\n type: \"button\" as const,\n onClick: disabled ? undefined : onClick,\n disabled,\n \"aria-pressed\": selected,\n }\n : {};\n\n const row = createElement(\n element,\n {\n ...props,\n ...interactiveProps,\n ref,\n className: classNames(\"hjm-list-row\", className),\n \"data-density\": density,\n // Exposes the text column to the enclosing List: its indented separator starts after the leading frame\n // (listRecipe.separators.indented.leadingInsetStart) only when this row has one.\n \"data-leading\": leading ? \"\" : undefined,\n \"data-tone\": tone,\n // One- and two-line rows have different minimum heights in the recipe;\n // the web renderer used a single hardcoded value until now.\n \"data-lines\": description ? \"two\" : \"one\",\n \"data-state\": disabled ? \"disabled\" : selected ? \"selected\" : \"idle\",\n // Placement wins over the legacy `style`, matching Surface's ordering.\n // With trailingAction the frame is the placed root, as Native's outer View.\n style: trailingAction ? style : { ...style, ...layoutStyle },\n },\n leading\n ? <span className=\"hjm-list-row__leading\" data-shape={leadingShape}>{leading}</span>\n : null,\n <span className=\"hjm-list-row__content\">\n <span className=\"hjm-list-row__title\">{title}</span>\n {description ? (\n <span className=\"hjm-list-row__description\">{description}</span>\n ) : null}\n </span>,\n trailing ? <span className=\"hjm-list-row__trailing\">{trailing}</span> : null,\n );\n const linked = href && renderLink ? renderLink(row.props as React.ComponentPropsWithRef<\"a\">) : row;\n // The frame owns the row surface and its bleed so the command and the separate action share one fill, as Native;\n // the action stays outside the link/button (styles.css `.hjm-list-row-frame`).\n return trailingAction ? (\n <div className=\"hjm-list-row-frame\" data-density={density} data-leading={leading ? \"\" : undefined}\n data-state={disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"} style={layoutStyle}>\n {linked}\n <div className=\"hjm-list-row__action\">{trailingAction}</div>\n </div>\n ) : linked;\n});\n"]}
|
package/dist/evidence.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export type ReactRendererEvidenceManifest = Readonly<{
|
|
|
34
34
|
export declare const reactRendererEvidence: {
|
|
35
35
|
readonly schemaVersion: 2;
|
|
36
36
|
readonly packageName: "@hjmds/react";
|
|
37
|
-
readonly packageVersion: "1.
|
|
37
|
+
readonly packageVersion: "1.38.1";
|
|
38
38
|
readonly surface: "web";
|
|
39
39
|
readonly components: Readonly<{
|
|
40
40
|
/** Canonical component id from the design-contracts catalog. */
|
package/dist/evidence.js
CHANGED
|
@@ -135,7 +135,7 @@ const activeWebEntries = componentCatalog.filter((entry) => {
|
|
|
135
135
|
export const reactRendererEvidence = {
|
|
136
136
|
schemaVersion: reactRendererEvidenceSchemaVersion,
|
|
137
137
|
packageName: "@hjmds/react",
|
|
138
|
-
packageVersion: "1.
|
|
138
|
+
packageVersion: "1.38.1",
|
|
139
139
|
surface: "web",
|
|
140
140
|
components: activeWebEntries.map(derivedClaim),
|
|
141
141
|
};
|