@hjmds/react 1.46.1 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/actions.d.ts +2 -2
  2. package/dist/activity-chip.d.ts +1 -1
  3. package/dist/advanced-display.d.ts +6 -0
  4. package/dist/advanced-display.d.ts.map +1 -1
  5. package/dist/advanced-display.js +4 -2
  6. package/dist/advanced-display.js.map +1 -1
  7. package/dist/advanced-forms.d.ts +2 -2
  8. package/dist/auth-screen.d.ts +1 -1
  9. package/dist/bottom-navigation.d.ts.map +1 -1
  10. package/dist/bottom-navigation.js +1 -1
  11. package/dist/bottom-navigation.js.map +1 -1
  12. package/dist/calendar.d.ts.map +1 -1
  13. package/dist/calendar.js +31 -24
  14. package/dist/calendar.js.map +1 -1
  15. package/dist/carousel.d.ts +5 -1
  16. package/dist/carousel.d.ts.map +1 -1
  17. package/dist/carousel.js +2 -2
  18. package/dist/carousel.js.map +1 -1
  19. package/dist/clipboard.d.ts +2 -2
  20. package/dist/color-picker.d.ts +33 -3
  21. package/dist/color-picker.d.ts.map +1 -1
  22. package/dist/color-picker.js +73 -10
  23. package/dist/color-picker.js.map +1 -1
  24. package/dist/communication.d.ts +6 -1
  25. package/dist/communication.d.ts.map +1 -1
  26. package/dist/communication.js +2 -2
  27. package/dist/communication.js.map +1 -1
  28. package/dist/conversation-row.d.ts +7 -1
  29. package/dist/conversation-row.d.ts.map +1 -1
  30. package/dist/conversation-row.js +4 -2
  31. package/dist/conversation-row.js.map +1 -1
  32. package/dist/date-range.d.ts +24 -3
  33. package/dist/date-range.d.ts.map +1 -1
  34. package/dist/date-range.js +38 -17
  35. package/dist/date-range.js.map +1 -1
  36. package/dist/display.d.ts +28 -0
  37. package/dist/display.d.ts.map +1 -1
  38. package/dist/display.js +11 -9
  39. package/dist/display.js.map +1 -1
  40. package/dist/evidence.d.ts +1 -1
  41. package/dist/evidence.js +1 -1
  42. package/dist/evidence.js.map +1 -1
  43. package/dist/feedback.d.ts +1 -1
  44. package/dist/floating-action-button.d.ts +1 -1
  45. package/dist/follow-list.d.ts +58 -0
  46. package/dist/follow-list.d.ts.map +1 -0
  47. package/dist/follow-list.js +25 -0
  48. package/dist/follow-list.js.map +1 -0
  49. package/dist/forms.d.ts +3 -3
  50. package/dist/image-viewer.d.ts +1 -1
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js.map +1 -1
  54. package/dist/internal/calendar-paint.d.ts +12 -0
  55. package/dist/internal/calendar-paint.d.ts.map +1 -0
  56. package/dist/internal/calendar-paint.js +3 -0
  57. package/dist/internal/calendar-paint.js.map +1 -0
  58. package/dist/internal/identity-action.d.ts +12 -0
  59. package/dist/internal/identity-action.d.ts.map +1 -0
  60. package/dist/internal/identity-action.js +10 -0
  61. package/dist/internal/identity-action.js.map +1 -0
  62. package/dist/internal.d.ts +1 -1
  63. package/dist/layout.d.ts +1 -1
  64. package/dist/overlays.d.ts +4 -0
  65. package/dist/overlays.d.ts.map +1 -1
  66. package/dist/overlays.js +3 -3
  67. package/dist/overlays.js.map +1 -1
  68. package/dist/provider-button.d.ts +1 -1
  69. package/dist/public-exports.generated.d.ts +3 -0
  70. package/dist/public-exports.generated.d.ts.map +1 -1
  71. package/dist/public-exports.generated.js +9 -0
  72. package/dist/public-exports.generated.js.map +1 -1
  73. package/dist/screen-flows.d.ts +33 -4
  74. package/dist/screen-flows.d.ts.map +1 -1
  75. package/dist/screen-flows.js +25 -10
  76. package/dist/screen-flows.js.map +1 -1
  77. package/dist/screens.d.ts +38 -6
  78. package/dist/screens.d.ts.map +1 -1
  79. package/dist/screens.js +26 -12
  80. package/dist/screens.js.map +1 -1
  81. package/dist/selection.d.ts +1 -1
  82. package/dist/social-compositions.d.ts +10 -0
  83. package/dist/social-compositions.d.ts.map +1 -1
  84. package/dist/social-compositions.js +3 -2
  85. package/dist/social-compositions.js.map +1 -1
  86. package/dist/styles.css +108 -46
  87. package/dist/styles.layered.css +108 -46
  88. package/dist/toast.d.ts +1 -1
  89. package/dist/top-bar.d.ts +1 -1
  90. package/package.json +8 -3
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-row.js","sourceRoot":"","sources":["../src/conversation-row.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMnC,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,EAAwB;IACxG,kFAAkF;IAClF,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,OAAO,+BAAkB,MAAM,+BAA2B,MAAM,iBAAc,MAAM,IAAI,SAAS,EAC/F,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,CAAC,GAAG,EAAC,aAAa,EAAC,MAAM,CAAC,aAAa,EAAC,YAAY,EAAC,MAAM,CAAC,YAAY,EAAC,QAAQ,EAAC,CAAC,EAAC,KAAK,EAAC,MAAM,EAAC,SAAS,EAAC,YAAY,EAAC,aAC7K,eAAM,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAC,KAAK,EAAC,MAAM,CAAC,UAAU,EAAC,MAAM,EAAC,MAAM,CAAC,UAAU,EAAC,UAAU,EAAC,CAAC,EAAC,YAAY,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAG,MAAM,GAAQ,EAC7L,gBAAM,KAAK,E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CAAC,QAAQ,GAAQ,CAAC,CAAC,CAAC,IAAI,IAChU,IACF,EACN,MAAM,CAAA,CAAC,CAAA,sCAA0B,MAAM,EAAC,KAAK,EAAE,EAAC,KAAK,EAAC,MAAM,CAAC,UAAU,EAAC,MAAM,EAAC,MAAM,CAAC,UAAU,EAAC,UAAU,EAAC,CAAC,EAAC,YAAY,EAAC,KAAK,EAAC,UAAU,EAAC,gCAAgC,EAAC,GAAG,CAAA,CAAC,CAAA,IAAI,IACjL,CAAC;AACV,CAAC","sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { conversationRowRecipe as recipe } from \"@hjmds/design-contracts/conversation-row\";\nimport { Text } from \"./layout.js\";\n\nexport type ConversationRowProps = Readonly<{\n title: string; preview: string; metadata: string; avatar: ReactNode; unread?: boolean;\n}>;\n\n/** Presentation inside a router-owned link: the host supplies its full accessible name. */\nexport function ConversationRow({ title, preview, metadata, avatar, unread = false }: ConversationRowProps) {\n // Separators join visible fields; a missing preview must not leave a leading dot.\n const hasPreview = preview.trim().length > 0;\n const hasMetadata = metadata.trim().length > 0;\n return <span aria-hidden=\"true\" data-hjm-conversation-row=\"true\" data-unread={unread || undefined}\n style={{display:\"flex\",alignItems:\"center\",gap:recipe.gap,paddingInline:recipe.paddingInline,paddingBlock:recipe.paddingBlock,minWidth:0,width:\"100%\",boxSizing:\"border-box\"}}>\n <span style={{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:recipe.avatarSize,height:recipe.avatarSize,flexShrink:0,borderRadius:\"50%\",overflow:\"hidden\"}}>{avatar}</span>\n <span style={{display:\"flex\",flexDirection:\"column\",gap:recipe.contentGap,flex:1,minWidth:0}}>\n <Text style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadTitleWeight:recipe.titleWeight}}>{title}</Text>\n <span style={{display:\"flex\",minWidth:0}}>\n {hasPreview ? <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{preview}</Text> : null}\n {hasMetadata ? <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{flexShrink:0,/* \"pre\": flex items drop the leading space of \" · \" (2026-10-17 comparison); still no wrap. */whiteSpace:\"pre\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{hasPreview ? ` · ${metadata}` : metadata}</Text> : null}\n </span>\n </span>\n {unread?<span data-hjm-unread-dot=\"true\" style={{width:recipe.unreadSize,height:recipe.unreadSize,flexShrink:0,borderRadius:\"50%\",background:\"var(--hjm-color-content-brand)\"}}/>:null}\n </span>;\n}\n"]}
1
+ {"version":3,"file":"conversation-row.js","sourceRoot":"","sources":["../src/conversation-row.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AASnC,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,EAAwB;IAClI,kFAAkF;IAClF,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,gBAAM,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,CAAC,GAAG,EAAC,IAAI,EAAC,CAAC,EAAC,QAAQ,EAAC,CAAC,EAAC,aA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EAAC,MAAM,EAAC,MAAM,CAAC,UAAU,EAAC,UAAU,EAAC,CAAC,EAAC,YAAY,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAG,MAAM,GAAQ,EACre,UAAU,CAAA,CAAC,CAAA,UAAU,CAAC,IAAI,CAAC,CAAA,CAAC,CAAA,IAAI,IAC5B,CAAC;AACV,CAAC","sourcesContent":["\"use client\";\n\nimport { IdentityAction } from \"./internal/identity-action.js\";\nimport type { ReactNode } from \"react\";\nimport { conversationRowRecipe as recipe } from \"@hjmds/design-contracts/conversation-row\";\nimport { Text } from \"./layout.js\";\n\nexport type ConversationRowProps = Readonly<{\n title: string; preview: string; metadata: string; avatar: ReactNode; unread?: boolean;\n avatarAction?: Readonly<{label:string;onPress():void}>;\n /** Router host for the body, separate from the member avatar destination. */\n renderBody?: (body:ReactNode)=>ReactNode;\n}>;\n\n/** Presentation inside a router-owned link: the host supplies its full accessible name. */\nexport function ConversationRow({ title, preview, metadata, avatar, avatarAction, renderBody, unread = false }: ConversationRowProps) {\n // Separators join visible fields; a missing preview must not leave a leading dot.\n const hasPreview = preview.trim().length > 0;\n const hasMetadata = metadata.trim().length > 0;\n const body = <span style={{display:\"flex\",alignItems:\"center\",gap:recipe.gap,flex:1,minWidth:0}}>\n <span style={{display:\"flex\",flexDirection:\"column\",gap:recipe.contentGap,flex:1,minWidth:0}}>\n <Text style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadTitleWeight:recipe.titleWeight}}>{title}</Text>\n <span style={{display:\"flex\",minWidth:0}}>\n {hasPreview ? <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{preview}</Text> : null}\n {hasMetadata ? <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{flexShrink:0,/* \"pre\": flex items drop the leading space of \" · \" (2026-10-17 comparison); still no wrap. */whiteSpace:\"pre\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{hasPreview ? ` · ${metadata}` : metadata}</Text> : null}\n </span>\n </span>\n {unread?<span data-hjm-unread-dot=\"true\" style={{width:recipe.unreadSize,height:recipe.unreadSize,flexShrink:0,borderRadius:\"50%\",background:\"var(--hjm-color-content-brand)\"}}/>:null}\n </span>;\n return <span aria-hidden={renderBody||avatarAction?undefined:true} data-hjm-conversation-row=\"true\" data-unread={unread || undefined}\n style={{display:\"flex\",alignItems:\"center\",gap:recipe.gap,paddingInline:recipe.paddingInline,paddingBlock:recipe.paddingBlock,minWidth:0,width:\"100%\",boxSizing:\"border-box\"}}>\n {avatarAction?<IdentityAction action={avatarAction}><span aria-hidden=\"true\" style={{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:recipe.avatarSize,height:recipe.avatarSize,flexShrink:0,borderRadius:\"50%\",overflow:\"hidden\"}}>{avatar}</span></IdentityAction>:<span aria-hidden=\"true\" style={{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:recipe.avatarSize,height:recipe.avatarSize,flexShrink:0,borderRadius:\"50%\",overflow:\"hidden\"}}>{avatar}</span>}\n {renderBody?renderBody(body):body}\n </span>;\n}\n"]}
@@ -1,11 +1,25 @@
1
- import { type DateRangeValue } from "@hjmds/design-contracts/components/date-range";
1
+ import { type DateRangeLimit, type DateRangePresetLength, type DateRangeValue } from "@hjmds/design-contracts/components/date-range";
2
2
  import type { CalendarDescriptor, ComposeCalendarAccessibleName } from "@hjmds/design-contracts/components/calendar";
3
3
  import { type ReactNode } from "react";
4
4
  import { type CalendarMonthAction } from "./calendar.js";
5
5
  import type { HjmCompositionStyleProp } from "./composition-style.js";
6
+ export type DateRangeSummary = Readonly<{
7
+ startLabel: string;
8
+ endLabel: string;
9
+ /** Shown in a field whose date is not chosen yet. */
10
+ placeholder: string;
11
+ formatDate: (date: string) => string;
12
+ }>;
13
+ /** A shortcut such as "최근 7일" or "1개월" that ends on the grid's `todayDate`. */
14
+ export type DateRangePresetOption = Readonly<{
15
+ id: string;
16
+ label: string;
17
+ length: DateRangePresetLength;
18
+ }>;
19
+ type RangeCalendarDescriptor<T> = T extends unknown ? Omit<T, "selectedDate" | "defaultSelectedDate" | "onSelectionChange"> : never;
6
20
  export type DateRangePickerProps<Content = unknown> = Readonly<{
7
21
  /** The same grid Calendar renders; the product still owns month data. */
8
- descriptor: Omit<CalendarDescriptor<Content>, "selectedDate" | "defaultSelectedDate" | "onSelectionChange">;
22
+ descriptor: RangeCalendarDescriptor<CalendarDescriptor<Content>>;
9
23
  composeAccessibleName: ComposeCalendarAccessibleName<Content>;
10
24
  value?: DateRangeValue;
11
25
  defaultValue?: DateRangeValue;
@@ -18,10 +32,17 @@ export type DateRangePickerProps<Content = unknown> = Readonly<{
18
32
  end: string;
19
33
  between: string;
20
34
  }>;
35
+ /** Inclusive calendar span; one year by default, null removes the limit. */
36
+ maxRange?: DateRangeLimit | null;
21
37
  renderCellContent?: (date: string) => ReactNode;
38
+ /** Start/end fields above the grid; the edge the next tap sets is marked (replaces a hint sentence). */
39
+ summary?: DateRangeSummary;
40
+ /** Shortcut chips between the summary and the grid; each ends on `descriptor.grid.todayDate`. */
41
+ presets?: readonly DateRangePresetOption[];
22
42
  className?: string;
23
43
  /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */
24
44
  layoutStyle?: HjmCompositionStyleProp;
25
45
  }>;
26
- export declare function DateRangePicker<Content = unknown>({ descriptor, composeAccessibleName, value: controlledValue, defaultValue, onValueChange, previousMonth, nextMonth, rangeLabels, renderCellContent, className, layoutStyle, }: DateRangePickerProps<Content>): import("react").JSX.Element;
46
+ export declare function DateRangePicker<Content = unknown>({ descriptor, composeAccessibleName, value: controlledValue, defaultValue, onValueChange, previousMonth, nextMonth, rangeLabels, maxRange, renderCellContent, summary, presets, className, layoutStyle, }: DateRangePickerProps<Content>): import("react").JSX.Element;
47
+ export {};
27
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-runtime";
3
- import { emptyDateRange, isCompleteDateRange, resolveDateRangeCellState, resolveDateRangeSelection, validateDateRange, } from "@hjmds/design-contracts/components/date-range";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { dateRangeRecipe, emptyDateRange, defaultDateRangeLimit, isDateWithinRangeLimit, isCompleteDateRange, resolveDateRangeActiveEdge, resolveDateRangeCellPaint, resolveDateRangeCellState, resolveDateRangePreset, resolveDateRangeSelection, validateDateRange, } from "@hjmds/design-contracts/components/date-range";
4
4
  import { useState } from "react";
5
5
  import { Calendar } from "./calendar.js";
6
6
  import { classNames, useControllableState } from "./internal.js";
7
- export function DateRangePicker({ descriptor, composeAccessibleName, value: controlledValue, defaultValue, onValueChange, previousMonth, nextMonth, rangeLabels, renderCellContent, className, layoutStyle, }) {
7
+ import { CalendarPaintContext } from "./internal/calendar-paint.js";
8
+ import { Chip } from "./selection.js";
9
+ export function DateRangePicker({ descriptor, composeAccessibleName, value: controlledValue, defaultValue, onValueChange, previousMonth, nextMonth, rangeLabels, maxRange = defaultDateRangeLimit, renderCellContent, summary, presets, className, layoutStyle, }) {
8
10
  const [value, setValue] = useControllableState({
9
11
  ...(controlledValue === undefined ? {} : { value: controlledValue }),
10
12
  defaultValue: defaultValue ?? emptyDateRange,
11
13
  ...(onValueChange === undefined ? {} : { onChange: onValueChange }),
12
14
  });
13
- validateDateRange(value);
15
+ validateDateRange(value, maxRange);
14
16
  // The hovered date previews the not-yet-committed end through the same cell
15
17
  // state function the committed range uses.
16
- const [hovered, setHovered] = useState(null);
17
- return (_jsx("div", { style: layoutStyle, className: classNames("hjm-date-range", className), "data-selecting": value.start !== null && value.end === null ? "" : undefined, "data-complete": isCompleteDateRange(value) || undefined, onMouseLeave: () => setHovered(null), children: _jsx(Calendar, { descriptor: {
18
- ...descriptor,
19
- // Calendar keeps single selection: the range's own edges are painted
20
- // through cell content and data attributes, not by lying to it.
21
- selectedDate: value.end ?? value.start,
22
- onSelectionChange: (date) => { if (date !== null)
23
- setValue(resolveDateRangeSelection(value, date)); },
24
- }, composeAccessibleName: (info) => {
25
- const state = resolveDateRangeCellState(value, info.date, hovered);
26
- const base = composeAccessibleName(info);
27
- return state === "none" ? base : `${base}, ${rangeLabels[state]}`;
28
- }, ...(previousMonth === undefined ? {} : { previousMonth }), ...(nextMonth === undefined ? {} : { nextMonth }), renderCellContent: (cell) => (_jsx("span", { className: "hjm-date-range__cell", "data-range": resolveDateRangeCellState(value, cell.date, hovered), onMouseEnter: () => setHovered(cell.date), children: renderCellContent?.(cell.date) ?? null })) }) }));
18
+ const [pointer, setPointer] = useState(null);
19
+ const hovered = pointer !== null && isDateWithinRangeLimit(value, pointer, maxRange) ? pointer : null;
20
+ const activeEdge = resolveDateRangeActiveEdge(value);
21
+ const field = (edge) => {
22
+ const date = value[edge];
23
+ return (_jsxs("div", { className: "hjm-date-range__field", "data-active": activeEdge === edge || undefined, "data-empty": date === null || undefined, children: [_jsx("span", { className: "hjm-date-range__field-label", children: edge === "start" ? summary.startLabel : summary.endLabel }), _jsx("span", { className: "hjm-date-range__field-value", children: date === null ? summary.placeholder : summary.formatDate(date) })] }, edge));
24
+ };
25
+ return (_jsxs("div", { style: layoutStyle, className: classNames("hjm-date-range", className), "data-selecting": value.start !== null && value.end === null ? "" : undefined, "data-complete": isCompleteDateRange(value) || undefined, onMouseLeave: () => setPointer(null), children: [summary ? _jsxs("div", { className: "hjm-date-range__summary", children: [field("start"), field("end")] }) : null, presets?.length ? (_jsx("div", { className: "hjm-date-range__presets", children: presets.map((preset) => {
26
+ const range = resolveDateRangePreset(descriptor.grid.todayDate, preset.length);
27
+ return (_jsx(Chip, { label: preset.label, size: dateRangeRecipe.presets.chipSize, selectionMode: "single", selected: range.start === value.start && range.end === value.end, onSelectedChange: () => {
28
+ validateDateRange(range, maxRange);
29
+ setValue(range);
30
+ // A preset ends today; bring its end month into view like a jump, so the band is visible.
31
+ const month = range.end.slice(0, 7);
32
+ if (descriptor.focusedMonth !== month)
33
+ descriptor.onFocusedMonthChange?.(month, "jump");
34
+ } }, preset.id));
35
+ }) })) : null, _jsx(CalendarPaintContext.Provider, { value: { paint: (date) => resolveDateRangeCellPaint(value, date, hovered), onDayHover: setPointer }, children: _jsx(Calendar, { descriptor: {
36
+ ...descriptor,
37
+ // The range owns eligibility; Calendar keeps the same disabled-day interaction contract.
38
+ grid: { ...descriptor.grid, cells: descriptor.grid.cells.map(cell => cell.date === undefined ? cell :
39
+ { ...cell, disabled: cell.disabled === true || !isDateWithinRangeLimit(value, cell.date, maxRange) }) },
40
+ // Calendar keeps single selection; the two edges and the band are painted through the internal
41
+ // paint context, and each day's name carries the range position for assistive tech.
42
+ selectedDate: value.end ?? value.start,
43
+ onSelectionChange: (date) => { if (date !== null)
44
+ setValue(resolveDateRangeSelection(value, date, maxRange)); },
45
+ }, composeAccessibleName: (info) => {
46
+ const state = resolveDateRangeCellState(value, info.date, hovered);
47
+ const base = composeAccessibleName(info);
48
+ return state === "none" ? base : `${base}, ${rangeLabels[state]}`;
49
+ }, ...(previousMonth === undefined ? {} : { previousMonth }), ...(nextMonth === undefined ? {} : { nextMonth }), ...(renderCellContent === undefined ? {} : { renderCellContent: (cell) => renderCellContent(cell.date) }) }) })] }));
29
50
  }
30
51
  //# sourceMappingURL=date-range.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-range.js","sourceRoot":"","sources":["../src/date-range.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,GAElB,MAAM,+CAA+C,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,QAAQ,EAA4B,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAoBjE,MAAM,UAAU,eAAe,CAAoB,EACjD,UAAU,EACV,qBAAq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C,CAAC,CAAC,CAAC,CAAC;aACvE,EAChC,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC9B,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACnE,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;gBACzC,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACpE,CAAC,KACG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,KACtD,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAClD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,eACE,SAAS,EAAC,sBAAsB,gBACpB,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAChE,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAExC,iBAAiB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,GAClC,CACR,GACD,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport {\n emptyDateRange,\n isCompleteDateRange,\n resolveDateRangeCellState,\n resolveDateRangeSelection,\n validateDateRange,\n type DateRangeValue,\n} from \"@hjmds/design-contracts/components/date-range\";\nimport type {\n CalendarDescriptor,\n ComposeCalendarAccessibleName,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport { useState, type ReactNode } from \"react\";\nimport { Calendar, type CalendarMonthAction } from \"./calendar.js\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type DateRangePickerProps<Content = unknown> = Readonly<{\n /** The same grid Calendar renders; the product still owns month data. */\n descriptor: Omit<CalendarDescriptor<Content>, \"selectedDate\" | \"defaultSelectedDate\" | \"onSelectionChange\">;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n value?: DateRangeValue;\n defaultValue?: DateRangeValue;\n onValueChange?: (value: DateRangeValue) => void;\n previousMonth?: CalendarMonthAction;\n nextMonth?: CalendarMonthAction;\n /** Localized suffixes appended to a day's name when it is a range edge. */\n rangeLabels: Readonly<{ start: string; end: string; between: string }>;\n renderCellContent?: (date: string) => ReactNode;\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function DateRangePicker<Content = unknown>({\n descriptor,\n composeAccessibleName,\n value: controlledValue,\n defaultValue,\n onValueChange,\n previousMonth,\n nextMonth,\n rangeLabels,\n renderCellContent,\n className,\n layoutStyle,\n}: DateRangePickerProps<Content>) {\n const [value, setValue] = useControllableState<DateRangeValue>({\n ...(controlledValue === undefined ? {} : { value: controlledValue }),\n defaultValue: defaultValue ?? emptyDateRange,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n validateDateRange(value);\n // The hovered date previews the not-yet-committed end through the same cell\n // state function the committed range uses.\n const [hovered, setHovered] = useState<string | null>(null);\n\n return (\n <div\n style={layoutStyle}\n className={classNames(\"hjm-date-range\", className)}\n data-selecting={value.start !== null && value.end === null ? \"\" : undefined}\n data-complete={isCompleteDateRange(value) || undefined}\n onMouseLeave={() => setHovered(null)}\n >\n <Calendar<Content>\n descriptor={{\n ...descriptor,\n // Calendar keeps single selection: the range's own edges are painted\n // through cell content and data attributes, not by lying to it.\n selectedDate: value.end ?? value.start,\n onSelectionChange: (date) => { if (date !== null) setValue(resolveDateRangeSelection(value, date)); },\n } as CalendarDescriptor<Content>}\n composeAccessibleName={(info) => {\n const state = resolveDateRangeCellState(value, info.date, hovered);\n const base = composeAccessibleName(info);\n return state === \"none\" ? base : `${base}, ${rangeLabels[state]}`;\n }}\n {...(previousMonth === undefined ? {} : { previousMonth })}\n {...(nextMonth === undefined ? {} : { nextMonth })}\n renderCellContent={(cell) => (\n <span\n className=\"hjm-date-range__cell\"\n data-range={resolveDateRangeCellState(value, cell.date, hovered)}\n onMouseEnter={() => setHovered(cell.date)}\n >\n {renderCellContent?.(cell.date) ?? null}\n </span>\n )}\n />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"date-range.js","sourceRoot":"","sources":["../src/date-range.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EAEtB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EAEtB,yBAAyB,EACzB,iBAAiB,GAElB,MAAM,+CAA+C,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,QAAQ,EAA4B,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAwCtC,MAAM,UAAU,eAAe,CAAoB,EACjD,UAAU,EACV,qBAAqB,EACrB,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,GAAG,qBAAqB,EAChC,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,WAAW,GACmB;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,oBAAoB,CAAiB;QAC7D,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,E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AI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBACpE,CAAC,KACG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,KACtD,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAC9C,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAC5H,GAC4B,IAC5B,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport {\n dateRangeRecipe,\n emptyDateRange,\n defaultDateRangeLimit,\n isDateWithinRangeLimit,\n type DateRangeLimit,\n isCompleteDateRange,\n resolveDateRangeActiveEdge,\n resolveDateRangeCellPaint,\n resolveDateRangeCellState,\n resolveDateRangePreset,\n type DateRangePresetLength,\n resolveDateRangeSelection,\n validateDateRange,\n type DateRangeValue,\n} from \"@hjmds/design-contracts/components/date-range\";\nimport type {\n CalendarDescriptor,\n ComposeCalendarAccessibleName,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport { useState, type ReactNode } from \"react\";\nimport { Calendar, type CalendarMonthAction } from \"./calendar.js\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport { CalendarPaintContext } from \"./internal/calendar-paint.js\";\nimport { Chip } from \"./selection.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type DateRangeSummary = Readonly<{\n startLabel: string;\n endLabel: string;\n /** Shown in a field whose date is not chosen yet. */\n placeholder: string;\n formatDate: (date: string) => string;\n}>;\n\n/** A shortcut such as \"최근 7일\" or \"1개월\" that ends on the grid's `todayDate`. */\nexport type DateRangePresetOption = Readonly<{ id: string; label: string; length: DateRangePresetLength }>;\n\n// Preserve Calendar's controlled/uncontrolled month union when removing its single-date selection props.\ntype RangeCalendarDescriptor<T> = T extends unknown ? Omit<T, \"selectedDate\" | \"defaultSelectedDate\" | \"onSelectionChange\"> : never;\n\nexport type DateRangePickerProps<Content = unknown> = Readonly<{\n /** The same grid Calendar renders; the product still owns month data. */\n descriptor: RangeCalendarDescriptor<CalendarDescriptor<Content>>;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n value?: DateRangeValue;\n defaultValue?: DateRangeValue;\n onValueChange?: (value: DateRangeValue) => void;\n previousMonth?: CalendarMonthAction;\n nextMonth?: CalendarMonthAction;\n /** Localized suffixes appended to a day's name when it is a range edge. */\n rangeLabels: Readonly<{ start: string; end: string; between: string }>;\n /** Inclusive calendar span; one year by default, null removes the limit. */\n maxRange?: DateRangeLimit | null;\n renderCellContent?: (date: string) => ReactNode;\n /** Start/end fields above the grid; the edge the next tap sets is marked (replaces a hint sentence). */\n summary?: DateRangeSummary;\n /** Shortcut chips between the summary and the grid; each ends on `descriptor.grid.todayDate`. */\n presets?: readonly DateRangePresetOption[];\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function DateRangePicker<Content = unknown>({\n descriptor,\n composeAccessibleName,\n value: controlledValue,\n defaultValue,\n onValueChange,\n previousMonth,\n nextMonth,\n rangeLabels,\n maxRange = defaultDateRangeLimit,\n renderCellContent,\n summary,\n presets,\n className,\n layoutStyle,\n}: DateRangePickerProps<Content>) {\n const [value, setValue] = useControllableState<DateRangeValue>({\n ...(controlledValue === undefined ? {} : { value: controlledValue }),\n defaultValue: defaultValue ?? emptyDateRange,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n validateDateRange(value, maxRange);\n // The hovered date previews the not-yet-committed end through the same cell\n // state function the committed range uses.\n const [pointer, setPointer] = useState<string | null>(null);\n const hovered = pointer !== null && isDateWithinRangeLimit(value, pointer, maxRange) ? pointer : null;\n\n const activeEdge = resolveDateRangeActiveEdge(value);\n const field = (edge: \"start\" | \"end\") => {\n const date = value[edge];\n return (\n <div key={edge} className=\"hjm-date-range__field\" data-active={activeEdge === edge || undefined} data-empty={date === null || undefined}>\n <span className=\"hjm-date-range__field-label\">{edge === \"start\" ? summary!.startLabel : summary!.endLabel}</span>\n <span className=\"hjm-date-range__field-value\">{date === null ? summary!.placeholder : summary!.formatDate(date)}</span>\n </div>\n );\n };\n\n return (\n <div\n style={layoutStyle}\n className={classNames(\"hjm-date-range\", className)}\n data-selecting={value.start !== null && value.end === null ? \"\" : undefined}\n data-complete={isCompleteDateRange(value) || undefined}\n onMouseLeave={() => setPointer(null)}\n >\n {summary ? <div className=\"hjm-date-range__summary\">{field(\"start\")}{field(\"end\")}</div> : null}\n {presets?.length ? (\n <div className=\"hjm-date-range__presets\">\n {presets.map((preset) => {\n const range = resolveDateRangePreset(descriptor.grid.todayDate, preset.length);\n return (\n <Chip key={preset.id} label={preset.label} size={dateRangeRecipe.presets.chipSize} selectionMode=\"single\"\n selected={range.start === value.start && range.end === value.end}\n onSelectedChange={() => {\n validateDateRange(range, maxRange);\n setValue(range);\n // A preset ends today; bring its end month into view like a jump, so the band is visible.\n const month = range.end!.slice(0, 7);\n if (descriptor.focusedMonth !== month) descriptor.onFocusedMonthChange?.(month, \"jump\");\n }} />\n );\n })}\n </div>\n ) : null}\n <CalendarPaintContext.Provider value={{ paint: (date) => resolveDateRangeCellPaint(value, date, hovered), onDayHover: setPointer }}>\n <Calendar<Content>\n descriptor={{\n ...descriptor,\n // The range owns eligibility; Calendar keeps the same disabled-day interaction contract.\n grid: { ...descriptor.grid, cells: descriptor.grid.cells.map(cell => cell.date === undefined ? cell :\n { ...cell, disabled: cell.disabled === true || !isDateWithinRangeLimit(value, cell.date, maxRange) }) },\n // Calendar keeps single selection; the two edges and the band are painted through the internal\n // paint context, and each day's name carries the range position for assistive tech.\n selectedDate: value.end ?? value.start,\n onSelectionChange: (date) => { if (date !== null) setValue(resolveDateRangeSelection(value, date, maxRange)); },\n } as CalendarDescriptor<Content>}\n composeAccessibleName={(info) => {\n const state = resolveDateRangeCellState(value, info.date, hovered);\n const base = composeAccessibleName(info);\n return state === \"none\" ? base : `${base}, ${rangeLabels[state]}`;\n }}\n {...(previousMonth === undefined ? {} : { previousMonth })}\n {...(nextMonth === undefined ? {} : { nextMonth })}\n {...(renderCellContent === undefined ? {} : { renderCellContent: (cell: { date: string }) => renderCellContent(cell.date) })}\n />\n </CalendarPaintContext.Provider>\n </div>\n );\n}\n"]}
package/dist/display.d.ts CHANGED
@@ -51,6 +51,12 @@ export type CardProps = Omit<HTMLAttributes<HTMLElement>, "title"> & Readonly<{
51
51
  title?: ReactNode;
52
52
  description?: ReactNode;
53
53
  leading?: ReactNode;
54
+ /** Independent identity destination, outside the card activation host. */
55
+ leadingAction?: Readonly<{
56
+ label: string;
57
+ onPress(): void;
58
+ disabled?: boolean;
59
+ }>;
54
60
  media?: ReactNode;
55
61
  /** Decorative artwork behind the shared body/actions; its host determines the available height. */
56
62
  backgroundMedia?: ReactNode;
@@ -96,6 +102,12 @@ export declare const Card: import("react").ForwardRefExoticComponent<Omit<HTMLAt
96
102
  title?: ReactNode;
97
103
  description?: ReactNode;
98
104
  leading?: ReactNode;
105
+ /** Independent identity destination, outside the card activation host. */
106
+ leadingAction?: Readonly<{
107
+ label: string;
108
+ onPress(): void;
109
+ disabled?: boolean;
110
+ }>;
99
111
  media?: ReactNode;
100
112
  /** Decorative artwork behind the shared body/actions; its host determines the available height. */
101
113
  backgroundMedia?: ReactNode;
@@ -152,6 +164,12 @@ export type ListRowProps = Omit<HTMLAttributes<HTMLElement>, "title" | "onClick"
152
164
  title: ReactNode;
153
165
  description?: ReactNode;
154
166
  leading?: ReactNode;
167
+ /** Independent member destination; rendered beside, never inside, the row command. */
168
+ leadingAction?: Readonly<{
169
+ label: string;
170
+ onPress(): void;
171
+ disabled?: boolean;
172
+ }>;
155
173
  trailing?: ReactNode;
156
174
  /**
157
175
  * `disclosure`: the row opens another screen. HJM draws the decorative chevron after `trailing`, inside the row
@@ -167,6 +185,8 @@ export type ListRowProps = Omit<HTMLAttributes<HTMLElement>, "title" | "onClick"
167
185
  tone?: keyof typeof listRowRecipe.tones;
168
186
  /** Frame the ListRow paints around `leading`; the recipe owns its size. */
169
187
  leadingShape?: ListRowLeadingShape;
188
+ /** Large member portraits use the shared 48px frame; icons retain the default frame. */
189
+ leadingSize?: "default" | "large";
170
190
  selected?: boolean;
171
191
  disabled?: boolean;
172
192
  /**
@@ -186,6 +206,12 @@ export declare const ListRow: import("react").ForwardRefExoticComponent<Omit<HTM
186
206
  title: ReactNode;
187
207
  description?: ReactNode;
188
208
  leading?: ReactNode;
209
+ /** Independent member destination; rendered beside, never inside, the row command. */
210
+ leadingAction?: Readonly<{
211
+ label: string;
212
+ onPress(): void;
213
+ disabled?: boolean;
214
+ }>;
189
215
  trailing?: ReactNode;
190
216
  /**
191
217
  * `disclosure`: the row opens another screen. HJM draws the decorative chevron after `trailing`, inside the row
@@ -201,6 +227,8 @@ export declare const ListRow: import("react").ForwardRefExoticComponent<Omit<HTM
201
227
  tone?: keyof typeof listRowRecipe.tones;
202
228
  /** Frame the ListRow paints around `leading`; the recipe owns its size. */
203
229
  leadingShape?: ListRowLeadingShape;
230
+ /** Large member portraits use the shared 48px frame; icons retain the default frame. */
231
+ leadingSize?: "default" | "large";
204
232
  selected?: boolean;
205
233
  disabled?: boolean;
206
234
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../src/display.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,IAAI,oBAAoB,EAGzC,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,C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C5D,mBAAmB;IAClC,wFAAwF;kBAC1E,SAAS,GAAG,OAAO;eACtB,OAAO;eACP,OAAO;IAClB;;;;OAIG;cACO,OAAO;IACjB,uDAAuD;mBACxC,MAAM;WACd,MAAM;cACH,iBAAiB,CAAC,WAAW,CAAC;IACtC,4EAA4E;kBAChE,uBAAuB;gDAoIvC,CAAC"}
package/dist/display.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { IdentityAction } from "./internal/identity-action.js";
3
4
  import { badgeRecipe, listRowRecipe, resolveBadgeCategoryColor, validateListRowTrailingAccessory, } from "@hjmds/design-contracts/recipes";
4
5
  import { THEMES } from "@hjmds/design-contracts/colors";
5
6
  import { glyph } from "@hjmds/design-contracts/foundations";
@@ -40,7 +41,7 @@ export const Tag = forwardRef(function Tag({ children, tone, className, layoutSt
40
41
  });
41
42
  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 }) }));
