@hjmds/react 1.41.1 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/actions.d.ts +41 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +40 -3
- package/dist/actions.js.map +1 -1
- package/dist/activity-chip.d.ts.map +1 -1
- package/dist/activity-chip.js +1 -0
- package/dist/activity-chip.js.map +1 -1
- package/dist/advanced-display.d.ts +47 -14
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +72 -17
- package/dist/advanced-display.js.map +1 -1
- package/dist/advanced-forms.d.ts.map +1 -1
- package/dist/advanced-forms.js +1 -0
- package/dist/advanced-forms.js.map +1 -1
- package/dist/affix.d.ts +6 -1
- package/dist/affix.d.ts.map +1 -1
- package/dist/affix.js +5 -3
- package/dist/affix.js.map +1 -1
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +1 -0
- package/dist/agreement.js.map +1 -1
- package/dist/alert-dialog-queue.d.ts +24 -0
- package/dist/alert-dialog-queue.d.ts.map +1 -0
- package/dist/alert-dialog-queue.js +44 -0
- package/dist/alert-dialog-queue.js.map +1 -0
- package/dist/anchor.d.ts.map +1 -1
- package/dist/anchor.js +1 -0
- package/dist/anchor.js.map +1 -1
- package/dist/asset.d.ts.map +1 -1
- package/dist/asset.js +1 -0
- package/dist/asset.js.map +1 -1
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +1 -0
- package/dist/auth-screen.js.map +1 -1
- package/dist/avatar-blobatar-motion.d.ts.map +1 -1
- package/dist/avatar-blobatar-motion.js +1 -0
- package/dist/avatar-blobatar-motion.js.map +1 -1
- package/dist/avatar-blobatar.d.ts.map +1 -1
- package/dist/avatar-blobatar.js +1 -0
- package/dist/avatar-blobatar.js.map +1 -1
- package/dist/bottom-cta.d.ts.map +1 -1
- package/dist/bottom-cta.js +1 -0
- package/dist/bottom-cta.js.map +1 -1
- package/dist/bottom-info.d.ts.map +1 -1
- package/dist/bottom-info.js +1 -0
- package/dist/bottom-info.js.map +1 -1
- package/dist/bottom-navigation.d.ts.map +1 -1
- package/dist/bottom-navigation.js +1 -0
- package/dist/bottom-navigation.js.map +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +1 -0
- package/dist/breadcrumb.js.map +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +1 -0
- package/dist/calendar.js.map +1 -1
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +1 -0
- package/dist/carousel-motion.js.map +1 -1
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +1 -0
- package/dist/carousel.js.map +1 -1
- package/dist/celebration.d.ts.map +1 -1
- package/dist/celebration.js +1 -0
- package/dist/celebration.js.map +1 -1
- package/dist/chart.d.ts +7 -2
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +6 -3
- package/dist/chart.js.map +1 -1
- package/dist/choice-row.d.ts +24 -7
- package/dist/choice-row.d.ts.map +1 -1
- package/dist/choice-row.js +11 -6
- package/dist/choice-row.js.map +1 -1
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +1 -0
- package/dist/clipboard.js.map +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +1 -0
- package/dist/collapsible.js.map +1 -1
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js +3 -1
- package/dist/collection-rail.js.map +1 -1
- package/dist/color-picker.d.ts.map +1 -1
- package/dist/color-picker.js +1 -0
- package/dist/color-picker.js.map +1 -1
- package/dist/command-palette.d.ts.map +1 -1
- package/dist/command-palette.js +1 -0
- package/dist/command-palette.js.map +1 -1
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +1 -0
- package/dist/content-transition.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +1 -0
- package/dist/context-menu.js.map +1 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +1 -0
- package/dist/conversation-row.js.map +1 -1
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +1 -0
- package/dist/data-table.js.map +1 -1
- package/dist/date-entry.d.ts.map +1 -1
- package/dist/date-entry.js +1 -0
- package/dist/date-entry.js.map +1 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +1 -0
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range.d.ts.map +1 -1
- package/dist/date-range.js +1 -0
- package/dist/date-range.js.map +1 -1
- package/dist/design-profile.d.ts.map +1 -1
- package/dist/design-profile.js +1 -0
- package/dist/design-profile.js.map +1 -1
- package/dist/display.d.ts +21 -1
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +34 -8
- package/dist/display.js.map +1 -1
- package/dist/duration-field.d.ts.map +1 -1
- package/dist/duration-field.js +1 -0
- package/dist/duration-field.js.map +1 -1
- package/dist/effect-surface.d.ts.map +1 -1
- package/dist/effect-surface.js +1 -0
- 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.map +1 -1
- package/dist/feedback.js +1 -0
- package/dist/feedback.js.map +1 -1
- package/dist/field-group.d.ts.map +1 -1
- package/dist/field-group.js +1 -0
- package/dist/field-group.js.map +1 -1
- package/dist/file-picker.d.ts.map +1 -1
- package/dist/file-picker.js +1 -0
- package/dist/file-picker.js.map +1 -1
- package/dist/floating-action-button.d.ts.map +1 -1
- package/dist/floating-action-button.js +1 -0
- package/dist/floating-action-button.js.map +1 -1
- package/dist/folder-preview.d.ts.map +1 -1
- package/dist/folder-preview.js +1 -0
- package/dist/folder-preview.js.map +1 -1
- package/dist/forms.d.ts +30 -6
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +56 -14
- package/dist/forms.js.map +1 -1
- package/dist/gravity-letters.d.ts.map +1 -1
- package/dist/gravity-letters.js +1 -0
- package/dist/gravity-letters.js.map +1 -1
- package/dist/grid-reveal.d.ts.map +1 -1
- package/dist/grid-reveal.js +1 -0
- package/dist/grid-reveal.js.map +1 -1
- package/dist/heading.d.ts.map +1 -1
- package/dist/heading.js +1 -0
- package/dist/heading.js.map +1 -1
- package/dist/image-choice.d.ts.map +1 -1
- package/dist/image-choice.js +1 -0
- package/dist/image-choice.js.map +1 -1
- package/dist/image-comparison.d.ts.map +1 -1
- package/dist/image-comparison.js +1 -0
- package/dist/image-comparison.js.map +1 -1
- package/dist/image-viewer.d.ts +22 -1
- package/dist/image-viewer.d.ts.map +1 -1
- package/dist/image-viewer.js +14 -1
- package/dist/image-viewer.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-confirm.d.ts.map +1 -1
- package/dist/inline-confirm.js +1 -0
- package/dist/inline-confirm.js.map +1 -1
- package/dist/internal/document-resource.d.ts.map +1 -1
- package/dist/internal/document-resource.js +1 -0
- package/dist/internal/document-resource.js.map +1 -1
- package/dist/internal/initial-focus.d.ts.map +1 -1
- package/dist/internal/initial-focus.js +1 -0
- package/dist/internal/initial-focus.js.map +1 -1
- package/dist/internal/media-album.d.ts.map +1 -1
- package/dist/internal/media-album.js +1 -0
- package/dist/internal/media-album.js.map +1 -1
- package/dist/internal/message-reactions.d.ts.map +1 -1
- package/dist/internal/message-reactions.js +1 -0
- package/dist/internal/message-reactions.js.map +1 -1
- package/dist/internal/overlay-origin-motion.d.ts.map +1 -1
- package/dist/internal/overlay-origin-motion.js +1 -0
- package/dist/internal/overlay-origin-motion.js.map +1 -1
- package/dist/internal/pending-content.d.ts.map +1 -1
- package/dist/internal/pending-content.js +1 -0
- package/dist/internal/pending-content.js.map +1 -1
- package/dist/internal/photo-source-icon.d.ts.map +1 -1
- package/dist/internal/photo-source-icon.js +1 -0
- package/dist/internal/photo-source-icon.js.map +1 -1
- package/dist/internal/screen-exit.d.ts.map +1 -1
- package/dist/internal/screen-exit.js +1 -0
- package/dist/internal/screen-exit.js.map +1 -1
- package/dist/internal/screen-footer.d.ts.map +1 -1
- package/dist/internal/screen-footer.js +1 -0
- package/dist/internal/screen-footer.js.map +1 -1
- package/dist/internal/spinner.d.ts.map +1 -1
- package/dist/internal/spinner.js +1 -0
- package/dist/internal/spinner.js.map +1 -1
- package/dist/internal/use-composition-action.d.ts.map +1 -1
- package/dist/internal/use-composition-action.js +1 -0
- package/dist/internal/use-composition-action.js.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/layout.d.ts +11 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +8 -4
- package/dist/layout.js.map +1 -1
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +1 -0
- package/dist/mentions.js.map +1 -1
- package/dist/menu-morph.d.ts.map +1 -1
- package/dist/menu-morph.js +1 -0
- package/dist/menu-morph.js.map +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +1 -0
- package/dist/menubar.js.map +1 -1
- package/dist/modal.d.ts.map +1 -1
- package/dist/modal.js +1 -0
- package/dist/modal.js.map +1 -1
- package/dist/navigation-bar.d.ts.map +1 -1
- package/dist/navigation-bar.js +1 -0
- package/dist/navigation-bar.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +1 -0
- package/dist/navigation.js.map +1 -1
- package/dist/notification-bell.d.ts +1 -1
- package/dist/notification-bell.d.ts.map +1 -1
- package/dist/notification-bell.js +5 -1
- package/dist/notification-bell.js.map +1 -1
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +1 -0
- package/dist/number-field.js.map +1 -1
- package/dist/overlay-stack.d.ts.map +1 -1
- package/dist/overlay-stack.js +1 -0
- package/dist/overlay-stack.js.map +1 -1
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +11 -2
- package/dist/overlays.js.map +1 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +1 -0
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +1 -0
- package/dist/popover.js.map +1 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.js +1 -0
- package/dist/portal.js.map +1 -1
- package/dist/progressive-blur.d.ts.map +1 -1
- package/dist/progressive-blur.js +1 -0
- package/dist/progressive-blur.js.map +1 -1
- package/dist/provider-button.d.ts.map +1 -1
- package/dist/provider-button.js +1 -0
- package/dist/provider-button.js.map +1 -1
- package/dist/provider.d.ts +9 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +2 -2
- package/dist/provider.js.map +1 -1
- package/dist/public-exports.generated.d.ts +3 -0
- package/dist/public-exports.generated.d.ts.map +1 -1
- package/dist/public-exports.generated.js +9 -0
- package/dist/public-exports.generated.js.map +1 -1
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +1 -0
- package/dist/rating.js.map +1 -1
- package/dist/reaction-picker.d.ts.map +1 -1
- package/dist/reaction-picker.js +1 -0
- package/dist/reaction-picker.js.map +1 -1
- package/dist/saved-items.d.ts.map +1 -1
- package/dist/saved-items.js +1 -0
- package/dist/saved-items.js.map +1 -1
- package/dist/screen-flows.d.ts +5 -1
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +13 -4
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +24 -4
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +38 -11
- package/dist/screens.js.map +1 -1
- package/dist/scroll-progress.d.ts.map +1 -1
- package/dist/scroll-progress.js +1 -0
- package/dist/scroll-progress.js.map +1 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +1 -0
- package/dist/select.js.map +1 -1
- package/dist/selection.d.ts +7 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +33 -10
- package/dist/selection.js.map +1 -1
- package/dist/side-panel.d.ts.map +1 -1
- package/dist/side-panel.js +1 -0
- package/dist/side-panel.js.map +1 -1
- package/dist/sidebar.d.ts +21 -2
- package/dist/sidebar.d.ts.map +1 -1
- package/dist/sidebar.js +40 -20
- package/dist/sidebar.js.map +1 -1
- package/dist/skip-nav.d.ts.map +1 -1
- package/dist/skip-nav.js +1 -0
- package/dist/skip-nav.js.map +1 -1
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +1 -0
- package/dist/slider.js.map +1 -1
- package/dist/sortable.d.ts.map +1 -1
- package/dist/sortable.js +1 -0
- package/dist/sortable.js.map +1 -1
- package/dist/splitter.d.ts.map +1 -1
- package/dist/splitter.js +1 -0
- package/dist/splitter.js.map +1 -1
- package/dist/statistic-motion.d.ts.map +1 -1
- package/dist/statistic-motion.js +1 -0
- package/dist/statistic-motion.js.map +1 -1
- package/dist/status-text.d.ts.map +1 -1
- package/dist/status-text.js +1 -0
- package/dist/status-text.js.map +1 -1
- package/dist/step-player.d.ts.map +1 -1
- package/dist/step-player.js +1 -0
- package/dist/step-player.js.map +1 -1
- package/dist/steps.d.ts +16 -14
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +26 -9
- package/dist/steps.js.map +1 -1
- package/dist/styles.css +140 -35
- package/dist/styles.layered.css +140 -35
- package/dist/supplemental-display.d.ts.map +1 -1
- package/dist/supplemental-display.js +1 -0
- package/dist/supplemental-display.js.map +1 -1
- package/dist/supplemental-navigation.d.ts.map +1 -1
- package/dist/supplemental-navigation.js +1 -0
- package/dist/supplemental-navigation.js.map +1 -1
- package/dist/swipe-actions.d.ts.map +1 -1
- package/dist/swipe-actions.js +1 -0
- package/dist/swipe-actions.js.map +1 -1
- package/dist/table-family.d.ts.map +1 -1
- package/dist/table-family.js +1 -0
- package/dist/table-family.js.map +1 -1
- package/dist/table-sort-button.d.ts.map +1 -1
- package/dist/table-sort-button.js +1 -0
- package/dist/table-sort-button.js.map +1 -1
- package/dist/tags-input.d.ts.map +1 -1
- package/dist/tags-input.js +1 -0
- package/dist/tags-input.js.map +1 -1
- package/dist/task-list.d.ts.map +1 -1
- package/dist/task-list.js +1 -0
- package/dist/task-list.js.map +1 -1
- package/dist/text-annotation.d.ts.map +1 -1
- package/dist/text-annotation.js +1 -0
- package/dist/text-annotation.js.map +1 -1
- package/dist/text-formats.d.ts.map +1 -1
- package/dist/text-formats.js +1 -0
- package/dist/text-formats.js.map +1 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +12 -1
- package/dist/theme.js.map +1 -1
- package/dist/thinking-orb.d.ts.map +1 -1
- package/dist/thinking-orb.js +1 -0
- package/dist/thinking-orb.js.map +1 -1
- package/dist/toast.d.ts.map +1 -1
- package/dist/toast.js +1 -0
- package/dist/toast.js.map +1 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +1 -0
- package/dist/toggle-group.js.map +1 -1
- package/dist/top-bar.d.ts.map +1 -1
- package/dist/top-bar.js +1 -0
- package/dist/top-bar.js.map +1 -1
- package/dist/top.d.ts.map +1 -1
- package/dist/top.js +4 -3
- package/dist/top.js.map +1 -1
- package/dist/tour.d.ts.map +1 -1
- package/dist/tour.js +1 -0
- package/dist/tour.js.map +1 -1
- package/dist/transfer-list.d.ts.map +1 -1
- package/dist/transfer-list.js +1 -0
- package/dist/transfer-list.js.map +1 -1
- package/dist/tree.d.ts.map +1 -1
- package/dist/tree.js +1 -0
- package/dist/tree.js.map +1 -1
- package/dist/upload-item.d.ts.map +1 -1
- package/dist/upload-item.js +1 -0
- package/dist/upload-item.js.map +1 -1
- package/dist/virtual-list.d.ts.map +1 -1
- package/dist/virtual-list.js +1 -0
- package/dist/virtual-list.js.map +1 -1
- package/dist/voice-note.d.ts.map +1 -1
- package/dist/voice-note.js +1 -0
- package/dist/voice-note.js.map +1 -1
- package/package.json +8 -3
package/dist/image-choice.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-choice.js","sourceRo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AE,GAAG,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,OAAO,KAAK,2BAA2B,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,EAC7N,cAAc,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;oBAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YACxL,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,IAF3F,GAAG,CAGxB,CAAC,GACH,CAAC,CAAC,CAAC,IAAI,GACT,CAAC;AACT,CAAC","sourcesContent":["import { useEffect, useId, useLayoutEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { Text } from \"./layout.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport { typography } from \"@hjmds/design-contracts/foundations\";\nimport {\n imageChoiceRecipe, resolveImageChoiceCaptionLines, resolveImageChoiceColumns, resolveImageChoiceOuterSize, resolveImageChoiceTileHeight, resolveImageChoiceToggle,\n validateImageChoiceItemLabelLines, validateImageChoiceItems, type ImageChoiceItemDescriptor, type ImageChoiceItemLabelLines,\n} from \"@hjmds/design-contracts/components/image-choice\";\nimport { resolveVirtualWindow, virtualListRecipe } from \"@hjmds/design-contracts/components/virtual-list\";\n\nexport type ImageChoiceItem = ImageChoiceItemDescriptor & Readonly<{ image: ReactNode }>;\nexport type ImageChoiceVirtualization = Readonly<{\n /** Height of the scrolling viewport in px. The group scrolls itself, so do not also put it in a scrolling parent. */\n height: number;\n /** Rows kept mounted above and below the visible window. */\n overscan?: number;\n}>;\ntype Base = Readonly<{\n /** Localized group name read before the choices. */\n label: string;\n /** Visible caption above the tiles; omit when the screen heading already names the choice. */\n showLabel?: boolean;\n /**\n * Shows each item's `label` under its tile (one ellipsized line), e.g. a person's name in a recipient picker.\n * The tile keeps the same accessible name, so turning this on does not change what assistive tech reads.\n */\n showItemLabels?: boolean;\n /** Lines the visible item label wraps to before the ellipsis (default 1). Every tile reserves the same height. */\n itemLabelLines?: ImageChoiceItemLabelLines;\n items: readonly ImageChoiceItem[];\n disabled?: boolean;\n className?: string;\n /**\n * Long lists (hundreds of people): only the rows near the viewport are mounted. Tiles keep their size; the column\n * count follows the measured width.\n */\n virtualized?: ImageChoiceVirtualization;\n}>;\nexport type ImageChoiceGroupProps = Base & (\n | Readonly<{ selectionMode: \"single\"; value: string | null; onValueChange(value: string): void }>\n | Readonly<{ selectionMode: \"multiple\"; value: readonly string[]; onValueChange(value: string[]): void }>\n);\n\n/**\n * Picks avatars or photos by image (2026-10-16). Tiles are square, wrap to the available width, and show\n * a brand ring plus a check when chosen; assistive tech hears radios (single) or checkboxes (multiple).\n */\nexport function ImageChoiceGroup(props: ImageChoiceGroupProps) {\n const { label, showLabel = false, showItemLabels = false, itemLabelLines = imageChoiceRecipe.itemLabelLines, items, disabled = false, className, virtualized } = props;\n validateImageChoiceItems(items);\n validateImageChoiceItemLabelLines(itemLabelLines);\n const theme = useOptionalHjmTheme();\n const baseId = useId();\n const isSelected = (id: string) => props.selectionMode === \"single\" ? props.value === id : props.value.includes(id);\n const choose = (id: string) => {\n if (props.selectionMode === \"single\") props.onValueChange(resolveImageChoiceToggle(\"single\", props.value, id));\n else props.onValueChange(resolveImageChoiceToggle(\"multiple\", props.value, id));\n };\n const role = props.selectionMode === \"single\" ? \"radio\" : \"checkbox\";\n const groupRole = props.selectionMode === \"single\" ? \"radiogroup\" : \"group\";\n const captionLines = resolveImageChoiceCaptionLines({ showItemLabels, itemLabelLines, hasDescription: items.some(item => item.description !== undefined) });\n const style = { \"--hjm-image-choice-size\": `${imageChoiceRecipe.tileSize}px`, \"--hjm-image-choice-gap\": `${imageChoiceRecipe.gap}px`, \"--hjm-image-choice-radius\": `${imageChoiceRecipe.radius}px`, \"--hjm-image-choice-ring\": `${imageChoiceRecipe.ringWidth}px`, \"--hjm-image-choice-offset\": `${imageChoiceRecipe.ringOffset}px`, \"--hjm-image-choice-check\": `${imageChoiceRecipe.checkSize}px`, \"--hjm-image-choice-item-label-gap\": `${imageChoiceRecipe.itemLabelGap}px`, \"--hjm-image-choice-caption-lines\": captionLines, \"--hjm-image-choice-viewport-inset\": `${imageChoiceRecipe.virtualViewportInset}px` } as CSSProperties;\n const renderTile = (item: ImageChoiceItem, index: number) => {\n const selected = isSelected(item.id);\n const descriptionId = item.description === undefined ? undefined : `${baseId}-description-${index}`;\n return <button key={item.id} type=\"button\" role={role} aria-checked={selected} aria-label={item.label} aria-describedby={descriptionId} className=\"hjm-image-choice__tile\" data-selected={selected || undefined}\n disabled={disabled || item.disabled} onClick={() => choose(item.id)}>\n {/* The ring lives on an inner frame so an item label can sit below it inside the same button (one tap target). */}\n <span className=\"hjm-image-choice__ring\">\n <span className=\"hjm-image-choice__image\">{item.image}</span>\n {selected ? <span className=\"hjm-image-choice__check\" aria-hidden=\"true\">✓</span> : null}\n </span>\n {/* Every tile reserves the same caption block, so wrapped rows stay even and virtual rows share one height.\n aria-label already names the tile; the description is read once through aria-describedby. */}\n {captionLines > 0 ? <span className=\"hjm-image-choice__caption\">\n {showItemLabels ? <Text variant={imageChoiceRecipe.itemLabelVariant} className=\"hjm-image-choice__item-label\" aria-hidden=\"true\" data-lines={itemLabelLines === 1 ? undefined : itemLabelLines}>{item.label}</Text> : null}\n {item.description === undefined ? null : <Text id={descriptionId} variant={imageChoiceRecipe.itemDescriptionVariant} tone={imageChoiceRecipe.itemDescriptionTone} className=\"hjm-image-choice__item-description\" aria-hidden=\"true\">{item.description}</Text>}\n </span> : null}\n </button>;\n };\n // First-paint estimate in px; the rendered row is measured afterwards because caption line height is rem-based.\n const estimatedTileHeight = resolveImageChoiceTileHeight(captionLines, typography[imageChoiceRecipe.itemLabelVariant].lineHeight * (theme?.environment.textScale ?? 1));\n return <div className={[\"hjm-image-choice\", className].filter(Boolean).join(\" \")} style={style}>\n {showLabel ? <span className=\"hjm-image-choice__label\">{label}</span> : null}\n {virtualized\n ? <VirtualTileRows items={items} renderTile={renderTile} label={label} role={groupRole} height={virtualized.height} overscan={virtualized.overscan ?? virtualListRecipe.overscan} estimatedTileHeight={estimatedTileHeight} />\n : <div className=\"hjm-image-choice__tiles\" role={groupRole} aria-label={label}>{items.map(renderTile)}</div>}\n </div>;\n}\n\n/**\n * Windowed rows of tiles. It reuses the VirtualList window math (`resolveVirtualWindow`) but not the VirtualList\n * component: that one names its rows as list items and moves focus row by row, which would replace the radio/checkbox\n * group this control is. Tiles stay in the tab order; focusing one scrolls it into view and the window follows.\n */\nfunction VirtualTileRows({ items, renderTile, label, role, height, overscan, estimatedTileHeight }: Readonly<{\n items: readonly ImageChoiceItem[]; renderTile: (item: ImageChoiceItem, index: number) => ReactNode; label: string;\n role: \"radiogroup\" | \"group\"; height: number; overscan: number; estimatedTileHeight: number;\n}>) {\n const host = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(0);\n const [measuredTileHeight, setMeasuredTileHeight] = useState(0);\n const [scrollTop, setScrollTop] = useState(0);\n const [focusedRow, setFocusedRow] = useState<number | null>(null);\n useEffect(() => {\n if (!host.current) return;\n // Measure the slot itself (content box: inside the inset and the scrollbar); sheets and sidebars change it.\n const observer = new ResizeObserver(([entry]) => setWidth(entry?.contentRect.width ?? 0));\n observer.observe(host.current);\n return () => observer.disconnect();\n }, []);\n useLayoutEffect(() => {\n // Every row is one tile high (the caption block is reserved), so any mounted row gives the real stride.\n const rendered = host.current?.querySelector<HTMLElement>(\".hjm-image-choice__row\")?.offsetHeight ?? 0;\n if (rendered > 0 && rendered !== measuredTileHeight) setMeasuredTileHeight(rendered);\n });\n const columns = width > 0 ? Math.min(items.length, resolveImageChoiceColumns(width)) : 0;\n const stride = (measuredTileHeight || estimatedTileHeight) + imageChoiceRecipe.gap;\n const rowCount = columns ? Math.ceil(items.length / columns) : 0;\n const range = resolveVirtualWindow(rowCount, stride, height, scrollTop, overscan);\n // Keep the focused tile's row mounted when scrolling moves it out of the window, so focus is not dropped to body.\n const rows = Array.from({ length: range.end - range.start }, (_, i) => range.start + i);\n if (focusedRow !== null && focusedRow < rowCount && !rows.includes(focusedRow)) rows.push(focusedRow);\n rows.sort((first, second) => first - second); // DOM order is the tab order\n return <div ref={host} className=\"hjm-image-choice__viewport\" role={role} aria-label={label} style={{ height }}\n onScroll={event => setScrollTop(event.currentTarget.scrollTop)}>\n {columns ? <div style={{ position: \"relative\", height: Math.max(0, range.totalHeight - imageChoiceRecipe.gap) }}>\n {rows.map(row => <div key={row} className=\"hjm-image-choice__row\" style={{ top: row * stride, display: \"grid\", gridTemplateColumns: `repeat(${columns}, ${resolveImageChoiceOuterSize()}px)`, justifyContent: \"space-between\" }}\n onFocusCapture={() => setFocusedRow(row)} onBlurCapture={event => { if (!event.currentTarget.contains(event.relatedTarget)) setFocusedRow(current => current === row ? null : current); }}>\n {items.slice(row * columns, row * columns + columns).map((item, offset) => renderTile(item, row * columns + offset))}\n </div>)}\n </div> : null}\n </div>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"image-choice.js","sourceRoot":"","sources":["../src/image-choice.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAChH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC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AG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;oBAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YACxL,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,IAF3F,GAAG,CAGxB,CAAC,GACH,CAAC,CAAC,CAAC,IAAI,GACT,CAAC;AACT,CAAC","sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { Text } from \"./layout.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport { typography } from \"@hjmds/design-contracts/foundations\";\nimport {\n imageChoiceRecipe, resolveImageChoiceCaptionLines, resolveImageChoiceColumns, resolveImageChoiceOuterSize, resolveImageChoiceTileHeight, resolveImageChoiceToggle,\n validateImageChoiceItemLabelLines, validateImageChoiceItems, type ImageChoiceItemDescriptor, type ImageChoiceItemLabelLines,\n} from \"@hjmds/design-contracts/components/image-choice\";\nimport { resolveVirtualWindow, virtualListRecipe } from \"@hjmds/design-contracts/components/virtual-list\";\n\nexport type ImageChoiceItem = ImageChoiceItemDescriptor & Readonly<{ image: ReactNode }>;\nexport type ImageChoiceVirtualization = Readonly<{\n /** Height of the scrolling viewport in px. The group scrolls itself, so do not also put it in a scrolling parent. */\n height: number;\n /** Rows kept mounted above and below the visible window. */\n overscan?: number;\n}>;\ntype Base = Readonly<{\n /** Localized group name read before the choices. */\n label: string;\n /** Visible caption above the tiles; omit when the screen heading already names the choice. */\n showLabel?: boolean;\n /**\n * Shows each item's `label` under its tile (one ellipsized line), e.g. a person's name in a recipient picker.\n * The tile keeps the same accessible name, so turning this on does not change what assistive tech reads.\n */\n showItemLabels?: boolean;\n /** Lines the visible item label wraps to before the ellipsis (default 1). Every tile reserves the same height. */\n itemLabelLines?: ImageChoiceItemLabelLines;\n items: readonly ImageChoiceItem[];\n disabled?: boolean;\n className?: string;\n /**\n * Long lists (hundreds of people): only the rows near the viewport are mounted. Tiles keep their size; the column\n * count follows the measured width.\n */\n virtualized?: ImageChoiceVirtualization;\n}>;\nexport type ImageChoiceGroupProps = Base & (\n | Readonly<{ selectionMode: \"single\"; value: string | null; onValueChange(value: string): void }>\n | Readonly<{ selectionMode: \"multiple\"; value: readonly string[]; onValueChange(value: string[]): void }>\n);\n\n/**\n * Picks avatars or photos by image (2026-10-16). Tiles are square, wrap to the available width, and show\n * a brand ring plus a check when chosen; assistive tech hears radios (single) or checkboxes (multiple).\n */\nexport function ImageChoiceGroup(props: ImageChoiceGroupProps) {\n const { label, showLabel = false, showItemLabels = false, itemLabelLines = imageChoiceRecipe.itemLabelLines, items, disabled = false, className, virtualized } = props;\n validateImageChoiceItems(items);\n validateImageChoiceItemLabelLines(itemLabelLines);\n const theme = useOptionalHjmTheme();\n const baseId = useId();\n const isSelected = (id: string) => props.selectionMode === \"single\" ? props.value === id : props.value.includes(id);\n const choose = (id: string) => {\n if (props.selectionMode === \"single\") props.onValueChange(resolveImageChoiceToggle(\"single\", props.value, id));\n else props.onValueChange(resolveImageChoiceToggle(\"multiple\", props.value, id));\n };\n const role = props.selectionMode === \"single\" ? \"radio\" : \"checkbox\";\n const groupRole = props.selectionMode === \"single\" ? \"radiogroup\" : \"group\";\n const captionLines = resolveImageChoiceCaptionLines({ showItemLabels, itemLabelLines, hasDescription: items.some(item => item.description !== undefined) });\n const style = { \"--hjm-image-choice-size\": `${imageChoiceRecipe.tileSize}px`, \"--hjm-image-choice-gap\": `${imageChoiceRecipe.gap}px`, \"--hjm-image-choice-radius\": `${imageChoiceRecipe.radius}px`, \"--hjm-image-choice-ring\": `${imageChoiceRecipe.ringWidth}px`, \"--hjm-image-choice-offset\": `${imageChoiceRecipe.ringOffset}px`, \"--hjm-image-choice-check\": `${imageChoiceRecipe.checkSize}px`, \"--hjm-image-choice-item-label-gap\": `${imageChoiceRecipe.itemLabelGap}px`, \"--hjm-image-choice-caption-lines\": captionLines, \"--hjm-image-choice-viewport-inset\": `${imageChoiceRecipe.virtualViewportInset}px` } as CSSProperties;\n const renderTile = (item: ImageChoiceItem, index: number) => {\n const selected = isSelected(item.id);\n const descriptionId = item.description === undefined ? undefined : `${baseId}-description-${index}`;\n return <button key={item.id} type=\"button\" role={role} aria-checked={selected} aria-label={item.label} aria-describedby={descriptionId} className=\"hjm-image-choice__tile\" data-selected={selected || undefined}\n disabled={disabled || item.disabled} onClick={() => choose(item.id)}>\n {/* The ring lives on an inner frame so an item label can sit below it inside the same button (one tap target). */}\n <span className=\"hjm-image-choice__ring\">\n <span className=\"hjm-image-choice__image\">{item.image}</span>\n {selected ? <span className=\"hjm-image-choice__check\" aria-hidden=\"true\">✓</span> : null}\n </span>\n {/* Every tile reserves the same caption block, so wrapped rows stay even and virtual rows share one height.\n aria-label already names the tile; the description is read once through aria-describedby. */}\n {captionLines > 0 ? <span className=\"hjm-image-choice__caption\">\n {showItemLabels ? <Text variant={imageChoiceRecipe.itemLabelVariant} className=\"hjm-image-choice__item-label\" aria-hidden=\"true\" data-lines={itemLabelLines === 1 ? undefined : itemLabelLines}>{item.label}</Text> : null}\n {item.description === undefined ? null : <Text id={descriptionId} variant={imageChoiceRecipe.itemDescriptionVariant} tone={imageChoiceRecipe.itemDescriptionTone} className=\"hjm-image-choice__item-description\" aria-hidden=\"true\">{item.description}</Text>}\n </span> : null}\n </button>;\n };\n // First-paint estimate in px; the rendered row is measured afterwards because caption line height is rem-based.\n const estimatedTileHeight = resolveImageChoiceTileHeight(captionLines, typography[imageChoiceRecipe.itemLabelVariant].lineHeight * (theme?.environment.textScale ?? 1));\n return <div className={[\"hjm-image-choice\", className].filter(Boolean).join(\" \")} style={style}>\n {showLabel ? <span className=\"hjm-image-choice__label\">{label}</span> : null}\n {virtualized\n ? <VirtualTileRows items={items} renderTile={renderTile} label={label} role={groupRole} height={virtualized.height} overscan={virtualized.overscan ?? virtualListRecipe.overscan} estimatedTileHeight={estimatedTileHeight} />\n : <div className=\"hjm-image-choice__tiles\" role={groupRole} aria-label={label}>{items.map(renderTile)}</div>}\n </div>;\n}\n\n/**\n * Windowed rows of tiles. It reuses the VirtualList window math (`resolveVirtualWindow`) but not the VirtualList\n * component: that one names its rows as list items and moves focus row by row, which would replace the radio/checkbox\n * group this control is. Tiles stay in the tab order; focusing one scrolls it into view and the window follows.\n */\nfunction VirtualTileRows({ items, renderTile, label, role, height, overscan, estimatedTileHeight }: Readonly<{\n items: readonly ImageChoiceItem[]; renderTile: (item: ImageChoiceItem, index: number) => ReactNode; label: string;\n role: \"radiogroup\" | \"group\"; height: number; overscan: number; estimatedTileHeight: number;\n}>) {\n const host = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(0);\n const [measuredTileHeight, setMeasuredTileHeight] = useState(0);\n const [scrollTop, setScrollTop] = useState(0);\n const [focusedRow, setFocusedRow] = useState<number | null>(null);\n useEffect(() => {\n if (!host.current) return;\n // Measure the slot itself (content box: inside the inset and the scrollbar); sheets and sidebars change it.\n const observer = new ResizeObserver(([entry]) => setWidth(entry?.contentRect.width ?? 0));\n observer.observe(host.current);\n return () => observer.disconnect();\n }, []);\n useLayoutEffect(() => {\n // Every row is one tile high (the caption block is reserved), so any mounted row gives the real stride.\n const rendered = host.current?.querySelector<HTMLElement>(\".hjm-image-choice__row\")?.offsetHeight ?? 0;\n if (rendered > 0 && rendered !== measuredTileHeight) setMeasuredTileHeight(rendered);\n });\n const columns = width > 0 ? Math.min(items.length, resolveImageChoiceColumns(width)) : 0;\n const stride = (measuredTileHeight || estimatedTileHeight) + imageChoiceRecipe.gap;\n const rowCount = columns ? Math.ceil(items.length / columns) : 0;\n const range = resolveVirtualWindow(rowCount, stride, height, scrollTop, overscan);\n // Keep the focused tile's row mounted when scrolling moves it out of the window, so focus is not dropped to body.\n const rows = Array.from({ length: range.end - range.start }, (_, i) => range.start + i);\n if (focusedRow !== null && focusedRow < rowCount && !rows.includes(focusedRow)) rows.push(focusedRow);\n rows.sort((first, second) => first - second); // DOM order is the tab order\n return <div ref={host} className=\"hjm-image-choice__viewport\" role={role} aria-label={label} style={{ height }}\n onScroll={event => setScrollTop(event.currentTarget.scrollTop)}>\n {columns ? <div style={{ position: \"relative\", height: Math.max(0, range.totalHeight - imageChoiceRecipe.gap) }}>\n {rows.map(row => <div key={row} className=\"hjm-image-choice__row\" style={{ top: row * stride, display: \"grid\", gridTemplateColumns: `repeat(${columns}, ${resolveImageChoiceOuterSize()}px)`, justifyContent: \"space-between\" }}\n onFocusCapture={() => setFocusedRow(row)} onBlurCapture={event => { if (!event.currentTarget.contains(event.relatedTarget)) setFocusedRow(current => current === row ? null : current); }}>\n {items.slice(row * columns, row * columns + columns).map((item, offset) => renderTile(item, row * columns + offset))}\n </div>)}\n </div> : null}\n </div>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-comparison.d.ts","sourceRoot":"","sources":["../src/image-comparison.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-comparison.d.ts","sourceRoot":"","sources":["../src/image-comparison.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAA0B,KAAK,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAIpH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,QAAQ,CAAC;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAC;AACxN;wEACwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAgB1D"}
|
package/dist/image-comparison.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-comparison.js","sourceRoot":"","sources":["../src/image-comparison.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-comparison.js","sourceRoot":"","sources":["../src/image-comparison.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,sBAAsB,EAAkC,MAAM,4CAA4C,CAAC;AACpH,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD;wEACwE;AACxE,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAC7F,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChE,8EAA8E;IAC9E,iFAAiF;IACjF,OAAO,eAAK,SAAS,EAAC,sBAAsB,EAAC,KAAK,EAAE,KAAK,CAAC,WAAW,aACnE,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAE,eAAM,GAAG,EAAC,MAAM,YAAE,MAAM,CAAC,KAAK,GAAQ,EAAA,eAAM,GAAG,EAAC,MAAM,YAAE,KAAK,CAAC,KAAK,GAAQ,IAAM,EAGnN,e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E,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI,IAC3I,CAAC;AACT,CAAC","sourcesContent":["\"use client\";\n\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { resolveImageComparison, type ImageComparisonDescriptor } from \"@hjmds/design-contracts/reference-controls\";\nimport { imageRecipe } from \"@hjmds/design-contracts/components/image\";\nimport { Slider } from \"./slider.js\";\nimport { Image } from \"./supplemental-display.js\";\nexport type ImageComparisonProps = ImageComparisonDescriptor & Readonly<{ onValueChange: (value: number) => void; getValueText: (value: number) => string; disabled?: boolean; layoutStyle?: HjmCompositionStyleProp }>;\n/** Reuse Slider for drag/keyboard/commit semantics. The image divider is a\n * visual projection, not a second competing gesture or focus target. */\nexport function ImageComparison(props: ImageComparisonProps) {\n const { before, after, label, value, onValueChange, getValueText, disabled = false } = props;\n const { aspectRatio, fraction } = resolveImageComparison(props);\n // Labels follow the physical comparison sides even in RTL; each label retains\n // its own writing direction. Mirroring only the labels misidentifies the images.\n return <div className=\"hjm-image-comparison\" style={props.layoutStyle}>\n <div style={{ display: \"flex\", justifyContent: \"space-between\", direction: \"ltr\", gap: \"var(--hjm-space-sm)\", flexWrap: \"wrap\" }}><span dir=\"auto\">{before.label}</span><span dir=\"auto\">{after.label}</span></div>\n {/* The frame takes the images' own corner radius: a square frame let the surface show through each image's\n rounded corners (2026-10-17 review N9). */}\n <div style={{ position: \"relative\", aspectRatio, overflow: \"hidden\", borderRadius: `var(--hjm-radius-${imageRecipe.radius})`, direction: \"ltr\", background: \"var(--hjm-color-surface-alt)\" }}>\n <Image src={after.src} width={after.width} height={after.height} decorative={false} accessibilityLabel={after.label} style={{ display: \"block\", width: \"100%\", height: \"100%\" }} />\n <div style={{ position: \"absolute\", inset: 0, clipPath: `inset(0 ${100 - value}% 0 0)` }}><Image src={before.src} width={before.width} height={before.height} decorative={false} accessibilityLabel={before.label} style={{ display: \"block\", width: \"100%\", height: \"100%\" }} /></div>\n <div aria-hidden=\"true\" style={{ position: \"absolute\", top: 0, bottom: 0, left: `${fraction * 100}%`, borderInlineStart: \"2px solid var(--hjm-color-border)\", pointerEvents: \"none\" }} />\n </div>\n <Slider label={label} min={0} max={100} step={1} value={value} onValueChange={onValueChange} getValueText={getValueText} disabled={disabled} />\n </div>;\n}\n"]}
|
package/dist/image-viewer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
2
3
|
export type ImageViewerItem = {
|
|
3
4
|
id: string;
|
|
4
5
|
uri: string;
|
|
@@ -20,6 +21,26 @@ export type ImageViewerProps = {
|
|
|
20
21
|
/** Authorized image hosts keep their fetching, loading and retry policy. Only the selected item mounts. */
|
|
21
22
|
renderImage?: (item: ImageViewerItem) => ReactNode;
|
|
22
23
|
};
|
|
24
|
+
export type ImageViewerTriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "aria-label" | "type" | "style"> & Readonly<{
|
|
25
|
+
/** Localized accessible name, e.g. "사진 크게 보기". The media inside is decorative. */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Product media (HJM `Image` with `decorative`, `<img alt="">`). */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/** Layout-only placement; the trigger fills its container width by default, set `width` for a thumbnail. */
|
|
30
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Button around product media that opens ImageViewer. The product keeps the viewer's `open` state and calls it from
|
|
34
|
+
* `onClick`; the trigger owns the name, focus ring on the image frame radius, zoom cursor and pressed opacity.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ImageViewerTrigger: import("react").ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "style" | "aria-label" | "type"> & Readonly<{
|
|
37
|
+
/** Localized accessible name, e.g. "사진 크게 보기". The media inside is decorative. */
|
|
38
|
+
label: string;
|
|
39
|
+
/** Product media (HJM `Image` with `decorative`, `<img alt="">`). */
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
/** Layout-only placement; the trigger fills its container width by default, set `width` for a thumbnail. */
|
|
42
|
+
layoutStyle?: HjmCompositionStyleProp;
|
|
43
|
+
}> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
44
|
/** Full viewport photo presentation; shares modal isolation, focus return and Escape with Dialog. */
|
|
24
45
|
export declare function ImageViewer(props: ImageViewerProps): import("react").JSX.Element | null;
|
|
25
46
|
//# sourceMappingURL=image-viewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-viewer.d.ts","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAEvI,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAKtE,MAAM,MAAM,eAAe,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IACxE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAC7D,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAC7D,2GAA2G;IAC3G,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,SAAS,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,QAAQ,CAAC;IAC3I,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,QAAQ,EAAE,SAAS,CAAC;IACpB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAZ7B,kFAAkF;WAC3E,MAAM;IACb,qEAAqE;cAC3D,SAAS;IACnB,4GAA4G;kBAC9F,uBAAuB;sDAkBrC,CAAC;AAEH,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,sCAQlD"}
|
package/dist/image-viewer.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState } from "react";
|
|
3
|
+
import { forwardRef, useRef, useState } from "react";
|
|
4
|
+
import { imageViewerTriggerRecipe, validateImageViewerTriggerLabel } from "@hjmds/design-contracts/components/image";
|
|
5
|
+
import { classNames } from "./internal.js";
|
|
3
6
|
import { HjmPortal, getModalLayer, useModalFocus } from "./modal.js";
|
|
4
7
|
import { IconButton } from "./actions.js";
|
|
8
|
+
/**
|
|
9
|
+
* Button around product media that opens ImageViewer. The product keeps the viewer's `open` state and calls it from
|
|
10
|
+
* `onClick`; the trigger owns the name, focus ring on the image frame radius, zoom cursor and pressed opacity.
|
|
11
|
+
*/
|
|
12
|
+
export const ImageViewerTrigger = forwardRef(function ImageViewerTrigger({ label, children, className, layoutStyle, ...props }, ref) {
|
|
13
|
+
validateImageViewerTriggerLabel(label);
|
|
14
|
+
return _jsx("button", { ...props, ref: ref, type: "button", "aria-label": label, "aria-haspopup": "dialog", className: classNames("hjm-image-viewer-trigger", className), style: { ...layoutStyle, "--hjm-image-viewer-trigger-pressed-opacity": imageViewerTriggerRecipe.pressedOpacity,
|
|
15
|
+
"--hjm-image-viewer-trigger-disabled-opacity": imageViewerTriggerRecipe.disabledOpacity,
|
|
16
|
+
"--hjm-image-viewer-trigger-cursor": imageViewerTriggerRecipe.cursor }, children: children });
|
|
17
|
+
});
|
|
5
18
|
/** Full viewport photo presentation; shares modal isolation, focus return and Escape with Dialog. */
|
|
6
19
|
export function ImageViewer(props) {
|
|
7
20
|
if (!props.open)
|
package/dist/image-viewer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAqC,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,qGAAqG;AACrG,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,IAAI,CAAC,KAAK,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,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AI,CAAC;AAC1M,CAAC","sourcesContent":["import { useRef, useState, type ReactNode, type PointerEvent } from \"react\";\nimport { HjmPortal, getModalLayer, useModalFocus } from \"./modal.js\";\nimport { IconButton } from \"./actions.js\";\n\nexport type ImageViewerItem = { id: string; uri: string; label: string };\nexport type ImageViewerProps = {\n actions?: ReactNode;\n open: boolean; items: readonly ImageViewerItem[]; initialIndex?: number;\n onClose: () => void; onIndexChange?: (index: number) => void;\n closeLabel: string; previousLabel: string; nextLabel: string;\n loadingLabel: string; errorLabel: string; retryLabel: string;\n /** Authorized image hosts keep their fetching, loading and retry policy. Only the selected item mounts. */\n renderImage?: (item: ImageViewerItem) => ReactNode;\n};\n\n/** Full viewport photo presentation; shares modal isolation, focus return and Escape with Dialog. */\nexport function ImageViewer(props: ImageViewerProps) {\n if (!props.open) return null;\n if (!props.items.length || new Set(props.items.map(item => item.id)).size !== props.items.length ||\n props.items.some(item => !item.id.trim() || !item.uri.trim() || !item.label.trim()) ||\n [props.closeLabel, props.previousLabel, props.nextLabel, props.loadingLabel, props.errorLabel, props.retryLabel].some(label => !label.trim()) ||\n !Number.isInteger(props.initialIndex ?? 0) || (props.initialIndex ?? 0) < 0 || (props.initialIndex ?? 0) >= props.items.length)\n throw new TypeError(\"ImageViewer needs named images, localized controls and a valid index\");\n return <ViewerSession key={JSON.stringify(props.items.map(item => [item.id, item.uri]))} {...props} />;\n}\nfunction ViewerSession(props: ImageViewerProps) {\n const contentRef = useRef<HTMLDivElement>(null), closeRef = useRef<HTMLButtonElement>(null);\n const [index, setIndex] = useState(props.initialIndex ?? 0);\n const [view, setView] = useState({ scale: 1, x: 0, y: 0 });\n const pointers = useRef(new Map<number, { x: number; y: number }>());\n const item = props.items[index]!;\n useModalFocus({ active: true, contentRef, initialFocusRef: closeRef, onEscape: props.onClose });\n const move = (next: number) => { pointers.current.clear(); setView({ scale: 1, x: 0, y: 0 }); setIndex(next); props.onIndexChange?.(next); };\n const clamp = (scale: number, x = view.x, y = view.y) => {\n const bounds = contentRef.current?.querySelector(\".hjm-image-viewer__stage\")?.getBoundingClientRect();\n const image = contentRef.current?.querySelector('img');\n const fit = image?.naturalWidth && bounds ? Math.min(bounds.width / image.naturalWidth, bounds.height / image.naturalHeight) : 1;\n const imageWidth = image?.naturalWidth ? image.naturalWidth * fit : bounds?.width ?? 0;\n const imageHeight = image?.naturalHeight ? image.naturalHeight * fit : bounds?.height ?? 0;\n const limitX = Math.max(0, imageWidth * scale - (bounds?.width ?? 0)) / 2;\n const limitY = Math.max(0, imageHeight * scale - (bounds?.height ?? 0)) / 2;\n setView({ scale, x: Math.max(-limitX, Math.min(limitX, x)), y: Math.max(-limitY, Math.min(limitY, y)) });\n };\n const pointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const old = pointers.current.get(event.pointerId);\n if (!old) return;\n const other = [...pointers.current.entries()].find(([id]) => id !== event.pointerId)?.[1];\n pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (other) {\n const before = Math.hypot(old.x - other.x, old.y - other.y);\n if (before > 0) clamp(Math.max(1, Math.min(4, view.scale * Math.hypot(event.clientX - other.x, event.clientY - other.y) / before)));\n } else if (view.scale > 1) clamp(view.scale, view.x + event.clientX - old.x, view.y + event.clientY - old.y);\n };\n return <HjmPortal><div className=\"hjm-image-viewer\" style={{ zIndex: getModalLayer(0) }} ref={contentRef}\n role=\"dialog\" aria-modal=\"true\" aria-label={item.label} data-hjm-modal-content=\"\" tabIndex={-1}>\n <div className=\"hjm-image-viewer__header\"><IconButton ref={closeRef} label={props.closeLabel} tone=\"ghost\" onClick={props.onClose}>×</IconButton>{props.actions ? <div className=\"hjm-image-viewer__actions\">{props.actions}</div> : null}</div>\n <div className=\"hjm-image-viewer__stage\" onDoubleClick={() => clamp(view.scale === 1 ? 2 : 1, 0, 0)}\n onPointerDown={event => {\n if ((event.target as HTMLElement).closest(\"button\")) return;\n pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY }); event.currentTarget.setPointerCapture(event.pointerId);\n }} onPointerMove={pointerMove} onPointerUp={event => pointers.current.delete(event.pointerId)} onPointerCancel={event => pointers.current.delete(event.pointerId)}\n onKeyDown={event => {\n if (event.key === \"+\" || event.key === \"=\") { event.preventDefault(); clamp(Math.min(4, view.scale + 1)); }\n if (event.key === \"-\") { event.preventDefault(); clamp(Math.max(1, view.scale - 1)); }\n if (event.key.startsWith('Arrow')) {\n event.preventDefault();\n if (view.scale > 1) clamp(view.scale, view.x + (event.key === 'ArrowLeft' ? 40 : event.key === 'ArrowRight' ? -40 : 0), view.y + (event.key === 'ArrowUp' ? 40 : event.key === 'ArrowDown' ? -40 : 0));\n else if (event.key === 'ArrowLeft' && index > 0) move(index - 1);\n else if (event.key === 'ArrowRight' && index + 1 < props.items.length) move(index + 1);\n }\n }} tabIndex={0} aria-label={item.label}>\n <div className=\"hjm-image-viewer__image\" style={{ transform: `translate(${view.x}px, ${view.y}px) scale(${view.scale})` }}>\n {props.renderImage ? props.renderImage(item) : <ViewerImage key={item.uri} item={item} {...props} />}\n </div>\n </div>\n <div className=\"hjm-image-viewer__footer\">\n {props.items.length > 1 ? <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => move(index - 1)}>‹</IconButton> : null}\n <span aria-live=\"polite\">{item.label}{props.items.length > 1 ? ` · ${index + 1}/${props.items.length}` : \"\"}</span>\n {props.items.length > 1 ? <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.items.length - 1} onClick={() => move(index + 1)}>›</IconButton> : null}\n </div>\n </div></HjmPortal>;\n}\nfunction ViewerImage({ item, loadingLabel, errorLabel, retryLabel }: ImageViewerProps & { item: ImageViewerItem }) {\n const [attempt, setAttempt] = useState(0);\n // A retry retires the whole host, so an old image callback cannot mark a new attempt ready.\n return <ImageAttempt key={attempt} item={item} loadingLabel={loadingLabel} errorLabel={errorLabel} retryLabel={retryLabel} onRetry={() => setAttempt(n => n + 1)} />;\n}\nfunction ImageAttempt({ item, loadingLabel, errorLabel, retryLabel, onRetry }: Pick<ImageViewerProps, 'loadingLabel' | 'errorLabel' | 'retryLabel'> & { item: ImageViewerItem; onRetry: () => void }) {\n const [status, setStatus] = useState<\"loading\" | \"ready\" | \"error\">(\"loading\");\n return <><img src={item.uri} alt={item.label} draggable={false} onLoad={() => setStatus(current => current === 'error' ? current : 'ready')} onError={() => setStatus(\"error\")} />\n {status === \"loading\" ? <span role=\"status\">{loadingLabel}</span> : status === \"error\" ? <div role=\"alert\">{errorLabel}<button type=\"button\" onClick={onRetry}>{retryLabel}</button></div> : null}</>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../src/image-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAoF,MAAM,OAAO,CAAC;AACvI,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAErH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAA6C,SAAS,kBAAkB,CAClH,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAE1D,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,oBAAY,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,QAAQ,gBAAa,KAAK,mBAAgB,QAAQ,EACzF,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,SAAS,CAAC,EAC5D,KAAK,EAAE,EAAE,GAAG,WAAW,EAAE,4CAA4C,EAAE,wBAAwB,CAAC,cAAc;YAC5G,6CAA6C,EAAE,wBA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OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,GAAI,EAC/K,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,eAAM,IAAI,EAAC,QAAQ,YAAE,YAAY,GAAQ,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,eAAK,IAAI,EAAC,OAAO,aAAE,UAAU,EAAC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,YAAG,UAAU,GAAU,IAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC1M,CAAC","sourcesContent":["\"use client\";\n\nimport { forwardRef, useRef, useState, type ButtonHTMLAttributes, type CSSProperties, type ReactNode, type PointerEvent } from \"react\";\nimport { imageViewerTriggerRecipe, validateImageViewerTriggerLabel } from \"@hjmds/design-contracts/components/image\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { classNames } from \"./internal.js\";\nimport { HjmPortal, getModalLayer, useModalFocus } from \"./modal.js\";\nimport { IconButton } from \"./actions.js\";\n\nexport type ImageViewerItem = { id: string; uri: string; label: string };\nexport type ImageViewerProps = {\n actions?: ReactNode;\n open: boolean; items: readonly ImageViewerItem[]; initialIndex?: number;\n onClose: () => void; onIndexChange?: (index: number) => void;\n closeLabel: string; previousLabel: string; nextLabel: string;\n loadingLabel: string; errorLabel: string; retryLabel: string;\n /** Authorized image hosts keep their fetching, loading and retry policy. Only the selected item mounts. */\n renderImage?: (item: ImageViewerItem) => ReactNode;\n};\n\nexport type ImageViewerTriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\" | \"type\" | \"style\"> & Readonly<{\n /** Localized accessible name, e.g. \"사진 크게 보기\". The media inside is decorative. */\n label: string;\n /** Product media (HJM `Image` with `decorative`, `<img alt=\"\">`). */\n children: ReactNode;\n /** Layout-only placement; the trigger fills its container width by default, set `width` for a thumbnail. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/**\n * Button around product media that opens ImageViewer. The product keeps the viewer's `open` state and calls it from\n * `onClick`; the trigger owns the name, focus ring on the image frame radius, zoom cursor and pressed opacity.\n */\nexport const ImageViewerTrigger = forwardRef<HTMLButtonElement, ImageViewerTriggerProps>(function ImageViewerTrigger(\n { label, children, className, layoutStyle, ...props }, ref,\n) {\n validateImageViewerTriggerLabel(label);\n return <button {...props} ref={ref} type=\"button\" aria-label={label} aria-haspopup=\"dialog\"\n className={classNames(\"hjm-image-viewer-trigger\", className)}\n style={{ ...layoutStyle, \"--hjm-image-viewer-trigger-pressed-opacity\": imageViewerTriggerRecipe.pressedOpacity,\n \"--hjm-image-viewer-trigger-disabled-opacity\": imageViewerTriggerRecipe.disabledOpacity,\n \"--hjm-image-viewer-trigger-cursor\": imageViewerTriggerRecipe.cursor } as CSSProperties}>\n {children}\n </button>;\n});\n\n/** Full viewport photo presentation; shares modal isolation, focus return and Escape with Dialog. */\nexport function ImageViewer(props: ImageViewerProps) {\n if (!props.open) return null;\n if (!props.items.length || new Set(props.items.map(item => item.id)).size !== props.items.length ||\n props.items.some(item => !item.id.trim() || !item.uri.trim() || !item.label.trim()) ||\n [props.closeLabel, props.previousLabel, props.nextLabel, props.loadingLabel, props.errorLabel, props.retryLabel].some(label => !label.trim()) ||\n !Number.isInteger(props.initialIndex ?? 0) || (props.initialIndex ?? 0) < 0 || (props.initialIndex ?? 0) >= props.items.length)\n throw new TypeError(\"ImageViewer needs named images, localized controls and a valid index\");\n return <ViewerSession key={JSON.stringify(props.items.map(item => [item.id, item.uri]))} {...props} />;\n}\nfunction ViewerSession(props: ImageViewerProps) {\n const contentRef = useRef<HTMLDivElement>(null), closeRef = useRef<HTMLButtonElement>(null);\n const [index, setIndex] = useState(props.initialIndex ?? 0);\n const [view, setView] = useState({ scale: 1, x: 0, y: 0 });\n const pointers = useRef(new Map<number, { x: number; y: number }>());\n const item = props.items[index]!;\n useModalFocus({ active: true, contentRef, initialFocusRef: closeRef, onEscape: props.onClose });\n const move = (next: number) => { pointers.current.clear(); setView({ scale: 1, x: 0, y: 0 }); setIndex(next); props.onIndexChange?.(next); };\n const clamp = (scale: number, x = view.x, y = view.y) => {\n const bounds = contentRef.current?.querySelector(\".hjm-image-viewer__stage\")?.getBoundingClientRect();\n const image = contentRef.current?.querySelector('img');\n const fit = image?.naturalWidth && bounds ? Math.min(bounds.width / image.naturalWidth, bounds.height / image.naturalHeight) : 1;\n const imageWidth = image?.naturalWidth ? image.naturalWidth * fit : bounds?.width ?? 0;\n const imageHeight = image?.naturalHeight ? image.naturalHeight * fit : bounds?.height ?? 0;\n const limitX = Math.max(0, imageWidth * scale - (bounds?.width ?? 0)) / 2;\n const limitY = Math.max(0, imageHeight * scale - (bounds?.height ?? 0)) / 2;\n setView({ scale, x: Math.max(-limitX, Math.min(limitX, x)), y: Math.max(-limitY, Math.min(limitY, y)) });\n };\n const pointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const old = pointers.current.get(event.pointerId);\n if (!old) return;\n const other = [...pointers.current.entries()].find(([id]) => id !== event.pointerId)?.[1];\n pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });\n if (other) {\n const before = Math.hypot(old.x - other.x, old.y - other.y);\n if (before > 0) clamp(Math.max(1, Math.min(4, view.scale * Math.hypot(event.clientX - other.x, event.clientY - other.y) / before)));\n } else if (view.scale > 1) clamp(view.scale, view.x + event.clientX - old.x, view.y + event.clientY - old.y);\n };\n return <HjmPortal><div className=\"hjm-image-viewer\" style={{ zIndex: getModalLayer(0) }} ref={contentRef}\n role=\"dialog\" aria-modal=\"true\" aria-label={item.label} data-hjm-modal-content=\"\" tabIndex={-1}>\n <div className=\"hjm-image-viewer__header\"><IconButton ref={closeRef} label={props.closeLabel} tone=\"ghost\" onClick={props.onClose}>×</IconButton>{props.actions ? <div className=\"hjm-image-viewer__actions\">{props.actions}</div> : null}</div>\n <div className=\"hjm-image-viewer__stage\" onDoubleClick={() => clamp(view.scale === 1 ? 2 : 1, 0, 0)}\n onPointerDown={event => {\n if ((event.target as HTMLElement).closest(\"button\")) return;\n pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY }); event.currentTarget.setPointerCapture(event.pointerId);\n }} onPointerMove={pointerMove} onPointerUp={event => pointers.current.delete(event.pointerId)} onPointerCancel={event => pointers.current.delete(event.pointerId)}\n onKeyDown={event => {\n if (event.key === \"+\" || event.key === \"=\") { event.preventDefault(); clamp(Math.min(4, view.scale + 1)); }\n if (event.key === \"-\") { event.preventDefault(); clamp(Math.max(1, view.scale - 1)); }\n if (event.key.startsWith('Arrow')) {\n event.preventDefault();\n if (view.scale > 1) clamp(view.scale, view.x + (event.key === 'ArrowLeft' ? 40 : event.key === 'ArrowRight' ? -40 : 0), view.y + (event.key === 'ArrowUp' ? 40 : event.key === 'ArrowDown' ? -40 : 0));\n else if (event.key === 'ArrowLeft' && index > 0) move(index - 1);\n else if (event.key === 'ArrowRight' && index + 1 < props.items.length) move(index + 1);\n }\n }} tabIndex={0} aria-label={item.label}>\n <div className=\"hjm-image-viewer__image\" style={{ transform: `translate(${view.x}px, ${view.y}px) scale(${view.scale})` }}>\n {props.renderImage ? props.renderImage(item) : <ViewerImage key={item.uri} item={item} {...props} />}\n </div>\n </div>\n <div className=\"hjm-image-viewer__footer\">\n {props.items.length > 1 ? <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => move(index - 1)}>‹</IconButton> : null}\n <span aria-live=\"polite\">{item.label}{props.items.length > 1 ? ` · ${index + 1}/${props.items.length}` : \"\"}</span>\n {props.items.length > 1 ? <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.items.length - 1} onClick={() => move(index + 1)}>›</IconButton> : null}\n </div>\n </div></HjmPortal>;\n}\nfunction ViewerImage({ item, loadingLabel, errorLabel, retryLabel }: ImageViewerProps & { item: ImageViewerItem }) {\n const [attempt, setAttempt] = useState(0);\n // A retry retires the whole host, so an old image callback cannot mark a new attempt ready.\n return <ImageAttempt key={attempt} item={item} loadingLabel={loadingLabel} errorLabel={errorLabel} retryLabel={retryLabel} onRetry={() => setAttempt(n => n + 1)} />;\n}\nfunction ImageAttempt({ item, loadingLabel, errorLabel, retryLabel, onRetry }: Pick<ImageViewerProps, 'loadingLabel' | 'errorLabel' | 'retryLabel'> & { item: ImageViewerItem; onRetry: () => void }) {\n const [status, setStatus] = useState<\"loading\" | \"ready\" | \"error\">(\"loading\");\n return <><img src={item.uri} alt={item.label} draggable={false} onLoad={() => setStatus(current => current === 'error' ? current : 'ready')} onError={() => setStatus(\"error\")} />\n {status === \"loading\" ? <span role=\"status\">{loadingLabel}</span> : status === \"error\" ? <div role=\"alert\">{errorLabel}<button type=\"button\" onClick={onRetry}>{retryLabel}</button></div> : null}</>;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { TopBar, type TopBarProps } from "./top-bar.js";
|
|
|
3
3
|
export { BottomCTA, type BottomCTAAction, type BottomCTAProps } from "./bottom-cta.js";
|
|
4
4
|
export { hjmCompositionStyleKeys, type HjmCompositionStyle, type HjmCompositionStyleKey, type HjmCompositionStyleProp, } from "./composition-style.js";
|
|
5
5
|
export { AspectRatio, Container, Grid, Layout, Section, Stack, Surface, Text, VisuallyHidden, type AspectRatioProps, type AspectRatioValue, type ContainerGutter, type ContainerProps, type ContainerSize, type GridGap, type GridProps, type LayoutProps, type LayoutSidebar, type SectionProps, type StackAlign, type StackAxis, type StackGap, type StackJustify, type StackProps, type SurfacePadding, type SurfaceProps, type SurfaceRadius, type SurfaceTone, type TextEmphasis, type TextProps, type TextTone, type VisuallyHiddenProps, } from "./layout.js";
|
|
6
|
-
export { Button, ButtonLink, type ButtonLinkProps, IconButton, Link, type ButtonAlign, type ButtonProps, type ButtonShape, type ButtonAppearance, type ButtonSize, type ButtonTone, type IconButtonProps, type IconButtonShape, type IconButtonSize, type IconButtonTone, type LinkRenderProps, type LinkProps, } from "./actions.js";
|
|
6
|
+
export { Button, ButtonLink, type ButtonLinkProps, IconButton, IconButtonLink, type IconButtonLinkProps, Link, type ButtonAlign, type ButtonProps, type ButtonShape, type ButtonAppearance, type ButtonSize, type ButtonTone, type IconButtonProps, type IconButtonShape, type IconButtonSize, type IconButtonTone, type LinkRenderProps, type LinkProps, } from "./actions.js";
|
|
7
7
|
export { Field, OtpField, PasswordField, SearchField, TextArea, TextField, type FieldControlProps, type FieldProps, type OtpFieldProps, type PasswordFieldProps, type PasswordFieldToggleRenderProps, type SearchFieldProps, type SearchFieldIconRenderProps, type TextAreaProps, type TextFieldProps, } from "./forms.js";
|
|
8
8
|
export { Combobox, Form, type ComboboxItem, type ComboboxOpenChangeReason, type ComboboxProps, type FormProps, type FormSubmitHandler, NativeSelect, type NativeSelectProps, type SelectOption, } from "./advanced-forms.js";
|
|
9
9
|
export { Select, type SelectItem, type SelectLeadingRenderProps, type SelectOptionLeadingRenderProps, type SelectProps, type SelectSection, } from "./select.js";
|
|
@@ -20,7 +20,7 @@ export { Steps, type StepsProps, } from "./steps.js";
|
|
|
20
20
|
export { BottomNavigation, BottomNavigationInsetProvider, useBottomNavigationInset, getBottomNavigationGridColumn, isUnmodifiedPrimaryBottomNavigationClick, shouldHideBottomNavigationForKeyboard, type BottomNavigationIconRenderProps, type BottomNavigationInsetProviderProps, type BottomNavigationLinkRenderProps, type BottomNavigationProps, } from "./bottom-navigation.js";
|
|
21
21
|
export { Badge, Card, QuoteCard, ListRow, Tag, type BadgeProps, type BadgeVariant, type CardHeadingLevel, type CardProps, type QuoteCardProps, type ListRowProps, type TagProps, type TagTone, } from "./display.js";
|
|
22
22
|
export { CounterBadge, Icon, Image, type CounterBadgeProps, type IconProps, type ImageAdapterProps, type ImageProps, } from "./supplemental-display.js";
|
|
23
|
-
export { Accordion, Avatar, AvatarGroup, type AvatarGroupProps, DescriptionList, Divider, List, ListSeparator, Statistic, StatisticGroup, Table, Timeline, type AccordionItem, type AccordionProps, type AvatarProps, type DescriptionListProps, type DividerInset, type DividerOrientation, type DividerProps, type ListAppearance, type ListProps, type ListSeparatorProps, type StatisticProps, type StatisticGroupProps, type StatisticTrendMarkRenderProps, type ComposeStatisticAccessibilityLabel, type TableColumn, type TableProps, type TableSortDirection, type TimelineProps, } from "./advanced-display.js";
|
|
23
|
+
export { Accordion, Avatar, AvatarGroup, type AvatarGroupProps, DescriptionList, Divider, List, ListSeparator, Statistic, StatisticGroup, Table, Timeline, type AccordionItem, type AccordionProps, type AvatarProps, type AvatarImageRenderProps, type DescriptionListProps, type DividerInset, type DividerOrientation, type DividerProps, type ListAppearance, type ListProps, type ListSeparatorProps, type StatisticProps, type StatisticGroupProps, type StatisticTrendMarkRenderProps, type ComposeStatisticAccessibilityLabel, type TableColumn, type TableProps, type TableSortDirection, type TimelineProps, } from "./advanced-display.js";
|
|
24
24
|
export { UploadItem, type UploadItemProps, } from "./upload-item.js";
|
|
25
25
|
export { EmptyState, Notice, Progress, Result, Skeleton, Spinner, PendingContent, type PendingContentProps, type EmptyStateProps, type NoticeProps, type ProgressProps, type ResultProps, type SkeletonProps, type SpinnerProps, } from "./feedback.js";
|
|
26
26
|
export { Toast, ToastProvider, useToast, type ToastApi, type ToastProps, type ToastProviderProps, } from "./toast.js";
|
|
@@ -46,7 +46,7 @@ export { ToggleGroup, type ToggleGroupProps } from "./toggle-group.js";
|
|
|
46
46
|
export { TagsInput, type TagsInputProps } from "./tags-input.js";
|
|
47
47
|
export { SkipNav, type SkipNavProps } from "./skip-nav.js";
|
|
48
48
|
export { BottomInfo, type BottomInfoProps } from "./bottom-info.js";
|
|
49
|
-
export { Sidebar, type SidebarProps } from "./sidebar.js";
|
|
49
|
+
export { Sidebar, type SidebarLinkRenderProps, type SidebarProps, type SidebarSize } from "./sidebar.js";
|
|
50
50
|
export { DateRangePicker, type DateRangePickerProps } from "./date-range.js";
|
|
51
51
|
export { OverlayStackProvider, useOverlayStack, useDialog, useSheet, type OverlayStackApi, type OverlayStackProviderProps, type OverlayHandle, } from "./overlay-stack.js";
|
|
52
52
|
export { AuthProviderButton, type AuthProviderButtonProps } from "./provider-button.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EACL,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,SAAS,EACT,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,eAAe,EACpB,UAAU,EACV,IAAI,EACJ,KAAK,WAAW,EAChB,KAA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jmCompositionStyleKeys, } from "./composition-style.js";
|
|
5
5
|
export { AspectRatio, Container, Grid, Layout, Section, Stack, Surface, Text, VisuallyHidden, } from "./layout.js";
|
|
6
|
-
export { Button, ButtonLink, IconButton, Link, } from "./actions.js";
|
|
6
|
+
export { Button, ButtonLink, IconButton, IconButtonLink, Link, } from "./actions.js";
|
|
7
7
|
export { Field, OtpField, PasswordField, SearchField, TextArea, TextField, } from "./forms.js";
|
|
8
8
|
export { Combobox, Form, NativeSelect, } from "./advanced-forms.js";
|
|
9
9
|
export { Select, } from "./select.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,GAIZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAA6C,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EACL,uBAAuB,GAIxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,SAAS,EACT,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,cAAc,GAwBf,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,MAAM,EACN,UAAU,EAEV,UAAU,EACV,IAAI,GAaL,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,GAUV,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,IAAI,EAMJ,YAAY,GAGb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,MAAM,GAMP,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,MAAM,GAEP,MAAM,aAAa,CAAC;AAErB,OAA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,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAAe,EAA6B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,QAAQ,GAIT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAgC,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAA+G,MAAM,kBAAkB,CAAC;AACnM,OAAO,EAAE,SAAS,EAA6C,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAyB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,WAAW,EAA+C,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAyC,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC","sourcesContent":["export {\n HjmProvider,\n useHjmTheme,\n type HjmBrandPalette,\n type HjmProviderHost,\n type HjmProviderProps,\n} from \"./provider.js\";\n\nexport { TopBar, type TopBarProps } from \"./top-bar.js\";\nexport { BottomCTA, type BottomCTAAction, type BottomCTAProps } from \"./bottom-cta.js\";\n\nexport {\n hjmCompositionStyleKeys,\n type HjmCompositionStyle,\n type HjmCompositionStyleKey,\n type HjmCompositionStyleProp,\n} from \"./composition-style.js\";\n\nexport {\n AspectRatio,\n Container,\n Grid,\n Layout,\n Section,\n Stack,\n Surface,\n Text,\n VisuallyHidden,\n type AspectRatioProps,\n type AspectRatioValue,\n type ContainerGutter,\n type ContainerProps,\n type ContainerSize,\n type GridGap,\n type GridProps,\n type LayoutProps,\n type LayoutSidebar,\n type SectionProps,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type StackProps,\n type SurfacePadding,\n type SurfaceProps,\n type SurfaceRadius,\n type SurfaceTone,\n type TextEmphasis,\n type TextProps,\n type TextTone,\n type VisuallyHiddenProps,\n} from \"./layout.js\";\n\nexport {\n Button,\n ButtonLink,\n type ButtonLinkProps,\n IconButton,\n Link,\n type ButtonAlign,\n type ButtonProps,\n type ButtonShape,\n type ButtonAppearance,\n type ButtonSize,\n type ButtonTone,\n type IconButtonProps,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkRenderProps,\n type LinkProps,\n} from \"./actions.js\";\n\nexport {\n Field,\n OtpField,\n PasswordField,\n SearchField,\n TextArea,\n TextField,\n type FieldControlProps,\n type FieldProps,\n type OtpFieldProps,\n type PasswordFieldProps,\n type PasswordFieldToggleRenderProps,\n type SearchFieldProps,\n type SearchFieldIconRenderProps,\n type TextAreaProps,\n type TextFieldProps,\n} from \"./forms.js\";\n\nexport {\n Combobox,\n Form,\n type ComboboxItem,\n type ComboboxOpenChangeReason,\n type ComboboxProps,\n type FormProps,\n type FormSubmitHandler,\n NativeSelect,\n type NativeSelectProps,\n type SelectOption,\n} from \"./advanced-forms.js\";\n\nexport {\n Select,\n type SelectItem,\n type SelectLeadingRenderProps,\n type SelectOptionLeadingRenderProps,\n type SelectProps,\n type SelectSection,\n} from \"./select.js\";\n\nexport {\n NumberField,\n type NumberFieldProps,\n} from \"./number-field.js\";\n\nexport {\n Slider,\n type SliderProps,\n} from \"./slider.js\";\n\nexport {\n DatePicker,\n type DatePickerMonthAction,\n type DatePickerProps,\n} from \"./date-picker.js\";\n\nexport {\n FilePicker,\n type FilePickerProps,\n} from \"./file-picker.js\";\n\nexport {\n Checkbox,\n CheckboxGroup,\n Chip,\n Radio,\n RadioGroup,\n SegmentedControl,\n Switch,\n type CheckboxProps,\n type CheckboxGroupItem,\n type CheckboxGroupProps,\n type ChipProps,\n type ChoiceLeadingRenderProps,\n type RadioProps,\n type RadioGroupItem,\n type RadioGroupProps,\n type SegmentedControlItem,\n type SegmentedControlProps,\n type SwitchProps,\n type SwitchSize,\n} from \"./selection.js\";\n\nexport {\n TabPanel,\n Tabs,\n getDynamicTabPanelId,\n getTabId,\n getTabPanelId,\n type TabLeadingRenderProps,\n type TabItem,\n type TabPanelProps,\n type TabsProps,\n} from \"./navigation.js\";\n\nexport { Breadcrumb, type BreadcrumbProps } from \"./breadcrumb.js\";\nexport { Pagination, type PaginationProps } from \"./pagination.js\";\n\nexport {\n LoadMore,\n type LoadMoreProps,\n} from \"./supplemental-navigation.js\";\n\nexport {\n Steps,\n type StepsProps,\n} from \"./steps.js\";\n\nexport {\n BottomNavigation,\n BottomNavigationInsetProvider,\n useBottomNavigationInset,\n getBottomNavigationGridColumn,\n isUnmodifiedPrimaryBottomNavigationClick,\n shouldHideBottomNavigationForKeyboard,\n type BottomNavigationIconRenderProps,\n type BottomNavigationInsetProviderProps,\n type BottomNavigationLinkRenderProps,\n type BottomNavigationProps,\n} from \"./bottom-navigation.js\";\n\nexport {\n Badge,\n Card,\n QuoteCard,\n ListRow,\n Tag,\n type BadgeProps,\n type BadgeVariant,\n type CardHeadingLevel,\n type CardProps,\n type QuoteCardProps,\n type ListRowProps,\n type TagProps,\n type TagTone,\n} from \"./display.js\";\n\nexport {\n CounterBadge,\n Icon,\n Image,\n type CounterBadgeProps,\n type IconProps,\n type ImageAdapterProps,\n type ImageProps,\n} from \"./supplemental-display.js\";\n\nexport {\n Accordion,\n Avatar,\n AvatarGroup,\n type AvatarGroupProps,\n DescriptionList,\n Divider,\n List,\n ListSeparator,\n Statistic,\n StatisticGroup,\n Table,\n Timeline,\n type AccordionItem,\n type AccordionProps,\n type AvatarProps,\n type DescriptionListProps,\n type DividerInset,\n type DividerOrientation,\n type DividerProps,\n type ListAppearance,\n type ListProps,\n type ListSeparatorProps,\n type StatisticProps,\n type StatisticGroupProps,\n type StatisticTrendMarkRenderProps,\n type ComposeStatisticAccessibilityLabel,\n type TableColumn,\n type TableProps,\n type TableSortDirection,\n type TimelineProps,\n} from \"./advanced-display.js\";\n\nexport {\n UploadItem,\n type UploadItemProps,\n} from \"./upload-item.js\";\n\nexport {\n EmptyState,\n Notice,\n Progress,\n Result,\n Skeleton,\n Spinner,\n PendingContent,\n type PendingContentProps,\n type EmptyStateProps,\n type NoticeProps,\n type ProgressProps,\n type ResultProps,\n type SkeletonProps,\n type SpinnerProps,\n} from \"./feedback.js\";\n\nexport {\n Toast,\n ToastProvider,\n useToast,\n type ToastApi,\n type ToastProps,\n type ToastProviderProps,\n} from \"./toast.js\";\n\nexport {\n AlertDialog,\n Dialog,\n ImmersiveOverlay,\n Menu,\n Sheet,\n Tooltip,\n type AlertDialogProps,\n type DialogOpenChangeReason,\n type DialogProps,\n type ImmersiveOverlayOpenChangeReason,\n type ImmersiveOverlayProps,\n type MenuItem,\n type MenuAsyncState,\n type MenuOpenChangeReason,\n type MenuProps,\n type MenuSection,\n type OverlayTrigger,\n type SheetPlacement,\n type SheetProps,\n type SheetSize,\n type TooltipProps,\n} from \"./overlays.js\";\n\nexport { Carousel, PageIndicator, type CarouselProps, type CarouselLabels, type PageIndicatorProps } from \"./carousel.js\";\n\nexport { FloatingActionButton, useFloatingActionButtonScroll, resolveFloatingActionButtonContentClearance, type FloatingActionButtonProps } from \"./floating-action-button.js\";\n\nexport { Calendar, type CalendarProps, type CalendarMonthAction, type CalendarHandle, type CalendarOverflow } from \"./calendar.js\";\n\nexport { Anchor, type AnchorProps } from \"./anchor.js\";\n\nexport { Popover, type PopoverProps, type PopoverContentActions } from \"./popover.js\";\nexport { SidePanel, type SidePanelProps } from \"./side-panel.js\";\nexport { Splitter, type SplitterProps } from \"./splitter.js\";\nexport { Tour, type TourProps } from \"./tour.js\";\nexport { Tree, type TreeProps } from \"./tree.js\";\nexport { TransferList, type TransferListProps, type TransferListLabels } from \"./transfer-list.js\";\nexport { Mentions, type MentionsProps, type MentionCandidate } from \"./mentions.js\";\nexport { CommandPalette, type CommandPaletteProps } from \"./command-palette.js\";\nexport { Agreement, type AgreementProps } from \"./agreement.js\";\nexport { Top, type TopProps } from \"./top.js\";\nexport { Heading, type HeadingProps } from \"./heading.js\";\nexport { TextFormat, type TextFormatProps } from \"./text-formats.js\";\nexport { ClipboardButton, ClipboardIconButton, type ClipboardButtonProps, type ClipboardIconButtonProps } from \"./clipboard.js\";\nexport { ToggleGroup, type ToggleGroupProps } from \"./toggle-group.js\";\nexport { TagsInput, type TagsInputProps } from \"./tags-input.js\";\nexport { SkipNav, type SkipNavProps } from \"./skip-nav.js\";\nexport { BottomInfo, type BottomInfoProps } from \"./bottom-info.js\";\nexport { Sidebar, type SidebarProps } from \"./sidebar.js\";\nexport { DateRangePicker, type DateRangePickerProps } from \"./date-range.js\";\nexport {\n OverlayStackProvider,\n useOverlayStack,\n useDialog,\n useSheet,\n type OverlayStackApi,\n type OverlayStackProviderProps,\n type OverlayHandle,\n} from \"./overlay-stack.js\";\nexport { AuthProviderButton, type AuthProviderButtonProps } from \"./provider-button.js\";\nexport { AuthScreenLayout, AuthScreenHero, AuthScreenFooter, type AuthScreenLayoutProps, type AuthScreenHeroProps, type AuthScreenFooterProps, type AuthScreenPolicyLink } from \"./auth-screen.js\";\nexport { DataTable, type DataTableProps, type DataTableLabels } from \"./data-table.js\";\nexport { Collapsible, CollapsibleMarker, type CollapsibleProps } from \"./collapsible.js\";\nexport { ContextMenu, type ContextMenuItem, type ContextMenuProps } from \"./context-menu.js\";\nexport { Menubar, type MenubarProps } from \"./menubar.js\";\nexport { Asset, AssetGroup, type AssetProps, type AssetGroupProps } from \"./asset.js\";\n\nexport { StatusText, type StatusTextProps } from \"./status-text.js\";\n\nexport { TimePicker, type TimePickerProps } from \"./time-picker.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,GAIZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAC;A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EAAE,UAAU,EAAyC,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC","sourcesContent":["export {\n HjmProvider,\n useHjmTheme,\n type HjmBrandPalette,\n type HjmProviderHost,\n type HjmProviderProps,\n} from \"./provider.js\";\n\nexport { TopBar, type TopBarProps } from \"./top-bar.js\";\nexport { BottomCTA, type BottomCTAAction, type BottomCTAProps } from \"./bottom-cta.js\";\n\nexport {\n hjmCompositionStyleKeys,\n type HjmCompositionStyle,\n type HjmCompositionStyleKey,\n type HjmCompositionStyleProp,\n} from \"./composition-style.js\";\n\nexport {\n AspectRatio,\n Container,\n Grid,\n Layout,\n Section,\n Stack,\n Surface,\n Text,\n VisuallyHidden,\n type AspectRatioProps,\n type AspectRatioValue,\n type ContainerGutter,\n type ContainerProps,\n type ContainerSize,\n type GridGap,\n type GridProps,\n type LayoutProps,\n type LayoutSidebar,\n type SectionProps,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type StackProps,\n type SurfacePadding,\n type SurfaceProps,\n type SurfaceRadius,\n type SurfaceTone,\n type TextEmphasis,\n type TextProps,\n type TextTone,\n type VisuallyHiddenProps,\n} from \"./layout.js\";\n\nexport {\n Button,\n ButtonLink,\n type ButtonLinkProps,\n IconButton,\n IconButtonLink,\n type IconButtonLinkProps,\n Link,\n type ButtonAlign,\n type ButtonProps,\n type ButtonShape,\n type ButtonAppearance,\n type ButtonSize,\n type ButtonTone,\n type IconButtonProps,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkRenderProps,\n type LinkProps,\n} from \"./actions.js\";\n\nexport {\n Field,\n OtpField,\n PasswordField,\n SearchField,\n TextArea,\n TextField,\n type FieldControlProps,\n type FieldProps,\n type OtpFieldProps,\n type PasswordFieldProps,\n type PasswordFieldToggleRenderProps,\n type SearchFieldProps,\n type SearchFieldIconRenderProps,\n type TextAreaProps,\n type TextFieldProps,\n} from \"./forms.js\";\n\nexport {\n Combobox,\n Form,\n type ComboboxItem,\n type ComboboxOpenChangeReason,\n type ComboboxProps,\n type FormProps,\n type FormSubmitHandler,\n NativeSelect,\n type NativeSelectProps,\n type SelectOption,\n} from \"./advanced-forms.js\";\n\nexport {\n Select,\n type SelectItem,\n type SelectLeadingRenderProps,\n type SelectOptionLeadingRenderProps,\n type SelectProps,\n type SelectSection,\n} from \"./select.js\";\n\nexport {\n NumberField,\n type NumberFieldProps,\n} from \"./number-field.js\";\n\nexport {\n Slider,\n type SliderProps,\n} from \"./slider.js\";\n\nexport {\n DatePicker,\n type DatePickerMonthAction,\n type DatePickerProps,\n} from \"./date-picker.js\";\n\nexport {\n FilePicker,\n type FilePickerProps,\n} from \"./file-picker.js\";\n\nexport {\n Checkbox,\n CheckboxGroup,\n Chip,\n Radio,\n RadioGroup,\n SegmentedControl,\n Switch,\n type CheckboxProps,\n type CheckboxGroupItem,\n type CheckboxGroupProps,\n type ChipProps,\n type ChoiceLeadingRenderProps,\n type RadioProps,\n type RadioGroupItem,\n type RadioGroupProps,\n type SegmentedControlItem,\n type SegmentedControlProps,\n type SwitchProps,\n type SwitchSize,\n} from \"./selection.js\";\n\nexport {\n TabPanel,\n Tabs,\n getDynamicTabPanelId,\n getTabId,\n getTabPanelId,\n type TabLeadingRenderProps,\n type TabItem,\n type TabPanelProps,\n type TabsProps,\n} from \"./navigation.js\";\n\nexport { Breadcrumb, type BreadcrumbProps } from \"./breadcrumb.js\";\nexport { Pagination, type PaginationProps } from \"./pagination.js\";\n\nexport {\n LoadMore,\n type LoadMoreProps,\n} from \"./supplemental-navigation.js\";\n\nexport {\n Steps,\n type StepsProps,\n} from \"./steps.js\";\n\nexport {\n BottomNavigation,\n BottomNavigationInsetProvider,\n useBottomNavigationInset,\n getBottomNavigationGridColumn,\n isUnmodifiedPrimaryBottomNavigationClick,\n shouldHideBottomNavigationForKeyboard,\n type BottomNavigationIconRenderProps,\n type BottomNavigationInsetProviderProps,\n type BottomNavigationLinkRenderProps,\n type BottomNavigationProps,\n} from \"./bottom-navigation.js\";\n\nexport {\n Badge,\n Card,\n QuoteCard,\n ListRow,\n Tag,\n type BadgeProps,\n type BadgeVariant,\n type CardHeadingLevel,\n type CardProps,\n type QuoteCardProps,\n type ListRowProps,\n type TagProps,\n type TagTone,\n} from \"./display.js\";\n\nexport {\n CounterBadge,\n Icon,\n Image,\n type CounterBadgeProps,\n type IconProps,\n type ImageAdapterProps,\n type ImageProps,\n} from \"./supplemental-display.js\";\n\nexport {\n Accordion,\n Avatar,\n AvatarGroup,\n type AvatarGroupProps,\n DescriptionList,\n Divider,\n List,\n ListSeparator,\n Statistic,\n StatisticGroup,\n Table,\n Timeline,\n type AccordionItem,\n type AccordionProps,\n type AvatarProps,\n type AvatarImageRenderProps,\n type DescriptionListProps,\n type DividerInset,\n type DividerOrientation,\n type DividerProps,\n type ListAppearance,\n type ListProps,\n type ListSeparatorProps,\n type StatisticProps,\n type StatisticGroupProps,\n type StatisticTrendMarkRenderProps,\n type ComposeStatisticAccessibilityLabel,\n type TableColumn,\n type TableProps,\n type TableSortDirection,\n type TimelineProps,\n} from \"./advanced-display.js\";\n\nexport {\n UploadItem,\n type UploadItemProps,\n} from \"./upload-item.js\";\n\nexport {\n EmptyState,\n Notice,\n Progress,\n Result,\n Skeleton,\n Spinner,\n PendingContent,\n type PendingContentProps,\n type EmptyStateProps,\n type NoticeProps,\n type ProgressProps,\n type ResultProps,\n type SkeletonProps,\n type SpinnerProps,\n} from \"./feedback.js\";\n\nexport {\n Toast,\n ToastProvider,\n useToast,\n type ToastApi,\n type ToastProps,\n type ToastProviderProps,\n} from \"./toast.js\";\n\nexport {\n AlertDialog,\n Dialog,\n ImmersiveOverlay,\n Menu,\n Sheet,\n Tooltip,\n type AlertDialogProps,\n type DialogOpenChangeReason,\n type DialogProps,\n type ImmersiveOverlayOpenChangeReason,\n type ImmersiveOverlayProps,\n type MenuItem,\n type MenuAsyncState,\n type MenuOpenChangeReason,\n type MenuProps,\n type MenuSection,\n type OverlayTrigger,\n type SheetPlacement,\n type SheetProps,\n type SheetSize,\n type TooltipProps,\n} from \"./overlays.js\";\n\nexport { Carousel, PageIndicator, type CarouselProps, type CarouselLabels, type PageIndicatorProps } from \"./carousel.js\";\n\nexport { FloatingActionButton, useFloatingActionButtonScroll, resolveFloatingActionButtonContentClearance, type FloatingActionButtonProps } from \"./floating-action-button.js\";\n\nexport { Calendar, type CalendarProps, type CalendarMonthAction, type CalendarHandle, type CalendarOverflow } from \"./calendar.js\";\n\nexport { Anchor, type AnchorProps } from \"./anchor.js\";\n\nexport { Popover, type PopoverProps, type PopoverContentActions } from \"./popover.js\";\nexport { SidePanel, type SidePanelProps } from \"./side-panel.js\";\nexport { Splitter, type SplitterProps } from \"./splitter.js\";\nexport { Tour, type TourProps } from \"./tour.js\";\nexport { Tree, type TreeProps } from \"./tree.js\";\nexport { TransferList, type TransferListProps, type TransferListLabels } from \"./transfer-list.js\";\nexport { Mentions, type MentionsProps, type MentionCandidate } from \"./mentions.js\";\nexport { CommandPalette, type CommandPaletteProps } from \"./command-palette.js\";\nexport { Agreement, type AgreementProps } from \"./agreement.js\";\nexport { Top, type TopProps } from \"./top.js\";\nexport { Heading, type HeadingProps } from \"./heading.js\";\nexport { TextFormat, type TextFormatProps } from \"./text-formats.js\";\nexport { ClipboardButton, ClipboardIconButton, type ClipboardButtonProps, type ClipboardIconButtonProps } from \"./clipboard.js\";\nexport { ToggleGroup, type ToggleGroupProps } from \"./toggle-group.js\";\nexport { TagsInput, type TagsInputProps } from \"./tags-input.js\";\nexport { SkipNav, type SkipNavProps } from \"./skip-nav.js\";\nexport { BottomInfo, type BottomInfoProps } from \"./bottom-info.js\";\nexport { Sidebar, type SidebarLinkRenderProps, type SidebarProps, type SidebarSize } from \"./sidebar.js\";\nexport { DateRangePicker, type DateRangePickerProps } from \"./date-range.js\";\nexport {\n OverlayStackProvider,\n useOverlayStack,\n useDialog,\n useSheet,\n type OverlayStackApi,\n type OverlayStackProviderProps,\n type OverlayHandle,\n} from \"./overlay-stack.js\";\nexport { AuthProviderButton, type AuthProviderButtonProps } from \"./provider-button.js\";\nexport { AuthScreenLayout, AuthScreenHero, AuthScreenFooter, type AuthScreenLayoutProps, type AuthScreenHeroProps, type AuthScreenFooterProps, type AuthScreenPolicyLink } from \"./auth-screen.js\";\nexport { DataTable, type DataTableProps, type DataTableLabels } from \"./data-table.js\";\nexport { Collapsible, CollapsibleMarker, type CollapsibleProps } from \"./collapsible.js\";\nexport { ContextMenu, type ContextMenuItem, type ContextMenuProps } from \"./context-menu.js\";\nexport { Menubar, type MenubarProps } from \"./menubar.js\";\nexport { Asset, AssetGroup, type AssetProps, type AssetGroupProps } from \"./asset.js\";\n\nexport { StatusText, type StatusTextProps } from \"./status-text.js\";\n\nexport { TimePicker, type TimePickerProps } from \"./time-picker.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-confirm.d.ts","sourceRoot":"","sources":["../src/inline-confirm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline-confirm.d.ts","sourceRoot":"","sources":["../src/inline-confirm.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9O,uHAAuH;IACvH,WAAW,CAAC,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAC;AAG3C,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAyCtD"}
|
package/dist/inline-confirm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-confirm.js","sourceRoot":"","sources":["../src/inline-confirm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inline-confirm.js","sourceRoot":"","sources":["../src/inline-confirm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAA2B,MAAM,iDAAiD,CAAC;AACpH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;AACtC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AACjC,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,0EAA0E;IAC1E,2EAA2E;IAC3E,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA4B,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,aAAa,CAAC,CAAC;IAC/H,MAAM,OAAO,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,CAAoB,IAA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CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,EAAE,aAC7P,yBAAO,KAAK,CAAC,MAAM,GAAQ,EAAC,KAAK,EAAE,MAAM,KAAK,OAAO,IAAI,eAAM,IAAI,EAAC,OAAO,YAAE,KAAK,CAAC,OAAO,GAAQ,EAClG,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,EAAE,aAC3E,KAAC,MAAM,IAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,YAAG,KAAK,CAAC,WAAW,GAAU,EAC9H,KAAC,MAAM,IAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;4BACrG,uEAAuE;4BACvE,yEAAyE;4BACzE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;gCAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;4BAClG,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;wBACzB,CAAC,YAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,GAAU,IACxD,IACF,CAAC;AACT,CAAC","sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState, useSyncExternalStore } from \"react\";\nimport { createAlertDialogSession, type AlertDialogSession } from \"@hjmds/design-contracts/components/alert-dialog\";\nimport { Button } from \"./actions.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nexport type InlineConfirmProps = Readonly<{ label: string; prompt: string; confirmLabel: string; cancelLabel: string; pendingLabel: string; successLabel: string; errorLabel: string; disabled?: boolean; onConfirm: () => void | Promise<void>;\n /** Canonical layout-only placement, applied to whichever root the current phase renders so the block does not jump. */\n layoutStyle?: HjmCompositionStyleProp }>;\nconst emptySubscribe = () => () => {};\nconst emptySnapshot = () => null;\n/** Low-complexity confirmation using the existing async dialog session semantics. */\nexport function InlineConfirm(props: InlineConfirmProps) {\n // The displayed prompt can change while confirmation is open. Execute the\n // current action rather than the callback captured when the prompt opened.\n const confirmRef = useRef(props.onConfirm);\n confirmRef.current = props.onConfirm;\n const [session, setSession] = useState<AlertDialogSession | null>(null);\n const [done, setDone] = useState(false);\n const phase = useSyncExternalStore(session?.subscribe ?? emptySubscribe, session?.getSnapshot ?? emptySnapshot, emptySnapshot);\n const trigger = useRef<HTMLButtonElement>(null);\n const cancel = useRef<HTMLButtonElement>(null);\n const confirm = useRef<HTMLButtonElement>(null);\n const group = useRef<HTMLDivElement>(null);\n const result = useRef<HTMLSpanElement>(null);\n const focusResult = useRef(false);\n useEffect(() => { if (session) cancel.current?.focus(); }, [session]);\n useEffect(() => {\n if (phase?.status !== \"closing\") return;\n const confirmed = phase.result.outcome === \"confirmed\";\n // Completion removes both actions. Move only this group's current focus;\n // an async response must not steal focus from another part of the page.\n focusResult.current = confirmed && (group.current?.contains(document.activeElement) ?? false);\n session?.completeExit();setDone(confirmed);setSession(null);\n // Cancel returns focus to the original action; success leaves a live result.\n if (!confirmed) queueMicrotask(() => trigger.current?.focus());\n }, [phase, session]);\n useEffect(() => { if (done && focusResult.current) { focusResult.current = false; result.current?.focus(); } }, [done]);\n if (done) return <span ref={result} tabIndex={-1} role=\"status\" style={props.layoutStyle}>{props.successLabel}</span>;\n if (!session) return <Button ref={trigger} tone=\"danger\" disabled={props.disabled ?? false} {...(props.layoutStyle === undefined ? {} : { layoutStyle: props.layoutStyle })} onClick={() => setSession(createAlertDialogSession({ mode: \"confirm\", tone: \"danger\", title: props.label, description: props.prompt, confirmLabel: props.confirmLabel, cancelLabel: props.cancelLabel, onConfirm: () => confirmRef.current(), fallbackErrorMessage: props.errorLabel }))}>{props.label}</Button>;\n const busy = phase?.status === \"busy\";\n return <div ref={group} role=\"group\" aria-label={props.prompt} onKeyDown={event => { if (event.key === \"Escape\" && !busy) { event.stopPropagation();session.cancel(\"escape\"); } }} style={{ ...props.layoutStyle, display: \"grid\", gap: \"var(--hjm-space-sm)\" }}>\n <span>{props.prompt}</span>{phase?.status === \"error\" && <span role=\"alert\">{phase.message}</span>}\n <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: \"var(--hjm-space-xs)\" }}>\n <Button ref={cancel} tone=\"ghost\" disabled={busy} onClick={() => session.cancel(\"cancel-action\")}>{props.cancelLabel}</Button>\n <Button ref={confirm} tone=\"danger\" loading={busy} disabled={props.disabled ?? false} onClick={event => {\n // WebKit pointer activation can leave focus on the now-disabled cancel\n // button. Transfer it before submitting; loading already blocks repeats.\n if (event.detail > 0 || group.current?.contains(document.activeElement)) confirm.current?.focus();\n void session.confirm();\n }}>{busy ? props.pendingLabel : props.confirmLabel}</Button>\n </div>\n </div>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-resource.d.ts","sourceRoot":"","sources":["../../src/internal/document-resource.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-resource.d.ts","sourceRoot":"","sources":["../../src/internal/document-resource.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAmC,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAI3H,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GAAG,QAAQ,CAAC;IAAE,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAEzH,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,+BAwDxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-resource.js","sourceRoot":"","sources":["../../src/internal/document-resource.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-resource.js","sourceRoot":"","sources":["../../src/internal/document-resource.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAiC,MAAM,2CAA2C,CAAC;AAC3H,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpD,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB;IACvF,MAAM,QAAQ,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC;IAC1D,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC;IACpD,MAAM,aAAa,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,MAAM,CAAkB,IAAI,CAAC,CAA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C,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,EAC3J,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;4BAC7G,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC9F,EACP,UAAU,IACL,GACA,CAAC;AACb,CAAC","sourcesContent":["\"use client\";\n\nimport { useCallback, useLayoutEffect, useRef, type ReactNode } from \"react\";\nimport { resolveDocumentResourceControls, type DocumentResourceControls } from \"@hjmds/design-contracts/document-resource\";\nimport { Button } from \"../actions.js\";\nimport { Stack, Surface, Text } from \"../layout.js\";\n\nexport type DocumentResourceProps = DocumentResourceControls & Readonly<{ preview?: ReactNode; moreAction?: ReactNode }>;\n\n/** Rendering a host result never initiates file access or transfer. */\nexport function DocumentResource({ preview, moreAction, ...props }: DocumentResourceProps) {\n const resource = resolveDocumentResourceControls(props);\n const { labels } = props;\n const previewFailed = resource.preview.status === \"error\";\n const saveFailed = resource.save.status === \"error\";\n const previewButton = useRef<HTMLButtonElement>(null);\n const saveButton = useRef<HTMLButtonElement>(null);\n const retryButton = useRef<HTMLButtonElement | null>(null);\n const previousId = useRef(resource.id);\n const detachedFocus = useRef<Document | null>(null);\n const attachRetry = useCallback((node: HTMLButtonElement | null) => {\n const old = retryButton.current;\n // Capture before removal: after commit the browser has already dropped focus to body.\n if (!node && old && old.ownerDocument.activeElement === old) detachedFocus.current = old.ownerDocument;\n retryButton.current = node;\n }, []);\n useLayoutEffect(() => {\n const owner = detachedFocus.current;\n detachedFocus.current = null;\n // Only recover our removed control; never move focus across file identities or from another control.\n if (owner && previousId.current === resource.id && owner.activeElement === owner.body) {\n const target = [previewButton.current, saveButton.current].find(button =>\n button && !button.disabled && button.getAttribute(\"aria-disabled\") !== \"true\");\n target?.focus();\n }\n previousId.current = resource.id;\n });\n return <Surface padding=\"md\" radius=\"lg\" role=\"group\" aria-label={resource.name}>\n <Stack gap=\"sm\">\n {/* A file name is not automatically a page heading. Keep it readable when the preview fails. */}\n <Text emphasis=\"strong\" style={{ overflowWrap: \"anywhere\" }}>{resource.name}</Text>\n {resource.metadata.map((label, index) => <Text key={index} variant=\"caption\" tone=\"muted\">{label}</Text>)}\n {resource.description ? <Text>{resource.description}</Text> : null}\n {/* Center each state with its own actions without moving the document metadata. */}\n {resource.preview.status !== \"ready\" || preview != null || props.onPreview ? <Stack gap=\"sm\" justify=\"center\">\n {resource.preview.status === \"ready\" ? preview : null}\n {resource.preview.status === \"none\" ? <Text tone=\"muted\" style={{ textAlign: \"center\" }}>{labels.previewUnavailable}</Text> : null}\n {resource.preview.status === \"loading\" ? <Text role=\"status\" style={{ textAlign: \"center\" }}>{labels.previewLoading}</Text> : null}\n {previewFailed ? <Text tone=\"danger\" role=\"alert\" style={{ textAlign: \"center\" }}>{resource.preview.status === \"error\" ? resource.preview.message : \"\"}</Text> : null}\n {/* Independent buttons prevent preview navigation from swallowing save/menu interaction. */}\n <Stack gap=\"xs\">{props.onPreview ? <Button ref={previewButton} tone=\"secondary\" disabled={!resource.canPreview} onClick={props.onPreview}>{labels.preview}</Button> : null}\n {previewFailed && resource.preview.retryable ? <Button ref={attachRetry} tone=\"secondary\" disabled={!resource.canRetryPreview} onClick={props.onRetryPreview}>{labels.retryPreview}</Button> : null}</Stack>\n </Stack> : null}\n <Stack gap=\"sm\" justify=\"center\">\n <Button ref={saveButton} disabled={saveFailed ? !resource.canRetrySave : !resource.canSave}\n loading={resource.save.status === \"pending\"}\n onClick={saveFailed ? props.onRetrySave : props.onSave}>\n {saveFailed ? labels.retrySave : resource.save.status === \"pending\" ? labels.saving : labels.save}\n </Button>\n {saveFailed ? <Text tone=\"danger\" role=\"alert\" style={{ textAlign: \"center\" }}>{resource.save.status === \"error\" ? resource.save.message : \"\"}</Text> : null}\n {resource.save.status === \"started\" || resource.save.status === \"saved\" || resource.save.status === \"cancelled\"\n ? <Text role=\"status\" style={{ textAlign: \"center\" }}>{labels[resource.save.status]}</Text> : null}\n </Stack>\n {moreAction}\n </Stack>\n </Surface>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial-focus.d.ts","sourceRoot":"","sources":["../../src/internal/initial-focus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initial-focus.d.ts","sourceRoot":"","sources":["../../src/internal/initial-focus.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6F,KAAK,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3K,OAAO,EAA0E,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/H,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,OAAO,IAAI,WAAW,GAAG,IAAI,CAAC;IAAC,SAAS,IAAI,OAAO,CAAA;CAAE,CAAC;AACrH,KAAK,QAAQ,GAAG;IAAE,SAAS,IAAI,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CAAA;CAAE,CAAC;AAC9F,qGAAqG;AAC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