@hjmds/react 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/advanced-display.d.ts +1 -0
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +3 -2
- package/dist/advanced-display.js.map +1 -1
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +2 -1
- package/dist/agreement.js.map +1 -1
- package/dist/bottom-cta.d.ts.map +1 -1
- package/dist/bottom-cta.js +5 -2
- package/dist/bottom-cta.js.map +1 -1
- package/dist/bottom-navigation.d.ts.map +1 -1
- package/dist/bottom-navigation.js +3 -0
- package/dist/bottom-navigation.js.map +1 -1
- package/dist/calendar.js +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +4 -3
- package/dist/carousel-motion.js.map +1 -1
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +3 -2
- package/dist/carousel.js.map +1 -1
- package/dist/chart.d.ts +3 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +9 -4
- package/dist/chart.js.map +1 -1
- package/dist/clipboard.d.ts +27 -1
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +26 -12
- package/dist/clipboard.js.map +1 -1
- package/dist/collapsible.d.ts +9 -0
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +9 -2
- package/dist/collapsible.js.map +1 -1
- package/dist/collection-editing.d.ts.map +1 -1
- package/dist/collection-editing.js +15 -10
- package/dist/collection-editing.js.map +1 -1
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js +3 -2
- package/dist/collection-rail.js.map +1 -1
- package/dist/communication.d.ts.map +1 -1
- package/dist/communication.js +5 -2
- package/dist/communication.js.map +1 -1
- package/dist/context-menu.d.ts +9 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/context-menu.js.map +1 -1
- package/dist/conversation-row.js +1 -1
- package/dist/conversation-row.js.map +1 -1
- package/dist/data-workflows.d.ts.map +1 -1
- package/dist/data-workflows.js +4 -3
- package/dist/data-workflows.js.map +1 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +5 -3
- package/dist/date-picker.js.map +1 -1
- package/dist/design-profile.d.ts.map +1 -1
- package/dist/design-profile.js +4 -2
- package/dist/design-profile.js.map +1 -1
- package/dist/effect-surface.d.ts +9 -3
- package/dist/effect-surface.d.ts.map +1 -1
- package/dist/effect-surface.js +3 -2
- package/dist/effect-surface.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/feedback.d.ts +8 -19
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +7 -3
- package/dist/feedback.js.map +1 -1
- package/dist/field-group.d.ts.map +1 -1
- package/dist/field-group.js +15 -8
- package/dist/field-group.js.map +1 -1
- package/dist/file-picker.d.ts +14 -2
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +5 -2
- package/dist/file-picker.js.map +1 -1
- package/dist/folder-preview.d.ts.map +1 -1
- package/dist/folder-preview.js +2 -2
- package/dist/folder-preview.js.map +1 -1
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +2 -1
- package/dist/forms.js.map +1 -1
- package/dist/image-choice.d.ts +30 -0
- package/dist/image-choice.d.ts.map +1 -0
- package/dist/image-choice.js +24 -0
- package/dist/image-choice.js.map +1 -0
- package/dist/image-comparison.d.ts.map +1 -1
- package/dist/image-comparison.js +2 -1
- package/dist/image-comparison.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/message-reactions.d.ts +28 -2
- package/dist/internal/message-reactions.d.ts.map +1 -1
- package/dist/internal/message-reactions.js +11 -4
- package/dist/internal/message-reactions.js.map +1 -1
- package/dist/internal/screen-exit.d.ts +11 -0
- package/dist/internal/screen-exit.d.ts.map +1 -0
- package/dist/internal/screen-exit.js +10 -0
- package/dist/internal/screen-exit.js.map +1 -0
- package/dist/internal/screen-footer.d.ts +7 -0
- package/dist/internal/screen-footer.d.ts.map +1 -0
- package/dist/internal/screen-footer.js +8 -0
- package/dist/internal/screen-footer.js.map +1 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +8 -4
- package/dist/layout.js.map +1 -1
- package/dist/masonry.d.ts +5 -3
- package/dist/masonry.d.ts.map +1 -1
- package/dist/masonry.js +25 -3
- package/dist/masonry.js.map +1 -1
- package/dist/menu-morph.d.ts.map +1 -1
- package/dist/menu-morph.js +30 -7
- package/dist/menu-morph.js.map +1 -1
- package/dist/overlays.d.ts +2 -0
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +48 -11
- package/dist/overlays.js.map +1 -1
- package/dist/popover.d.ts +6 -0
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +3 -3
- package/dist/popover.js.map +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/qr-code.js.map +1 -1
- package/dist/reaction-picker.d.ts.map +1 -1
- package/dist/reaction-picker.js +14 -1
- package/dist/reaction-picker.js.map +1 -1
- package/dist/saved-items.d.ts +8 -2
- package/dist/saved-items.d.ts.map +1 -1
- package/dist/saved-items.js +4 -4
- package/dist/saved-items.js.map +1 -1
- package/dist/screen-flows.d.ts +52 -6
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +50 -22
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +56 -8
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +41 -15
- package/dist/screens.js.map +1 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +4 -4
- package/dist/selection.js.map +1 -1
- package/dist/social-compositions.d.ts.map +1 -1
- package/dist/social-compositions.js +3 -2
- package/dist/social-compositions.js.map +1 -1
- package/dist/sortable.d.ts.map +1 -1
- package/dist/sortable.js +9 -3
- package/dist/sortable.js.map +1 -1
- package/dist/status-text.d.ts.map +1 -1
- package/dist/status-text.js +5 -2
- package/dist/status-text.js.map +1 -1
- package/dist/styles.css +219 -126
- package/dist/styles.layered.css +219 -126
- package/dist/table-family.d.ts +1 -1
- package/dist/table-family.d.ts.map +1 -1
- package/dist/table-family.js +24 -7
- package/dist/table-family.js.map +1 -1
- package/dist/task-controls.d.ts.map +1 -1
- package/dist/task-controls.js +9 -4
- package/dist/task-controls.js.map +1 -1
- package/dist/task-list.d.ts +1 -1
- package/dist/task-list.d.ts.map +1 -1
- package/dist/task-list.js +4 -3
- package/dist/task-list.js.map +1 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +4 -0
- package/dist/theme.js.map +1 -1
- package/dist/top-bar.d.ts +5 -0
- package/dist/top-bar.d.ts.map +1 -1
- package/dist/top-bar.js +6 -1
- package/dist/top-bar.js.map +1 -1
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +13 -3
- package/dist/transfer-list.js.map +1 -1
- package/dist/upload-item.d.ts.map +1 -1
- package/dist/upload-item.js +3 -1
- package/dist/upload-item.js.map +1 -1
- package/fonts/pretendard/LICENSE.txt +94 -0
- package/fonts/pretendard/pretendard.css +927 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.0.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.1.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.10.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.11.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.12.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.13.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.14.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.15.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.16.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.17.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.18.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.19.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.2.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.20.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.21.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.22.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.23.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.24.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.25.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.26.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.27.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.28.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.29.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.3.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.30.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.31.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.32.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.33.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.34.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.35.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.36.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.37.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.38.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.39.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.4.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.40.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.41.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.42.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.43.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.44.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.45.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.46.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.47.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.48.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.49.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.5.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.50.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.51.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.52.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.53.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.54.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.55.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.56.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.57.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.58.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.59.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.6.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.60.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.61.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.62.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.63.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.64.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.65.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.66.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.67.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.68.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.69.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.7.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.70.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.71.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.72.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.73.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.74.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.75.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.76.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.77.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.78.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.79.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.8.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.80.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.81.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.82.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.83.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.84.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.85.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.86.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.87.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.88.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.89.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.9.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.90.woff2 +0 -0
- package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.91.woff2 +0 -0
- package/package.json +10 -3
package/dist/table-family.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import type { ColorReference } from "@hjmds/design-contracts/color-references";
|
|
3
3
|
import { type ComparisonRow, type DataTableCellHeat, type DataTableCellTone, type LineScoreTeam, type MatrixCell } from "@hjmds/design-contracts/components/data-table";
|
|
4
4
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-family.d.ts","sourceRoot":"","sources":["../src/table-family.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"table-family.d.ts","sourceRoot":"","sources":["../src/table-family.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAEL,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EACxG,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAYtE,kIAAkI;AAClI,wBAAgB,aAAa,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAO/D;AAMD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,QAAQ,CAAC;IAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC7G,UAAU,CAAC,EAAE,eAAe,GAC3B,QAAQ,CAAC;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,IAAI,CAAC,EAAE,iBAAiB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GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,WAAkB,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,+BA8BpL;AAID,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/B,kDAAkD;IAClD,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACvG,kHAAkH;IAClH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAoB,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,oBAAoB,+BAmCtI"}
|
package/dist/table-family.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useLayoutEffect, useRef } from "react";
|
|
3
|
+
import { dataTableFamilyRecipe, formatLineScoreCell, resolveComparisonRow, resolveLineScore, resolveMatrix, } from "@hjmds/design-contracts/components/data-table";
|
|
3
4
|
import { classNames } from "./internal.js";
|
|
4
5
|
/*
|
|
5
6
|
* Table family companions (2026-10-14): layouts products kept hand-building next to DataTable.
|
|
@@ -18,8 +19,8 @@ export function tableCssColor(reference) {
|
|
|
18
19
|
? `var(${name})`
|
|
19
20
|
: `color-mix(in srgb, var(${name}) ${Math.round(reference.alpha * 100)}%, transparent)`;
|
|
20
21
|
}
|
|
21
|
-
/** Live period and "my team" row
|
|
22
|
-
const familyStyle = { "--hjm-table-family-selected": tableCssColor(
|
|
22
|
+
/** Live period and "my team" row share the family highlight tint. */
|
|
23
|
+
const familyStyle = { "--hjm-table-family-selected": tableCssColor(dataTableFamilyRecipe.highlight.background) };
|
|
23
24
|
const withFamilyStyle = (layoutStyle) => ({ ...familyStyle, ...layoutStyle });
|
|
24
25
|
/**
|
|
25
26
|
* Cell emphasis as inline style. Heat paints a background *image* so pinned cells keep their opaque
|
|
@@ -40,17 +41,33 @@ export function tableCellEmphasis(decoration, heatColors) {
|
|
|
40
41
|
}
|
|
41
42
|
return { style: style, ...(tone ? { tone } : {}), ...(heat ? { heat: `${heat.side}-${heat.strength}` } : {}) };
|
|
42
43
|
}
|
|
44
|
+
/* ---------------------------------------------- Line score ------------------------------------- */
|
|
45
|
+
/**
|
|
46
|
+
* Team and total columns stay pinned while only the periods scroll, as on Native: at 402px the totals — the result —
|
|
47
|
+
* scrolled off with the extra innings (2026-10-17 review E17). Totals have a fixed width so each can pin at its offset.
|
|
48
|
+
*/
|
|
49
|
+
const totalOffset = (count, index) => ({ insetInlineEnd: `calc(var(--hjm-line-score-total-width) * ${count - 1 - index})` });
|
|
43
50
|
export function LineScore({ teams, totals, currentPeriod = null, minPeriods, renderTeam, accessibilityLabel, className, layoutStyle }) {
|
|
44
51
|
const score = resolveLineScore(teams, { totals, currentPeriod, ...(minPeriods !== undefined ? { minPeriods } : {}) });
|
|
45
52
|
const periods = score.columns.filter((column) => column.kind === "period");
|
|
46
53
|
const totalColumns = score.columns.filter((column) => column.kind === "total");
|
|
47
|
-
|
|
54
|
+
// Open the period strip at the live (or latest) period, as Native: starting at inning 1 hid extra innings behind the
|
|
55
|
+
// pinned totals and read as a shorter game (2026-10-17 review N4). scroll-padding keeps it clear of the totals.
|
|
56
|
+
const host = useRef(null);
|
|
57
|
+
const focusPeriod = score.currentPeriod ?? periods.length;
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
const container = host.current;
|
|
60
|
+
if (!container || container.scrollWidth <= container.clientWidth)
|
|
61
|
+
return;
|
|
62
|
+
container.querySelector(`thead [data-period="${focusPeriod}"]`)?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
63
|
+
}, [focusPeriod, periods.length]);
|
|
64
|
+
return (_jsx("div", { ref: host, className: classNames("hjm-table-family", "hjm-line-score", className), style: { ...withFamilyStyle(layoutStyle), "--hjm-line-score-total-count": totalColumns.length }, children: _jsxs("table", { className: "hjm-line-score__table", "aria-label": accessibilityLabel, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("td", { className: "hjm-line-score__team" }), periods.map((column, index) => {
|
|
48
65
|
const live = score.currentPeriod === index + 1;
|
|
49
|
-
return _jsx("th", { scope: "col", className: "hjm-line-score__period", "aria-current": live ? "true" : undefined, "data-current": live || undefined, children: column.header }, column.id);
|
|
50
|
-
}), totalColumns.map((column, index) => (_jsx("th", { scope: "col", className: classNames("hjm-line-score__total", index === 0 && "hjm-line-score__total-edge"), children: column.header }, column.id)))] }) }), _jsx("tbody", { children: teams.map((team) => (_jsxs("tr", { "data-leader": score.leaderId === team.id || undefined, children: [_jsx("th", { scope: "row", className: "hjm-line-score__team", children: _jsxs("span", { className: "hjm-line-score__team-content", children: [renderTeam?.(team), _jsx("span", { children: team.name })] }) }), periods.map((column, index) => {
|
|
66
|
+
return _jsx("th", { scope: "col", className: "hjm-line-score__period", "data-period": index + 1, "aria-current": live ? "true" : undefined, "data-current": live || undefined, children: column.header }, column.id);
|
|
67
|
+
}), totalColumns.map((column, index) => (_jsx("th", { scope: "col", className: classNames("hjm-line-score__total", index === 0 && "hjm-line-score__total-edge"), style: totalOffset(totalColumns.length, index), children: column.header }, column.id)))] }) }), _jsx("tbody", { children: teams.map((team) => (_jsxs("tr", { "data-leader": score.leaderId === team.id || undefined, children: [_jsx("th", { scope: "row", className: "hjm-line-score__team", children: _jsxs("span", { className: "hjm-line-score__team-content", children: [renderTeam?.(team), _jsx("span", { children: team.name })] }) }), periods.map((column, index) => {
|
|
51
68
|
const value = team.periods[index];
|
|
52
69
|
return _jsx("td", { className: "hjm-line-score__period", "data-current": score.currentPeriod === index + 1 || undefined, "data-scored": typeof value === "number" && value > 0 || undefined, children: formatLineScoreCell(value) }, column.id);
|
|
53
|
-
}), totalColumns.map((column, index) => (_jsx("td", { className: classNames("hjm-line-score__total", index === 0 && "hjm-line-score__total-edge"), children: team.totals[column.header] ?? "—" }, column.id)))] }, team.id))) })] }) }));
|
|
70
|
+
}), totalColumns.map((column, index) => (_jsx("td", { className: classNames("hjm-line-score__total", index === 0 && "hjm-line-score__total-edge"), style: totalOffset(totalColumns.length, index), children: team.totals[column.header] ?? "—" }, column.id)))] }, team.id))) })] }) }));
|
|
54
71
|
}
|
|
55
72
|
export function MatrixTable({ ids, labelOf, getCell, highlightId = null, heatColors, accessibilityLabel, className, layoutStyle }) {
|
|
56
73
|
const matrix = resolveMatrix(ids, getCell);
|
package/dist/table-family.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-family.js","sourceRoot":"","sources":["../src/table-family.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,qBAAqB,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,GAEnH,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;GAIG;AAEH,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,kIAAkI;AAClI,MAAM,UAAU,aAAa,CAAC,SAAyB;IACrD,MAAM,IAAI,GAAG,SAAS,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,SAAS,EAAC,8BAA8B,iBAAa,MAAM,aAC9D,2BAAgB,MAAM,KAAK,CAAC,IAAI,SAAS,YAAG,KAAK,CAAC,CAAC,CAAC,GAAQ,EAC5D,eAAM,SAAS,EAAC,6BAA6B,YAAE,GAAG,CAAC,KAAK,GAAQ,EAChE,2BAAgB,MAAM,KAAK,CAAC,IAAI,SAAS,YAAG,KAAK,CAAC,CAAC,CAAC,GAAQ,IACxD,EACN,cAAK,SAAS,EAAC,4BAA4B,iBAAa,MAAM,YAC1D,CAAC,CAAC,EAAE,CAAC,CAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAChC,eAAkB,SAAS,EAAC,6BAA6B,eAAY,KAAK,YACxE,eACE,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAC1J,IAJO,KAAK,CAKT,CACR,CAAC,GACE,KAjBC,GAAG,CAAC,EAAE,CAkBV,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,IACG,CACX,CAAC;AACJ,CAAC","sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport type { ColorReference } from \"@hjmds/design-contracts/color-references\";\nimport {\n dataTableFamilyRecipe, dataTableRecipe, formatLineScoreCell, resolveComparisonRow, resolveLineScore, resolveMatrix,\n type ComparisonRow, type DataTableCellHeat, type DataTableCellTone, type LineScoreTeam, type MatrixCell,\n} from \"@hjmds/design-contracts/components/data-table\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n/*\n * Table family companions (2026-10-14): layouts products kept hand-building next to DataTable.\n * LineScore follows MLB/ESPN game headers, MatrixTable a head-to-head cross table, ComparisonTable\n * the ESPN matchup rows. Geometry and rules live in the data-table contract; these only draw.\n */\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n/** Recipe colors resolve through the provider's CSS variables so a theme switch repaints without re-rendering (same as Chart). */\nexport function tableCssColor(reference: ColorReference): string {\n const name = reference.source === \"theme\"\n ? `--hjm-color-${kebab(reference.key)}`\n : reference.source === \"accent\" ? `--hjm-accent-${kebab(reference.key)}` : `--hjm-accent-fill-${kebab(reference.key)}`;\n return reference.alpha === undefined || reference.alpha === 1\n ? `var(${name})`\n : `color-mix(in srgb, var(${name}) ${Math.round(reference.alpha * 100)}%, transparent)`;\n}\n\n/** Live period and \"my team\" row reuse the shared selected-row tint. */\nconst familyStyle = { \"--hjm-table-family-selected\": tableCssColor(dataTableRecipe.row.selectedBackground) } as CSSProperties;\nconst withFamilyStyle = (layoutStyle: HjmCompositionStyleProp | undefined) => ({ ...familyStyle, ...layoutStyle }) as CSSProperties;\n\nexport type TableHeatColors = Readonly<{ high: string; low: string }>;\n\n/**\n * Cell emphasis as inline style. Heat paints a background *image* so pinned cells keep their opaque\n * canvas color underneath and scrolled content never shows through the translucent tint.\n */\nexport function tableCellEmphasis(\n decoration: Readonly<{ tone?: DataTableCellTone | null; heat?: DataTableCellHeat | null }> | null | undefined,\n heatColors?: TableHeatColors,\n): Readonly<{ style: CSSProperties; tone?: DataTableCellTone; heat?: string }> {\n if (!decoration) return { style: {} };\n const style: Record<string, string | number> = {};\n const tone = decoration.tone ?? undefined, heat = decoration.heat ?? null;\n if (tone) {\n style.color = tableCssColor(dataTableFamilyRecipe.tone[tone].color);\n style.fontWeight = dataTableFamilyRecipe.tone[tone].fontWeight;\n }\n if (heat) {\n const base = heatColors?.[heat.side] ?? tableCssColor(dataTableFamilyRecipe.heat[heat.side]);\n style[\"--hjm-data-table-heat\"] = `color-mix(in srgb, ${base} ${Math.round(dataTableFamilyRecipe.heatAlpha[heat.strength] * 100)}%, transparent)`;\n }\n return { style: style as CSSProperties, ...(tone ? { tone } : {}), ...(heat ? { heat: `${heat.side}-${heat.strength}` } : {}) };\n}\n\n/* ---------------------------------------------- Line score ------------------------------------- */\n\nexport type LineScoreProps = Readonly<{\n teams: readonly LineScoreTeam[];\n /** Total column headers in order, e.g. [\"R\", \"H\", \"E\", \"B\"]. The first one decides the leader. */\n totals: readonly string[];\n /** Live period (1-based) to highlight. */\n currentPeriod?: number | null;\n minPeriods?: number;\n /** Optional leading content per team (logo/badge). */\n renderTeam?: (team: LineScoreTeam) => ReactNode;\n /** Accessible name of the table (prop name kept for Native parity). */\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function LineScore({ teams, totals, currentPeriod = null, minPeriods, renderTeam, accessibilityLabel, className, layoutStyle }: LineScoreProps) {\n const score = resolveLineScore(teams, { totals, currentPeriod, ...(minPeriods !== undefined ? { minPeriods } : {}) });\n const periods = score.columns.filter((column) => column.kind === \"period\");\n const totalColumns = score.columns.filter((column) => column.kind === \"total\");\n return (\n <div className={classNames(\"hjm-table-family\", \"hjm-line-score\", className)} style={withFamilyStyle(layoutStyle)}>\n <table className=\"hjm-line-score__table\" aria-label={accessibilityLabel}>\n <thead>\n <tr>\n <td className=\"hjm-line-score__team\" />\n {periods.map((column, index) => {\n const live = score.currentPeriod === index + 1;\n return <th key={column.id} scope=\"col\" className=\"hjm-line-score__period\" aria-current={live ? \"true\" : undefined} data-current={live || undefined}>{column.header}</th>;\n })}\n {totalColumns.map((column, index) => (\n <th key={column.id} scope=\"col\" className={classNames(\"hjm-line-score__total\", index === 0 && \"hjm-line-score__total-edge\")}>{column.header}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {teams.map((team) => (\n <tr key={team.id} data-leader={score.leaderId === team.id || undefined}>\n <th scope=\"row\" className=\"hjm-line-score__team\">\n <span className=\"hjm-line-score__team-content\">{renderTeam?.(team)}<span>{team.name}</span></span>\n </th>\n {periods.map((column, index) => {\n const value = team.periods[index];\n return <td key={column.id} className=\"hjm-line-score__period\" data-current={score.currentPeriod === index + 1 || undefined} data-scored={typeof value === \"number\" && value > 0 || undefined}>{formatLineScoreCell(value)}</td>;\n })}\n {totalColumns.map((column, index) => (\n <td key={column.id} className={classNames(\"hjm-line-score__total\", index === 0 && \"hjm-line-score__total-edge\")}>{team.totals[column.header] ?? \"—\"}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n/* ---------------------------------------------- Matrix table ----------------------------------- */\n\nexport type MatrixTableProps<Key extends string = string> = Readonly<{\n ids: readonly Key[];\n /** Short header per id (team short name). */\n labelOf: (id: Key) => string;\n getCell: (row: Key, column: Key) => MatrixCell | null;\n /** Row id to highlight (my team). */\n highlightId?: Key | null;\n heatColors?: TableHeatColors;\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function MatrixTable<Key extends string = string>({ ids, labelOf, getCell, highlightId = null, heatColors, accessibilityLabel, className, layoutStyle }: MatrixTableProps<Key>) {\n const matrix = resolveMatrix(ids, getCell);\n return (\n <div className={classNames(\"hjm-table-family\", \"hjm-matrix-table\", className)} style={withFamilyStyle(layoutStyle)}>\n <table className=\"hjm-matrix-table__table\" aria-label={accessibilityLabel}>\n <thead>\n <tr>\n <td className=\"hjm-matrix-table__corner\" />\n {ids.map((id) => <th key={id} scope=\"col\">{labelOf(id)}</th>)}\n </tr>\n </thead>\n <tbody>\n {matrix.map((cells, rowIndex) => {\n const rowId = ids[rowIndex]!;\n return (\n <tr key={rowId} data-highlighted={rowId === highlightId || undefined}>\n <th scope=\"row\">{labelOf(rowId)}</th>\n {cells.map((cell, columnIndex) => {\n // The diagonal is a team against itself: blank and hidden, not \"no record\".\n if (cell === \"self\") return <td key={ids[columnIndex]} className=\"hjm-matrix-table__self\" aria-hidden=\"true\" />;\n const emphasis = tableCellEmphasis(cell, heatColors);\n return <td key={ids[columnIndex]} className={emphasis.heat ? \"hjm-table-family__heat\" : undefined} style={emphasis.style} data-tone={emphasis.tone} data-heat={emphasis.heat}>{cell?.label ?? \"—\"}</td>;\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n}\n\n/* ---------------------------------------------- Comparison table ------------------------------- */\n\nexport type ComparisonTableProps = Readonly<{\n rows: readonly ComparisonRow[];\n /** Side names and accent colors (team colors). */\n sides: readonly [Readonly<{ name: string; color: string }>, Readonly<{ name: string; color: string }>];\n /** Hide duplicate visual names when the two sides are already identified above; spoken row labels retain them. */\n showSideNames?: boolean;\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function ComparisonTable({ rows, sides, showSideNames = true, accessibilityLabel, className, layoutStyle }: ComparisonTableProps) {\n return (\n <section className={classNames(\"hjm-table-family\", \"hjm-comparison-table\", className)} style={withFamilyStyle(layoutStyle)} aria-label={accessibilityLabel}>\n {showSideNames && <div className=\"hjm-comparison-table__sides\" aria-hidden=\"true\">\n {sides.map((side, index) => <span key={index} style={{ color: side.color }}>{side.name}</span>)}\n </div>}\n <ul className=\"hjm-comparison-table__rows\" role=\"list\">\n {rows.map((row) => {\n const { winner, shares } = resolveComparisonRow(row);\n const shown = row.display ?? [row.values[0] === null ? \"—\" : String(row.values[0]), row.values[1] === null ? \"—\" : String(row.values[1])];\n return (\n <li key={row.id} className=\"hjm-comparison-table__row\" data-winner={winner ?? undefined}>\n {/* One sentence for assistive tech; the visual grid and bars are decoration. */}\n <span className=\"hjm-visually-hidden\">{`${row.label} ${sides[0].name} ${shown[0]}, ${sides[1].name} ${shown[1]}`}</span>\n <div className=\"hjm-comparison-table__values\" aria-hidden=\"true\">\n <span data-win={winner === 0 || undefined}>{shown[0]}</span>\n <span className=\"hjm-comparison-table__label\">{row.label}</span>\n <span data-win={winner === 1 || undefined}>{shown[1]}</span>\n </div>\n <div className=\"hjm-comparison-table__bars\" aria-hidden=\"true\">\n {([0, 1] as const).map((index) => (\n <span key={index} className=\"hjm-comparison-table__track\" data-side={index}>\n <span\n className=\"hjm-comparison-table__bar\"\n style={{ inlineSize: `${Math.round(shares[index] * 1000) / 10}%`, background: sides[index].color, opacity: winner === null || winner === index ? 1 : 0.6 }}\n />\n </span>\n ))}\n </div>\n </li>\n );\n })}\n </ul>\n </section>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"table-family.js","sourceRoot":"","sources":["../src/table-family.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAsC,MAAM,OAAO,CAAC;AAEpF,OAAO,EACL,qBAAqB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,GAElG,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;GAIG;AAEH,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,kIAAkI;AAClI,MAAM,UAAU,aAAa,CAAC,SAAyB;IACrD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,KAAK,OAAO;QACvC,CAAC,CAAC,eAAe,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;IACzH,OAAO,SAAS,CAAC,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,CAAC;QAC3D,CAAC,CAAC,OAAO,IAAI,GAAG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AAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAC1J,IAJO,KAAK,CAKT,CACR,CAAC,GACE,KAjBC,GAAG,CAAC,EAAE,CAkBV,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,IACG,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { useLayoutEffect, useRef, type CSSProperties, type ReactNode } from \"react\";\nimport type { ColorReference } from \"@hjmds/design-contracts/color-references\";\nimport {\n dataTableFamilyRecipe, formatLineScoreCell, resolveComparisonRow, resolveLineScore, resolveMatrix,\n type ComparisonRow, type DataTableCellHeat, type DataTableCellTone, type LineScoreTeam, type MatrixCell,\n} from \"@hjmds/design-contracts/components/data-table\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n/*\n * Table family companions (2026-10-14): layouts products kept hand-building next to DataTable.\n * LineScore follows MLB/ESPN game headers, MatrixTable a head-to-head cross table, ComparisonTable\n * the ESPN matchup rows. Geometry and rules live in the data-table contract; these only draw.\n */\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n/** Recipe colors resolve through the provider's CSS variables so a theme switch repaints without re-rendering (same as Chart). */\nexport function tableCssColor(reference: ColorReference): string {\n const name = reference.source === \"theme\"\n ? `--hjm-color-${kebab(reference.key)}`\n : reference.source === \"accent\" ? `--hjm-accent-${kebab(reference.key)}` : `--hjm-accent-fill-${kebab(reference.key)}`;\n return reference.alpha === undefined || reference.alpha === 1\n ? `var(${name})`\n : `color-mix(in srgb, var(${name}) ${Math.round(reference.alpha * 100)}%, transparent)`;\n}\n\n/** Live period and \"my team\" row share the family highlight tint. */\nconst familyStyle = { \"--hjm-table-family-selected\": tableCssColor(dataTableFamilyRecipe.highlight.background) } as CSSProperties;\nconst withFamilyStyle = (layoutStyle: HjmCompositionStyleProp | undefined) => ({ ...familyStyle, ...layoutStyle }) as CSSProperties;\n\nexport type TableHeatColors = Readonly<{ high: string; low: string }>;\n\n/**\n * Cell emphasis as inline style. Heat paints a background *image* so pinned cells keep their opaque\n * canvas color underneath and scrolled content never shows through the translucent tint.\n */\nexport function tableCellEmphasis(\n decoration: Readonly<{ tone?: DataTableCellTone | null; heat?: DataTableCellHeat | null }> | null | undefined,\n heatColors?: TableHeatColors,\n): Readonly<{ style: CSSProperties; tone?: DataTableCellTone; heat?: string }> {\n if (!decoration) return { style: {} };\n const style: Record<string, string | number> = {};\n const tone = decoration.tone ?? undefined, heat = decoration.heat ?? null;\n if (tone) {\n style.color = tableCssColor(dataTableFamilyRecipe.tone[tone].color);\n style.fontWeight = dataTableFamilyRecipe.tone[tone].fontWeight;\n }\n if (heat) {\n const base = heatColors?.[heat.side] ?? tableCssColor(dataTableFamilyRecipe.heat[heat.side]);\n style[\"--hjm-data-table-heat\"] = `color-mix(in srgb, ${base} ${Math.round(dataTableFamilyRecipe.heatAlpha[heat.strength] * 100)}%, transparent)`;\n }\n return { style: style as CSSProperties, ...(tone ? { tone } : {}), ...(heat ? { heat: `${heat.side}-${heat.strength}` } : {}) };\n}\n\n/* ---------------------------------------------- Line score ------------------------------------- */\n\n/**\n * Team and total columns stay pinned while only the periods scroll, as on Native: at 402px the totals — the result —\n * scrolled off with the extra innings (2026-10-17 review E17). Totals have a fixed width so each can pin at its offset.\n */\nconst totalOffset = (count: number, index: number): CSSProperties => ({ insetInlineEnd: `calc(var(--hjm-line-score-total-width) * ${count - 1 - index})` });\n\nexport type LineScoreProps = Readonly<{\n teams: readonly LineScoreTeam[];\n /** Total column headers in order, e.g. [\"R\", \"H\", \"E\", \"B\"]. The first one decides the leader. */\n totals: readonly string[];\n /** Live period (1-based) to highlight. */\n currentPeriod?: number | null;\n minPeriods?: number;\n /** Optional leading content per team (logo/badge). */\n renderTeam?: (team: LineScoreTeam) => ReactNode;\n /** Accessible name of the table (prop name kept for Native parity). */\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function LineScore({ teams, totals, currentPeriod = null, minPeriods, renderTeam, accessibilityLabel, className, layoutStyle }: LineScoreProps) {\n const score = resolveLineScore(teams, { totals, currentPeriod, ...(minPeriods !== undefined ? { minPeriods } : {}) });\n const periods = score.columns.filter((column) => column.kind === \"period\");\n const totalColumns = score.columns.filter((column) => column.kind === \"total\");\n // Open the period strip at the live (or latest) period, as Native: starting at inning 1 hid extra innings behind the\n // pinned totals and read as a shorter game (2026-10-17 review N4). scroll-padding keeps it clear of the totals.\n const host = useRef<HTMLDivElement>(null);\n const focusPeriod = score.currentPeriod ?? periods.length;\n useLayoutEffect(() => {\n const container = host.current;\n if (!container || container.scrollWidth <= container.clientWidth) return;\n container.querySelector<HTMLElement>(`thead [data-period=\"${focusPeriod}\"]`)?.scrollIntoView({ block: \"nearest\", inline: \"nearest\" });\n }, [focusPeriod, periods.length]);\n return (\n <div ref={host} className={classNames(\"hjm-table-family\", \"hjm-line-score\", className)} style={{ ...withFamilyStyle(layoutStyle), \"--hjm-line-score-total-count\": totalColumns.length } as CSSProperties}>\n <table className=\"hjm-line-score__table\" aria-label={accessibilityLabel}>\n <thead>\n <tr>\n <td className=\"hjm-line-score__team\" />\n {periods.map((column, index) => {\n const live = score.currentPeriod === index + 1;\n return <th key={column.id} scope=\"col\" className=\"hjm-line-score__period\" data-period={index + 1} aria-current={live ? \"true\" : undefined} data-current={live || undefined}>{column.header}</th>;\n })}\n {totalColumns.map((column, index) => (\n <th key={column.id} scope=\"col\" className={classNames(\"hjm-line-score__total\", index === 0 && \"hjm-line-score__total-edge\")} style={totalOffset(totalColumns.length, index)}>{column.header}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {teams.map((team) => (\n <tr key={team.id} data-leader={score.leaderId === team.id || undefined}>\n <th scope=\"row\" className=\"hjm-line-score__team\">\n <span className=\"hjm-line-score__team-content\">{renderTeam?.(team)}<span>{team.name}</span></span>\n </th>\n {periods.map((column, index) => {\n const value = team.periods[index];\n return <td key={column.id} className=\"hjm-line-score__period\" data-current={score.currentPeriod === index + 1 || undefined} data-scored={typeof value === \"number\" && value > 0 || undefined}>{formatLineScoreCell(value)}</td>;\n })}\n {totalColumns.map((column, index) => (\n <td key={column.id} className={classNames(\"hjm-line-score__total\", index === 0 && \"hjm-line-score__total-edge\")} style={totalOffset(totalColumns.length, index)}>{team.totals[column.header] ?? \"—\"}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n/* ---------------------------------------------- Matrix table ----------------------------------- */\n\nexport type MatrixTableProps<Key extends string = string> = Readonly<{\n ids: readonly Key[];\n /** Short header per id (team short name). */\n labelOf: (id: Key) => string;\n getCell: (row: Key, column: Key) => MatrixCell | null;\n /** Row id to highlight (my team). */\n highlightId?: Key | null;\n heatColors?: TableHeatColors;\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function MatrixTable<Key extends string = string>({ ids, labelOf, getCell, highlightId = null, heatColors, accessibilityLabel, className, layoutStyle }: MatrixTableProps<Key>) {\n const matrix = resolveMatrix(ids, getCell);\n return (\n <div className={classNames(\"hjm-table-family\", \"hjm-matrix-table\", className)} style={withFamilyStyle(layoutStyle)}>\n <table className=\"hjm-matrix-table__table\" aria-label={accessibilityLabel}>\n <thead>\n <tr>\n <td className=\"hjm-matrix-table__corner\" />\n {ids.map((id) => <th key={id} scope=\"col\">{labelOf(id)}</th>)}\n </tr>\n </thead>\n <tbody>\n {matrix.map((cells, rowIndex) => {\n const rowId = ids[rowIndex]!;\n return (\n <tr key={rowId} data-highlighted={rowId === highlightId || undefined}>\n <th scope=\"row\">{labelOf(rowId)}</th>\n {cells.map((cell, columnIndex) => {\n // The diagonal is a team against itself: blank and hidden, not \"no record\".\n if (cell === \"self\") return <td key={ids[columnIndex]} className=\"hjm-matrix-table__self\" aria-hidden=\"true\" />;\n const emphasis = tableCellEmphasis(cell, heatColors);\n return <td key={ids[columnIndex]} className={emphasis.heat ? \"hjm-table-family__heat\" : undefined} style={emphasis.style} data-tone={emphasis.tone} data-heat={emphasis.heat}>{cell?.label ?? \"—\"}</td>;\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n}\n\n/* ---------------------------------------------- Comparison table ------------------------------- */\n\nexport type ComparisonTableProps = Readonly<{\n rows: readonly ComparisonRow[];\n /** Side names and accent colors (team colors). */\n sides: readonly [Readonly<{ name: string; color: string }>, Readonly<{ name: string; color: string }>];\n /** Hide duplicate visual names when the two sides are already identified above; spoken row labels retain them. */\n showSideNames?: boolean;\n accessibilityLabel: string;\n className?: string;\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport function ComparisonTable({ rows, sides, showSideNames = true, accessibilityLabel, className, layoutStyle }: ComparisonTableProps) {\n return (\n <section className={classNames(\"hjm-table-family\", \"hjm-comparison-table\", className)} style={withFamilyStyle(layoutStyle)} aria-label={accessibilityLabel}>\n {showSideNames && <div className=\"hjm-comparison-table__sides\" aria-hidden=\"true\">\n {sides.map((side, index) => <span key={index} style={{ color: side.color }}>{side.name}</span>)}\n </div>}\n <ul className=\"hjm-comparison-table__rows\" role=\"list\">\n {rows.map((row) => {\n const { winner, shares } = resolveComparisonRow(row);\n const shown = row.display ?? [row.values[0] === null ? \"—\" : String(row.values[0]), row.values[1] === null ? \"—\" : String(row.values[1])];\n return (\n <li key={row.id} className=\"hjm-comparison-table__row\" data-winner={winner ?? undefined}>\n {/* One sentence for assistive tech; the visual grid and bars are decoration. */}\n <span className=\"hjm-visually-hidden\">{`${row.label} ${sides[0].name} ${shown[0]}, ${sides[1].name} ${shown[1]}`}</span>\n <div className=\"hjm-comparison-table__values\" aria-hidden=\"true\">\n <span data-win={winner === 0 || undefined}>{shown[0]}</span>\n <span className=\"hjm-comparison-table__label\">{row.label}</span>\n <span data-win={winner === 1 || undefined}>{shown[1]}</span>\n </div>\n <div className=\"hjm-comparison-table__bars\" aria-hidden=\"true\">\n {([0, 1] as const).map((index) => (\n <span key={index} className=\"hjm-comparison-table__track\" data-side={index}>\n <span\n className=\"hjm-comparison-table__bar\"\n style={{ inlineSize: `${Math.round(shares[index] * 1000) / 10}%`, background: sides[index].color, opacity: winner === null || winner === index ? 1 : 0.6 }}\n />\n </span>\n ))}\n </div>\n </li>\n );\n })}\n </ul>\n </section>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-controls.d.ts","sourceRoot":"","sources":["../src/task-controls.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,oBAAoB,EAAsB,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"task-controls.d.ts","sourceRoot":"","sources":["../src/task-controls.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,oBAAoB,EAAsB,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAI1K,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAsBpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,YAAY,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;IAChG,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACjF,CAAC,CAAC;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAQlD;AAED,MAAM,MAAM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AE,MAAM,KAAK,IAAI,CAAC;IAC5G,WAAW,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IACxF,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC/E,CAAC,CAAC;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAUtD"}
|
package/dist/task-controls.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { resolveTaskChoice, resolvePasswordRules, resolvePriceOption } from "@hjmds/design-contracts/task-controls";
|
|
4
|
-
import { Button } from "./actions.js";
|
|
4
|
+
import { Button, IconButton } from "./actions.js";
|
|
5
|
+
import { Icon } from "./supplemental-display.js";
|
|
5
6
|
import { Menu } from "./overlays.js";
|
|
6
7
|
import { PasswordField } from "./forms.js";
|
|
7
8
|
import { RadioGroup } from "./selection.js";
|
|
@@ -11,9 +12,12 @@ import { Stack, Text } from "./layout.js";
|
|
|
11
12
|
import { useCompositionAction } from "./internal/use-composition-action.js";
|
|
12
13
|
function ChoiceMenu(props) {
|
|
13
14
|
const available = props.choices.some(choice => !choice.disabled);
|
|
15
|
+
if (props.trigger === "icon" && !available)
|
|
16
|
+
return _jsx(IconButton, { label: props.label, tone: "secondary", disabled: true, children: _jsx(Icon, { name: "chevronDown" }) });
|
|
14
17
|
if (!available)
|
|
15
18
|
return _jsx(Button, { disabled: true, children: props.label });
|
|
16
|
-
|
|
19
|
+
const trigger = props.trigger === "icon" ? _jsx(IconButton, { label: props.label, tone: "secondary", children: _jsx(Icon, { name: "chevronDown" }) }) : _jsx(Button, { tone: "secondary", loading: props.pending === true, children: props.label });
|
|
20
|
+
return _jsx(Menu, { label: props.label, trigger: trigger, disabled: props.disabled, items: props.choices, selectionMode: "single", value: props.selectedId, onValueChange: () => undefined, onActionAfterDismiss: props.onChoose });
|
|
17
21
|
}
|
|
18
22
|
function Failure({ failed, label }) {
|
|
19
23
|
return failed ? _jsx(Text, { role: "alert", tone: "danger", style: { textAlign: "center" }, children: label }) : null;
|
|
@@ -21,8 +25,9 @@ function Failure({ failed, label }) {
|
|
|
21
25
|
export function SplitAction(props) {
|
|
22
26
|
const mode = resolveTaskChoice(props.modes, props.modeId), action = useCompositionAction(props.disabled);
|
|
23
27
|
const locked = props.disabled === true || action.pending;
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
// The mode menu is a chevron tool at the action's end, inline gap 12 (button.md); a second text button read as an unrelated action (2026-10-17 review).
|
|
29
|
+
return _jsxs(Stack, { gap: "sm", children: [_jsxs(Stack, { axis: "inline", gap: "sm", align: "center", children: [_jsx(Button, { loading: action.pending, disabled: props.disabled === true || mode.disabled === true, onClick: () => { if (!mode.disabled)
|
|
30
|
+
void action.run(mode.id, () => props.onExecute(mode.id)); }, children: props.executeLabel(mode) }), _jsx(ChoiceMenu, { trigger: "icon", choices: props.modes, selectedId: mode.id, label: props.menuLabel, dismissLabel: props.dismissLabel, disabled: locked, onChoose: id => { if (!locked && !resolveTaskChoice(props.modes, id).disabled)
|
|
26
31
|
props.onModeChange(id); } })] }), _jsx(Failure, { failed: action.failed, label: props.errorLabel })] });
|
|
27
32
|
}
|
|
28
33
|
export function AccountSwitcher(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-controls.js","sourceRoot":"","sources":["../src/task-controls.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,kBAAkB,EAAwD,MAAM,uCAAuC,CAAC;AAC1K,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,eA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AAK,CAAC,aAAa,GAAU,EACzS,KAAC,OAAO,IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,GAAI,IAAQ,GAAO,CAAC;AAC/E,CAAC","sourcesContent":["\"use client\";\nimport { resolveTaskChoice, resolvePasswordRules, resolvePriceOption, type TaskChoice, type PasswordRule, type PriceOption } from \"@hjmds/design-contracts/task-controls\";\nimport { Button } from \"./actions.js\";\nimport { Menu } from \"./overlays.js\";\nimport { PasswordField, type PasswordFieldProps } from \"./forms.js\";\nimport { RadioGroup } from \"./selection.js\";\nimport { Card } from \"./display.js\";\nimport { Progress } from \"./feedback.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\ntype ChoiceMenuProps = Readonly<{ choices: readonly TaskChoice[]; selectedId: string; label: string; dismissLabel: string; disabled: boolean; pending?: boolean; onChoose: (id: string) => void }>;\nfunction ChoiceMenu(props: ChoiceMenuProps) {\n const available = props.choices.some(choice => !choice.disabled);\n if (!available) return <Button disabled>{props.label}</Button>;\n return <Menu label={props.label} trigger={<Button tone=\"secondary\" loading={props.pending === true}>{props.label}</Button>} disabled={props.disabled}\n items={props.choices} selectionMode=\"single\" value={props.selectedId} onValueChange={() => undefined} onActionAfterDismiss={props.onChoose} />;\n}\nfunction Failure({ failed, label }: Readonly<{ failed: boolean; label: string }>) {\n return failed ? <Text role=\"alert\" tone=\"danger\" style={{ textAlign: \"center\" }}>{label}</Text> : null;\n}\n\nexport type SplitActionProps = Readonly<{\n modes: readonly TaskChoice[]; modeId: string; onModeChange: (id: string) => void;\n onExecute: (modeId: string) => void | Promise<void>; executeLabel: (mode: TaskChoice) => string;\n menuLabel: string; dismissLabel: string; errorLabel: string; disabled?: boolean;\n}>;\nexport function SplitAction(props: SplitActionProps) {\n const mode = resolveTaskChoice(props.modes, props.modeId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n return <Stack gap=\"sm\"><Stack axis=\"inline\" gap=\"xs\" wrap>\n <Button loading={action.pending} disabled={props.disabled === true || mode.disabled === true} onClick={() => { if (!mode.disabled) void action.run(mode.id, () => props.onExecute(mode.id)); }}>{props.executeLabel(mode)}</Button>\n <ChoiceMenu choices={props.modes} selectedId={mode.id} label={props.menuLabel} dismissLabel={props.dismissLabel} disabled={locked} onChoose={id => { if (!locked && !resolveTaskChoice(props.modes, id).disabled) props.onModeChange(id); }} />\n </Stack><Failure failed={action.failed} label={props.errorLabel} /></Stack>;\n}\n\nexport type AccountSwitcherProps = Readonly<{\n accounts: readonly TaskChoice[]; accountId: string; label: string; dismissLabel: string; errorLabel: string;\n onSwitch: (accountId: string) => void | Promise<void>; disabled?: boolean;\n}>;\nexport function AccountSwitcher(props: AccountSwitcherProps) {\n const account = resolveTaskChoice(props.accounts, props.accountId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n // The controlled account stays confirmed until the product completes the session change.\n return <Stack gap=\"sm\"><Text emphasis=\"strong\">{account.label}</Text><ChoiceMenu choices={props.accounts} selectedId={account.id} label={props.label} dismissLabel={props.dismissLabel} disabled={locked} pending={action.pending}\n onChoose={id => { if (id !== account.id && !resolveTaskChoice(props.accounts, id).disabled) void action.run(id, () => props.onSwitch(id)); }} />\n <Failure failed={action.failed} label={props.errorLabel} /></Stack>;\n}\n\nexport type PasswordRulesFieldProps = Omit<PasswordFieldProps, \"value\" | \"defaultValue\" | \"onValueChange\"> & Readonly<{\n label: string; value: string; onValueChange: (value: string) => void; rules: readonly PasswordRule[];\n progressLabel: string; summaryLabel: (satisfied: number, total: number) => string;\n ruleLabel: (rule: ReturnType<typeof resolvePasswordRules>[\"rules\"][number]) => string;\n}>;\nexport function PasswordRulesField({ rules, progressLabel, summaryLabel, ruleLabel, ...field }: PasswordRulesFieldProps) {\n const state = resolvePasswordRules(field.value, rules);\n return <Stack gap=\"sm\"><PasswordField {...field} />\n <Progress label={progressLabel} value={state.satisfied} max={state.total} valueText={summaryLabel(state.satisfied, state.total)} />\n {state.rules.map(rule => <Text key={rule.id} variant=\"caption\" tone={rule.satisfied ? \"primary\" : \"muted\"}>{ruleLabel(rule)}</Text>)}\n </Stack>;\n}\n\nexport type PricingChoiceProps = Readonly<{\n label: string; options: readonly PriceOption[]; selectedId: string; onSelectionChange: (id: string) => void;\n formatPrice: (option: PriceOption) => string; continueLabel: string; errorLabel: string;\n onContinue: (option: PriceOption) => void | Promise<void>; disabled?: boolean;\n}>;\nexport function PricingChoice(props: PricingChoiceProps) {\n const option = resolvePriceOption(props.options, props.selectedId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n return <Card title={props.label}><Stack gap=\"md\"><RadioGroup accessibilityLabel={props.label} presentation=\"card\" value={option.id} disabled={locked}\n items={props.options.map(price => ({ value: price.id, label: price.label, description: props.formatPrice(price), disabled: price.disabled === true }))}\n onValueChange={id => { if (id !== null && !locked && !resolveTaskChoice(props.options, id).disabled) props.onSelectionChange(id); }} />\n <Text emphasis=\"strong\">{props.formatPrice(option)}</Text>\n {option.benefits.map((benefit, index) => <Text key={index}>{benefit}</Text>)}\n <Button loading={action.pending} disabled={props.disabled === true || option.disabled === true} onClick={() => { if (!option.disabled) void action.run(option.id, () => props.onContinue(Object.freeze({ ...option, benefits: Object.freeze([...option.benefits]) }))); }}>{props.continueLabel}</Button>\n <Failure failed={action.failed} label={props.errorLabel} /></Stack></Card>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"task-controls.js","sourceRoot":"","sources":["../src/task-controls.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,kBAAkB,EAAwD,MAAM,uCAAuC,CAAC;AAC1K,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC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,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ;wBAAE,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAG,KAAK,CAAC,aAAa,GAAU,EACzS,KAAC,OAAO,IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,GAAI,IAAQ,GAAO,CAAC;AAC/E,CAAC","sourcesContent":["\"use client\";\nimport { resolveTaskChoice, resolvePasswordRules, resolvePriceOption, type TaskChoice, type PasswordRule, type PriceOption } from \"@hjmds/design-contracts/task-controls\";\nimport { Button, IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { Menu } from \"./overlays.js\";\nimport { PasswordField, type PasswordFieldProps } from \"./forms.js\";\nimport { RadioGroup } from \"./selection.js\";\nimport { Card } from \"./display.js\";\nimport { Progress } from \"./feedback.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\ntype ChoiceMenuProps = Readonly<{ choices: readonly TaskChoice[]; selectedId: string; label: string; dismissLabel: string; disabled: boolean; pending?: boolean; onChoose: (id: string) => void;\n /** `icon`: a chevron tool beside the action it modifies (SplitAction); the label stays the accessible name. */\n trigger?: \"text\" | \"icon\" }>;\nfunction ChoiceMenu(props: ChoiceMenuProps) {\n const available = props.choices.some(choice => !choice.disabled);\n if (props.trigger === \"icon\" && !available) return <IconButton label={props.label} tone=\"secondary\" disabled><Icon name=\"chevronDown\" /></IconButton>;\n if (!available) return <Button disabled>{props.label}</Button>;\n const trigger = props.trigger === \"icon\" ? <IconButton label={props.label} tone=\"secondary\"><Icon name=\"chevronDown\" /></IconButton> : <Button tone=\"secondary\" loading={props.pending === true}>{props.label}</Button>;\n return <Menu label={props.label} trigger={trigger} disabled={props.disabled}\n items={props.choices} selectionMode=\"single\" value={props.selectedId} onValueChange={() => undefined} onActionAfterDismiss={props.onChoose} />;\n}\nfunction Failure({ failed, label }: Readonly<{ failed: boolean; label: string }>) {\n return failed ? <Text role=\"alert\" tone=\"danger\" style={{ textAlign: \"center\" }}>{label}</Text> : null;\n}\n\nexport type SplitActionProps = Readonly<{\n modes: readonly TaskChoice[]; modeId: string; onModeChange: (id: string) => void;\n onExecute: (modeId: string) => void | Promise<void>; executeLabel: (mode: TaskChoice) => string;\n menuLabel: string; dismissLabel: string; errorLabel: string; disabled?: boolean;\n}>;\nexport function SplitAction(props: SplitActionProps) {\n const mode = resolveTaskChoice(props.modes, props.modeId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n // The mode menu is a chevron tool at the action's end, inline gap 12 (button.md); a second text button read as an unrelated action (2026-10-17 review).\n return <Stack gap=\"sm\"><Stack axis=\"inline\" gap=\"sm\" align=\"center\">\n <Button loading={action.pending} disabled={props.disabled === true || mode.disabled === true} onClick={() => { if (!mode.disabled) void action.run(mode.id, () => props.onExecute(mode.id)); }}>{props.executeLabel(mode)}</Button>\n <ChoiceMenu trigger=\"icon\" choices={props.modes} selectedId={mode.id} label={props.menuLabel} dismissLabel={props.dismissLabel} disabled={locked} onChoose={id => { if (!locked && !resolveTaskChoice(props.modes, id).disabled) props.onModeChange(id); }} />\n </Stack><Failure failed={action.failed} label={props.errorLabel} /></Stack>;\n}\n\nexport type AccountSwitcherProps = Readonly<{\n accounts: readonly TaskChoice[]; accountId: string; label: string; dismissLabel: string; errorLabel: string;\n onSwitch: (accountId: string) => void | Promise<void>; disabled?: boolean;\n}>;\nexport function AccountSwitcher(props: AccountSwitcherProps) {\n const account = resolveTaskChoice(props.accounts, props.accountId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n // The controlled account stays confirmed until the product completes the session change.\n return <Stack gap=\"sm\"><Text emphasis=\"strong\">{account.label}</Text><ChoiceMenu choices={props.accounts} selectedId={account.id} label={props.label} dismissLabel={props.dismissLabel} disabled={locked} pending={action.pending}\n onChoose={id => { if (id !== account.id && !resolveTaskChoice(props.accounts, id).disabled) void action.run(id, () => props.onSwitch(id)); }} />\n <Failure failed={action.failed} label={props.errorLabel} /></Stack>;\n}\n\nexport type PasswordRulesFieldProps = Omit<PasswordFieldProps, \"value\" | \"defaultValue\" | \"onValueChange\"> & Readonly<{\n label: string; value: string; onValueChange: (value: string) => void; rules: readonly PasswordRule[];\n progressLabel: string; summaryLabel: (satisfied: number, total: number) => string;\n ruleLabel: (rule: ReturnType<typeof resolvePasswordRules>[\"rules\"][number]) => string;\n}>;\nexport function PasswordRulesField({ rules, progressLabel, summaryLabel, ruleLabel, ...field }: PasswordRulesFieldProps) {\n const state = resolvePasswordRules(field.value, rules);\n return <Stack gap=\"sm\"><PasswordField {...field} />\n <Progress label={progressLabel} value={state.satisfied} max={state.total} valueText={summaryLabel(state.satisfied, state.total)} />\n {state.rules.map(rule => <Text key={rule.id} variant=\"caption\" tone={rule.satisfied ? \"primary\" : \"muted\"}>{ruleLabel(rule)}</Text>)}\n </Stack>;\n}\n\nexport type PricingChoiceProps = Readonly<{\n label: string; options: readonly PriceOption[]; selectedId: string; onSelectionChange: (id: string) => void;\n formatPrice: (option: PriceOption) => string; continueLabel: string; errorLabel: string;\n onContinue: (option: PriceOption) => void | Promise<void>; disabled?: boolean;\n}>;\nexport function PricingChoice(props: PricingChoiceProps) {\n const option = resolvePriceOption(props.options, props.selectedId), action = useCompositionAction(props.disabled);\n const locked = props.disabled === true || action.pending;\n return <Card title={props.label}><Stack gap=\"md\"><RadioGroup accessibilityLabel={props.label} presentation=\"card\" value={option.id} disabled={locked}\n items={props.options.map(price => ({ value: price.id, label: price.label, description: props.formatPrice(price), disabled: price.disabled === true }))}\n onValueChange={id => { if (id !== null && !locked && !resolveTaskChoice(props.options, id).disabled) props.onSelectionChange(id); }} />\n <Text emphasis=\"strong\">{props.formatPrice(option)}</Text>\n {option.benefits.map((benefit, index) => <Text key={index}>{benefit}</Text>)}\n <Button loading={action.pending} disabled={props.disabled === true || option.disabled === true} onClick={() => { if (!option.disabled) void action.run(option.id, () => props.onContinue(Object.freeze({ ...option, benefits: Object.freeze([...option.benefits]) }))); }}>{props.continueLabel}</Button>\n <Failure failed={action.failed} label={props.errorLabel} /></Stack></Card>;\n}\n"]}
|
package/dist/task-list.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type TaskListProps = Readonly<{
|
|
|
7
7
|
onCompletedChange: (id: string, completed: boolean) => void;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
emptyContent?: ReactNode;
|
|
10
|
-
/** Independent row action
|
|
10
|
+
/** Independent row action beside the checkbox; apply disabled to the supplied control. */
|
|
11
11
|
renderItemAction?: (context: Readonly<{
|
|
12
12
|
item: TaskItem;
|
|
13
13
|
disabled: boolean;
|
package/dist/task-list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-list.d.ts","sourceRoot":"","sources":["../src/task-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAI,EAAC,SAAS,EAAC,MAAI,OAAO,CAAC;AAClC,OAAM,EAAe,KAAK,QAAQ,EAAC,MAAI,mCAAmC,CAAC;AAE3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,MAAM,MAAM,aAAa,GAAC,QAAQ,CAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAA,KAAK,EAAC,SAAS,QAAQ,EAAE,CAAC;IAAA,iB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AgB,EAAC,gBAAgB,EAAC,WAAW,EAAC,EAAC,aAAa,+BAQ/I"}
|
package/dist/task-list.js
CHANGED
|
@@ -10,13 +10,14 @@ export function TaskList({ label, items, onCompletedChange, disabled = false, em
|
|
|
10
10
|
const renderItem = (item) => {
|
|
11
11
|
const control = _jsx(Checkbox, { label: item.label, checked: item.completed, disabled: disabled || item.disabled === true, onCheckedChange: completed => onCompletedChange(item.id, completed), ...(item.description === undefined ? {} : { description: item.description }) });
|
|
12
12
|
const action = renderItemAction?.({ item, disabled: disabled || item.disabled === true });
|
|
13
|
-
//
|
|
14
|
-
|
|
13
|
+
// The action sits beside Checkbox, never inside its label (pressing it must not toggle completion); long labels wrap
|
|
14
|
+
// inside the checkbox column. A separate action line made each task two to three lines tall (2026-10-17 review).
|
|
15
|
+
return _jsxs("div", { style: { display: "grid", gridTemplateColumns: action == null ? "minmax(0, 1fr)" : "minmax(0, 1fr) auto", alignItems: "center", gap: "var(--hjm-space-sm)" }, children: [control, action] });
|
|
15
16
|
};
|
|
16
17
|
if (items.length === 0)
|
|
17
18
|
return _jsx(List, { label: label, ...(layoutStyle === undefined ? {} : { layoutStyle }), children: emptyContent });
|
|
18
19
|
if (renderCollection)
|
|
19
20
|
return _jsx(_Fragment, { children: renderCollection({ items, renderItem }) });
|
|
20
|
-
return _jsx(List, { label: label, appearance: "grouped", ...(layoutStyle === undefined ? {} : { layoutStyle }), children: items.map(item => _jsx("div", { children: renderItem(item) }, item.id)) });
|
|
21
|
+
return _jsx(List, { label: label, appearance: "grouped", ...(layoutStyle === undefined ? {} : { layoutStyle }), children: items.map(item => _jsx("div", { style: { padding: "var(--hjm-space-md)" }, children: renderItem(item) }, item.id)) });
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=task-list.js.map
|
package/dist/task-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-list.js","sourceRoot":"","sources":["../src/task-list.tsx"],"names":[],"mappings":";AACA,OAAM,EAA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AAG,KAAK,CAAC,MAAM,KAAG,CAAC;QAAC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,KAAM,CAAC,WAAW,KAAG,SAAS,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,EAAC,WAAW,EAAC,CAAC,YAAG,YAAY,GAAQ,CAAC;IACrH,IAAG,gBAAgB;QAAC,OAAO,4BAAG,gBAAgB,CAAC,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,GAAI,CAAC;IACvE,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAC,SAAS,KAAK,CAAC,WAAW,KAAG,SAAS,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,EAAC,WAAW,EAAC,CAAC,YAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAA,EAAE,CAAA,cAAmB,KAAK,EAAE,EAAC,OAAO,EAAC,qBAAqB,EAAC,YAAG,UAAU,CAAC,IAAI,CAAC,IAAlE,IAAI,CAAC,EAAE,CAAkE,CAAC,GAAQ,CAAC;AAC/M,CAAC","sourcesContent":["import type{ReactNode}from'react';\nimport{validateTasks,type TaskItem}from'@hjmds/design-contracts/task-list';\nimport{Checkbox}from'./selection.js';import{List}from'./advanced-display.js';\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nexport type TaskListProps=Readonly<{label:string;items:readonly TaskItem[];onCompletedChange:(id:string,completed:boolean)=>void;disabled?:boolean;emptyContent?:ReactNode;\n /** Independent row action beside the checkbox; apply disabled to the supplied control. */\n renderItemAction?:(context:Readonly<{item:TaskItem;disabled:boolean}>)=>ReactNode;\n renderCollection?:(context:Readonly<{items:readonly TaskItem[];renderItem:(item:TaskItem)=>ReactNode}>)=>ReactNode;\n /** Canonical layout-only placement on the List root. With `renderCollection` the product owns the root, so place that instead. */\n layoutStyle?:HjmCompositionStyleProp}>;\n/** Canonical Checkbox/List own semantics; optional collection composition keeps drag peers out of this entry. */\nexport function TaskList({label,items,onCompletedChange,disabled=false,emptyContent,renderItemAction,renderCollection,layoutStyle}:TaskListProps){validateTasks(items);if(!label.trim())throw new TypeError('TaskList needs a localized label');\n const renderItem=(item:TaskItem)=>{const control=<Checkbox label={item.label} checked={item.completed} disabled={disabled||item.disabled===true} onCheckedChange={completed=>onCompletedChange(item.id,completed)} {...(item.description===undefined?{}:{description:item.description})}/>;const action=renderItemAction?.({item,disabled:disabled||item.disabled===true});\n // The action sits beside Checkbox, never inside its label (pressing it must not toggle completion); long labels wrap\n // inside the checkbox column. A separate action line made each task two to three lines tall (2026-10-17 review).\n return <div style={{display:\"grid\",gridTemplateColumns:action==null?\"minmax(0, 1fr)\":\"minmax(0, 1fr) auto\",alignItems:\"center\",gap:\"var(--hjm-space-sm)\"}}>{control}{action}</div>;};\n if(items.length===0)return <List label={label} {...(layoutStyle===undefined?{}:{layoutStyle})}>{emptyContent}</List>;\n if(renderCollection)return <>{renderCollection({items,renderItem})}</>;\n return <List label={label} appearance=\"grouped\" {...(layoutStyle===undefined?{}:{layoutStyle})}>{items.map(item=><div key={item.id} style={{padding:\"var(--hjm-space-md)\"}}>{renderItem(item)}</div>)}</List>;\n}\n"]}
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,2DAA2D,CAAC;AAgBnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,aAAa,GACvC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAmB7C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,GAC/B,aAAa,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,2DAA2D,CAAC;AAgBnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,aAAa,GACvC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAmB7C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,GAC/B,aAAa,CAkMf"}
|
package/dist/theme.js
CHANGED
|
@@ -76,6 +76,10 @@ export function createHjmThemeStyle(value) {
|
|
|
76
76
|
// does not carry a second copy of the same numbers.
|
|
77
77
|
style["--hjm-list-row-gap"] = rem(listRowRecipe.gap);
|
|
78
78
|
style["--hjm-list-row-leading-size"] = rem(listRowRecipe.leadingSize);
|
|
79
|
+
// Native already pins a described switch to the two-line list-row height; Web
|
|
80
|
+
// let content decide (~48), so neighbouring settings rows differed by platform.
|
|
81
|
+
style["--hjm-switch-row-min-height"] = rem(switchRecipe.rowMinHeight);
|
|
82
|
+
style["--hjm-switch-row-two-line-min-height"] = rem(switchRecipe.rowTwoLineMinHeight);
|
|
79
83
|
for (const [name, value] of Object.entries(switchRecipe.sizes)) {
|
|
80
84
|
style[`--hjm-switch-${kebab(name)}-width`] = rem(value.width);
|
|
81
85
|
style[`--hjm-switch-${kebab(name)}-height`] = rem(value.height);
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,GACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,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CAAiC,CAAC,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC,gBAAgB,IAAI,CAAC;IAC7F,KAAK,CAAC,8BAA8B,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;IACrE,KAAK,CAAC,+BAA+B,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC;IACvE,KAAK,CAAC,0BAA0B,CAAC,GAAG,GAAG,WAAW,CAAC,WAAW,IAAI,CAAC;IACnE,KAAK,CAAC,8BAA8B,CAAC,GAAG,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC;IAC1E,KAAK,CAAC,8BAA8B,CAAC,GAAG,WAAW,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,gCAAgC,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC;IACxE,KAAK,CAAC,4BAA4B,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC;IACjE,KAAK,CAAC,kCAAkC,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAChF,KAAK,CAAC,2BAA2B,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACjE,2EAA2E;QAC3E,yEAAyE;QACzE,KAAK,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,GAAG,oBAAoB,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolveSurfaceFillOpacity } from \"@hjmds/design-contracts/palette-contrast\";\nimport {\n backdrop,\n control,\n easing,\n fontFamily,\n resolveFontFamilyStack,\n fontWeight,\n motion,\n layer,\n radius,\n shadow,\n spacing,\n stroke,\n typography,\n} from \"@hjmds/design-contracts/foundations\";\nimport { resolveColorReference } from \"@hjmds/design-contracts/color-references\";\nimport { focusIndicatorContract } from \"@hjmds/design-contracts/contracts\";\nimport {\n visibleControlHeight,\n type DesignSystemProviderValue,\n} from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { buttonRecipe, fieldRecipe } from \"@hjmds/design-contracts/recipes/base\";\nimport {\n bottomNavigationRecipe,\n comboboxRecipe,\n dialogRecipe,\n listRowRecipe,\n menuRecipe,\n searchFieldRecipe,\n selectRecipe,\n sheetRecipe,\n skeletonRecipe,\n tooltipRecipe,\n switchRecipe,\n toastRecipe,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { CSSProperties } from \"react\";\n\nexport type HjmThemeStyle = CSSProperties &\n Record<`--hjm-${string}`, string | number>;\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\ntype ShadowToken = Readonly<{ color: string; opacity: number; radius: number; offsetY: number }>;\n\n// RN shadow token -> CSS; blur = radius, as react-native-web maps it.\nfunction shadowCss(token: ShadowToken, offsetX = 0): string {\n const hex = token.color.replace(\"#\", \"\");\n const [r, g, b] = [0, 2, 4].map((start) => Number.parseInt(hex.slice(start, start + 2), 16));\n return `${offsetX}px ${token.offsetY}px ${token.radius}px rgb(${r} ${g} ${b} / ${Math.round(token.opacity * 100)}%)`;\n}\n\nfunction rem(value: number): string {\n return `${Number((value / 16).toFixed(5))}rem`;\n}\n\nexport function createHjmThemeStyle(\n value: DesignSystemProviderValue,\n): HjmThemeStyle {\n const { environment, palette } = value;\n const profileTokens = value.designProfile?.tokens;\n const style: HjmThemeStyle = {\n \"--hjm-backdrop-modal\": `color-mix(in srgb, ${backdrop.modal.color} ${backdrop.modal.opacity * 100}%, transparent)`,\n \"--hjm-text-scale\": environment.textScale,\n \"--hjm-motion-scale\": environment.reducedMotion ? 0 : 1,\n colorScheme: environment.theme,\n backgroundColor: palette.theme.bg,\n color: palette.theme.text,\n };\n\n for (const [name, color] of Object.entries(palette.theme)) {\n style[`--hjm-color-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccents)) {\n style[`--hjm-accent-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccentFills)) {\n style[`--hjm-accent-fill-${kebab(name)}`] = color;\n }\n for (const [name, value] of Object.entries(spacing)) {\n style[`--hjm-space-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.radius ?? radius)) {\n style[`--hjm-radius-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.typography ?? typography)) {\n style[`--hjm-type-${kebab(name)}-size`] =\n `calc(${rem(value.fontSize)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-line-height`] =\n `calc(${rem(value.lineHeight)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-weight`] = value.fontWeight;\n }\n for (const [name, value] of Object.entries(fontWeight)) {\n style[`--hjm-font-weight-${kebab(name)}`] = value;\n }\n for (const [name, value] of Object.entries(motion)) {\n style[`--hjm-motion-${kebab(name)}`] = environment.reducedMotion\n ? \"0ms\"\n : `${value}ms`;\n }\n\n style[\"--hjm-font-family-ui\"] = (profileTokens?.fontFamily.ui ?? fontFamily.ui).join(\", \");\n style[\"--hjm-font-family-code\"] = (profileTokens?.fontFamily.code ?? fontFamily.code).join(\", \");\n // Roles resolve from the nearest Provider, including portal/nested reset contexts.\n for (const role of [\"display\", \"reading\"] as const) {\n style[`--hjm-font-family-${role}`] = resolveFontFamilyStack(profileTokens?.fontFamily ?? fontFamily, role).join(\", \");\n }\n for (const [name, value] of Object.entries(stroke)) {\n style[`--hjm-stroke-${kebab(name)}`] = `${value}px`;\n }\n // Unset before 1.4.1, so focus rules were invalid and drew no ring.\n style[\"--hjm-color-focus\"] = resolveColorReference(focusIndicatorContract.color, palette);\n style[\"--hjm-focus-width\"] = `${focusIndicatorContract.width}px`;\n style[\"--hjm-focus-offset\"] = `${focusIndicatorContract.offset}px`;\n style[\"--hjm-bottom-navigation-pressed-background\"] = resolveColorReference(\n bottomNavigationRecipe.states.pressedBackground,\n palette,\n );\n // Row rhythm and the leading frame come from the recipe so the stylesheet\n // does not carry a second copy of the same numbers.\n style[\"--hjm-list-row-gap\"] = rem(listRowRecipe.gap);\n style[\"--hjm-list-row-leading-size\"] = rem(listRowRecipe.leadingSize);\n for (const [name, value] of Object.entries(switchRecipe.sizes)) {\n style[`--hjm-switch-${kebab(name)}-width`] = rem(value.width);\n style[`--hjm-switch-${kebab(name)}-height`] = rem(value.height);\n style[`--hjm-switch-${kebab(name)}-thumb`] = rem(value.thumb);\n style[`--hjm-switch-${kebab(name)}-inset`] = rem(value.inset);\n style[`--hjm-switch-${kebab(name)}-offset`] = rem(\n value.width - value.thumb - value.inset * 2,\n );\n }\n for (const [name, value] of Object.entries(listRowRecipe.density)) {\n style[`--hjm-list-row-${kebab(name)}-one-line`] = rem(value.oneLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-two-line`] = rem(value.twoLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-padding-inline`] = rem(value.paddingHorizontal);\n style[`--hjm-list-row-${kebab(name)}-padding-block`] = rem(value.paddingVertical);\n }\n // The recipe owns these; a second copy in the stylesheet drifts silently\n // because the gates read that file as text only. Block and text heights\n // already resolve through --hjm-space-*, so they are not re-emitted.\n const skeletonCurve = easing[skeletonRecipe.animation.easing];\n style[\"--hjm-skeleton-circle-size\"] =\n `${skeletonRecipe.shapes.circle.defaultHeight}px`;\n style[\"--hjm-skeleton-duration\"] = `${skeletonRecipe.animation.duration}ms`;\n style[\"--hjm-skeleton-easing\"] = `cubic-bezier(${skeletonCurve.join(\", \")})`;\n style[\"--hjm-skeleton-from-opacity\"] = skeletonRecipe.animation.fromOpacity;\n style[\"--hjm-skeleton-to-opacity\"] = skeletonRecipe.animation.toOpacity;\n // Export the shared order instead of keeping a second numeric scale in CSS.\n for (const [name, value] of Object.entries(layer)) {\n style[`--hjm-layer-${kebab(name)}`] = value;\n }\n for (const [name, token] of Object.entries(profileTokens?.shadow ?? shadow)) {\n style[`--hjm-shadow-${kebab(name)}`] = shadowCss(token);\n }\n const surfaceMaterial = value.designProfile?.material.surface;\n // Defaults are emitted on every Provider, so a nested neutral profile clears\n // inherited glass/clay. Unsupported transparency remains an opaque CSS fill.\n style[\"--hjm-surface-blur\"] = surfaceMaterial?.blurStrength ? `blur(${surfaceMaterial.blurStrength * 32}px)` : \"none\";\n style[\"--hjm-surface-fill-opacity\"] = surfaceMaterial?.blurStrength ? resolveSurfaceFillOpacity(surfaceMaterial.fillOpacity, palette.theme) : 1;\n const insetShadow = surfaceMaterial?.insetShadows.length\n ? surfaceMaterial.insetShadows.map(token => `inset ${shadowCss(token, token.offsetX)}`).join(\", \")\n : \"\";\n style[\"--hjm-surface-inset-shadow\"] = insetShadow || \"none\";\n style[\"--hjm-surface-raised-shadow\"] = shadowCss(profileTokens?.shadow.floating ?? shadow.floating) + (insetShadow ? `, ${insetShadow}` : \"\");\n // BottomCTA overlaps content above it (bottomCtaRecipe rationale). Profile\n // strength is shared, but its shadow must cast upward rather than behind the\n // footer; preserve the stylesheet-only legacy path when no profile is supplied.\n style[\"--hjm-bottom-cta-shadow\"] = profileTokens\n ? shadowCss({ ...profileTokens.shadow.floating, offsetY: -Math.abs(profileTokens.shadow.floating.offsetY) })\n : \"none\";\n // Toast body metrics follow a selected profile; emit legacy values when no profile is selected\n // instead of inheriting a parent profile or changing standalone presentation.\n style[\"--hjm-toast-title-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.35\";\n style[\"--hjm-toast-description-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.45\";\n // Overlay chrome and sizes come from the recipes Native reads (1.5.0).\n for (const [name, chrome] of [[\"dialog\", dialogRecipe.content], [\"sheet\", sheetRecipe.content], [\"toast\", toastRecipe.surface]] as const) {\n style[`--hjm-${name}-background`] = resolveColorReference(chrome.background, palette);\n style[`--hjm-${name}-border`] = resolveColorReference(chrome.border, palette);\n style[`--hjm-${name}-border-width`] = `${chrome.borderWidth}px`;\n style[`--hjm-${name}-radius`] = `var(--hjm-radius-${chrome.radius})`;\n // Recipes select the floating role. Resolve its value from the profile so\n // dialogs, sheets and toasts cannot retain neutral shadows after a theme switch.\n style[`--hjm-${name}-shadow`] = shadowCss(profileTokens?.shadow.floating ?? chrome.shadow);\n }\n style[\"--hjm-sheet-max-height\"] = `${sheetRecipe.content.maxHeightRatio * 100}dvh`;\n style[\"--hjm-sheet-max-width\"] = `${sheetRecipe.web.maxWidth}px`;\n style[\"--hjm-sheet-handle-width\"] = `${sheetRecipe.handle.width}px`;\n style[\"--hjm-sheet-handle-height\"] = `${sheetRecipe.handle.height}px`;\n style[\"--hjm-sheet-handle-color\"] = resolveColorReference(sheetRecipe.handle.color, palette);\n for (const [name, ratio] of Object.entries(sheetRecipe.sizes)) {\n if (ratio !== null) style[`--hjm-sheet-size-${name}`] = `${ratio * 100}dvh`;\n }\n // Toast badge/action colours resolve from the recipe so Web and Native share one tone table (1.10.0).\n for (const [tone, contract] of Object.entries(toastRecipe.tones)) {\n style[`--hjm-toast-accent-${tone}`] = resolveColorReference(contract.accent, palette);\n style[`--hjm-toast-badge-${tone}`] = resolveColorReference(contract.badge, palette);\n }\n style[\"--hjm-toast-badge-size\"] = `${toastRecipe.icon.badgeDiameter}px`;\n style[\"--hjm-toast-action-background\"] = resolveColorReference(toastRecipe.action.background, palette);\n style[\"--hjm-toast-action-color\"] = resolveColorReference(toastRecipe.action.color, palette);\n style[\"--hjm-toast-description-color\"] = resolveColorReference(toastRecipe.description.color, palette);\n // Panel toast (2026-10-10): media column, step progress and action alignment come from the same recipe Native reads.\n style[\"--hjm-toast-media-size\"] = `${toastRecipe.media.size}px`;\n style[\"--hjm-toast-action-align\"] = toastRecipe.action.align;\n style[\"--hjm-toast-pressed-opacity\"] = toastRecipe.states.pressedOpacity;\n style[\"--hjm-toast-progress-gap\"] = `${toastRecipe.progress.gap}px`;\n style[\"--hjm-toast-progress-dot\"] = `${toastRecipe.progress.dotSize}px`;\n style[\"--hjm-toast-progress-current-scale\"] = String(toastRecipe.progress.currentScale);\n style[\"--hjm-toast-progress-done\"] = resolveColorReference(toastRecipe.progress.doneColor, palette);\n style[\"--hjm-toast-progress-upcoming\"] = resolveColorReference(toastRecipe.progress.upcomingColor, palette);\n style[\"--hjm-toast-progress-label\"] = resolveColorReference(toastRecipe.progress.labelColor, palette);\n style[\"--hjm-toast-progress-current-label\"] = resolveColorReference(toastRecipe.progress.currentLabelColor, palette);\n const toastExit = toastRecipe.transition.web.exit;\n style[\"--hjm-toast-exit-duration\"] = environment.reducedMotion ? \"0ms\" : `${toastExit.duration}ms`;\n style[\"--hjm-toast-exit-easing\"] = `cubic-bezier(${easing[toastExit.easing].join(\", \")})`;\n // SearchField geometry comes from searchFieldRecipe (2026-10-06 follow-up). Web had drawn TextField's\n // 16px padding for both sizes and a 44px clear button even at `medium`, where the recipe and Native\n // use a 36 circle with a 4px hit slop (44 target, 36 footprint).\n for (const [name, size] of Object.entries(searchFieldRecipe.sizes)) {\n style[`--hjm-search-field-padding-${name}`] = `${size.paddingHorizontal}px`;\n style[`--hjm-search-field-gap-${name}`] = `${size.gap}px`;\n style[`--hjm-search-field-clear-${name}`] = `${size.clearDiameter}px`;\n style[`--hjm-search-field-clear-slop-${name}`] = `${size.clearHitSlop}px`;\n }\n style[\"--hjm-tooltip-max-width\"] = `${tooltipRecipe.content.maxWidth}px`;\n style[\"--hjm-tooltip-padding\"] = `${tooltipRecipe.surface.padding}px`;\n // Floating collection surfaces read their padding from the recipe (2026-10-06): the stylesheet's 4 had drifted from 8.\n style[\"--hjm-menu-padding\"] = `${menuRecipe.surface.padding}px`;\n style[\"--hjm-select-popover-padding\"] = `${selectRecipe.popover.padding}px`;\n style[\"--hjm-combobox-popover-padding\"] = `${comboboxRecipe.popover.padding}px`;\n style[\"--hjm-tooltip-collision-padding\"] = `${tooltipRecipe.positioning.collisionPadding}px`;\n style[\"--hjm-button-pressed-opacity\"] = buttonRecipe.opacity.pressed;\n style[\"--hjm-button-disabled-opacity\"] = buttonRecipe.opacity.disabled;\n style[\"--hjm-field-border-width\"] = `${fieldRecipe.borderWidth}px`;\n style[\"--hjm-field-focus-ring-width\"] = `${fieldRecipe.focusRingWidth}px`;\n style[\"--hjm-field-disabled-opacity\"] = fieldRecipe.disabledOpacity;\n style[\"--hjm-control-min-touch-target\"] = `${control.minTouchTarget}px`;\n style[\"--hjm-control-field-height\"] = `${control.fieldHeight}px`;\n style[\"--hjm-field-multiline-min-height\"] = rem(fieldRecipe.multilineMinHeight);\n style[\"--hjm-field-padding-block\"] = rem(fieldRecipe.paddingVertical);\n for (const [name, value] of Object.entries(control.buttonHeight)) {\n // The axis is applied to the emitted variables rather than to each rule so\n // that every stylesheet consumer of a control height honours it at once.\n style[`--hjm-control-button-${kebab(name)}`] =\n `${visibleControlHeight(value, environment.minimumVisualTarget)}px`;\n }\n\n return style;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,GACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,oBAAoB,GAErB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,cAAc,EAC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a,CAAC,WAAW,CAAC,gBAAgB,IAAI,CAAC;IAC7F,KAAK,CAAC,8BAA8B,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;IACrE,KAAK,CAAC,+BAA+B,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC;IACvE,KAAK,CAAC,0BAA0B,CAAC,GAAG,GAAG,WAAW,CAAC,WAAW,IAAI,CAAC;IACnE,KAAK,CAAC,8BAA8B,CAAC,GAAG,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC;IAC1E,KAAK,CAAC,8BAA8B,CAAC,GAAG,WAAW,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,gCAAgC,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC;IACxE,KAAK,CAAC,4BAA4B,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC;IACjE,KAAK,CAAC,kCAAkC,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAChF,KAAK,CAAC,2BAA2B,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACjE,2EAA2E;QAC3E,yEAAyE;QACzE,KAAK,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,GAAG,oBAAoB,CAAC,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { resolveSurfaceFillOpacity } from \"@hjmds/design-contracts/palette-contrast\";\nimport {\n backdrop,\n control,\n easing,\n fontFamily,\n resolveFontFamilyStack,\n fontWeight,\n motion,\n layer,\n radius,\n shadow,\n spacing,\n stroke,\n typography,\n} from \"@hjmds/design-contracts/foundations\";\nimport { resolveColorReference } from \"@hjmds/design-contracts/color-references\";\nimport { focusIndicatorContract } from \"@hjmds/design-contracts/contracts\";\nimport {\n visibleControlHeight,\n type DesignSystemProviderValue,\n} from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { buttonRecipe, fieldRecipe } from \"@hjmds/design-contracts/recipes/base\";\nimport {\n bottomNavigationRecipe,\n comboboxRecipe,\n dialogRecipe,\n listRowRecipe,\n menuRecipe,\n searchFieldRecipe,\n selectRecipe,\n sheetRecipe,\n skeletonRecipe,\n tooltipRecipe,\n switchRecipe,\n toastRecipe,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { CSSProperties } from \"react\";\n\nexport type HjmThemeStyle = CSSProperties &\n Record<`--hjm-${string}`, string | number>;\n\nfunction kebab(value: string): string {\n return value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\ntype ShadowToken = Readonly<{ color: string; opacity: number; radius: number; offsetY: number }>;\n\n// RN shadow token -> CSS; blur = radius, as react-native-web maps it.\nfunction shadowCss(token: ShadowToken, offsetX = 0): string {\n const hex = token.color.replace(\"#\", \"\");\n const [r, g, b] = [0, 2, 4].map((start) => Number.parseInt(hex.slice(start, start + 2), 16));\n return `${offsetX}px ${token.offsetY}px ${token.radius}px rgb(${r} ${g} ${b} / ${Math.round(token.opacity * 100)}%)`;\n}\n\nfunction rem(value: number): string {\n return `${Number((value / 16).toFixed(5))}rem`;\n}\n\nexport function createHjmThemeStyle(\n value: DesignSystemProviderValue,\n): HjmThemeStyle {\n const { environment, palette } = value;\n const profileTokens = value.designProfile?.tokens;\n const style: HjmThemeStyle = {\n \"--hjm-backdrop-modal\": `color-mix(in srgb, ${backdrop.modal.color} ${backdrop.modal.opacity * 100}%, transparent)`,\n \"--hjm-text-scale\": environment.textScale,\n \"--hjm-motion-scale\": environment.reducedMotion ? 0 : 1,\n colorScheme: environment.theme,\n backgroundColor: palette.theme.bg,\n color: palette.theme.text,\n };\n\n for (const [name, color] of Object.entries(palette.theme)) {\n style[`--hjm-color-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccents)) {\n style[`--hjm-accent-${kebab(name)}`] = color;\n }\n for (const [name, color] of Object.entries(palette.statusAccentFills)) {\n style[`--hjm-accent-fill-${kebab(name)}`] = color;\n }\n for (const [name, value] of Object.entries(spacing)) {\n style[`--hjm-space-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.radius ?? radius)) {\n style[`--hjm-radius-${kebab(name)}`] = `${value}px`;\n }\n for (const [name, value] of Object.entries(profileTokens?.typography ?? typography)) {\n style[`--hjm-type-${kebab(name)}-size`] =\n `calc(${rem(value.fontSize)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-line-height`] =\n `calc(${rem(value.lineHeight)} * var(--hjm-text-scale))`;\n style[`--hjm-type-${kebab(name)}-weight`] = value.fontWeight;\n }\n for (const [name, value] of Object.entries(fontWeight)) {\n style[`--hjm-font-weight-${kebab(name)}`] = value;\n }\n for (const [name, value] of Object.entries(motion)) {\n style[`--hjm-motion-${kebab(name)}`] = environment.reducedMotion\n ? \"0ms\"\n : `${value}ms`;\n }\n\n style[\"--hjm-font-family-ui\"] = (profileTokens?.fontFamily.ui ?? fontFamily.ui).join(\", \");\n style[\"--hjm-font-family-code\"] = (profileTokens?.fontFamily.code ?? fontFamily.code).join(\", \");\n // Roles resolve from the nearest Provider, including portal/nested reset contexts.\n for (const role of [\"display\", \"reading\"] as const) {\n style[`--hjm-font-family-${role}`] = resolveFontFamilyStack(profileTokens?.fontFamily ?? fontFamily, role).join(\", \");\n }\n for (const [name, value] of Object.entries(stroke)) {\n style[`--hjm-stroke-${kebab(name)}`] = `${value}px`;\n }\n // Unset before 1.4.1, so focus rules were invalid and drew no ring.\n style[\"--hjm-color-focus\"] = resolveColorReference(focusIndicatorContract.color, palette);\n style[\"--hjm-focus-width\"] = `${focusIndicatorContract.width}px`;\n style[\"--hjm-focus-offset\"] = `${focusIndicatorContract.offset}px`;\n style[\"--hjm-bottom-navigation-pressed-background\"] = resolveColorReference(\n bottomNavigationRecipe.states.pressedBackground,\n palette,\n );\n // Row rhythm and the leading frame come from the recipe so the stylesheet\n // does not carry a second copy of the same numbers.\n style[\"--hjm-list-row-gap\"] = rem(listRowRecipe.gap);\n style[\"--hjm-list-row-leading-size\"] = rem(listRowRecipe.leadingSize);\n // Native already pins a described switch to the two-line list-row height; Web\n // let content decide (~48), so neighbouring settings rows differed by platform.\n style[\"--hjm-switch-row-min-height\"] = rem(switchRecipe.rowMinHeight);\n style[\"--hjm-switch-row-two-line-min-height\"] = rem(switchRecipe.rowTwoLineMinHeight);\n for (const [name, value] of Object.entries(switchRecipe.sizes)) {\n style[`--hjm-switch-${kebab(name)}-width`] = rem(value.width);\n style[`--hjm-switch-${kebab(name)}-height`] = rem(value.height);\n style[`--hjm-switch-${kebab(name)}-thumb`] = rem(value.thumb);\n style[`--hjm-switch-${kebab(name)}-inset`] = rem(value.inset);\n style[`--hjm-switch-${kebab(name)}-offset`] = rem(\n value.width - value.thumb - value.inset * 2,\n );\n }\n for (const [name, value] of Object.entries(listRowRecipe.density)) {\n style[`--hjm-list-row-${kebab(name)}-one-line`] = rem(value.oneLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-two-line`] = rem(value.twoLineMinHeight);\n style[`--hjm-list-row-${kebab(name)}-padding-inline`] = rem(value.paddingHorizontal);\n style[`--hjm-list-row-${kebab(name)}-padding-block`] = rem(value.paddingVertical);\n }\n // The recipe owns these; a second copy in the stylesheet drifts silently\n // because the gates read that file as text only. Block and text heights\n // already resolve through --hjm-space-*, so they are not re-emitted.\n const skeletonCurve = easing[skeletonRecipe.animation.easing];\n style[\"--hjm-skeleton-circle-size\"] =\n `${skeletonRecipe.shapes.circle.defaultHeight}px`;\n style[\"--hjm-skeleton-duration\"] = `${skeletonRecipe.animation.duration}ms`;\n style[\"--hjm-skeleton-easing\"] = `cubic-bezier(${skeletonCurve.join(\", \")})`;\n style[\"--hjm-skeleton-from-opacity\"] = skeletonRecipe.animation.fromOpacity;\n style[\"--hjm-skeleton-to-opacity\"] = skeletonRecipe.animation.toOpacity;\n // Export the shared order instead of keeping a second numeric scale in CSS.\n for (const [name, value] of Object.entries(layer)) {\n style[`--hjm-layer-${kebab(name)}`] = value;\n }\n for (const [name, token] of Object.entries(profileTokens?.shadow ?? shadow)) {\n style[`--hjm-shadow-${kebab(name)}`] = shadowCss(token);\n }\n const surfaceMaterial = value.designProfile?.material.surface;\n // Defaults are emitted on every Provider, so a nested neutral profile clears\n // inherited glass/clay. Unsupported transparency remains an opaque CSS fill.\n style[\"--hjm-surface-blur\"] = surfaceMaterial?.blurStrength ? `blur(${surfaceMaterial.blurStrength * 32}px)` : \"none\";\n style[\"--hjm-surface-fill-opacity\"] = surfaceMaterial?.blurStrength ? resolveSurfaceFillOpacity(surfaceMaterial.fillOpacity, palette.theme) : 1;\n const insetShadow = surfaceMaterial?.insetShadows.length\n ? surfaceMaterial.insetShadows.map(token => `inset ${shadowCss(token, token.offsetX)}`).join(\", \")\n : \"\";\n style[\"--hjm-surface-inset-shadow\"] = insetShadow || \"none\";\n style[\"--hjm-surface-raised-shadow\"] = shadowCss(profileTokens?.shadow.floating ?? shadow.floating) + (insetShadow ? `, ${insetShadow}` : \"\");\n // BottomCTA overlaps content above it (bottomCtaRecipe rationale). Profile\n // strength is shared, but its shadow must cast upward rather than behind the\n // footer; preserve the stylesheet-only legacy path when no profile is supplied.\n style[\"--hjm-bottom-cta-shadow\"] = profileTokens\n ? shadowCss({ ...profileTokens.shadow.floating, offsetY: -Math.abs(profileTokens.shadow.floating.offsetY) })\n : \"none\";\n // Toast body metrics follow a selected profile; emit legacy values when no profile is selected\n // instead of inheriting a parent profile or changing standalone presentation.\n style[\"--hjm-toast-title-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.35\";\n style[\"--hjm-toast-description-line-height\"] = profileTokens ? \"var(--hjm-type-body-line-height)\" : \"1.45\";\n // Overlay chrome and sizes come from the recipes Native reads (1.5.0).\n for (const [name, chrome] of [[\"dialog\", dialogRecipe.content], [\"sheet\", sheetRecipe.content], [\"toast\", toastRecipe.surface]] as const) {\n style[`--hjm-${name}-background`] = resolveColorReference(chrome.background, palette);\n style[`--hjm-${name}-border`] = resolveColorReference(chrome.border, palette);\n style[`--hjm-${name}-border-width`] = `${chrome.borderWidth}px`;\n style[`--hjm-${name}-radius`] = `var(--hjm-radius-${chrome.radius})`;\n // Recipes select the floating role. Resolve its value from the profile so\n // dialogs, sheets and toasts cannot retain neutral shadows after a theme switch.\n style[`--hjm-${name}-shadow`] = shadowCss(profileTokens?.shadow.floating ?? chrome.shadow);\n }\n style[\"--hjm-sheet-max-height\"] = `${sheetRecipe.content.maxHeightRatio * 100}dvh`;\n style[\"--hjm-sheet-max-width\"] = `${sheetRecipe.web.maxWidth}px`;\n style[\"--hjm-sheet-handle-width\"] = `${sheetRecipe.handle.width}px`;\n style[\"--hjm-sheet-handle-height\"] = `${sheetRecipe.handle.height}px`;\n style[\"--hjm-sheet-handle-color\"] = resolveColorReference(sheetRecipe.handle.color, palette);\n for (const [name, ratio] of Object.entries(sheetRecipe.sizes)) {\n if (ratio !== null) style[`--hjm-sheet-size-${name}`] = `${ratio * 100}dvh`;\n }\n // Toast badge/action colours resolve from the recipe so Web and Native share one tone table (1.10.0).\n for (const [tone, contract] of Object.entries(toastRecipe.tones)) {\n style[`--hjm-toast-accent-${tone}`] = resolveColorReference(contract.accent, palette);\n style[`--hjm-toast-badge-${tone}`] = resolveColorReference(contract.badge, palette);\n }\n style[\"--hjm-toast-badge-size\"] = `${toastRecipe.icon.badgeDiameter}px`;\n style[\"--hjm-toast-action-background\"] = resolveColorReference(toastRecipe.action.background, palette);\n style[\"--hjm-toast-action-color\"] = resolveColorReference(toastRecipe.action.color, palette);\n style[\"--hjm-toast-description-color\"] = resolveColorReference(toastRecipe.description.color, palette);\n // Panel toast (2026-10-10): media column, step progress and action alignment come from the same recipe Native reads.\n style[\"--hjm-toast-media-size\"] = `${toastRecipe.media.size}px`;\n style[\"--hjm-toast-action-align\"] = toastRecipe.action.align;\n style[\"--hjm-toast-pressed-opacity\"] = toastRecipe.states.pressedOpacity;\n style[\"--hjm-toast-progress-gap\"] = `${toastRecipe.progress.gap}px`;\n style[\"--hjm-toast-progress-dot\"] = `${toastRecipe.progress.dotSize}px`;\n style[\"--hjm-toast-progress-current-scale\"] = String(toastRecipe.progress.currentScale);\n style[\"--hjm-toast-progress-done\"] = resolveColorReference(toastRecipe.progress.doneColor, palette);\n style[\"--hjm-toast-progress-upcoming\"] = resolveColorReference(toastRecipe.progress.upcomingColor, palette);\n style[\"--hjm-toast-progress-label\"] = resolveColorReference(toastRecipe.progress.labelColor, palette);\n style[\"--hjm-toast-progress-current-label\"] = resolveColorReference(toastRecipe.progress.currentLabelColor, palette);\n const toastExit = toastRecipe.transition.web.exit;\n style[\"--hjm-toast-exit-duration\"] = environment.reducedMotion ? \"0ms\" : `${toastExit.duration}ms`;\n style[\"--hjm-toast-exit-easing\"] = `cubic-bezier(${easing[toastExit.easing].join(\", \")})`;\n // SearchField geometry comes from searchFieldRecipe (2026-10-06 follow-up). Web had drawn TextField's\n // 16px padding for both sizes and a 44px clear button even at `medium`, where the recipe and Native\n // use a 36 circle with a 4px hit slop (44 target, 36 footprint).\n for (const [name, size] of Object.entries(searchFieldRecipe.sizes)) {\n style[`--hjm-search-field-padding-${name}`] = `${size.paddingHorizontal}px`;\n style[`--hjm-search-field-gap-${name}`] = `${size.gap}px`;\n style[`--hjm-search-field-clear-${name}`] = `${size.clearDiameter}px`;\n style[`--hjm-search-field-clear-slop-${name}`] = `${size.clearHitSlop}px`;\n }\n style[\"--hjm-tooltip-max-width\"] = `${tooltipRecipe.content.maxWidth}px`;\n style[\"--hjm-tooltip-padding\"] = `${tooltipRecipe.surface.padding}px`;\n // Floating collection surfaces read their padding from the recipe (2026-10-06): the stylesheet's 4 had drifted from 8.\n style[\"--hjm-menu-padding\"] = `${menuRecipe.surface.padding}px`;\n style[\"--hjm-select-popover-padding\"] = `${selectRecipe.popover.padding}px`;\n style[\"--hjm-combobox-popover-padding\"] = `${comboboxRecipe.popover.padding}px`;\n style[\"--hjm-tooltip-collision-padding\"] = `${tooltipRecipe.positioning.collisionPadding}px`;\n style[\"--hjm-button-pressed-opacity\"] = buttonRecipe.opacity.pressed;\n style[\"--hjm-button-disabled-opacity\"] = buttonRecipe.opacity.disabled;\n style[\"--hjm-field-border-width\"] = `${fieldRecipe.borderWidth}px`;\n style[\"--hjm-field-focus-ring-width\"] = `${fieldRecipe.focusRingWidth}px`;\n style[\"--hjm-field-disabled-opacity\"] = fieldRecipe.disabledOpacity;\n style[\"--hjm-control-min-touch-target\"] = `${control.minTouchTarget}px`;\n style[\"--hjm-control-field-height\"] = `${control.fieldHeight}px`;\n style[\"--hjm-field-multiline-min-height\"] = rem(fieldRecipe.multilineMinHeight);\n style[\"--hjm-field-padding-block\"] = rem(fieldRecipe.paddingVertical);\n for (const [name, value] of Object.entries(control.buttonHeight)) {\n // The axis is applied to the emitted variables rather than to each rule so\n // that every stylesheet consumer of a control height honours it at once.\n style[`--hjm-control-button-${kebab(name)}`] =\n `${visibleControlHeight(value, environment.minimumVisualTarget)}px`;\n }\n\n return style;\n}\n"]}
|
package/dist/top-bar.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
+
import { type ScreenExit } from "./internal/screen-exit.js";
|
|
2
3
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
3
4
|
export type TopBarProps = Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> & Readonly<{
|
|
4
5
|
title?: string;
|
|
@@ -10,6 +11,8 @@ export type TopBarProps = Omit<HTMLAttributes<HTMLDivElement>, "title" | "childr
|
|
|
10
11
|
onTitleClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
12
|
titleAccessibilityLabel?: string;
|
|
12
13
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
/** Leaving this screen: icon-only back/close fixed at the leading edge (2026-10-17). Exclusive with `leading`. */
|
|
15
|
+
exit?: ScreenExit;
|
|
13
16
|
leading?: ReactNode;
|
|
14
17
|
trailing?: ReactNode;
|
|
15
18
|
actions?: ReactNode;
|
|
@@ -29,6 +32,8 @@ export declare const TopBar: import("react").ForwardRefExoticComponent<Omit<HTML
|
|
|
29
32
|
onTitleClick?: MouseEventHandler<HTMLButtonElement>;
|
|
30
33
|
titleAccessibilityLabel?: string;
|
|
31
34
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
35
|
+
/** Leaving this screen: icon-only back/close fixed at the leading edge (2026-10-17). Exclusive with `leading`. */
|
|
36
|
+
exit?: ScreenExit;
|
|
32
37
|
leading?: ReactNode;
|
|
33
38
|
trailing?: ReactNode;
|
|
34
39
|
actions?: ReactNode;
|
package/dist/top-bar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../src/top-bar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../src/top-bar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpH,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG,QAAQ,CAAC;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,kHAAkH;IAClH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,wGAAwG;AACxG,eAAO,MAAM,MAAM;YArBT,MAAM;IACd,uFAAuF;mBACxE,SAAS;IACxB,2EAA2E;eAChE,MAAM;mBACF,SAAS;mBACT,iBAAiB,CAAC,iBAAiB,CAAC;8BACzB,MAAM;mBACjB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACpC,kHAAkH;WAC3G,UAAU;cACP,SAAS;eACR,SAAS;cACV,SAAS;eACR,OAAO;kBACJ,MAAM;IACpB,gGAAgG;kBAClF,uBAAuB;mDA0CrC,CAAC"}
|
package/dist/top-bar.js
CHANGED
|
@@ -2,11 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { topBarRecipe } from "@hjmds/design-contracts/recipes";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { Button } from "./actions.js";
|
|
5
|
+
import { ScreenExitButton } from "./internal/screen-exit.js";
|
|
6
|
+
import { validateScreenExit } from "@hjmds/design-contracts/screen-patterns";
|
|
5
7
|
import { classNames } from "./internal.js";
|
|
6
8
|
import { useOptionalHjmTheme } from "./provider.js";
|
|
7
9
|
/** Screen chrome stays composable inside pages and dialogs, without adding a second banner landmark. */
|
|
8
|
-
export const TopBar = forwardRef(function TopBar({ title, titleContent, subtitle, titleLeading, onTitleClick, titleAccessibilityLabel, headingLevel = 1, leading, trailing, actions, centered = topBarRecipe.defaults.centered, safeAreaTop = 0, className, style, layoutStyle, ...props }, ref) {
|
|
10
|
+
export const TopBar = forwardRef(function TopBar({ title, titleContent, subtitle, titleLeading, onTitleClick, titleAccessibilityLabel, headingLevel = 1, exit, leading: leadingSlot, trailing, actions, centered = topBarRecipe.defaults.centered, safeAreaTop = 0, className, style, layoutStyle, ...props }, ref) {
|
|
9
11
|
const theme = useOptionalHjmTheme();
|
|
12
|
+
if (exit)
|
|
13
|
+
validateScreenExit(exit, leadingSlot !== undefined);
|
|
14
|
+
const leading = exit ? _jsx(ScreenExitButton, { ...exit }) : leadingSlot;
|
|
10
15
|
if (titleContent !== undefined && (title !== undefined || subtitle !== undefined || titleLeading !== undefined || onTitleClick !== undefined || titleAccessibilityLabel !== undefined)) {
|
|
11
16
|
throw new TypeError("TopBar titleContent is exclusive with title affordances");
|
|
12
17
|
}
|