42
43
  });
43
- 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,
44
+ export const Card = forwardRef(function Card({ title, description, leading, leadingAction, media, backgroundMedia, backgroundInteraction, mediaBadges, badges, badgesAlign = cardRecipe.defaults.badgesAlign, mediaAction, actions, headerActions, headingLevel = cardRecipe.defaults.headingLevel,
44
45
  // An omitted selection is an ordinary action, not an unpressed toggle.
45
46
  selected, onActivate, href, renderLink, disabled = false, tone = cardRecipe.defaults.tone, bordered = cardRecipe.defaults.bordered, padding = cardRecipe.defaults.padding, radius, className, children, ...props }, ref) {
46
47
  if (href !== undefined && (!href.trim() || onActivate))
@@ -59,7 +60,7 @@ selected, onActivate, href, renderLink, disabled = false, tone = cardRecipe.defa
59
60
  const hasHeader = leading !== undefined || title !== undefined || description !== undefined || headerActions !== undefined;
60
61
  // Whole-card open plus separate commands (2026-10-18 unairplane journey card: open + delete). A root button cannot
61
62
  // contain the action buttons, so the root stays an article and an overlay button carries the card's name and state.
62
- const overlay = href !== undefined || (onActivate !== undefined && Boolean(actions || headerActions));
63
+ const overlay = href !== undefined || (onActivate !== undefined && Boolean(actions || headerActions || leadingAction));
63
64
  const { "aria-label": activationLabel, ...rootProps } = props;
64
65
  const activate = () => { if (!disabled)
65
66
  onActivate?.(); };
@@ -74,16 +75,17 @@ selected, onActivate, href, renderLink, disabled = false, tone = cardRecipe.defa
74
75
  "data-interactive": true, onClick: activate,
75
76
  } : {}), ...(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,
76
77
  "--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)
77
- 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
78
+ 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", "data-interactive": leadingAction ? "" : undefined, children: leadingAction ? _jsx(IdentityAction, { action: leadingAction, children: leading }) : leading })), _jsxs("div", { className: "hjm-card__copy", children: [title === undefined
78
79
  ? null
79
80
  : 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] }));
