@hjmds/design-contracts 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -0
- package/dist/alert-dialog.d.ts +102 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +136 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/base-recipes.d.ts +184 -0
- package/dist/base-recipes.d.ts.map +1 -0
- package/dist/base-recipes.js +129 -0
- package/dist/base-recipes.js.map +1 -0
- package/dist/behaviors.d.ts +1254 -0
- package/dist/behaviors.d.ts.map +1 -0
- package/dist/behaviors.js +972 -0
- package/dist/behaviors.js.map +1 -0
- package/dist/bottom-navigation-defaults.d.ts +13 -0
- package/dist/bottom-navigation-defaults.d.ts.map +1 -0
- package/dist/bottom-navigation-defaults.js +10 -0
- package/dist/bottom-navigation-defaults.js.map +1 -0
- package/dist/bottom-navigation.d.ts +114 -0
- package/dist/bottom-navigation.d.ts.map +1 -0
- package/dist/bottom-navigation.js +223 -0
- package/dist/bottom-navigation.js.map +1 -0
- package/dist/breadcrumb.d.ts +97 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +99 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/calendar.d.ts +285 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +297 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +39 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +50 -0
- package/dist/card.js.map +1 -0
- package/dist/carousel.d.ts +180 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +172 -0
- package/dist/carousel.js.map +1 -0
- package/dist/catalog.d.ts +7158 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +220 -0
- package/dist/catalog.js.map +1 -0
- package/dist/collection.d.ts +123 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +211 -0
- package/dist/collection.js.map +1 -0
- package/dist/color-references.d.ts +46 -0
- package/dist/color-references.d.ts.map +1 -0
- package/dist/color-references.js +39 -0
- package/dist/color-references.js.map +1 -0
- package/dist/colors.d.ts +56 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +90 -0
- package/dist/colors.js.map +1 -0
- package/dist/command-palette.d.ts +240 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +97 -0
- package/dist/command-palette.js.map +1 -0
- package/dist/component-contracts.d.ts +137 -0
- package/dist/component-contracts.d.ts.map +1 -0
- package/dist/component-contracts.js +53 -0
- package/dist/component-contracts.js.map +1 -0
- package/dist/component-definitions.d.ts +135 -0
- package/dist/component-definitions.d.ts.map +1 -0
- package/dist/component-definitions.js +142 -0
- package/dist/component-definitions.js.map +1 -0
- package/dist/component-recipes.d.ts +3583 -0
- package/dist/component-recipes.d.ts.map +1 -0
- package/dist/component-recipes.js +1503 -0
- package/dist/component-recipes.js.map +1 -0
- package/dist/component-references.d.ts +416 -0
- package/dist/component-references.d.ts.map +1 -0
- package/dist/component-references.js +140 -0
- package/dist/component-references.js.map +1 -0
- package/dist/content-state.d.ts +104 -0
- package/dist/content-state.d.ts.map +1 -0
- package/dist/content-state.js +116 -0
- package/dist/content-state.js.map +1 -0
- package/dist/counter-badge-recipe.d.ts +80 -0
- package/dist/counter-badge-recipe.d.ts.map +1 -0
- package/dist/counter-badge-recipe.js +44 -0
- package/dist/counter-badge-recipe.js.map +1 -0
- package/dist/counter-badge.d.ts +12 -0
- package/dist/counter-badge.d.ts.map +1 -0
- package/dist/counter-badge.js +21 -0
- package/dist/counter-badge.js.map +1 -0
- package/dist/data-table.d.ts +203 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +182 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +268 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/date-picker.js +168 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/description-list.d.ts +68 -0
- package/dist/description-list.d.ts.map +1 -0
- package/dist/description-list.js +85 -0
- package/dist/description-list.js.map +1 -0
- package/dist/design-system-provider.d.ts +80 -0
- package/dist/design-system-provider.d.ts.map +1 -0
- package/dist/design-system-provider.js +147 -0
- package/dist/design-system-provider.js.map +1 -0
- package/dist/evidence.d.ts +49 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +133 -0
- package/dist/evidence.js.map +1 -0
- package/dist/file-picker.d.ts +183 -0
- package/dist/file-picker.d.ts.map +1 -0
- package/dist/file-picker.js +224 -0
- package/dist/file-picker.js.map +1 -0
- package/dist/floating-action-button.d.ts +143 -0
- package/dist/floating-action-button.d.ts.map +1 -0
- package/dist/floating-action-button.js +149 -0
- package/dist/floating-action-button.js.map +1 -0
- package/dist/form.d.ts +143 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +206 -0
- package/dist/form.js.map +1 -0
- package/dist/foundations.d.ts +300 -0
- package/dist/foundations.d.ts.map +1 -0
- package/dist/foundations.js +238 -0
- package/dist/foundations.js.map +1 -0
- package/dist/grid.d.ts +75 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +133 -0
- package/dist/grid.js.map +1 -0
- package/dist/icon-button-recipe.d.ts +99 -0
- package/dist/icon-button-recipe.d.ts.map +1 -0
- package/dist/icon-button-recipe.js +53 -0
- package/dist/icon-button-recipe.js.map +1 -0
- package/dist/icon.d.ts +41 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +147 -0
- package/dist/icon.js.map +1 -0
- package/dist/image.d.ts +82 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +100 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +118 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +118 -0
- package/dist/layout.js.map +1 -0
- package/dist/link.d.ts +57 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +142 -0
- package/dist/link.js.map +1 -0
- package/dist/load-more.d.ts +64 -0
- package/dist/load-more.d.ts.map +1 -0
- package/dist/load-more.js +124 -0
- package/dist/load-more.js.map +1 -0
- package/dist/mentions.d.ts +67 -0
- package/dist/mentions.d.ts.map +1 -0
- package/dist/mentions.js +107 -0
- package/dist/mentions.js.map +1 -0
- package/dist/number-field.d.ts +208 -0
- package/dist/number-field.d.ts.map +1 -0
- package/dist/number-field.js +247 -0
- package/dist/number-field.js.map +1 -0
- package/dist/otp-field.d.ts +152 -0
- package/dist/otp-field.d.ts.map +1 -0
- package/dist/otp-field.js +117 -0
- package/dist/otp-field.js.map +1 -0
- package/dist/pagination.d.ts +181 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +226 -0
- package/dist/pagination.js.map +1 -0
- package/dist/password-field.d.ts +187 -0
- package/dist/password-field.d.ts.map +1 -0
- package/dist/password-field.js +120 -0
- package/dist/password-field.js.map +1 -0
- package/dist/popover.d.ts +152 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +137 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress-recipe.d.ts +43 -0
- package/dist/progress-recipe.d.ts.map +1 -0
- package/dist/progress-recipe.js +16 -0
- package/dist/progress-recipe.js.map +1 -0
- package/dist/recipes.d.ts +31 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/recipes.js +46 -0
- package/dist/recipes.js.map +1 -0
- package/dist/responsive.d.ts +27 -0
- package/dist/responsive.d.ts.map +1 -0
- package/dist/responsive.js +66 -0
- package/dist/responsive.js.map +1 -0
- package/dist/result.d.ts +111 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +97 -0
- package/dist/result.js.map +1 -0
- package/dist/selection-helpers.d.ts +16 -0
- package/dist/selection-helpers.d.ts.map +1 -0
- package/dist/selection-helpers.js +52 -0
- package/dist/selection-helpers.js.map +1 -0
- package/dist/semantic-colors.d.ts +275 -0
- package/dist/semantic-colors.d.ts.map +1 -0
- package/dist/semantic-colors.js +84 -0
- package/dist/semantic-colors.js.map +1 -0
- package/dist/sheet.d.ts +51 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +69 -0
- package/dist/sheet.js.map +1 -0
- package/dist/showcase.d.ts +153 -0
- package/dist/showcase.d.ts.map +1 -0
- package/dist/showcase.js +210 -0
- package/dist/showcase.js.map +1 -0
- package/dist/side-panel.d.ts +199 -0
- package/dist/side-panel.d.ts.map +1 -0
- package/dist/side-panel.js +111 -0
- package/dist/side-panel.js.map +1 -0
- package/dist/slider.d.ts +138 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +150 -0
- package/dist/slider.js.map +1 -0
- package/dist/splitter.d.ts +113 -0
- package/dist/splitter.d.ts.map +1 -0
- package/dist/splitter.js +99 -0
- package/dist/splitter.js.map +1 -0
- package/dist/statistic.d.ts +41 -0
- package/dist/statistic.d.ts.map +1 -0
- package/dist/statistic.js +76 -0
- package/dist/statistic.js.map +1 -0
- package/dist/steps.d.ts +196 -0
- package/dist/steps.d.ts.map +1 -0
- package/dist/steps.js +160 -0
- package/dist/steps.js.map +1 -0
- package/dist/tag.d.ts +128 -0
- package/dist/tag.d.ts.map +1 -0
- package/dist/tag.js +93 -0
- package/dist/tag.js.map +1 -0
- package/dist/timeline.d.ts +147 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +127 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toast.d.ts +164 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +529 -0
- package/dist/toast.js.map +1 -0
- package/dist/tokens.d.ts +9 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +9 -0
- package/dist/tokens.js.map +1 -0
- package/dist/tooltip.d.ts +44 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +88 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tour.d.ts +218 -0
- package/dist/tour.d.ts.map +1 -0
- package/dist/tour.js +211 -0
- package/dist/tour.js.map +1 -0
- package/dist/transfer-list.d.ts +207 -0
- package/dist/transfer-list.d.ts.map +1 -0
- package/dist/transfer-list.js +193 -0
- package/dist/transfer-list.js.map +1 -0
- package/dist/tree-select.d.ts +78 -0
- package/dist/tree-select.d.ts.map +1 -0
- package/dist/tree-select.js +132 -0
- package/dist/tree-select.js.map +1 -0
- package/dist/tree.d.ts +206 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +223 -0
- package/dist/tree.js.map +1 -0
- package/dist/upload-item.d.ts +173 -0
- package/dist/upload-item.d.ts.map +1 -0
- package/dist/upload-item.js +156 -0
- package/dist/upload-item.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/docs/affix.md +63 -0
- package/docs/anchor.md +59 -0
- package/docs/ant-design-coverage.md +119 -0
- package/docs/app-provider.md +50 -0
- package/docs/app-rn-adoption.md +227 -0
- package/docs/architecture.md +320 -0
- package/docs/authoring-brief.md +87 -0
- package/docs/border-beam.md +66 -0
- package/docs/bottom-navigation.md +127 -0
- package/docs/breadcrumb.md +82 -0
- package/docs/calendar.md +154 -0
- package/docs/carousel.md +130 -0
- package/docs/cascader.md +93 -0
- package/docs/catalog-decision-status.md +306 -0
- package/docs/color-picker.md +72 -0
- package/docs/command-palette.md +116 -0
- package/docs/confirm-popover.md +93 -0
- package/docs/consistency-audit.md +383 -0
- package/docs/consumer-release-gate.md +90 -0
- package/docs/content-state.md +156 -0
- package/docs/context-panel.md +88 -0
- package/docs/cross-platform-core-normalization.md +118 -0
- package/docs/data-table.md +79 -0
- package/docs/date-picker.md +84 -0
- package/docs/description-list.md +75 -0
- package/docs/design-system-provider.md +139 -0
- package/docs/dropdown.md +78 -0
- package/docs/expansion-roadmap.md +285 -0
- package/docs/file-picker.md +59 -0
- package/docs/floating-action-button.md +111 -0
- package/docs/form.md +134 -0
- package/docs/generated/component-maturity.md +103 -0
- package/docs/generated/renderer-evidence.json +5597 -0
- package/docs/generated/renderer-evidence.md +132 -0
- package/docs/generated/showcase-manifest.json +3732 -0
- package/docs/icon.md +22 -0
- package/docs/identity.md +121 -0
- package/docs/image.md +84 -0
- package/docs/implementation-0.5.md +85 -0
- package/docs/layout-primitives.md +107 -0
- package/docs/layout.md +83 -0
- package/docs/library-reference-decisions.md +123 -0
- package/docs/link.md +67 -0
- package/docs/load-more.md +31 -0
- package/docs/mentions.md +82 -0
- package/docs/migration-0.2.md +108 -0
- package/docs/migration-0.3.md +72 -0
- package/docs/migration-0.5.md +82 -0
- package/docs/migration-0.6.md +197 -0
- package/docs/notification.md +54 -0
- package/docs/number-field.md +82 -0
- package/docs/otp-field.md +103 -0
- package/docs/pagination.md +139 -0
- package/docs/password-field.md +98 -0
- package/docs/popover.md +124 -0
- package/docs/promotion-candidates.md +169 -0
- package/docs/qr-code.md +69 -0
- package/docs/rating.md +58 -0
- package/docs/responsive-grid.md +90 -0
- package/docs/result.md +96 -0
- package/docs/showcase.md +97 -0
- package/docs/side-panel.md +71 -0
- package/docs/slider.md +79 -0
- package/docs/splitter.md +55 -0
- package/docs/statistic.md +16 -0
- package/docs/steps.md +115 -0
- package/docs/tag.md +57 -0
- package/docs/time-picker.md +88 -0
- package/docs/timeline.md +146 -0
- package/docs/toast.md +127 -0
- package/docs/tooltip.md +58 -0
- package/docs/tour.md +136 -0
- package/docs/transfer-list.md +94 -0
- package/docs/tree-select.md +101 -0
- package/docs/tree.md +123 -0
- package/docs/upload-item.md +68 -0
- package/docs/utility.md +53 -0
- package/docs/virtual-list.md +70 -0
- package/docs/watermark.md +58 -0
- package/package.json +402 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,sB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CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC","sourcesContent":["export {\n getIconDirectionality,\n getIconTransform,\n resolveIconDescriptor,\n semanticIconNames,\n validateIconDescriptor,\n type DecorativeIconDescriptor,\n type IconDescriptor,\n type IconDirection,\n type IconDirectionality,\n type IconTransform,\n type InformativeIconDescriptor,\n type ResolvedIconDescriptor,\n type SemanticIconName,\n} from \"./icon.js\";\n\nexport {\n resolveLinkDescriptor,\n validateLinkDescriptor,\n validateLinkDestination,\n type ExternalLinkDestination,\n type InternalLinkDestination,\n type LinkDescriptor,\n type LinkDestination,\n type LinkIconDescriptor,\n type ResolvedLinkDescriptor,\n type ResolvedLinkIconDescriptor,\n} from \"./link.js\";\n\nexport {\n bottomNavigationBehaviorDefaults,\n resolveBottomNavigationActivation,\n resolveBottomNavigationConfiguration,\n resolveBottomNavigationDescriptor,\n resolveBottomNavigationItem,\n validateBottomNavigationConfiguration,\n validateBottomNavigationDescriptor,\n type BottomNavigationActivation,\n type BottomNavigationConfiguration,\n type BottomNavigationCounterBadge,\n type BottomNavigationDescriptor,\n type BottomNavigationDirection,\n type BottomNavigationIconDescriptor,\n type BottomNavigationItemDescriptor,\n type BottomNavigationKeyboardBehavior,\n type ResolvedBottomNavigationCounterBadge,\n type ResolvedBottomNavigationConfiguration,\n type ResolvedBottomNavigationDescriptor,\n type ResolvedBottomNavigationIconDescriptor,\n type ResolvedBottomNavigationItemDescriptor,\n} from \"./bottom-navigation.js\";\n\nexport {\n resolveTooltipDescriptor,\n tooltipBehaviorDefaults,\n tooltipDescriptorDefaults,\n validateTooltipDescriptor,\n validateTooltipOpenState,\n type ControlledTooltipOpenState,\n type ResolvedTooltipDescriptor,\n type TooltipAlign,\n type TooltipDescriptor,\n type TooltipOpenChangeDetails,\n type TooltipOpenChangeReason,\n type TooltipOpenState,\n type TooltipPlacement,\n type UncontrolledTooltipOpenState,\n} from \"./tooltip.js\";\n\nexport {\n alertDialogBehaviorDefaults,\n canDismissAlertDialog,\n createAlertDialogSession,\n getAlertDialogInitialFocus,\n validateAlertDialogRequest,\n type AlertDialogAsyncState,\n type AlertDialogCancelReason,\n type AlertDialogConfirmAction,\n type AlertDialogDismissReason,\n type AlertDialogInitialFocus,\n type AlertDialogMode,\n type AlertDialogOpenChangeReason,\n type AlertDialogOpenState,\n type AlertDialogPhase,\n type AlertDialogRequest,\n type AlertDialogResult,\n type AlertDialogSession,\n} from \"./alert-dialog.js\";\n\nexport {\n canDismissSheet,\n createSheetLifecycle,\n sheetBehaviorDefaults,\n type SheetDismissPolicy,\n type SheetDismissReason,\n type SheetLifecycle,\n type SheetOpenChangeDetails,\n type SheetOpenState,\n} from \"./sheet.js\";\n\nexport {\n createToastSession,\n createToastStore,\n resolveToastAnnouncement,\n resolveToastDescriptor,\n resolveToastDuration,\n toastBehaviorDefaults,\n validateToastDescriptor,\n type ResolvedToastActionDescriptor,\n type ResolvedToastDescriptor,\n type ToastActionDescriptor,\n type ToastAnnouncement,\n type ToastAnnouncementPriority,\n type ToastDescriptor,\n type ToastDismissReason,\n type ToastDuplicatePolicy,\n type ToastId,\n type ToastOverflowPolicy,\n type ToastPauseReason,\n type ToastPhase,\n type ToastPublishOptions,\n type ToastPublishResult,\n type ToastSession,\n type ToastSessionSnapshot,\n type ToastStore,\n type ToastStoreOptions,\n type ToastStoreSnapshot,\n type ToastTimerSnapshot,\n type ToastTimerStatus,\n type ToastTimerUpdatePolicy,\n} from \"./toast.js\";\n\nexport {\n resolveStatisticDescriptor,\n statisticDefaults,\n statisticTrendMarks,\n validateStatisticDescriptor,\n validateStatisticGroup,\n type ResolvedStatisticDescriptor,\n type ResolvedStatisticTrendDescriptor,\n type StatisticDescriptor,\n type StatisticGroupDescriptor,\n type StatisticTrendDescriptor,\n type StatisticTrendDirection,\n type StatisticTrendTone,\n} from \"./statistic.js\";\n\nexport {\n canRequestLoadMore,\n createLoadMoreController,\n loadMoreBehaviorDefaults,\n validateLoadMoreDescriptor,\n validateLoadMoreLabels,\n validateLoadMoreState,\n type LoadMoreCompleteState,\n type LoadMoreController,\n type LoadMoreControllerOptions,\n type LoadMoreControllerSnapshot,\n type LoadMoreDescriptor,\n type LoadMoreErrorState,\n type LoadMoreLabels,\n type LoadMoreLoadingState,\n type LoadMoreMode,\n type LoadMoreReadyState,\n type LoadMoreRequest,\n type LoadMoreRequestHandler,\n type LoadMoreRequestOutcome,\n type LoadMoreRequestReason,\n type LoadMoreState,\n} from \"./load-more.js\";\n\nexport {\n collectionValidationDefaults,\n flattenCollectionItems,\n getCollectionNavigationIntent,\n getCollectionNavigationTarget,\n getCollectionTypeaheadMatch,\n isComboboxResultCurrent,\n reconcileSelectSelection,\n resolveComboboxSelectedItem,\n resolveCollectionItem,\n resolveSelectSelectedItem,\n validateCollection,\n type CollectionNavigationIntent,\n type CollectionSource,\n type SelectCollectionSectionDescriptor,\n type SelectCollectionSource,\n type CollectionTypeaheadOptions,\n type CollectionValidationOptions,\n type ComboboxCollectionState,\n type ComboboxState,\n type ReconcileSelectOptions,\n type SelectCollectionState,\n type SelectConfiguration,\n type SelectLabel,\n type SelectOpenChangeReason,\n type SelectOpenState,\n type SelectState,\n} from \"./collection.js\";\n\nexport {\n ACCENTS,\n THEMES,\n accentFill,\n accentTint,\n brandGradient,\n isThemePreference,\n onAccentFill,\n onBrandGradient,\n withAlpha,\n type AccentTone,\n type ResolvedTheme,\n type ThemeColors,\n type ThemePreference,\n} from \"./colors.js\";\n\nexport {\n backdrop,\n breakpoint,\n control,\n easing,\n fontFamily,\n fontWeight,\n glyph,\n heading,\n layer,\n layout,\n letterSpacing,\n motion,\n motionPreset,\n numeric,\n opacity,\n overlay,\n radius,\n scrim,\n shadow,\n spacing,\n spring,\n stateLayer,\n stroke,\n typography,\n type BackdropReference,\n type FontFamily,\n type FontWeight,\n type FontWeightValue,\n type GlyphSize,\n type HeadingLevel,\n type LetterSpacing,\n type NumericVariant,\n type ReducedMotionBehavior,\n type TextVariant,\n} from \"./foundations.js\";\n\nexport {\n resolveResponsiveValue,\n resolveWindowClass,\n validateResponsiveValue,\n windowClassOrder,\n type ResponsiveValue,\n type WindowClass,\n} from \"./responsive.js\";\n\nexport {\n gridDefaults,\n gridGaps,\n gridRecipe,\n resolveGridLayout,\n validateGridDescriptor,\n type GridDescriptor,\n type GridGap,\n type GridGapToken,\n type ResolveGridLayoutOptions,\n type ResolvedGridLayout,\n} from \"./grid.js\";\n\nexport {\n accordionRecipe,\n alertDialogRecipe,\n avatarRecipe,\n badgeRecipe,\n bottomNavigationRecipe,\n bottomCtaRecipe,\n buttonRecipe,\n cardRecipe,\n chipRecipe,\n comboboxRecipe,\n counterBadgeRecipe,\n dialogRecipe,\n dividerRecipe,\n emptyStateRecipe,\n fieldRecipe,\n formatCounterBadgeCount,\n iconButtonRecipe,\n iconRecipe,\n linkRecipe,\n listRecipe,\n listRowRecipe,\n loadMoreRecipe,\n menuRecipe,\n noticeRecipe,\n progressRecipe,\n searchFieldRecipe,\n selectRecipe,\n selectionGroupRecipe,\n sectionRecipe,\n segmentedControlRecipe,\n selectionControlRecipe,\n sheetRecipe,\n skeletonRecipe,\n spinnerRecipe,\n surfaceDefaults,\n surfaceGeometry,\n stackRecipe,\n statisticRecipe,\n surfaceRecipe,\n switchRecipe,\n tabsRecipe,\n textRecipe,\n toastRecipe,\n tooltipRecipe,\n topBarRecipe,\n type AccordionDensity,\n type AlertDialogTone,\n type AvatarShape,\n type AvatarSize,\n type BadgeSize,\n type BadgeTone,\n type BadgeVariant,\n type BottomNavigationDensity,\n type BottomNavigationDistribution,\n type BottomNavigationPresentation,\n type ButtonSize,\n type ButtonTone,\n type CardHeadingLevel,\n type ChipSize,\n type SelectDensity,\n type SelectSize,\n type CounterBadgeSize,\n type CounterBadgeTone,\n type CounterBadgeVariant,\n type DialogSize,\n type FieldShape,\n type FieldVariant,\n type IconButtonShape,\n type IconButtonSize,\n type IconTone,\n type IconWeight,\n type LinkTone,\n type LinkVariant,\n type LoadMoreDensity,\n type ListRowDensity,\n type MenuDensity,\n type MenuItemTone,\n type NoticeTone,\n type ProgressSize,\n type ProgressTone,\n type SearchFieldSize,\n type SegmentedControlSize,\n type SelectionControlKind,\n type SelectionControlPresentation,\n type SelectionControlSize,\n type SelectionGroupOrientation,\n type SelectionGroupPresentation,\n type SpinnerSize,\n type SpinnerTone,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type StatisticDensity,\n type StatisticPresentation,\n type SurfaceTone,\n type SurfacePadding,\n type SurfaceRadius,\n type SwitchSize,\n type TabSize,\n type TabsLayout,\n type TabsOverflow,\n type TextEmphasis,\n type TextTone,\n type ToastPlacement,\n type ToastTone,\n type ToastToneMark,\n} from \"./recipes.js\";\n\nexport {\n accentColor,\n resolveColorReference,\n solidAccentColor,\n themeColor,\n type AccentColorReference,\n type AccentFillReference,\n type ColorReference,\n type ColorReferencePalette,\n type ThemeColorReference,\n} from \"./color-references.js\";\n\nexport {\n componentCatalog,\n getComponentSurfaceStatus,\n recipeRegistry,\n summarizeComponentRoadmap,\n type ComponentCatalogEntry,\n type ComponentCategory,\n type ComponentName,\n type ComponentPlatform,\n type ComponentRoadmap,\n type ComponentRoadmapState,\n type ComponentSurface,\n type ComponentSurfaceMaturity,\n type ComponentSurfaceStatus,\n type ComponentStatus,\n type RecipeName,\n} from \"./catalog.js\";\n\nexport { designSystemVersion } from \"./version.js\";\n\nexport {\n antDesignReferenceComponents,\n antDesignReferenceSystem,\n getAntDesignReferencesFor,\n summarizeAntDesignCoverage,\n type AntDesignCategory,\n type AntDesignComponentName,\n type AntDesignReferenceComponent,\n type ReferenceCoverageSummary,\n type ReferenceRelationship,\n} from \"./component-references.js\";\n\nexport {\n componentDefinitions,\n componentIds,\n getComponentDefinition,\n type ComponentDefinition,\n type ComponentId,\n type ComponentKind,\n} from \"./component-definitions.js\";\n\nexport { semanticColors } from \"./semantic-colors.js\";\n\nexport {\n behaviorRegistry,\n checkboxBehaviorDefaults,\n comboboxBehaviorDefaults,\n getCheckboxNextState,\n getRadioNavigationTarget,\n getSelectionNavigationIntent,\n getTabNavigationIntent,\n getTabNavigationTarget,\n reconcileCheckboxSelection,\n reconcileRadioSelection,\n radioGroupBehaviorDefaults,\n resolveInitialRadioValue,\n resolveControlAccessibleName,\n resolveRadioTabStop,\n resolveInitialTabValue,\n selectionGroupBehaviorDefaults,\n selectBehaviorDefaults,\n tabsBehaviorDefaults,\n toggleCheckboxSelection,\n validateCheckboxSelection,\n validateRadioSelection,\n validateSelectionItems,\n type AsyncCollectionState,\n type AvailabilityState,\n type BehaviorContract,\n type BehaviorName,\n type BehaviorStateAxis,\n type CollectionItemDescriptor,\n type CollectionItemTone,\n type CollectionKey,\n type CollectionSectionDescriptor,\n type MenuItemDescriptor,\n type MenuSectionDescriptor,\n type CollectionSelectionModel,\n type ComboboxCommitReason,\n type ComboboxFiltering,\n type ComboboxInput,\n type ControlledComboboxInput,\n type ControlledSelectSelection,\n type ControlledCheckboxGroupSelection,\n type ControlledCheckboxState,\n type ControlledRadioGroupSelection,\n type ContentState,\n type ControlledTabsSelection,\n type InteractionState,\n type MixedCheckboxActivation,\n type MultipleSelectionModel,\n type NativeAccessibilityState,\n type NoSelectionModel,\n type SingleSelectionModel,\n type SelectItemDescriptor,\n type SelectSelection,\n type CheckboxGroupSelection,\n type CheckboxSelection,\n type CheckboxState,\n type RadioGroupSelection,\n type SelectionDirection,\n type SelectionGroupLabel,\n type SelectionItemDescriptor,\n type SelectionNavigationIntent,\n type SelectionOrientation,\n type TabDescriptor,\n type TabNavigationIntent,\n type TabsActivationMode,\n type TabsDirection,\n type TabsMountPolicy,\n type TabsOrientation,\n type TabsPanelMode,\n type TabsSelection,\n type UncontrolledTabsSelection,\n type UncontrolledComboboxInput,\n type UncontrolledSelectSelection,\n type UncontrolledCheckboxGroupSelection,\n type UncontrolledCheckboxState,\n type UncontrolledRadioGroupSelection,\n type ValidationState,\n type ValueState,\n type WebKeyboardKey,\n} from \"./behaviors.js\";\n\nexport {\n collectionItemContract,\n fieldFrameContract,\n floatingSurfaceContract,\n focusIndicatorContract,\n formSupportContract,\n} from \"./component-contracts.js\";\n\nexport {\n assertShowcaseCoverage,\n createShowcaseCoverage,\n createShowcaseManifest,\n getRequiredShowcaseScenarios,\n getRequiredShowcaseEvidence,\n getRequiredShowcaseSurfaces,\n getShowcaseEnvironmentInput,\n getShowcaseStoryId,\n showcaseEnvironmentMatrix,\n showcaseManifest,\n showcaseScenarios,\n summarizeShowcaseMaturity,\n type ShowcaseComponentEntry,\n type ShowcaseCoverageEntry,\n type ShowcaseDirection,\n type ShowcaseEnvironment,\n type ShowcaseEvidenceEntry,\n type ShowcaseEvidenceRequirement,\n type ShowcaseMotionPreference,\n type ShowcaseScenario,\n type ShowcaseScenarioId,\n type ShowcaseSurface,\n type ShowcaseTextScale,\n type ShowcaseTheme,\n} from \"./showcase.js\";\n\nexport {\n assertShowcaseStoryIds,\n compareShowcaseStoryIds,\n createDesignSystemEvidence,\n createDesignSystemEvidenceCoverage,\n defineDesignSystemEvidence,\n designSystemEvidenceSchemaVersion,\n getShowcaseStoryIdsForSurface,\n toShowcaseEvidenceEntries,\n type DesignSystemEvidenceItem,\n type DesignSystemEvidenceManifest,\n type DesignSystemEvidenceSource,\n type DesignSystemEvidenceSourceKind,\n type ShowcaseStoryIdComparison,\n} from \"./evidence.js\";\n\n/*\n Batch 2 — 계약과 recipe가 준비된 컴포넌트.\n\n catalog의 status는 여전히 `planned`다. 로드맵의 maturity gate가 `planned → beta` 승격에\n **실제 제품 vertical slice 한 번**을 요구하므로, 계약이 준비된 것과 검증된 것을 섞지\n 않는다. 여기 있는 심볼은 제품이 renderer를 붙일 수 있다는 뜻이고, 붙여서 검증되면\n 그때 리드가 catalog를 올린다.\n*/\nexport * from \"./breadcrumb.js\";\nexport * from \"./calendar.js\";\nexport * from \"./carousel.js\";\nexport * from \"./command-palette.js\";\nexport * from \"./design-system-provider.js\";\nexport * from \"./floating-action-button.js\";\nexport * from \"./content-state.js\";\nexport * from \"./data-table.js\";\nexport * from \"./mentions.js\";\nexport * from \"./transfer-list.js\";\nexport * from \"./tour.js\";\nexport * from \"./layout.js\";\nexport * from \"./otp-field.js\";\nexport * from \"./password-field.js\";\nexport * from \"./splitter.js\";\nexport * from \"./tree-select.js\";\nexport * from \"./date-picker.js\";\nexport * from \"./side-panel.js\";\nexport * from \"./file-picker.js\";\nexport * from \"./pagination.js\";\nexport * from \"./popover.js\";\nexport * from \"./upload-item.js\";\nexport * from \"./timeline.js\";\nexport * from \"./tree.js\";\nexport * from \"./steps.js\";\nexport * from \"./number-field.js\";\nexport * from \"./slider.js\";\nexport * from \"./form.js\";\nexport * from \"./tag.js\";\nexport * from \"./description-list.js\";\nexport * from \"./result.js\";\nexport * from \"./image.js\";\n"]}
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Layout` (alias `AppShell`) does NOT own header or footer chrome — that is
|
|
3
|
+
* already `TopBar` (native, beta) and `BottomNavigation` (adaptive, beta).
|
|
4
|
+
* What is left after subtracting those: ordered regions, a sidebar that is
|
|
5
|
+
* either always-visible chrome or a dismissible overlay, and Web-only
|
|
6
|
+
* landmark composition (one `main` plus a required skip link whenever
|
|
7
|
+
* repeated navigation precedes it). The overlay case reuses `SidePanel`
|
|
8
|
+
* unchanged — see docs/layout.md for why this module does not redeclare
|
|
9
|
+
* open/dismiss state.
|
|
10
|
+
*/
|
|
11
|
+
export type LayoutSidebarRole = "navigation" | "complementary";
|
|
12
|
+
export type LayoutSidebarMode = "persistent" | "overlay";
|
|
13
|
+
export type LayoutSidebarDescriptor = Readonly<{
|
|
14
|
+
/** Primary site navigation vs. supplementary content (filters, related items) — independent of `mode`. */
|
|
15
|
+
role: LayoutSidebarRole;
|
|
16
|
+
/** `persistent`: always-visible landmark. `overlay`: a `SidePanel` — Layout does not re-contract its open/dismiss lifecycle. */
|
|
17
|
+
mode: LayoutSidebarMode;
|
|
18
|
+
label: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type LayoutDescriptor = Readonly<{
|
|
21
|
+
hasHeader?: boolean;
|
|
22
|
+
hasFooter?: boolean;
|
|
23
|
+
sidebar?: LayoutSidebarDescriptor;
|
|
24
|
+
/** Web-only: required whenever a header or sidebar precedes `main` (WCAG 2.4.1 bypass blocks). */
|
|
25
|
+
skipLinkLabel?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Cross-platform structure validation. This deliberately does not require a
|
|
29
|
+
* skip link: Native has no page-landmark or bypass-link equivalent.
|
|
30
|
+
*/
|
|
31
|
+
export declare function validateLayoutRegions(descriptor: LayoutDescriptor): void;
|
|
32
|
+
/** Web landmark validation, including the WCAG 2.4.1 bypass-link invariant. */
|
|
33
|
+
export declare function validateLayoutWebDescriptor(descriptor: LayoutDescriptor): void;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `validateLayoutRegions` for shared/Native structure or
|
|
36
|
+
* `validateLayoutWebDescriptor` for a Web app shell.
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateLayoutDescriptor(descriptor: LayoutDescriptor): void;
|
|
39
|
+
export type LayoutLandmarkRole = "banner" | "navigation" | "complementary" | "main" | "contentinfo";
|
|
40
|
+
/**
|
|
41
|
+
* Web-only translation: real landmark elements exist there. Native has no
|
|
42
|
+
* landmark-role equivalent at all (`accessibilityRole` covers headings and
|
|
43
|
+
* controls, not page regions) — RN renderers instead rely on visual/DOM
|
|
44
|
+
* order plus `accessibilityViewIsModal` for the overlay sidebar case. That
|
|
45
|
+
* asymmetry is documented, not papered over with a fake mapping.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveLayoutWebLandmarks(descriptor: LayoutDescriptor): readonly LayoutLandmarkRole[];
|
|
48
|
+
/**
|
|
49
|
+
* Skip link is hidden until it matters — visible only on keyboard focus.
|
|
50
|
+
* A skip link visible at rest fights identity.md's "조용한 화면 위에 중요한
|
|
51
|
+
* 순간만 선명하게": for a mouse/touch user it is noise every screen, for a
|
|
52
|
+
* keyboard user it is the first landmark on the page.
|
|
53
|
+
*/
|
|
54
|
+
export declare const layoutRecipe: {
|
|
55
|
+
readonly slots: readonly ["root", "skipLink", "header", "sidebar", "main", "footer"];
|
|
56
|
+
readonly defaults: {};
|
|
57
|
+
readonly main: {
|
|
58
|
+
readonly maxWidth: 1200;
|
|
59
|
+
readonly paddingHorizontal: 20;
|
|
60
|
+
};
|
|
61
|
+
readonly sidebar: {
|
|
62
|
+
readonly width: 280;
|
|
63
|
+
};
|
|
64
|
+
readonly skipLink: {
|
|
65
|
+
readonly visibility: "focus-only";
|
|
66
|
+
readonly background: Readonly<{
|
|
67
|
+
source: "theme";
|
|
68
|
+
key: "primary";
|
|
69
|
+
alpha?: number;
|
|
70
|
+
}>;
|
|
71
|
+
readonly color: Readonly<{
|
|
72
|
+
source: "theme";
|
|
73
|
+
key: "onPrimary";
|
|
74
|
+
alpha?: number;
|
|
75
|
+
}>;
|
|
76
|
+
readonly paddingHorizontal: 16;
|
|
77
|
+
readonly paddingVertical: 12;
|
|
78
|
+
};
|
|
79
|
+
readonly states: {
|
|
80
|
+
readonly focus: {
|
|
81
|
+
readonly color: Readonly<{
|
|
82
|
+
source: "theme";
|
|
83
|
+
key: "contentBrand";
|
|
84
|
+
alpha?: number;
|
|
85
|
+
}>;
|
|
86
|
+
readonly width: 2;
|
|
87
|
+
readonly offset: 2;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `controlled: []` on purpose: an overlay sidebar's open/dismiss lifecycle
|
|
93
|
+
* is a `SidePanel` (`src/side-panel.ts`) composed as-is. Redeclaring
|
|
94
|
+
* `open`/`defaultOpen`/`onOpenChange`/`dismissPolicy` here would be the same
|
|
95
|
+
* mistake DataTable avoided with Pagination/LoadMore — two places owning
|
|
96
|
+
* one piece of state that will drift the first time either one changes.
|
|
97
|
+
*/
|
|
98
|
+
export declare const layoutBehavior: {
|
|
99
|
+
readonly controlled: readonly [];
|
|
100
|
+
readonly inputs: readonly ["hasHeader", "hasFooter", "sidebar", "skipLinkLabel"];
|
|
101
|
+
readonly configuration: {
|
|
102
|
+
readonly "sidebar.mode": readonly ["persistent", "overlay"];
|
|
103
|
+
readonly "sidebar.role": readonly ["navigation", "complementary"];
|
|
104
|
+
};
|
|
105
|
+
readonly stateAxes: {};
|
|
106
|
+
readonly web: {
|
|
107
|
+
readonly roles: readonly ["banner", "navigation", "complementary", "main", "contentinfo"];
|
|
108
|
+
readonly keyboard: readonly ["Tab"];
|
|
109
|
+
readonly focus: "native";
|
|
110
|
+
};
|
|
111
|
+
readonly native: {
|
|
112
|
+
readonly roles: readonly [];
|
|
113
|
+
readonly states: readonly [];
|
|
114
|
+
readonly actions: readonly [];
|
|
115
|
+
};
|
|
116
|
+
readonly scenarios: readonly ["exactly-one-main-landmark-exists-per-layout", "web-skip-link-is-required-whenever-a-header-or-sidebar-precedes-main", "sidebar-role-navigation-or-complementary-is-chosen-independent-of-persistent-or-overlay-mode", "overlay-sidebar-reuses-sidepanel-open-state-and-dismiss-policy-unchanged", "header-and-footer-content-is-not-owned-here-compose-topbar-and-bottomnavigation", "skip-link-is-visually-hidden-until-keyboard-focus-reaches-it", "native-has-no-landmark-role-equivalent-translation-relies-on-order-and-accessibilityviewismodal"];
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAC;AAC/D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,0GAA0G;IAC1G,IAAI,EAAE,iBAAiB,CAAC;IACxB,gIAAgI;IAChI,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,kGAAkG;IAClG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAQH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAcxE;AAED,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAQ9E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAE3E;AAED,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,YAAY,GACZ,eAAe,GACf,MAAM,GACN,aAAa,CAAC;AAElB;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,gBAAgB,GAC3B,SAAS,kBAAkB,EAAE,CAQ/B;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;CAuBU,CAAC"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { focusIndicatorContract } from "./component-contracts.js";
|
|
2
|
+
import { layout as layoutFoundation, spacing } from "./foundations.js";
|
|
3
|
+
import { semanticColors } from "./semantic-colors.js";
|
|
4
|
+
function assertNonEmpty(value, field) {
|
|
5
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
6
|
+
throw new TypeError(`Layout ${field} must not be empty`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Cross-platform structure validation. This deliberately does not require a
|
|
11
|
+
* skip link: Native has no page-landmark or bypass-link equivalent.
|
|
12
|
+
*/
|
|
13
|
+
export function validateLayoutRegions(descriptor) {
|
|
14
|
+
if (descriptor.sidebar !== undefined) {
|
|
15
|
+
const { role, mode, label } = descriptor.sidebar;
|
|
16
|
+
if (role !== "navigation" && role !== "complementary") {
|
|
17
|
+
throw new TypeError(`Unsupported Layout sidebar role: ${String(role)}`);
|
|
18
|
+
}
|
|
19
|
+
if (mode !== "persistent" && mode !== "overlay") {
|
|
20
|
+
throw new TypeError(`Unsupported Layout sidebar mode: ${String(mode)}`);
|
|
21
|
+
}
|
|
22
|
+
assertNonEmpty(label, "sidebar.label");
|
|
23
|
+
}
|
|
24
|
+
if (descriptor.skipLinkLabel !== undefined) {
|
|
25
|
+
assertNonEmpty(descriptor.skipLinkLabel, "skipLinkLabel");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Web landmark validation, including the WCAG 2.4.1 bypass-link invariant. */
|
|
29
|
+
export function validateLayoutWebDescriptor(descriptor) {
|
|
30
|
+
validateLayoutRegions(descriptor);
|
|
31
|
+
const needsSkipLink = descriptor.hasHeader === true || descriptor.sidebar !== undefined;
|
|
32
|
+
if (needsSkipLink && descriptor.skipLinkLabel === undefined) {
|
|
33
|
+
throw new TypeError("Layout requires skipLinkLabel when a header or sidebar region precedes main");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `validateLayoutRegions` for shared/Native structure or
|
|
38
|
+
* `validateLayoutWebDescriptor` for a Web app shell.
|
|
39
|
+
*/
|
|
40
|
+
export function validateLayoutDescriptor(descriptor) {
|
|
41
|
+
validateLayoutWebDescriptor(descriptor);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Web-only translation: real landmark elements exist there. Native has no
|
|
45
|
+
* landmark-role equivalent at all (`accessibilityRole` covers headings and
|
|
46
|
+
* controls, not page regions) — RN renderers instead rely on visual/DOM
|
|
47
|
+
* order plus `accessibilityViewIsModal` for the overlay sidebar case. That
|
|
48
|
+
* asymmetry is documented, not papered over with a fake mapping.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveLayoutWebLandmarks(descriptor) {
|
|
51
|
+
validateLayoutWebDescriptor(descriptor);
|
|
52
|
+
const roles = [];
|
|
53
|
+
if (descriptor.hasHeader)
|
|
54
|
+
roles.push("banner");
|
|
55
|
+
if (descriptor.sidebar)
|
|
56
|
+
roles.push(descriptor.sidebar.role);
|
|
57
|
+
roles.push("main");
|
|
58
|
+
if (descriptor.hasFooter)
|
|
59
|
+
roles.push("contentinfo");
|
|
60
|
+
return roles;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Skip link is hidden until it matters — visible only on keyboard focus.
|
|
64
|
+
* A skip link visible at rest fights identity.md's "조용한 화면 위에 중요한
|
|
65
|
+
* 순간만 선명하게": for a mouse/touch user it is noise every screen, for a
|
|
66
|
+
* keyboard user it is the first landmark on the page.
|
|
67
|
+
*/
|
|
68
|
+
export const layoutRecipe = {
|
|
69
|
+
slots: ["root", "skipLink", "header", "sidebar", "main", "footer"],
|
|
70
|
+
defaults: {},
|
|
71
|
+
main: {
|
|
72
|
+
maxWidth: layoutFoundation.contentMaxWidth,
|
|
73
|
+
paddingHorizontal: layoutFoundation.pagePadding.regular,
|
|
74
|
+
},
|
|
75
|
+
sidebar: {
|
|
76
|
+
width: 280,
|
|
77
|
+
},
|
|
78
|
+
skipLink: {
|
|
79
|
+
visibility: "focus-only",
|
|
80
|
+
background: semanticColors.action.brand.background,
|
|
81
|
+
color: semanticColors.action.brand.content,
|
|
82
|
+
paddingHorizontal: spacing.md,
|
|
83
|
+
paddingVertical: spacing.sm,
|
|
84
|
+
},
|
|
85
|
+
states: { focus: focusIndicatorContract },
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* `controlled: []` on purpose: an overlay sidebar's open/dismiss lifecycle
|
|
89
|
+
* is a `SidePanel` (`src/side-panel.ts`) composed as-is. Redeclaring
|
|
90
|
+
* `open`/`defaultOpen`/`onOpenChange`/`dismissPolicy` here would be the same
|
|
91
|
+
* mistake DataTable avoided with Pagination/LoadMore — two places owning
|
|
92
|
+
* one piece of state that will drift the first time either one changes.
|
|
93
|
+
*/
|
|
94
|
+
export const layoutBehavior = {
|
|
95
|
+
controlled: [],
|
|
96
|
+
inputs: ["hasHeader", "hasFooter", "sidebar", "skipLinkLabel"],
|
|
97
|
+
configuration: {
|
|
98
|
+
"sidebar.mode": ["persistent", "overlay"],
|
|
99
|
+
"sidebar.role": ["navigation", "complementary"],
|
|
100
|
+
},
|
|
101
|
+
stateAxes: {},
|
|
102
|
+
web: {
|
|
103
|
+
roles: ["banner", "navigation", "complementary", "main", "contentinfo"],
|
|
104
|
+
keyboard: ["Tab"],
|
|
105
|
+
focus: "native",
|
|
106
|
+
},
|
|
107
|
+
native: { roles: [], states: [], actions: [] },
|
|
108
|
+
scenarios: [
|
|
109
|
+
"exactly-one-main-landmark-exists-per-layout",
|
|
110
|
+
"web-skip-link-is-required-whenever-a-header-or-sidebar-precedes-main",
|
|
111
|
+
"sidebar-role-navigation-or-complementary-is-chosen-independent-of-persistent-or-overlay-mode",
|
|
112
|
+
"overlay-sidebar-reuses-sidepanel-open-state-and-dismiss-policy-unchanged",
|
|
113
|
+
"header-and-footer-content-is-not-owned-here-compose-topbar-and-bottomnavigation",
|
|
114
|
+
"skip-link-is-visually-hidden-until-keyboard-focus-reaches-it",
|
|
115
|
+
"native-has-no-landmark-role-equivalent-translation-relies-on-order-and-accessibilityviewismodal",
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA+BtD,SAAS,cAAc,CAAC,KAAa,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,UAAU,KAAK,oBAAoB,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAA4B;IAChE,IAAI,UAAU,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAA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,EAAE,MAAM,EAAE,aAAa,CAAC;QACvE,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,KAAK,EAAE,QAAQ;KAChB;IACD,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9C,SAAS,EAAE;QACT,6CAA6C;QAC7C,sEAAsE;QACtE,8FAA8F;QAC9F,0EAA0E;QAC1E,iFAAiF;QACjF,8DAA8D;QAC9D,iGAAiG;KAClG;CACkC,CAAC","sourcesContent":["import type { ColorReference } from \"./color-references.js\";\nimport type { BehaviorContract } from \"./behaviors.js\";\nimport { focusIndicatorContract } from \"./component-contracts.js\";\nimport { layout as layoutFoundation, spacing } from \"./foundations.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\n/**\n * `Layout` (alias `AppShell`) does NOT own header or footer chrome — that is\n * already `TopBar` (native, beta) and `BottomNavigation` (adaptive, beta).\n * What is left after subtracting those: ordered regions, a sidebar that is\n * either always-visible chrome or a dismissible overlay, and Web-only\n * landmark composition (one `main` plus a required skip link whenever\n * repeated navigation precedes it). The overlay case reuses `SidePanel`\n * unchanged — see docs/layout.md for why this module does not redeclare\n * open/dismiss state.\n */\nexport type LayoutSidebarRole = \"navigation\" | \"complementary\";\nexport type LayoutSidebarMode = \"persistent\" | \"overlay\";\n\nexport type LayoutSidebarDescriptor = Readonly<{\n /** Primary site navigation vs. supplementary content (filters, related items) — independent of `mode`. */\n role: LayoutSidebarRole;\n /** `persistent`: always-visible landmark. `overlay`: a `SidePanel` — Layout does not re-contract its open/dismiss lifecycle. */\n mode: LayoutSidebarMode;\n label: string;\n}>;\n\nexport type LayoutDescriptor = Readonly<{\n hasHeader?: boolean;\n hasFooter?: boolean;\n sidebar?: LayoutSidebarDescriptor;\n /** Web-only: required whenever a header or sidebar precedes `main` (WCAG 2.4.1 bypass blocks). */\n skipLinkLabel?: string;\n}>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`Layout ${field} must not be empty`);\n }\n}\n\n/**\n * Cross-platform structure validation. This deliberately does not require a\n * skip link: Native has no page-landmark or bypass-link equivalent.\n */\nexport function validateLayoutRegions(descriptor: LayoutDescriptor): void {\n if (descriptor.sidebar !== undefined) {\n const { role, mode, label } = descriptor.sidebar;\n if (role !== \"navigation\" && role !== \"complementary\") {\n throw new TypeError(`Unsupported Layout sidebar role: ${String(role)}`);\n }\n if (mode !== \"persistent\" && mode !== \"overlay\") {\n throw new TypeError(`Unsupported Layout sidebar mode: ${String(mode)}`);\n }\n assertNonEmpty(label, \"sidebar.label\");\n }\n if (descriptor.skipLinkLabel !== undefined) {\n assertNonEmpty(descriptor.skipLinkLabel, \"skipLinkLabel\");\n }\n}\n\n/** Web landmark validation, including the WCAG 2.4.1 bypass-link invariant. */\nexport function validateLayoutWebDescriptor(descriptor: LayoutDescriptor): void {\n validateLayoutRegions(descriptor);\n const needsSkipLink = descriptor.hasHeader === true || descriptor.sidebar !== undefined;\n if (needsSkipLink && descriptor.skipLinkLabel === undefined) {\n throw new TypeError(\n \"Layout requires skipLinkLabel when a header or sidebar region precedes main\",\n );\n }\n}\n\n/**\n * @deprecated Use `validateLayoutRegions` for shared/Native structure or\n * `validateLayoutWebDescriptor` for a Web app shell.\n */\nexport function validateLayoutDescriptor(descriptor: LayoutDescriptor): void {\n validateLayoutWebDescriptor(descriptor);\n}\n\nexport type LayoutLandmarkRole =\n | \"banner\"\n | \"navigation\"\n | \"complementary\"\n | \"main\"\n | \"contentinfo\";\n\n/**\n * Web-only translation: real landmark elements exist there. Native has no\n * landmark-role equivalent at all (`accessibilityRole` covers headings and\n * controls, not page regions) — RN renderers instead rely on visual/DOM\n * order plus `accessibilityViewIsModal` for the overlay sidebar case. That\n * asymmetry is documented, not papered over with a fake mapping.\n */\nexport function resolveLayoutWebLandmarks(\n descriptor: LayoutDescriptor,\n): readonly LayoutLandmarkRole[] {\n validateLayoutWebDescriptor(descriptor);\n const roles: LayoutLandmarkRole[] = [];\n if (descriptor.hasHeader) roles.push(\"banner\");\n if (descriptor.sidebar) roles.push(descriptor.sidebar.role);\n roles.push(\"main\");\n if (descriptor.hasFooter) roles.push(\"contentinfo\");\n return roles;\n}\n\n/**\n * Skip link is hidden until it matters — visible only on keyboard focus.\n * A skip link visible at rest fights identity.md's \"조용한 화면 위에 중요한\n * 순간만 선명하게\": for a mouse/touch user it is noise every screen, for a\n * keyboard user it is the first landmark on the page.\n */\nexport const layoutRecipe = {\n slots: [\"root\", \"skipLink\", \"header\", \"sidebar\", \"main\", \"footer\"] as const,\n defaults: {},\n main: {\n maxWidth: layoutFoundation.contentMaxWidth,\n paddingHorizontal: layoutFoundation.pagePadding.regular,\n },\n sidebar: {\n width: 280,\n },\n skipLink: {\n visibility: \"focus-only\",\n background: semanticColors.action.brand.background,\n color: semanticColors.action.brand.content,\n paddingHorizontal: spacing.md,\n paddingVertical: spacing.sm,\n },\n states: { focus: focusIndicatorContract },\n} as const satisfies {\n slots: readonly [\"root\", \"skipLink\", \"header\", \"sidebar\", \"main\", \"footer\"];\n defaults: Record<string, never>;\n main: { maxWidth: number; paddingHorizontal: number };\n sidebar: { width: number };\n skipLink: {\n visibility: \"focus-only\";\n background: ColorReference;\n color: ColorReference;\n paddingHorizontal: number;\n paddingVertical: number;\n };\n states: { focus: typeof focusIndicatorContract };\n};\n\n/**\n * `controlled: []` on purpose: an overlay sidebar's open/dismiss lifecycle\n * is a `SidePanel` (`src/side-panel.ts`) composed as-is. Redeclaring\n * `open`/`defaultOpen`/`onOpenChange`/`dismissPolicy` here would be the same\n * mistake DataTable avoided with Pagination/LoadMore — two places owning\n * one piece of state that will drift the first time either one changes.\n */\nexport const layoutBehavior = {\n controlled: [],\n inputs: [\"hasHeader\", \"hasFooter\", \"sidebar\", \"skipLinkLabel\"],\n configuration: {\n \"sidebar.mode\": [\"persistent\", \"overlay\"],\n \"sidebar.role\": [\"navigation\", \"complementary\"],\n },\n stateAxes: {},\n web: {\n roles: [\"banner\", \"navigation\", \"complementary\", \"main\", \"contentinfo\"],\n keyboard: [\"Tab\"],\n focus: \"native\",\n },\n native: { roles: [], states: [], actions: [] },\n scenarios: [\n \"exactly-one-main-landmark-exists-per-layout\",\n \"web-skip-link-is-required-whenever-a-header-or-sidebar-precedes-main\",\n \"sidebar-role-navigation-or-complementary-is-chosen-independent-of-persistent-or-overlay-mode\",\n \"overlay-sidebar-reuses-sidepanel-open-state-and-dismiss-policy-unchanged\",\n \"header-and-footer-content-is-not-owned-here-compose-topbar-and-bottomnavigation\",\n \"skip-link-is-visually-hidden-until-keyboard-focus-reaches-it\",\n \"native-has-no-landmark-role-equivalent-translation-relies-on-order-and-accessibilityviewismodal\",\n ],\n} as const satisfies BehaviorContract;\n"]}
|
package/dist/link.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type SemanticIconName } from "./icon.js";
|
|
2
|
+
type ForbiddenLinkCommands = Readonly<{
|
|
3
|
+
/** Unavailable destinations render as text; links are never disabled controls. */
|
|
4
|
+
disabled?: never;
|
|
5
|
+
/** Navigation is owned by href and its platform router, not an action callback. */
|
|
6
|
+
onClick?: never;
|
|
7
|
+
onPress?: never;
|
|
8
|
+
/** Downloads are a separate platform workflow. */
|
|
9
|
+
download?: never;
|
|
10
|
+
/** Visited is a Web pseudo-state, not cross-platform application state. */
|
|
11
|
+
visited?: never;
|
|
12
|
+
}>;
|
|
13
|
+
export type InternalLinkDestination = ForbiddenLinkCommands & Readonly<{
|
|
14
|
+
kind: "internal";
|
|
15
|
+
href: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type ExternalLinkDestination = ForbiddenLinkCommands & Readonly<{
|
|
18
|
+
kind: "external";
|
|
19
|
+
href: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type LinkDestination = InternalLinkDestination | ExternalLinkDestination;
|
|
22
|
+
/**
|
|
23
|
+
* Link owns icon appearance through linkRecipe. Callers only choose an HJM
|
|
24
|
+
* semantic mark; size, tone, weight, and directionality cannot drift.
|
|
25
|
+
*/
|
|
26
|
+
export type LinkIconDescriptor = Readonly<{
|
|
27
|
+
name: SemanticIconName;
|
|
28
|
+
decorative?: true;
|
|
29
|
+
accessibilityLabel?: never;
|
|
30
|
+
size?: never;
|
|
31
|
+
tone?: never;
|
|
32
|
+
weight?: never;
|
|
33
|
+
directionality?: never;
|
|
34
|
+
}>;
|
|
35
|
+
export type ResolvedLinkIconDescriptor = Readonly<{
|
|
36
|
+
name: SemanticIconName;
|
|
37
|
+
decorative: true;
|
|
38
|
+
}>;
|
|
39
|
+
export type LinkDescriptor = ForbiddenLinkCommands & Readonly<{
|
|
40
|
+
label: string;
|
|
41
|
+
accessibilityLabel?: string;
|
|
42
|
+
destination: LinkDestination;
|
|
43
|
+
leadingIcon?: LinkIconDescriptor;
|
|
44
|
+
trailingIcon?: LinkIconDescriptor;
|
|
45
|
+
}>;
|
|
46
|
+
export type ResolvedLinkDescriptor = Readonly<{
|
|
47
|
+
label: string;
|
|
48
|
+
resolvedAccessibilityLabel: string;
|
|
49
|
+
destination: LinkDestination;
|
|
50
|
+
leadingIcon: ResolvedLinkIconDescriptor | null;
|
|
51
|
+
trailingIcon: ResolvedLinkIconDescriptor | null;
|
|
52
|
+
}>;
|
|
53
|
+
export declare function validateLinkDestination(destination: LinkDestination): void;
|
|
54
|
+
export declare function validateLinkDescriptor(descriptor: LinkDescriptor): void;
|
|
55
|
+
export declare function resolveLinkDescriptor(descriptor: LinkDescriptor): ResolvedLinkDescriptor;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAEnB,KAAK,qBAAqB,GAAG,QAAQ,CAAC;IACpC,kFAAkF;IAClF,QAAQ,CA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,kBAAkB,CAAC;CACnC,CAAC,CAAC;AAEL,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B,EAAE,MAAM,CAAC;IACnC,WAAW,EAAE,eAAe,CAAC;IAC7B,WAAW,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC/C,YAAY,EAAE,0BAA0B,GAAG,IAAI,CAAC;CACjD,CAAC,CAAC;AA8FH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,GAC3B,IAAI,CAcN;AAsBD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CA2BvE;AAQD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,GACzB,sBAAsB,CAaxB"}
|
package/dist/link.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { semanticIconNames, } from "./icon.js";
|
|
2
|
+
const externalProtocols = new Set(["https:", "http:", "mailto:", "tel:"]);
|
|
3
|
+
const semanticNames = new Set(semanticIconNames);
|
|
4
|
+
const descriptorKeys = new Set([
|
|
5
|
+
"label",
|
|
6
|
+
"accessibilityLabel",
|
|
7
|
+
"destination",
|
|
8
|
+
"leadingIcon",
|
|
9
|
+
"trailingIcon",
|
|
10
|
+
]);
|
|
11
|
+
const destinationKeys = new Set(["kind", "href"]);
|
|
12
|
+
const iconKeys = new Set(["name", "decorative"]);
|
|
13
|
+
function isObject(value) {
|
|
14
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
15
|
+
}
|
|
16
|
+
function validateCopy(value, field) {
|
|
17
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
18
|
+
throw new TypeError(`Link ${field} must not be empty`);
|
|
19
|
+
}
|
|
20
|
+
if (value !== value.trim()) {
|
|
21
|
+
throw new TypeError(`Link ${field} must not start or end with whitespace`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function rejectUnknownKeys(value, allowed, field) {
|
|
25
|
+
for (const key of Object.keys(value)) {
|
|
26
|
+
if (!allowed.has(key)) {
|
|
27
|
+
throw new TypeError(`Unsupported ${field} field: ${key}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function normalizedCopy(value) {
|
|
32
|
+
return value.normalize("NFKC").toLocaleLowerCase();
|
|
33
|
+
}
|
|
34
|
+
function validateHref(href, kind) {
|
|
35
|
+
validateCopy(href, "href");
|
|
36
|
+
if (/\s/u.test(href)) {
|
|
37
|
+
throw new TypeError("Link href must encode whitespace");
|
|
38
|
+
}
|
|
39
|
+
if (kind === "internal") {
|
|
40
|
+
if (href.includes("\\")) {
|
|
41
|
+
throw new TypeError("Internal Link href must not contain backslashes");
|
|
42
|
+
}
|
|
43
|
+
if ((href.startsWith("/") && !href.startsWith("//")) ||
|
|
44
|
+
href.startsWith("?") ||
|
|
45
|
+
href.startsWith("#")) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
throw new TypeError("Internal Link href must be root-relative, query-relative, or a fragment");
|
|
49
|
+
}
|
|
50
|
+
let parsed;
|
|
51
|
+
try {
|
|
52
|
+
parsed = new URL(href);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
throw new TypeError("External Link href must be an absolute URL");
|
|
56
|
+
}
|
|
57
|
+
if (!externalProtocols.has(parsed.protocol)) {
|
|
58
|
+
throw new TypeError(`Unsupported external Link protocol: ${parsed.protocol}`);
|
|
59
|
+
}
|
|
60
|
+
if (parsed.username.length > 0 || parsed.password.length > 0) {
|
|
61
|
+
throw new TypeError("External Link href must not contain credentials");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function rejectCommandFields(value) {
|
|
65
|
+
for (const field of [
|
|
66
|
+
"disabled",
|
|
67
|
+
"onClick",
|
|
68
|
+
"onPress",
|
|
69
|
+
"download",
|
|
70
|
+
"visited",
|
|
71
|
+
]) {
|
|
72
|
+
if (Object.prototype.hasOwnProperty.call(value, field)) {
|
|
73
|
+
throw new TypeError(`Link must not provide ${field}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function validateLinkDestination(destination) {
|
|
78
|
+
if (!isObject(destination)) {
|
|
79
|
+
throw new TypeError("Link destination must be an object");
|
|
80
|
+
}
|
|
81
|
+
const candidate = destination;
|
|
82
|
+
rejectCommandFields(candidate);
|
|
83
|
+
rejectUnknownKeys(candidate, destinationKeys, "Link destination");
|
|
84
|
+
const kind = candidate.kind;
|
|
85
|
+
if (kind !== "internal" && kind !== "external") {
|
|
86
|
+
throw new TypeError(`Unsupported Link destination kind: ${String(kind)}`);
|
|
87
|
+
}
|
|
88
|
+
validateHref(candidate.href, kind);
|
|
89
|
+
}
|
|
90
|
+
function validateLinkIcon(icon, field) {
|
|
91
|
+
if (!isObject(icon)) {
|
|
92
|
+
throw new TypeError(`Link ${field} must be an icon descriptor`);
|
|
93
|
+
}
|
|
94
|
+
const candidate = icon;
|
|
95
|
+
if (candidate.decorative !== undefined &&
|
|
96
|
+
candidate.decorative !== true) {
|
|
97
|
+
throw new TypeError(`Link ${field} must be decorative`);
|
|
98
|
+
}
|
|
99
|
+
rejectUnknownKeys(candidate, iconKeys, `Link ${field}`);
|
|
100
|
+
if (typeof candidate.name !== "string" || !semanticNames.has(candidate.name)) {
|
|
101
|
+
throw new TypeError(`Link ${field} must use an HJM semantic icon name`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function validateLinkDescriptor(descriptor) {
|
|
105
|
+
if (!isObject(descriptor)) {
|
|
106
|
+
throw new TypeError("Link descriptor must be an object");
|
|
107
|
+
}
|
|
108
|
+
const candidate = descriptor;
|
|
109
|
+
rejectCommandFields(candidate);
|
|
110
|
+
rejectUnknownKeys(candidate, descriptorKeys, "Link descriptor");
|
|
111
|
+
validateCopy(descriptor.label, "label");
|
|
112
|
+
if (descriptor.accessibilityLabel !== undefined) {
|
|
113
|
+
validateCopy(descriptor.accessibilityLabel, "accessibilityLabel");
|
|
114
|
+
if (!normalizedCopy(descriptor.accessibilityLabel).includes(normalizedCopy(descriptor.label))) {
|
|
115
|
+
throw new TypeError("Link accessibilityLabel must include the visible label");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
validateLinkDestination(descriptor.destination);
|
|
119
|
+
if (descriptor.leadingIcon !== undefined) {
|
|
120
|
+
validateLinkIcon(descriptor.leadingIcon, "leadingIcon");
|
|
121
|
+
}
|
|
122
|
+
if (descriptor.trailingIcon !== undefined) {
|
|
123
|
+
validateLinkIcon(descriptor.trailingIcon, "trailingIcon");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function resolveLinkIcon(icon) {
|
|
127
|
+
return icon === undefined ? null : { name: icon.name, decorative: true };
|
|
128
|
+
}
|
|
129
|
+
export function resolveLinkDescriptor(descriptor) {
|
|
130
|
+
validateLinkDescriptor(descriptor);
|
|
131
|
+
return {
|
|
132
|
+
label: descriptor.label,
|
|
133
|
+
resolvedAccessibilityLabel: descriptor.accessibilityLabel ?? descriptor.label,
|
|
134
|
+
destination: {
|
|
135
|
+
kind: descriptor.destination.kind,
|
|
136
|
+
href: descriptor.destination.href,
|
|
137
|
+
},
|
|
138
|
+
leadingIcon: resolveLinkIcon(descriptor.leadingIcon),
|
|
139
|
+
trailingIcon: resolveLinkIcon(descriptor.trailingIcon),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=link.js.map
|
package/dist/link.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAElB,MAAM,WAAW,CAAC;AAkEnB,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS,iBAAiB,CAAC,CAA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SAAS,EAAE,CAAC;QAC1C,gBAAgB,CAAC,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CACtB,IAAoC;IAEpC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,UAA0B;IAE1B,sBAAsB,CAAC,UAAU,CAAC,CAAC;IACnC,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,0BAA0B,EACxB,UAAU,CAAC,kBAAkB,IAAI,UAAU,CAAC,KAAK;QACnD,WAAW,EAAE;YACX,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI;YACjC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI;SAClC;QACD,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC,YAAY,CAAC;KACvD,CAAC;AACJ,CAAC","sourcesContent":["import {\n semanticIconNames,\n type SemanticIconName,\n} from \"./icon.js\";\n\ntype ForbiddenLinkCommands = Readonly<{\n /** Unavailable destinations render as text; links are never disabled controls. */\n disabled?: never;\n /** Navigation is owned by href and its platform router, not an action callback. */\n onClick?: never;\n onPress?: never;\n /** Downloads are a separate platform workflow. */\n download?: never;\n /** Visited is a Web pseudo-state, not cross-platform application state. */\n visited?: never;\n}>;\n\nexport type InternalLinkDestination = ForbiddenLinkCommands &\n Readonly<{\n kind: \"internal\";\n href: string;\n }>;\n\nexport type ExternalLinkDestination = ForbiddenLinkCommands &\n Readonly<{\n kind: \"external\";\n href: string;\n }>;\n\nexport type LinkDestination =\n | InternalLinkDestination\n | ExternalLinkDestination;\n\n/**\n * Link owns icon appearance through linkRecipe. Callers only choose an HJM\n * semantic mark; size, tone, weight, and directionality cannot drift.\n */\nexport type LinkIconDescriptor = Readonly<{\n name: SemanticIconName;\n decorative?: true;\n accessibilityLabel?: never;\n size?: never;\n tone?: never;\n weight?: never;\n directionality?: never;\n}>;\n\nexport type ResolvedLinkIconDescriptor = Readonly<{\n name: SemanticIconName;\n decorative: true;\n}>;\n\nexport type LinkDescriptor = ForbiddenLinkCommands &\n Readonly<{\n label: string;\n accessibilityLabel?: string;\n destination: LinkDestination;\n leadingIcon?: LinkIconDescriptor;\n trailingIcon?: LinkIconDescriptor;\n }>;\n\nexport type ResolvedLinkDescriptor = Readonly<{\n label: string;\n resolvedAccessibilityLabel: string;\n destination: LinkDestination;\n leadingIcon: ResolvedLinkIconDescriptor | null;\n trailingIcon: ResolvedLinkIconDescriptor | null;\n}>;\n\nconst externalProtocols = new Set([\"https:\", \"http:\", \"mailto:\", \"tel:\"]);\nconst semanticNames = new Set<string>(semanticIconNames);\nconst descriptorKeys = new Set([\n \"label\",\n \"accessibilityLabel\",\n \"destination\",\n \"leadingIcon\",\n \"trailingIcon\",\n]);\nconst destinationKeys = new Set([\"kind\", \"href\"]);\nconst iconKeys = new Set([\"name\", \"decorative\"]);\n\nfunction isObject(value: unknown): value is Readonly<Record<string, unknown>> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction validateCopy(value: unknown, field: string): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`Link ${field} must not be empty`);\n }\n if (value !== value.trim()) {\n throw new TypeError(`Link ${field} must not start or end with whitespace`);\n }\n}\n\nfunction rejectUnknownKeys(\n value: Readonly<Record<string, unknown>>,\n allowed: ReadonlySet<string>,\n field: string,\n): void {\n for (const key of Object.keys(value)) {\n if (!allowed.has(key)) {\n throw new TypeError(`Unsupported ${field} field: ${key}`);\n }\n }\n}\n\nfunction normalizedCopy(value: string): string {\n return value.normalize(\"NFKC\").toLocaleLowerCase();\n}\n\nfunction validateHref(href: unknown, kind: LinkDestination[\"kind\"]): void {\n validateCopy(href, \"href\");\n if (/\\s/u.test(href)) {\n throw new TypeError(\"Link href must encode whitespace\");\n }\n if (kind === \"internal\") {\n if (href.includes(\"\\\\\")) {\n throw new TypeError(\"Internal Link href must not contain backslashes\");\n }\n if (\n (href.startsWith(\"/\") && !href.startsWith(\"//\")) ||\n href.startsWith(\"?\") ||\n href.startsWith(\"#\")\n ) {\n return;\n }\n throw new TypeError(\n \"Internal Link href must be root-relative, query-relative, or a fragment\",\n );\n }\n\n let parsed: URL;\n try {\n parsed = new URL(href);\n } catch {\n throw new TypeError(\"External Link href must be an absolute URL\");\n }\n if (!externalProtocols.has(parsed.protocol)) {\n throw new TypeError(\n `Unsupported external Link protocol: ${parsed.protocol}`,\n );\n }\n if (parsed.username.length > 0 || parsed.password.length > 0) {\n throw new TypeError(\"External Link href must not contain credentials\");\n }\n}\n\nfunction rejectCommandFields(value: Readonly<Record<string, unknown>>): void {\n for (const field of [\n \"disabled\",\n \"onClick\",\n \"onPress\",\n \"download\",\n \"visited\",\n ] as const) {\n if (Object.prototype.hasOwnProperty.call(value, field)) {\n throw new TypeError(`Link must not provide ${field}`);\n }\n }\n}\n\nexport function validateLinkDestination(\n destination: LinkDestination,\n): void {\n if (!isObject(destination)) {\n throw new TypeError(\"Link destination must be an object\");\n }\n const candidate = destination as Readonly<Record<string, unknown>>;\n rejectCommandFields(candidate);\n rejectUnknownKeys(candidate, destinationKeys, \"Link destination\");\n const kind = candidate.kind;\n if (kind !== \"internal\" && kind !== \"external\") {\n throw new TypeError(\n `Unsupported Link destination kind: ${String(kind)}`,\n );\n }\n validateHref(candidate.href, kind);\n}\n\nfunction validateLinkIcon(\n icon: LinkIconDescriptor,\n field: string,\n): void {\n if (!isObject(icon)) {\n throw new TypeError(`Link ${field} must be an icon descriptor`);\n }\n const candidate = icon as Readonly<Record<string, unknown>>;\n if (\n candidate.decorative !== undefined &&\n candidate.decorative !== true\n ) {\n throw new TypeError(`Link ${field} must be decorative`);\n }\n rejectUnknownKeys(candidate, iconKeys, `Link ${field}`);\n if (typeof candidate.name !== \"string\" || !semanticNames.has(candidate.name)) {\n throw new TypeError(`Link ${field} must use an HJM semantic icon name`);\n }\n}\n\nexport function validateLinkDescriptor(descriptor: LinkDescriptor): void {\n if (!isObject(descriptor)) {\n throw new TypeError(\"Link descriptor must be an object\");\n }\n const candidate = descriptor as Readonly<Record<string, unknown>>;\n rejectCommandFields(candidate);\n rejectUnknownKeys(candidate, descriptorKeys, \"Link descriptor\");\n validateCopy(descriptor.label, \"label\");\n if (descriptor.accessibilityLabel !== undefined) {\n validateCopy(descriptor.accessibilityLabel, \"accessibilityLabel\");\n if (\n !normalizedCopy(descriptor.accessibilityLabel).includes(\n normalizedCopy(descriptor.label),\n )\n ) {\n throw new TypeError(\n \"Link accessibilityLabel must include the visible label\",\n );\n }\n }\n validateLinkDestination(descriptor.destination);\n if (descriptor.leadingIcon !== undefined) {\n validateLinkIcon(descriptor.leadingIcon, \"leadingIcon\");\n }\n if (descriptor.trailingIcon !== undefined) {\n validateLinkIcon(descriptor.trailingIcon, \"trailingIcon\");\n }\n}\n\nfunction resolveLinkIcon(\n icon: LinkIconDescriptor | undefined,\n): ResolvedLinkIconDescriptor | null {\n return icon === undefined ? null : { name: icon.name, decorative: true };\n}\n\nexport function resolveLinkDescriptor(\n descriptor: LinkDescriptor,\n): ResolvedLinkDescriptor {\n validateLinkDescriptor(descriptor);\n return {\n label: descriptor.label,\n resolvedAccessibilityLabel:\n descriptor.accessibilityLabel ?? descriptor.label,\n destination: {\n kind: descriptor.destination.kind,\n href: descriptor.destination.href,\n },\n leadingIcon: resolveLinkIcon(descriptor.leadingIcon),\n trailingIcon: resolveLinkIcon(descriptor.trailingIcon),\n };\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type LoadMoreMode = "automatic" | "manual";
|
|
2
|
+
export type LoadMoreRequestReason = "viewport" | "manual" | "retry";
|
|
3
|
+
export type LoadMoreReadyState = Readonly<{
|
|
4
|
+
status: "ready";
|
|
5
|
+
requestKey: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type LoadMoreLoadingState = Readonly<{
|
|
8
|
+
status: "loading";
|
|
9
|
+
requestKey: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type LoadMoreErrorState = Readonly<{
|
|
12
|
+
status: "error";
|
|
13
|
+
requestKey: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type LoadMoreCompleteState = Readonly<{
|
|
17
|
+
status: "complete";
|
|
18
|
+
requestKey?: never;
|
|
19
|
+
}>;
|
|
20
|
+
/** Existing collection items stay mounted while this footer state changes. */
|
|
21
|
+
export type LoadMoreState = LoadMoreReadyState | LoadMoreLoadingState | LoadMoreErrorState | LoadMoreCompleteState;
|
|
22
|
+
export type LoadMoreRequest = Readonly<{
|
|
23
|
+
requestKey: string;
|
|
24
|
+
reason: LoadMoreRequestReason;
|
|
25
|
+
}>;
|
|
26
|
+
export type LoadMoreLabels = Readonly<{
|
|
27
|
+
loadMore: string;
|
|
28
|
+
loading: string;
|
|
29
|
+
retry: string;
|
|
30
|
+
complete: string;
|
|
31
|
+
}>;
|
|
32
|
+
export type LoadMoreDescriptor = Readonly<{
|
|
33
|
+
state: LoadMoreState;
|
|
34
|
+
labels: LoadMoreLabels;
|
|
35
|
+
}>;
|
|
36
|
+
export type LoadMoreRequestHandler = (request: LoadMoreRequest) => Promise<void>;
|
|
37
|
+
export type LoadMoreRequestOutcome = "started" | "blocked-by-mode" | "blocked-by-state" | "already-requesting";
|
|
38
|
+
export type LoadMoreControllerOptions = Readonly<{
|
|
39
|
+
mode?: LoadMoreMode;
|
|
40
|
+
onLoadMore: LoadMoreRequestHandler;
|
|
41
|
+
}>;
|
|
42
|
+
export type LoadMoreControllerSnapshot = Readonly<{
|
|
43
|
+
mode: LoadMoreMode;
|
|
44
|
+
inFlightRequestKey: string | null;
|
|
45
|
+
disposed: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
export type LoadMoreController = Readonly<{
|
|
48
|
+
getSnapshot(): LoadMoreControllerSnapshot;
|
|
49
|
+
request(state: LoadMoreState, reason: LoadMoreRequestReason): Promise<LoadMoreRequestOutcome>;
|
|
50
|
+
dispose(): boolean;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const loadMoreBehaviorDefaults: {
|
|
53
|
+
readonly mode: "automatic";
|
|
54
|
+
};
|
|
55
|
+
export declare function validateLoadMoreState(state: LoadMoreState): void;
|
|
56
|
+
export declare function validateLoadMoreLabels(labels: LoadMoreLabels): void;
|
|
57
|
+
export declare function validateLoadMoreDescriptor(descriptor: LoadMoreDescriptor): void;
|
|
58
|
+
export declare function canRequestLoadMore(state: LoadMoreState, mode: LoadMoreMode, reason: LoadMoreRequestReason): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Prevents duplicate and out-of-order page requests without owning collection
|
|
61
|
+
* data. Query state remains product-owned; this controller only gates events.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createLoadMoreController(options: LoadMoreControllerOptions): LoadMoreController;
|
|
64
|
+
//# sourceMappingURL=load-more.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-more.d.ts","sourceRoot":"","sources":["../src/load-more.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,MAAM,EAAE,OAAO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