80
81
  });
81
82
  export function QuoteCard({ children, attribution, renderMark, ...props }) {
82
83
  return _jsx(Card, { ...props, leading: _jsx("span", { className: "hjm-quote-card__mark", "aria-hidden": "true", children: renderMark?.({ color: "currentColor", size: cardRecipe.quotation.markSize }) ?? "“" }), children: _jsxs("blockquote", { className: "hjm-quote-card__body", children: [children, attribution === undefined ? null : _jsx("footer", { children: _jsx(Text, { variant: "caption", tone: "muted", children: attribution }) })] }) });
83
84
  }
84
- export const ListRow = forwardRef(function ListRow({ title, description, leading, trailing, trailingAccessory = listRowRecipe.defaults.trailingAccessory, trailingAction, renderLink, density: densityProp, tone = listRowRecipe.defaults.tone, leadingShape = "square", selected, disabled = false, loading = false, loadingLabel, href, onClick, className, layoutStyle, style, ...props }, ref) {
85
+ export const ListRow = forwardRef(function ListRow({ title, description, leading, leadingAction, trailing, trailingAccessory = listRowRecipe.defaults.trailingAccessory, trailingAction, renderLink, density: densityProp, tone = listRowRecipe.defaults.tone, leadingShape = "square", leadingSize = leadingShape === "circle" ? "large" : "default", selected, disabled = false, loading = false, loadingLabel, href, onClick, className, layoutStyle, style, ...props }, ref) {
85
86
  // The hook runs unconditionally — `??` would short-circuit it and break the
86
87
  // rules of hooks on the very first row that passes `density`.
88
+ const separateActions = Boolean(trailingAction || leadingAction);
87
89
  const densityDefault = useHjmDensityDefault({
88
90
  comfortable: listRowRecipe.defaults.density,
89
91
  compact: "compact",
@@ -93,7 +95,7 @@ export const ListRow = forwardRef(function ListRow({ title, description, leading
93
95
  const accessory = trailingAccessory === "none" ? null : listRowRecipe.accessories[trailingAccessory];
94
96
  if (loading) {
95
97
  // A loading row is never interactive: there is nothing to activate yet.
96
- return (_jsxs("div", { ...props, ref: ref, role: loadingLabel ? "status" : undefined, "aria-busy": loadingLabel ? true : undefined, "aria-hidden": loadingLabel ? undefined : true, "aria-label": loadingLabel, className: classNames("hjm-list-row", "hjm-list-row--loading", className), "data-density": density, "data-leading": leading ? "" : undefined, "data-lines": description ? "two" : "one", "data-state": "loading", style: { ...style, ...layoutStyle }, children: [leading ? _jsx("span", { className: "hjm-list-row__leading", "data-shape": leadingShape, "data-placeholder": "" }) : null, _jsxs("span", { className: "hjm-list-row__content", children: [_jsx("span", { className: "hjm-list-row__title", "data-placeholder": "", style: { width: `${listRowRecipe.loading.titleWidthPercent}%` } }), description ? _jsx("span", { className: "hjm-list-row__description", "data-placeholder": "", style: { width: `${listRowRecipe.loading.descriptionWidthPercent}%` } }) : null] }), trailing ? _jsx("span", { className: "hjm-list-row__trailing", "data-placeholder": "", style: { width: listRowRecipe.loading.trailingWidth } }) : null, accessory ? _jsx("span", { className: "hjm-list-row__accessory", "data-accessory": trailingAccessory, style: { inlineSize: glyph[accessory.glyph], blockSize: glyph[accessory.glyph] } }) : null] }));
98
+ return (_jsxs("div", { ...props, ref: ref, role: loadingLabel ? "status" : undefined, "aria-busy": loadingLabel ? true : undefined, "aria-hidden": loadingLabel ? undefined : true, "aria-label": loadingLabel, className: classNames("hjm-list-row", "hjm-list-row--loading", className), "data-density": density, "data-leading": leading ? "" : undefined, "data-lines": description ? "two" : "one", "data-state": "loading", style: { ...style, ...layoutStyle }, children: [leading ? _jsx("span", { className: "hjm-list-row__leading", "data-shape": leadingShape, "data-size": leadingSize, "data-placeholder": "" }) : null, _jsxs("span", { className: "hjm-list-row__content", children: [_jsx("span", { className: "hjm-list-row__title", "data-placeholder": "", style: { width: `${listRowRecipe.loading.titleWidthPercent}%` } }), description ? _jsx("span", { className: "hjm-list-row__description", "data-placeholder": "", style: { width: `${listRowRecipe.loading.descriptionWidthPercent}%` } }) : null] }), trailing ? _jsx("span", { className: "hjm-list-row__trailing", "data-placeholder": "", style: { width: listRowRecipe.loading.trailingWidth } }) : null, accessory ? _jsx("span", { className: "hjm-list-row__accessory", "data-accessory": trailingAccessory, style: { inlineSize: glyph[accessory.glyph], blockSize: glyph[accessory.glyph] } }) : null] }));
97
99
  }
98
100
  const element = href ? "a" : onClick ? "button" : "div";
99
101
  const interactiveProps = href
@@ -127,15 +129,15 @@ export const ListRow = forwardRef(function ListRow({ title, description, leading
127
129
  "data-state": disabled ? "disabled" : selected ? "selected" : "idle",
128
130
  // Placement wins over the legacy `style`, matching Surface's ordering.
129
131
  // With trailingAction the frame is the placed root, as Native's outer View.
130
- style: trailingAction ? style : { ...style, ...layoutStyle },
131
- }, leading
132
- ? _jsx("span", { className: "hjm-list-row__leading", "data-shape": leadingShape, children: leading })
132
+ style: separateActions ? style : { ...style, ...layoutStyle },
133
+ }, leading && !leadingAction
134
+ ? _jsx("span", { className: "hjm-list-row__leading", "data-shape": leadingShape, "data-size": leadingSize, children: leading })
133
135
  : null, _jsxs("span", { className: "hjm-list-row__content", children: [_jsx("span", { className: "hjm-list-row__title", children: title }), description ? (_jsx("span", { className: "hjm-list-row__description", children: description })) : null] }), trailing ? _jsx("span", { className: "hjm-list-row__trailing", children: trailing }) : null, accessory
134
136
  ? _jsx("span", { className: "hjm-list-row__accessory", "data-accessory": trailingAccessory, "aria-hidden": "true", children: _jsx(Icon, { name: accessory.icon, size: accessory.glyph, weight: accessory.weight }) })
135
137
  : null);
136
138
  const linked = href && renderLink ? renderLink(row.props) : row;
137
139
  // The frame owns the row surface and its bleed so the command and the separate action share one fill, as Native;
138
140
  // the action stays outside the link/button (styles.css `.hjm-list-row-frame`).
139
- return trailingAction ? (_jsxs("div", { className: "hjm-list-row-frame", "data-density": density, "data-leading": leading ? "" : undefined, "data-state": disabled ? "disabled" : selected ? "selected" : "idle", style: layoutStyle, children: [linked, _jsx("div", { className: "hjm-list-row__action", children: trailingAction })] })) : linked;
141
+ return separateActions ? (_jsxs("div", { className: "hjm-list-row-frame", "data-leading-action": leadingAction ? "" : undefined, "data-trailing-action": trailingAction ? "" : undefined, "data-density": density, "data-leading": leading ? "" : undefined, "data-state": disabled ? "disabled" : selected ? "selected" : "idle", style: layoutStyle, children: [leadingAction && leading ? _jsx("div", { className: "hjm-list-row__profile", children: _jsx(IdentityAction, { action: leadingAction, children: leading }) }) : null, linked, trailingAction ? _jsx("div", { className: "hjm-list-row__action", children: trailingAction }) : null] })) : linked;
140
142
  });
141
143
  //# sourceMappingURL=display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,WAAW,EACX,aAAa,EAKb,yBAAyB,EACzB,gCAAgC,GAKjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EACL,oBAAoB,GAErB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,UAAU,GAEX,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,GAIhB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,UAAU,GAKX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAuBjD,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAA8B,SAAS,KAAK,CACzE,EACE,IAAI,EAAE,QAAQ,EACd,aAAa,EACb,IAAI,GA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,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,EAC5E,SAAS;QACP,CAAC,CAAC,eAAM,SAAS,EAAC,yBAAyB,oBAAiB,iBAAiB,iBAAc,MAAM,YAC7F,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,GAAI,GAC1E;QACT,CAAC,CAAC,IAAI,CACT,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":["\"use client\";\n\nimport {\n badgeRecipe,\n listRowRecipe,\n type BadgeAdornmentContext,\n type BadgeSize,\n type BadgeTone,\n type BadgeVariant as ContractBadgeVariant,\n resolveBadgeCategoryColor,\n validateListRowTrailingAccessory,\n type BadgeCategoryColor,\n type ListRowDensity,\n type ListRowLeadingShape,\n type ListRowTrailingAccessory,\n} from \"@hjmds/design-contracts/recipes\";\nimport { THEMES } from \"@hjmds/design-contracts/colors\";\nimport { glyph } from \"@hjmds/design-contracts/foundations\";\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, useOptionalHjmTheme } from \"./provider.js\";\nimport { Surface, Text } from \"./layout.js\";\nimport { Icon } from \"./supplemental-display.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 /**\n * Product classification color per theme (series, grade…) in place of `tone`. HJM keeps the frame and picks the\n * label ink; a color whose label cannot reach AA 4.5 throws instead of rendering unreadable.\n */\n categoryColor?: BadgeCategoryColor;\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: toneProp,\n categoryColor,\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 if (categoryColor !== undefined && toneProp !== undefined) throw new TypeError(\"Badge takes either tone or categoryColor, not both\");\n const tone = toneProp ?? badgeRecipe.defaults.tone;\n // Outside a provider the stylesheet paints the light palette, so the category resolves against it too.\n const theme = useOptionalHjmTheme();\n const category = categoryColor === undefined ? null : resolveBadgeCategoryColor(categoryColor, {\n theme: theme?.environment.theme ?? \"light\",\n variant,\n palette: theme?.palette.theme ?? THEMES.light,\n });\n const iconContext = { color: \"currentColor\", size: badgeRecipe.sizes[size].iconSize, strokeWidth: badgeRecipe.iconStrokeWidth };\n return (\n <span\n {...props}\n style={{\n ...style,\n ...(category ? {\n \"--hjm-badge-category-content\": category.content,\n \"--hjm-badge-category-background\": category.background ?? \"transparent\",\n \"--hjm-badge-category-border\": category.border ?? \"transparent\",\n } as CSSProperties : {}),\n ...layoutStyle,\n }}\n ref={ref}\n className={classNames(\"hjm-badge\", className)}\n data-tone={category ? \"category\" : 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 /**\n * `disclosure`: the row opens another screen. HJM draws the decorative chevron after `trailing`, inside the row\n * command (before any `trailingAction`), mirrored in RTL; size and color come from `listRowRecipe.accessories`.\n */\n trailingAccessory?: ListRowTrailingAccessory;\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 trailingAccessory = listRowRecipe.defaults.trailingAccessory,\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 validateListRowTrailingAccessory(trailingAccessory);\n const accessory = trailingAccessory === \"none\" ? null : listRowRecipe.accessories[trailingAccessory];\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 {/* Keep the accessory's box so the text column does not shift when the real row arrives. */}\n {accessory ? <span className=\"hjm-list-row__accessory\" data-accessory={trailingAccessory} style={{ inlineSize: glyph[accessory.glyph], blockSize: glyph[accessory.glyph] }} /> : 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 accessory\n ? <span className=\"hjm-list-row__accessory\" data-accessory={trailingAccessory} aria-hidden=\"true\">\n <Icon name={accessory.icon} size={accessory.glyph} weight={accessory.weight} />\n </span>\n : 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,YAAY,CAAC;;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EACL,WAAW,EACX,aAAa,EAKb,yBAAyB,EACzB,gCAAgC,GAKjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC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AC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,GAAI,GAC1E;QACT,CAAC,CAAC,IAAI,CACT,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,eAAe,CAAC,CAAC,CAAC,CACvB,eAAK,SAAS,EAAC,oBAAoB,yBAAsB,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,0BAAwB,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,kBAAgB,OAAO,kBAAgB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,gBAC/L,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,aACrF,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,uBAAuB,YAAC,KAAC,cAAc,IAAC,MAAM,EAAE,aAAa,YAAG,OAAO,GAAkB,GAAM,CAAC,CAAC,CAAC,IAAI,EAChJ,MAAM,EACN,cAAc,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,sBAAsB,YAAE,cAAc,GAAO,CAAC,CAAC,CAAC,IAAI,IACjF,CACP,CAAC,CAAC,CAAC,MAAM,CAAC;AACb,CAAC,CAAC,CAAC","sourcesContent":["\"use client\";\nimport { IdentityAction } from \"./internal/identity-action.js\";\n\nimport {\n badgeRecipe,\n listRowRecipe,\n type BadgeAdornmentContext,\n type BadgeSize,\n type BadgeTone,\n type BadgeVariant as ContractBadgeVariant,\n resolveBadgeCategoryColor,\n validateListRowTrailingAccessory,\n type BadgeCategoryColor,\n type ListRowDensity,\n type ListRowLeadingShape,\n type ListRowTrailingAccessory,\n} from \"@hjmds/design-contracts/recipes\";\nimport { THEMES } from \"@hjmds/design-contracts/colors\";\nimport { glyph } from \"@hjmds/design-contracts/foundations\";\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, useOptionalHjmTheme } from \"./provider.js\";\nimport { Surface, Text } from \"./layout.js\";\nimport { Icon } from \"./supplemental-display.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 /**\n * Product classification color per theme (series, grade…) in place of `tone`. HJM keeps the frame and picks the\n * label ink; a color whose label cannot reach AA 4.5 throws instead of rendering unreadable.\n */\n categoryColor?: BadgeCategoryColor;\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: toneProp,\n categoryColor,\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 if (categoryColor !== undefined && toneProp !== undefined) throw new TypeError(\"Badge takes either tone or categoryColor, not both\");\n const tone = toneProp ?? badgeRecipe.defaults.tone;\n // Outside a provider the stylesheet paints the light palette, so the category resolves against it too.\n const theme = useOptionalHjmTheme();\n const category = categoryColor === undefined ? null : resolveBadgeCategoryColor(categoryColor, {\n theme: theme?.environment.theme ?? \"light\",\n variant,\n palette: theme?.palette.theme ?? THEMES.light,\n });\n const iconContext = { color: \"currentColor\", size: badgeRecipe.sizes[size].iconSize, strokeWidth: badgeRecipe.iconStrokeWidth };\n return (\n <span\n {...props}\n style={{\n ...style,\n ...(category ? {\n \"--hjm-badge-category-content\": category.content,\n \"--hjm-badge-category-background\": category.background ?? \"transparent\",\n \"--hjm-badge-category-border\": category.border ?? \"transparent\",\n } as CSSProperties : {}),\n ...layoutStyle,\n }}\n ref={ref}\n className={classNames(\"hjm-badge\", className)}\n data-tone={category ? \"category\" : 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 /** Independent identity destination, outside the card activation host. */\n leadingAction?: Readonly<{label:string;onPress():void; disabled?: boolean }>;\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 leadingAction,\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 || leadingAction));\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\" data-interactive={leadingAction?\"\":undefined}>\n {leadingAction?<IdentityAction action={leadingAction}>{leading}</IdentityAction>: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 /** Independent member destination; rendered beside, never inside, the row command. */\n leadingAction?: Readonly<{ label: string; onPress(): void; disabled?: boolean }>;\n trailing?: ReactNode;\n /**\n * `disclosure`: the row opens another screen. HJM draws the decorative chevron after `trailing`, inside the row\n * command (before any `trailingAction`), mirrored in RTL; size and color come from `listRowRecipe.accessories`.\n */\n trailingAccessory?: ListRowTrailingAccessory;\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 /** Large member portraits use the shared 48px frame; icons retain the default frame. */\n leadingSize?: \"default\" | \"large\";\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 leadingAction,\n trailing,\n trailingAccessory = listRowRecipe.defaults.trailingAccessory,\n trailingAction,\n renderLink,\n density: densityProp,\n tone = listRowRecipe.defaults.tone,\n leadingShape = \"square\",\n leadingSize = leadingShape === \"circle\" ? \"large\" : \"default\",\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 separateActions = Boolean(trailingAction || leadingAction);\n const densityDefault = useHjmDensityDefault({\n comfortable: listRowRecipe.defaults.density,\n compact: \"compact\",\n });\n const density = densityProp ?? densityDefault;\n validateListRowTrailingAccessory(trailingAccessory);\n const accessory = trailingAccessory === \"none\" ? null : listRowRecipe.accessories[trailingAccessory];\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-size={leadingSize} 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 {/* Keep the accessory's box so the text column does not shift when the real row arrives. */}\n {accessory ? <span className=\"hjm-list-row__accessory\" data-accessory={trailingAccessory} style={{ inlineSize: glyph[accessory.glyph], blockSize: glyph[accessory.glyph] }} /> : 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: separateActions ? style : { ...style, ...layoutStyle },\n },\n leading && !leadingAction\n ? <span className=\"hjm-list-row__leading\" data-shape={leadingShape} data-size={leadingSize}>{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 accessory\n ? <span className=\"hjm-list-row__accessory\" data-accessory={trailingAccessory} aria-hidden=\"true\">\n <Icon name={accessory.icon} size={accessory.glyph} weight={accessory.weight} />\n </span>\n : 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 separateActions ? (\n <div className=\"hjm-list-row-frame\" data-leading-action={leadingAction ? \"\" : undefined} data-trailing-action={trailingAction ? \"\" : undefined} data-density={density} data-leading={leading ? \"\" : undefined}\n data-state={disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"} style={layoutStyle}>\n {leadingAction && leading ? <div className=\"hjm-list-row__profile\"><IdentityAction action={leadingAction}>{leading}</IdentityAction></div> : null}\n {linked}\n {trailingAction ? <div className=\"hjm-list-row__action\">{trailingAction}</div> : null}\n </div>\n ) : linked;\n});\n"]}