@datatechsolutions/tympan 0.3.0 → 0.4.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 +22 -4
- package/dist/{Avatar-P14MVkK1.js → Avatar-CU7B1WsX.js} +61 -1
- package/dist/{Avatar-P14MVkK1.js.map → Avatar-CU7B1WsX.js.map} +1 -1
- package/dist/avatars.js +1 -1
- package/dist/elements-DCGBSGS8.js +14699 -0
- package/dist/elements-DCGBSGS8.js.map +1 -0
- package/dist/elements-react.d.ts +1378 -0
- package/dist/elements-react.js +3639 -0
- package/dist/elements-react.js.map +1 -0
- package/dist/elements.bundle.js +5 -0
- package/dist/elements.d.ts +13520 -0
- package/dist/elements.js +3 -0
- package/dist/flow.css +174 -3
- package/dist/flow.d.ts +86 -4
- package/dist/flow.js +200 -11
- package/dist/flow.js.map +1 -1
- package/dist/{index-C3WAwKdm.d.ts → index-J-7EBkCL.d.ts} +175 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/parse-Dq4x3Wet.js +345 -0
- package/dist/parse-Dq4x3Wet.js.map +1 -0
- package/dist/{src-Ds9ArSaP.js → src-uCyIE-Te.js} +859 -668
- package/dist/src-uCyIE-Te.js.map +1 -0
- package/dist/styles.css +6937 -2592
- package/docs/html-contract.md +644 -0
- package/package.json +25 -14
- package/src/avatars/GeneratedAvatar.tsx +41 -0
- package/src/avatars/avatarSvg.ts +252 -0
- package/src/avatars/avatars.test.tsx +268 -0
- package/src/avatars/index.ts +30 -0
- package/src/avatars/styles.ts +80 -0
- package/src/base.css +49 -0
- package/src/components/action-menu/ActionMenu.css +152 -0
- package/src/components/action-menu/ActionMenu.test.tsx +189 -0
- package/src/components/action-menu/ActionMenu.tsx +282 -0
- package/src/components/activity-feed/ActivityFeed.css +91 -0
- package/src/components/activity-feed/ActivityFeed.test.tsx +89 -0
- package/src/components/activity-feed/ActivityFeed.tsx +86 -0
- package/src/components/actor-chip/ActorChip.css +93 -0
- package/src/components/actor-chip/ActorChip.test.tsx +89 -0
- package/src/components/actor-chip/ActorChip.tsx +98 -0
- package/src/components/agent-output-card/AgentOutputCard.css +105 -0
- package/src/components/agent-output-card/AgentOutputCard.rtl.test.tsx +12 -0
- package/src/components/agent-output-card/AgentOutputCard.test.tsx +65 -0
- package/src/components/agent-output-card/AgentOutputCard.tsx +74 -0
- package/src/components/ambient-backdrop/AmbientBackdrop.css +45 -0
- package/src/components/ambient-backdrop/AmbientBackdrop.rtl.test.tsx +12 -0
- package/src/components/ambient-backdrop/AmbientBackdrop.test.tsx +60 -0
- package/src/components/ambient-backdrop/AmbientBackdrop.tsx +11 -0
- package/src/components/app-frame/AppFrame.css +285 -0
- package/src/components/app-frame/AppFrame.test.tsx +127 -0
- package/src/components/app-frame/AppFrame.tsx +231 -0
- package/src/components/app-frame/AppFrameRail.css +321 -0
- package/src/components/app-frame/RailFrame.test.tsx +159 -0
- package/src/components/app-frame/RailFrame.tsx +140 -0
- package/src/components/app-frame/RailNav.tsx +118 -0
- package/src/components/app-frame/frameContext.ts +22 -0
- package/src/components/app-launcher-grid/AppLauncherGrid.css +140 -0
- package/src/components/app-launcher-grid/AppLauncherGrid.test.tsx +103 -0
- package/src/components/app-launcher-grid/AppLauncherGrid.tsx +201 -0
- package/src/components/app-navigation/AppNavigation.css +354 -0
- package/src/components/app-navigation/AppNavigation.test.tsx +129 -0
- package/src/components/app-navigation/AppNavigation.tsx +372 -0
- package/src/components/app-navigation/builders.ts +117 -0
- package/src/components/attention-list/AttentionList.css +90 -0
- package/src/components/attention-list/AttentionList.test.tsx +84 -0
- package/src/components/attention-list/AttentionList.tsx +82 -0
- package/src/components/auth-frame/AuthFrame.css +85 -0
- package/src/components/auth-frame/AuthFrame.rtl.test.tsx +14 -0
- package/src/components/auth-frame/AuthFrame.test.tsx +89 -0
- package/src/components/auth-frame/AuthFrame.tsx +35 -0
- package/src/components/avatar/Avatar.css +134 -0
- package/src/components/avatar/Avatar.test.tsx +98 -0
- package/src/components/avatar/Avatar.tsx +114 -0
- package/src/components/brand-loader/BrandLoader.css +78 -0
- package/src/components/brand-loader/BrandLoader.rtl.test.tsx +13 -0
- package/src/components/brand-loader/BrandLoader.test.tsx +83 -0
- package/src/components/brand-loader/BrandLoader.tsx +34 -0
- package/src/components/brand-mark/BrandMark.css +60 -0
- package/src/components/brand-mark/BrandMark.rtl.test.tsx +16 -0
- package/src/components/brand-mark/BrandMark.test.tsx +60 -0
- package/src/components/brand-mark/BrandMark.tsx +76 -0
- package/src/components/brand-panel/BrandPanel.css +100 -0
- package/src/components/brand-panel/BrandPanel.rtl.test.tsx +13 -0
- package/src/components/brand-panel/BrandPanel.test.tsx +59 -0
- package/src/components/brand-panel/BrandPanel.tsx +61 -0
- package/src/components/brand-wordmark/BrandWordmark.css +37 -0
- package/src/components/breadcrumbs/Breadcrumbs.css +158 -0
- package/src/components/breadcrumbs/Breadcrumbs.test.tsx +104 -0
- package/src/components/breadcrumbs/Breadcrumbs.tsx +130 -0
- package/src/components/button/Button.css +214 -0
- package/src/components/button/Button.test.tsx +177 -0
- package/src/components/button/Button.tsx +205 -0
- package/src/components/calendar/Calendar.css +260 -0
- package/src/components/calendar/Calendar.test.tsx +178 -0
- package/src/components/calendar/Calendar.tsx +341 -0
- package/src/components/cascade-grid/CascadeGrid.css +31 -0
- package/src/components/cascade-grid/CascadeGrid.rtl.test.tsx +20 -0
- package/src/components/cascade-grid/CascadeGrid.test.tsx +126 -0
- package/src/components/cascade-grid/CascadeGrid.tsx +98 -0
- package/src/components/category-tabs/CategoryTabs.css +108 -0
- package/src/components/category-tabs/CategoryTabs.test.tsx +118 -0
- package/src/components/category-tabs/CategoryTabs.tsx +94 -0
- package/src/components/chart/Chart.css +215 -0
- package/src/components/chart/Chart.rtl.test.tsx +42 -0
- package/src/components/chart/Chart.test.tsx +187 -0
- package/src/components/chart/Chart.tsx +502 -0
- package/src/components/chart/chartMath.ts +73 -0
- package/src/components/chart/plot.ts +53 -0
- package/src/components/chart/types.ts +72 -0
- package/src/components/checkbox/Checkbox.css +168 -0
- package/src/components/checkbox/Checkbox.test.tsx +97 -0
- package/src/components/checkbox/Checkbox.tsx +168 -0
- package/src/components/chip-group/ChipGroup.css +182 -0
- package/src/components/chip-group/ChipGroup.test.tsx +135 -0
- package/src/components/chip-group/ChipGroup.tsx +169 -0
- package/src/components/choice-card/ChoiceCard.css +141 -0
- package/src/components/choice-card/ChoiceCard.test.tsx +111 -0
- package/src/components/choice-card/ChoiceCard.tsx +139 -0
- package/src/components/choice-grid/ChoiceGrid.css +110 -0
- package/src/components/choice-grid/ChoiceGrid.test.tsx +85 -0
- package/src/components/choice-grid/ChoiceGrid.tsx +85 -0
- package/src/components/choice-tile/ChoiceTile.css +79 -0
- package/src/components/choice-tile/ChoiceTile.test.tsx +118 -0
- package/src/components/choice-tile/ChoiceTile.tsx +57 -0
- package/src/components/command-palette/CommandPalette.css +296 -0
- package/src/components/command-palette/CommandPalette.test.tsx +190 -0
- package/src/components/command-palette/CommandPalette.tsx +340 -0
- package/src/components/command-palette/model.ts +156 -0
- package/src/components/compact-confirm/CompactConfirm.css +136 -0
- package/src/components/compact-confirm/CompactConfirm.test.tsx +119 -0
- package/src/components/compact-confirm/CompactConfirm.tsx +91 -0
- package/src/components/confirm-service/ConfirmService.test.tsx +121 -0
- package/src/components/confirm-service/ConfirmService.tsx +152 -0
- package/src/components/consent-banner/ConsentBanner.css +73 -0
- package/src/components/consent-banner/ConsentBanner.rtl.test.tsx +12 -0
- package/src/components/consent-banner/ConsentBanner.test.tsx +86 -0
- package/src/components/consent-banner/ConsentBanner.tsx +66 -0
- package/src/components/contact-card/ContactCard.css +105 -0
- package/src/components/contact-card/ContactCard.rtl.test.tsx +17 -0
- package/src/components/contact-card/ContactCard.test.tsx +58 -0
- package/src/components/contact-card/ContactCard.tsx +99 -0
- package/src/components/copy-identifier/CopyIdentifier.css +90 -0
- package/src/components/copy-identifier/CopyIdentifier.test.tsx +103 -0
- package/src/components/copy-identifier/CopyIdentifier.tsx +89 -0
- package/src/components/count-badge/CountBadge.css +54 -0
- package/src/components/count-badge/CountBadge.test.tsx +81 -0
- package/src/components/count-badge/CountBadge.tsx +68 -0
- package/src/components/currency-field/CurrencyField.css +88 -0
- package/src/components/currency-field/CurrencyField.test.tsx +147 -0
- package/src/components/currency-field/CurrencyField.tsx +219 -0
- package/src/components/data-table/DataTable.css +362 -0
- package/src/components/data-table/DataTable.test.tsx +214 -0
- package/src/components/data-table/DataTable.tsx +396 -0
- package/src/components/date-field/DateField.css +126 -0
- package/src/components/date-field/DateField.test.tsx +143 -0
- package/src/components/date-field/DateField.tsx +235 -0
- package/src/components/date-range-field/DateRangeField.css +140 -0
- package/src/components/date-range-field/DateRangeField.test.tsx +187 -0
- package/src/components/date-range-field/DateRangeField.tsx +231 -0
- package/src/components/delta-indicator/DeltaIndicator.css +58 -0
- package/src/components/delta-indicator/DeltaIndicator.rtl.test.tsx +19 -0
- package/src/components/delta-indicator/DeltaIndicator.test.tsx +69 -0
- package/src/components/delta-indicator/DeltaIndicator.tsx +88 -0
- package/src/components/details-popover/DetailsPopover.css +166 -0
- package/src/components/details-popover/DetailsPopover.test.tsx +92 -0
- package/src/components/details-popover/DetailsPopover.tsx +141 -0
- package/src/components/drawer/Drawer.css +188 -0
- package/src/components/drawer/Drawer.test.tsx +152 -0
- package/src/components/drawer/Drawer.tsx +121 -0
- package/src/components/edge-swipe-back/EdgeSwipeBack.css +66 -0
- package/src/components/edge-swipe-back/EdgeSwipeBack.rtl.test.tsx +17 -0
- package/src/components/edge-swipe-back/EdgeSwipeBack.test.tsx +86 -0
- package/src/components/edge-swipe-back/EdgeSwipeBack.tsx +104 -0
- package/src/components/empty-state/EmptyState.css +70 -0
- package/src/components/empty-state/EmptyState.test.tsx +77 -0
- package/src/components/empty-state/EmptyState.tsx +105 -0
- package/src/components/environment-banner/EnvironmentBanner.css +46 -0
- package/src/components/environment-banner/EnvironmentBanner.rtl.test.tsx +13 -0
- package/src/components/environment-banner/EnvironmentBanner.test.tsx +51 -0
- package/src/components/environment-banner/EnvironmentBanner.tsx +75 -0
- package/src/components/error-state/ErrorState.css +113 -0
- package/src/components/error-state/ErrorState.test.tsx +98 -0
- package/src/components/error-state/ErrorState.tsx +145 -0
- package/src/components/evidence-panel/EvidencePanel.css +126 -0
- package/src/components/evidence-panel/EvidencePanel.test.tsx +130 -0
- package/src/components/evidence-panel/EvidencePanel.tsx +120 -0
- package/src/components/feature-showcase-card/FeatureShowcaseCard.css +136 -0
- package/src/components/feature-showcase-card/FeatureShowcaseCard.rtl.test.tsx +13 -0
- package/src/components/feature-showcase-card/FeatureShowcaseCard.test.tsx +91 -0
- package/src/components/feature-showcase-card/FeatureShowcaseCard.tsx +76 -0
- package/src/components/feature-tile/FeatureTile.css +111 -0
- package/src/components/feature-tile/FeatureTile.rtl.test.tsx +14 -0
- package/src/components/feature-tile/FeatureTile.test.tsx +78 -0
- package/src/components/feature-tile/FeatureTile.tsx +52 -0
- package/src/components/federated-sign-in/FederatedSignIn.css +23 -0
- package/src/components/federated-sign-in/FederatedSignIn.rtl.test.tsx +12 -0
- package/src/components/federated-sign-in/FederatedSignIn.test.tsx +74 -0
- package/src/components/federated-sign-in/FederatedSignIn.tsx +68 -0
- package/src/components/field/Field.css +99 -0
- package/src/components/field/Field.test.tsx +134 -0
- package/src/components/field/Field.tsx +228 -0
- package/src/components/filter-chips/FilterChips.css +145 -0
- package/src/components/filter-chips/FilterChips.test.tsx +121 -0
- package/src/components/filter-chips/FilterChips.tsx +134 -0
- package/src/components/filter-field/FilterField.css +11 -0
- package/src/components/filter-field/FilterField.test.tsx +92 -0
- package/src/components/filter-field/FilterField.tsx +43 -0
- package/src/components/filter-tile/FilterTile.css +145 -0
- package/src/components/filter-tile/FilterTile.test.tsx +69 -0
- package/src/components/filter-tile/FilterTile.tsx +87 -0
- package/src/components/flag-set-picker/FlagSetPicker.css +32 -0
- package/src/components/flag-set-picker/FlagSetPicker.test.tsx +75 -0
- package/src/components/flag-set-picker/FlagSetPicker.tsx +92 -0
- package/src/components/floating-action-bar/FloatingActionBar.css +375 -0
- package/src/components/floating-action-bar/FloatingActionBar.test.tsx +309 -0
- package/src/components/floating-action-bar/FloatingActionBar.tsx +655 -0
- package/src/components/floating-action-bar/barModel.ts +147 -0
- package/src/components/floating-action-button/FloatingActionButton.css +54 -0
- package/src/components/floating-action-button/FloatingActionButton.test.tsx +87 -0
- package/src/components/floating-action-button/FloatingActionButton.tsx +87 -0
- package/src/components/form-actions/FormActions.css +34 -0
- package/src/components/form-actions/FormActions.test.tsx +96 -0
- package/src/components/form-actions/FormActions.tsx +83 -0
- package/src/components/form-layout/FormLayout.css +148 -0
- package/src/components/form-layout/FormLayout.test.tsx +137 -0
- package/src/components/form-layout/FormLayout.tsx +177 -0
- package/src/components/glass-check-toggle/GlassCheckToggle.css +92 -0
- package/src/components/glass-check-toggle/GlassCheckToggle.rtl.test.tsx +12 -0
- package/src/components/glass-check-toggle/GlassCheckToggle.test.tsx +70 -0
- package/src/components/glass-check-toggle/GlassCheckToggle.tsx +75 -0
- package/src/components/gradient-mark/GradientMark.css +45 -0
- package/src/components/grouped-disclosure-list/GroupedDisclosureList.css +80 -0
- package/src/components/grouped-disclosure-list/GroupedDisclosureList.test.tsx +92 -0
- package/src/components/grouped-disclosure-list/GroupedDisclosureList.tsx +105 -0
- package/src/components/heading/Heading.css +67 -0
- package/src/components/heading/Heading.test.tsx +93 -0
- package/src/components/heading/Heading.tsx +60 -0
- package/src/components/highlight-stat/HighlightStat.css +50 -0
- package/src/components/highlight-stat/HighlightStat.rtl.test.tsx +13 -0
- package/src/components/highlight-stat/HighlightStat.test.tsx +83 -0
- package/src/components/highlight-stat/HighlightStat.tsx +66 -0
- package/src/components/history-list/HistoryList.css +116 -0
- package/src/components/history-list/HistoryList.test.tsx +88 -0
- package/src/components/history-list/HistoryList.tsx +115 -0
- package/src/components/http-error-page/HttpErrorPage.css +70 -0
- package/src/components/http-error-page/HttpErrorPage.rtl.test.tsx +12 -0
- package/src/components/http-error-page/HttpErrorPage.test.tsx +51 -0
- package/src/components/http-error-page/HttpErrorPage.tsx +70 -0
- package/src/components/image-picker/ImagePicker.css +151 -0
- package/src/components/image-picker/ImagePicker.test.tsx +133 -0
- package/src/components/image-picker/ImagePicker.tsx +167 -0
- package/src/components/inline-notice/InlineNotice.css +101 -0
- package/src/components/inline-notice/InlineNotice.test.tsx +123 -0
- package/src/components/inline-notice/InlineNotice.tsx +98 -0
- package/src/components/insight-card/InsightCard.css +109 -0
- package/src/components/insight-card/InsightCard.rtl.test.tsx +14 -0
- package/src/components/insight-card/InsightCard.test.tsx +102 -0
- package/src/components/insight-card/InsightCard.tsx +185 -0
- package/src/components/legal-document-frame/LegalDocumentFrame.css +163 -0
- package/src/components/legal-document-frame/LegalDocumentFrame.rtl.test.tsx +13 -0
- package/src/components/legal-document-frame/LegalDocumentFrame.test.tsx +123 -0
- package/src/components/legal-document-frame/LegalDocumentFrame.tsx +167 -0
- package/src/components/link/Link.css +76 -0
- package/src/components/link/Link.test.tsx +103 -0
- package/src/components/link/Link.tsx +87 -0
- package/src/components/list-panel/ListPanel.css +95 -0
- package/src/components/list-panel/ListPanel.test.tsx +128 -0
- package/src/components/list-panel/ListPanel.tsx +137 -0
- package/src/components/list-row/ListRow.css +81 -0
- package/src/components/list-row/ListRow.test.tsx +87 -0
- package/src/components/list-row/ListRow.tsx +68 -0
- package/src/components/listbox-select/ListboxSelect.css +263 -0
- package/src/components/listbox-select/ListboxSelect.test.tsx +157 -0
- package/src/components/listbox-select/ListboxSelect.tsx +178 -0
- package/src/components/live-report-view/LiveReportView.css +111 -0
- package/src/components/live-report-view/LiveReportView.rtl.test.tsx +14 -0
- package/src/components/live-report-view/LiveReportView.test.tsx +185 -0
- package/src/components/live-report-view/LiveReportView.tsx +135 -0
- package/src/components/live-report-view/runEvents.ts +103 -0
- package/src/components/live-report-view/useRunEventStream.ts +134 -0
- package/src/components/loader-presets/LoaderPresets.test.tsx +22 -0
- package/src/components/loader-presets/LoaderPresets.tsx +80 -0
- package/src/components/locale-picker/LocalePicker.css +91 -0
- package/src/components/locale-picker/LocalePicker.test.tsx +99 -0
- package/src/components/locale-picker/LocalePicker.tsx +128 -0
- package/src/components/long-press-menu/LongPressMenu.css +97 -0
- package/src/components/long-press-menu/LongPressMenu.test.tsx +106 -0
- package/src/components/long-press-menu/LongPressMenu.tsx +100 -0
- package/src/components/markdown-view/MarkdownView.css +93 -0
- package/src/components/markdown-view/MarkdownView.test.tsx +107 -0
- package/src/components/markdown-view/MarkdownView.tsx +96 -0
- package/src/components/markdown-view/parse.ts +152 -0
- package/src/components/metric-tile/MetricTile.css +104 -0
- package/src/components/metric-tile/MetricTile.rtl.test.tsx +12 -0
- package/src/components/metric-tile/MetricTile.test.tsx +70 -0
- package/src/components/metric-tile/MetricTile.tsx +59 -0
- package/src/components/modal-dialog/ModalDialog.css +165 -0
- package/src/components/modal-dialog/ModalDialog.test.tsx +158 -0
- package/src/components/modal-dialog/ModalDialog.tsx +112 -0
- package/src/components/month-field/MonthField.css +11 -0
- package/src/components/month-field/MonthField.test.tsx +101 -0
- package/src/components/month-field/MonthField.tsx +124 -0
- package/src/components/native-select/NativeSelect.css +246 -0
- package/src/components/native-select/NativeSelect.test.tsx +160 -0
- package/src/components/native-select/NativeSelect.tsx +234 -0
- package/src/components/navigation-flyout/NavigationFlyout.css +181 -0
- package/src/components/navigation-flyout/NavigationFlyout.test.tsx +111 -0
- package/src/components/navigation-flyout/NavigationFlyout.tsx +196 -0
- package/src/components/notification-center/NotificationCenter.css +187 -0
- package/src/components/notification-center/NotificationCenter.test.tsx +140 -0
- package/src/components/notification-center/NotificationCenter.tsx +229 -0
- package/src/components/one-time-code-field/OneTimeCodeField.css +62 -0
- package/src/components/one-time-code-field/OneTimeCodeField.test.tsx +150 -0
- package/src/components/one-time-code-field/OneTimeCodeField.tsx +176 -0
- package/src/components/page-dots/PageDots.css +90 -0
- package/src/components/page-dots/PageDots.test.tsx +87 -0
- package/src/components/page-dots/PageDots.tsx +95 -0
- package/src/components/page-header/PageHeader.css +271 -0
- package/src/components/page-header/PageHeader.test.tsx +185 -0
- package/src/components/page-header/PageHeader.tsx +194 -0
- package/src/components/pagination/Pagination.css +139 -0
- package/src/components/pagination/Pagination.test.tsx +104 -0
- package/src/components/pagination/Pagination.tsx +160 -0
- package/src/components/password-strength/PasswordStrength.css +85 -0
- package/src/components/password-strength/PasswordStrength.test.tsx +90 -0
- package/src/components/password-strength/PasswordStrength.tsx +109 -0
- package/src/components/phase-bar/PhaseBar.css +95 -0
- package/src/components/phase-bar/PhaseBar.test.tsx +67 -0
- package/src/components/phase-bar/PhaseBar.tsx +66 -0
- package/src/components/popover/Popover.css +130 -0
- package/src/components/popover/Popover.test.tsx +153 -0
- package/src/components/popover/Popover.tsx +110 -0
- package/src/components/product-mark/ProductMark.css +24 -0
- package/src/components/product-mark/ProductMark.test.tsx +48 -0
- package/src/components/product-mark/ProductMark.tsx +95 -0
- package/src/components/product-mark/marks.ts +115 -0
- package/src/components/product-mark/plate.ts +42 -0
- package/src/components/profile-avatar/ProfileAvatar.css +51 -0
- package/src/components/profile-avatar/ProfileAvatar.test.tsx +78 -0
- package/src/components/profile-avatar/ProfileAvatar.tsx +58 -0
- package/src/components/profile-summary/ProfileSummary.css +43 -0
- package/src/components/profile-summary/ProfileSummary.rtl.test.tsx +12 -0
- package/src/components/profile-summary/ProfileSummary.test.tsx +52 -0
- package/src/components/profile-summary/ProfileSummary.tsx +52 -0
- package/src/components/progress-bar/ProgressBar.css +100 -0
- package/src/components/progress-bar/ProgressBar.test.tsx +68 -0
- package/src/components/progress-bar/ProgressBar.tsx +76 -0
- package/src/components/proof-badge/ProofBadge.css +178 -0
- package/src/components/proof-badge/ProofBadge.test.tsx +95 -0
- package/src/components/proof-badge/ProofBadge.tsx +113 -0
- package/src/components/pull-to-refresh/PullToRefresh.css +99 -0
- package/src/components/pull-to-refresh/PullToRefresh.rtl.test.tsx +16 -0
- package/src/components/pull-to-refresh/PullToRefresh.test.tsx +117 -0
- package/src/components/pull-to-refresh/PullToRefresh.tsx +181 -0
- package/src/components/record-card/RecordCard.css +151 -0
- package/src/components/record-card/RecordCard.rtl.test.tsx +16 -0
- package/src/components/record-card/RecordCard.test.tsx +105 -0
- package/src/components/record-card/RecordCard.tsx +159 -0
- package/src/components/recovery-code-list/RecoveryCodeList.css +66 -0
- package/src/components/recovery-code-list/RecoveryCodeList.test.tsx +108 -0
- package/src/components/recovery-code-list/RecoveryCodeList.tsx +105 -0
- package/src/components/region-map/RegionMap.css +229 -0
- package/src/components/region-map/RegionMap.test.tsx +200 -0
- package/src/components/region-map/RegionMap.tsx +400 -0
- package/src/components/region-map/useRegionMapState.ts +92 -0
- package/src/components/region-theme/countryProfile.ts +110 -0
- package/src/components/region-theme/data/br-profile.ts +41 -0
- package/src/components/region-theme/data/br.ts +80 -0
- package/src/components/region-theme/format.ts +120 -0
- package/src/components/region-theme/geometry.ts +67 -0
- package/src/components/region-theme/index.ts +7 -0
- package/src/components/region-theme/regionTheme.test.tsx +200 -0
- package/src/components/region-theme/registry.ts +163 -0
- package/src/components/report-view/ReportView.css +323 -0
- package/src/components/report-view/ReportView.rtl.test.tsx +25 -0
- package/src/components/report-view/ReportView.test.tsx +141 -0
- package/src/components/report-view/ReportView.tsx +201 -0
- package/src/components/report-view/sections.tsx +281 -0
- package/src/components/report-view/types.ts +72 -0
- package/src/components/report-view/validateReport.ts +51 -0
- package/src/components/resizable-split/ResizableSplit.css +56 -0
- package/src/components/resizable-split/ResizableSplit.test.tsx +108 -0
- package/src/components/resizable-split/ResizableSplit.tsx +76 -0
- package/src/components/resizable-split/useSplitter.ts +72 -0
- package/src/components/reveal-number/RevealNumber.css +17 -0
- package/src/components/reveal-number/RevealNumber.rtl.test.tsx +13 -0
- package/src/components/reveal-number/RevealNumber.test.tsx +136 -0
- package/src/components/reveal-number/RevealNumber.tsx +115 -0
- package/src/components/route-progress/RouteProgress.css +54 -0
- package/src/components/route-progress/RouteProgress.rtl.test.tsx +16 -0
- package/src/components/route-progress/RouteProgress.test.tsx +62 -0
- package/src/components/route-progress/RouteProgress.tsx +63 -0
- package/src/components/ruled-grid/RuledGrid.css +86 -0
- package/src/components/ruled-grid/RuledGrid.rtl.test.tsx +13 -0
- package/src/components/ruled-grid/RuledGrid.test.tsx +92 -0
- package/src/components/ruled-grid/RuledGrid.tsx +73 -0
- package/src/components/safe-area-inset/SafeAreaInset.css +65 -0
- package/src/components/safe-area-inset/SafeAreaInset.rtl.test.tsx +17 -0
- package/src/components/safe-area-inset/SafeAreaInset.test.tsx +99 -0
- package/src/components/safe-area-inset/SafeAreaInset.tsx +101 -0
- package/src/components/schema-request-form/SchemaRequestForm.css +75 -0
- package/src/components/schema-request-form/SchemaRequestForm.test.tsx +138 -0
- package/src/components/schema-request-form/SchemaRequestForm.tsx +231 -0
- package/src/components/search-bar/SearchBar.css +117 -0
- package/src/components/search-bar/SearchBar.test.tsx +134 -0
- package/src/components/search-bar/SearchBar.tsx +176 -0
- package/src/components/section-heading/SectionHeading.css +68 -0
- package/src/components/section-heading/SectionHeading.test.tsx +65 -0
- package/src/components/section-heading/SectionHeading.tsx +61 -0
- package/src/components/section-panel/SectionPanel.css +207 -0
- package/src/components/section-panel/SectionPanel.test.tsx +122 -0
- package/src/components/section-panel/SectionPanel.tsx +139 -0
- package/src/components/sectioned-modal/SectionedModal.css +325 -0
- package/src/components/sectioned-modal/SectionedModal.test.tsx +138 -0
- package/src/components/sectioned-modal/SectionedModal.tsx +258 -0
- package/src/components/segmented-control/SegmentedControl.css +123 -0
- package/src/components/segmented-control/SegmentedControl.test.tsx +109 -0
- package/src/components/segmented-control/SegmentedControl.tsx +85 -0
- package/src/components/separator/Separator.css +61 -0
- package/src/components/separator/Separator.test.tsx +65 -0
- package/src/components/separator/Separator.tsx +46 -0
- package/src/components/settings-dialog/SettingsDialog.css +151 -0
- package/src/components/settings-dialog/SettingsDialog.test.tsx +155 -0
- package/src/components/settings-dialog/SettingsDialog.tsx +126 -0
- package/src/components/settings-dialog/settingsModel.ts +63 -0
- package/src/components/settings-dialog/settingsParts.tsx +149 -0
- package/src/components/showcase-backdrop/ShowcaseBackdrop.css +78 -0
- package/src/components/showcase-backdrop/ShowcaseBackdrop.rtl.test.tsx +12 -0
- package/src/components/showcase-backdrop/ShowcaseBackdrop.test.tsx +91 -0
- package/src/components/showcase-backdrop/ShowcaseBackdrop.tsx +47 -0
- package/src/components/showcase-heading/ShowcaseHeading.css +65 -0
- package/src/components/showcase-heading/ShowcaseHeading.rtl.test.tsx +13 -0
- package/src/components/showcase-heading/ShowcaseHeading.test.tsx +79 -0
- package/src/components/showcase-heading/ShowcaseHeading.tsx +67 -0
- package/src/components/skeleton/Skeleton.css +120 -0
- package/src/components/skeleton/Skeleton.test.tsx +96 -0
- package/src/components/skeleton/Skeleton.tsx +168 -0
- package/src/components/skeleton-fill/SkeletonFill.css +67 -0
- package/src/components/skeleton-fill/SkeletonFill.rtl.test.tsx +12 -0
- package/src/components/skeleton-fill/SkeletonFill.test.tsx +61 -0
- package/src/components/skeleton-fill/SkeletonFill.tsx +48 -0
- package/src/components/skip-link/SkipLink.css +52 -0
- package/src/components/skip-link/SkipLink.test.tsx +90 -0
- package/src/components/skip-link/SkipLink.tsx +42 -0
- package/src/components/spinner/Spinner.css +134 -0
- package/src/components/spinner/Spinner.test.tsx +99 -0
- package/src/components/spinner/Spinner.tsx +100 -0
- package/src/components/stage-strip/StageStrip.css +126 -0
- package/src/components/stage-strip/StageStrip.test.tsx +82 -0
- package/src/components/stage-strip/StageStrip.tsx +100 -0
- package/src/components/stat-strip/StatStrip.css +90 -0
- package/src/components/stat-strip/StatStrip.test.tsx +75 -0
- package/src/components/stat-strip/StatStrip.tsx +62 -0
- package/src/components/stat-tile/StatTile.css +171 -0
- package/src/components/stat-tile/StatTile.rtl.test.tsx +14 -0
- package/src/components/stat-tile/StatTile.test.tsx +90 -0
- package/src/components/stat-tile/StatTile.tsx +129 -0
- package/src/components/state-switch/StateSwitch.css +113 -0
- package/src/components/state-switch/StateSwitch.test.tsx +102 -0
- package/src/components/state-switch/StateSwitch.tsx +73 -0
- package/src/components/status-pill/StatusPill.css +85 -0
- package/src/components/status-pill/StatusPill.test.tsx +91 -0
- package/src/components/status-pill/StatusPill.tsx +73 -0
- package/src/components/step-list/StepList.css +181 -0
- package/src/components/step-list/StepList.test.tsx +93 -0
- package/src/components/step-list/StepList.tsx +118 -0
- package/src/components/summary-row/SummaryRow.css +85 -0
- package/src/components/summary-row/SummaryRow.test.tsx +77 -0
- package/src/components/summary-row/SummaryRow.tsx +72 -0
- package/src/components/surface/Surface.css +157 -0
- package/src/components/surface/Surface.test.tsx +97 -0
- package/src/components/surface/Surface.tsx +124 -0
- package/src/components/swipe-row/SwipeRow.css +131 -0
- package/src/components/swipe-row/SwipeRow.rtl.test.tsx +31 -0
- package/src/components/swipe-row/SwipeRow.test.tsx +124 -0
- package/src/components/swipe-row/SwipeRow.tsx +219 -0
- package/src/components/switch/Switch.css +182 -0
- package/src/components/switch/Switch.test.tsx +112 -0
- package/src/components/switch/Switch.tsx +125 -0
- package/src/components/tabs/Tabs.css +137 -0
- package/src/components/tabs/Tabs.test.tsx +127 -0
- package/src/components/tabs/Tabs.tsx +94 -0
- package/src/components/tag/Tag.css +146 -0
- package/src/components/tag/Tag.test.tsx +129 -0
- package/src/components/tag/Tag.tsx +168 -0
- package/src/components/tag-field/TagField.css +274 -0
- package/src/components/tag-field/TagField.test.tsx +156 -0
- package/src/components/tag-field/TagField.tsx +270 -0
- package/src/components/text/Text.css +84 -0
- package/src/components/text/Text.test.tsx +91 -0
- package/src/components/text/Text.tsx +84 -0
- package/src/components/text-area/TextArea.css +125 -0
- package/src/components/text-area/TextArea.test.tsx +97 -0
- package/src/components/text-area/TextArea.tsx +145 -0
- package/src/components/text-field/TextField.css +197 -0
- package/src/components/text-field/TextField.test.tsx +136 -0
- package/src/components/text-field/TextField.tsx +208 -0
- package/src/components/theme-palette/ThemePalette.css +262 -0
- package/src/components/theme-palette/ThemePalette.test.tsx +62 -0
- package/src/components/theme-palette/ThemePalette.tsx +377 -0
- package/src/components/theme-switcher/ThemeSwitcher.css +159 -0
- package/src/components/theme-switcher/ThemeSwitcher.test.tsx +71 -0
- package/src/components/theme-switcher/ThemeSwitcher.tsx +72 -0
- package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.css +56 -0
- package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.rtl.test.tsx +13 -0
- package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.test.tsx +100 -0
- package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.tsx +218 -0
- package/src/components/ticker-card/TickerCard.css +147 -0
- package/src/components/ticker-card/TickerCard.rtl.test.tsx +14 -0
- package/src/components/ticker-card/TickerCard.test.tsx +74 -0
- package/src/components/ticker-card/TickerCard.tsx +151 -0
- package/src/components/time-field/TimeField.css +69 -0
- package/src/components/time-field/TimeField.test.tsx +138 -0
- package/src/components/time-field/TimeField.tsx +205 -0
- package/src/components/toast/Toast.css +137 -0
- package/src/components/toast/Toast.test.tsx +269 -0
- package/src/components/toast/Toast.tsx +370 -0
- package/src/components/tone-tint/ToneTint.css +74 -0
- package/src/components/tone-tint/toneTint.test.tsx +74 -0
- package/src/components/tone-tint/toneTint.ts +57 -0
- package/src/components/toolbar-trigger/ToolbarTrigger.css +104 -0
- package/src/components/toolbar-trigger/ToolbarTrigger.test.tsx +75 -0
- package/src/components/toolbar-trigger/ToolbarTrigger.tsx +70 -0
- package/src/components/tooltip/Tooltip.css +70 -0
- package/src/components/tooltip/Tooltip.test.tsx +209 -0
- package/src/components/tooltip/Tooltip.tsx +102 -0
- package/src/components/tweened-number/TweenedNumber.css +7 -0
- package/src/components/tweened-number/TweenedNumber.rtl.test.tsx +19 -0
- package/src/components/tweened-number/TweenedNumber.test.tsx +97 -0
- package/src/components/tweened-number/TweenedNumber.tsx +70 -0
- package/src/components/upgrade-gate/UpgradeGate.css +94 -0
- package/src/components/upgrade-gate/UpgradeGate.rtl.test.tsx +12 -0
- package/src/components/upgrade-gate/UpgradeGate.test.tsx +56 -0
- package/src/components/upgrade-gate/UpgradeGate.tsx +56 -0
- package/src/components/wheel-picker/WheelPicker.css +149 -0
- package/src/components/wheel-picker/WheelPicker.test.tsx +150 -0
- package/src/components/wheel-picker/WheelPicker.tsx +228 -0
- package/src/components/wizard-page/WizardPage.css +114 -0
- package/src/components/wizard-page/WizardPage.test.tsx +117 -0
- package/src/components/wizard-page/WizardPage.tsx +123 -0
- package/src/elements/action-menu/definition.ts +123 -0
- package/src/elements/action-menu/element.ts +604 -0
- package/src/elements/anatomy.ts +55 -0
- package/src/elements/avatar/definition.ts +161 -0
- package/src/elements/avatar/element.ts +112 -0
- package/src/elements/base.ts +244 -0
- package/src/elements/brand-wordmark/definition.ts +37 -0
- package/src/elements/brand-wordmark/element.ts +13 -0
- package/src/elements/breadcrumbs/definition.ts +85 -0
- package/src/elements/breadcrumbs/element.ts +231 -0
- package/src/elements/button/definition.ts +74 -0
- package/src/elements/button/element.ts +25 -0
- package/src/elements/checkbox/definition.ts +132 -0
- package/src/elements/checkbox/element.ts +59 -0
- package/src/elements/command-palette/definition.ts +60 -0
- package/src/elements/command-palette/element.ts +706 -0
- package/src/elements/currency-field/definition.ts +159 -0
- package/src/elements/currency-field/element.ts +265 -0
- package/src/elements/data-table/definition.ts +54 -0
- package/src/elements/data-table/element.ts +440 -0
- package/src/elements/definition.ts +196 -0
- package/src/elements/drawer/definition.ts +156 -0
- package/src/elements/drawer/element.ts +304 -0
- package/src/elements/elements.css +156 -0
- package/src/elements/gradient-mark/definition.ts +41 -0
- package/src/elements/gradient-mark/element.ts +27 -0
- package/src/elements/heading/definition.ts +64 -0
- package/src/elements/heading/element.ts +14 -0
- package/src/elements/index.ts +146 -0
- package/src/elements/inline-notice/definition.ts +167 -0
- package/src/elements/inline-notice/element.ts +36 -0
- package/src/elements/link/definition.ts +70 -0
- package/src/elements/link/element.ts +40 -0
- package/src/elements/markdown-view/definition.ts +35 -0
- package/src/elements/markdown-view/element.ts +183 -0
- package/src/elements/modal/definition.ts +175 -0
- package/src/elements/modal/element.ts +226 -0
- package/src/elements/native-select/definition.ts +143 -0
- package/src/elements/native-select/element.ts +34 -0
- package/src/elements/notification-center/definition.ts +236 -0
- package/src/elements/notification-center/element.ts +527 -0
- package/src/elements/page-header/definition.ts +151 -0
- package/src/elements/page-header/element.ts +37 -0
- package/src/elements/popover/definition.ts +137 -0
- package/src/elements/popover/element.ts +196 -0
- package/src/elements/popover/model.ts +141 -0
- package/src/elements/progress-bar/definition.ts +84 -0
- package/src/elements/progress-bar/element.ts +82 -0
- package/src/elements/react/TyActionMenu.ts +79 -0
- package/src/elements/react/TyAvatar.ts +129 -0
- package/src/elements/react/TyBrandWordmark.ts +51 -0
- package/src/elements/react/TyBreadcrumbs.ts +82 -0
- package/src/elements/react/TyButton.ts +98 -0
- package/src/elements/react/TyCheckbox.ts +92 -0
- package/src/elements/react/TyCommandPalette.ts +120 -0
- package/src/elements/react/TyCurrencyField.ts +126 -0
- package/src/elements/react/TyDataTable.ts +105 -0
- package/src/elements/react/TyDrawer.ts +99 -0
- package/src/elements/react/TyGradientMark.ts +52 -0
- package/src/elements/react/TyHeading.ts +65 -0
- package/src/elements/react/TyInlineNotice.ts +191 -0
- package/src/elements/react/TyLink.ts +65 -0
- package/src/elements/react/TyMarkdownView.ts +46 -0
- package/src/elements/react/TyModal.ts +118 -0
- package/src/elements/react/TyNativeSelect.ts +96 -0
- package/src/elements/react/TyNotificationCenter.ts +153 -0
- package/src/elements/react/TyPageHeader.ts +126 -0
- package/src/elements/react/TyPopover.ts +95 -0
- package/src/elements/react/TyProgressBar.ts +72 -0
- package/src/elements/react/TySectionHeading.ts +78 -0
- package/src/elements/react/TySegmentedControl.ts +64 -0
- package/src/elements/react/TySeparator.ts +51 -0
- package/src/elements/react/TySkeleton.ts +61 -0
- package/src/elements/react/TySkipLink.ts +39 -0
- package/src/elements/react/TySpinner.ts +55 -0
- package/src/elements/react/TyStatusPill.ts +66 -0
- package/src/elements/react/TySurface.ts +104 -0
- package/src/elements/react/TySwitch.ts +77 -0
- package/src/elements/react/TyTabs.ts +66 -0
- package/src/elements/react/TyTag.ts +71 -0
- package/src/elements/react/TyTagField.ts +90 -0
- package/src/elements/react/TyTextArea.ts +124 -0
- package/src/elements/react/TyTextField.ts +186 -0
- package/src/elements/react/TyThemePalette.ts +126 -0
- package/src/elements/react/TyToast.ts +57 -0
- package/src/elements/react/TyWheelPicker.ts +60 -0
- package/src/elements/react/index.ts +39 -0
- package/src/elements/register.ts +7 -0
- package/src/elements/section-heading/definition.ts +81 -0
- package/src/elements/section-heading/element.ts +15 -0
- package/src/elements/segmented-control/definition.ts +72 -0
- package/src/elements/segmented-control/element.ts +253 -0
- package/src/elements/separator/definition.ts +44 -0
- package/src/elements/separator/element.ts +13 -0
- package/src/elements/skeleton/definition.ts +91 -0
- package/src/elements/skeleton/element.ts +175 -0
- package/src/elements/skip-link/definition.ts +26 -0
- package/src/elements/skip-link/element.ts +75 -0
- package/src/elements/spinner/definition.ts +52 -0
- package/src/elements/spinner/element.ts +58 -0
- package/src/elements/status-pill/definition.ts +48 -0
- package/src/elements/status-pill/element.ts +50 -0
- package/src/elements/surface/definition.ts +93 -0
- package/src/elements/surface/element.ts +42 -0
- package/src/elements/switch/definition.ts +72 -0
- package/src/elements/switch/element.ts +65 -0
- package/src/elements/tabs/definition.ts +60 -0
- package/src/elements/tabs/element.ts +319 -0
- package/src/elements/tag/definition.ts +69 -0
- package/src/elements/tag/element.ts +35 -0
- package/src/elements/tag-field/definition.ts +51 -0
- package/src/elements/tag-field/element.ts +461 -0
- package/src/elements/text-area/definition.ts +137 -0
- package/src/elements/text-area/element.ts +113 -0
- package/src/elements/text-field/definition.ts +236 -0
- package/src/elements/text-field/element.ts +151 -0
- package/src/elements/theme-palette/definition.ts +52 -0
- package/src/elements/theme-palette/element.ts +372 -0
- package/src/elements/theme-palette/model.ts +140 -0
- package/src/elements/toast/definition.ts +42 -0
- package/src/elements/toast/element.ts +479 -0
- package/src/elements/wheel-picker/definition.ts +39 -0
- package/src/elements/wheel-picker/element.ts +407 -0
- package/src/flags/Flag.css +58 -0
- package/src/flags/Flag.tsx +70 -0
- package/src/flags/art/1x1/ad.ts +2 -0
- package/src/flags/art/1x1/ae.ts +2 -0
- package/src/flags/art/1x1/af.ts +2 -0
- package/src/flags/art/1x1/ag.ts +2 -0
- package/src/flags/art/1x1/ai.ts +2 -0
- package/src/flags/art/1x1/al.ts +2 -0
- package/src/flags/art/1x1/am.ts +2 -0
- package/src/flags/art/1x1/ao.ts +2 -0
- package/src/flags/art/1x1/aq.ts +2 -0
- package/src/flags/art/1x1/ar.ts +2 -0
- package/src/flags/art/1x1/arab.ts +2 -0
- package/src/flags/art/1x1/as.ts +2 -0
- package/src/flags/art/1x1/asean.ts +2 -0
- package/src/flags/art/1x1/at.ts +2 -0
- package/src/flags/art/1x1/au.ts +2 -0
- package/src/flags/art/1x1/aw.ts +2 -0
- package/src/flags/art/1x1/ax.ts +2 -0
- package/src/flags/art/1x1/az.ts +2 -0
- package/src/flags/art/1x1/ba.ts +2 -0
- package/src/flags/art/1x1/bb.ts +2 -0
- package/src/flags/art/1x1/bd.ts +2 -0
- package/src/flags/art/1x1/be.ts +2 -0
- package/src/flags/art/1x1/bf.ts +2 -0
- package/src/flags/art/1x1/bg.ts +2 -0
- package/src/flags/art/1x1/bh.ts +2 -0
- package/src/flags/art/1x1/bi.ts +2 -0
- package/src/flags/art/1x1/bj.ts +2 -0
- package/src/flags/art/1x1/bl.ts +2 -0
- package/src/flags/art/1x1/bm.ts +2 -0
- package/src/flags/art/1x1/bn.ts +2 -0
- package/src/flags/art/1x1/bo.ts +2 -0
- package/src/flags/art/1x1/bq.ts +2 -0
- package/src/flags/art/1x1/br.ts +2 -0
- package/src/flags/art/1x1/bs.ts +2 -0
- package/src/flags/art/1x1/bt.ts +2 -0
- package/src/flags/art/1x1/bv.ts +2 -0
- package/src/flags/art/1x1/bw.ts +2 -0
- package/src/flags/art/1x1/by.ts +2 -0
- package/src/flags/art/1x1/bz.ts +2 -0
- package/src/flags/art/1x1/ca.ts +2 -0
- package/src/flags/art/1x1/cc.ts +2 -0
- package/src/flags/art/1x1/cd.ts +2 -0
- package/src/flags/art/1x1/cefta.ts +2 -0
- package/src/flags/art/1x1/cf.ts +2 -0
- package/src/flags/art/1x1/cg.ts +2 -0
- package/src/flags/art/1x1/ch.ts +2 -0
- package/src/flags/art/1x1/ci.ts +2 -0
- package/src/flags/art/1x1/ck.ts +2 -0
- package/src/flags/art/1x1/cl.ts +2 -0
- package/src/flags/art/1x1/cm.ts +2 -0
- package/src/flags/art/1x1/cn.ts +2 -0
- package/src/flags/art/1x1/co.ts +2 -0
- package/src/flags/art/1x1/cp.ts +2 -0
- package/src/flags/art/1x1/cr.ts +2 -0
- package/src/flags/art/1x1/cu.ts +2 -0
- package/src/flags/art/1x1/cv.ts +2 -0
- package/src/flags/art/1x1/cw.ts +2 -0
- package/src/flags/art/1x1/cx.ts +2 -0
- package/src/flags/art/1x1/cy.ts +2 -0
- package/src/flags/art/1x1/cz.ts +2 -0
- package/src/flags/art/1x1/de.ts +2 -0
- package/src/flags/art/1x1/dg.ts +2 -0
- package/src/flags/art/1x1/dj.ts +2 -0
- package/src/flags/art/1x1/dk.ts +2 -0
- package/src/flags/art/1x1/dm.ts +2 -0
- package/src/flags/art/1x1/do.ts +2 -0
- package/src/flags/art/1x1/dz.ts +2 -0
- package/src/flags/art/1x1/eac.ts +2 -0
- package/src/flags/art/1x1/ec.ts +2 -0
- package/src/flags/art/1x1/ee.ts +2 -0
- package/src/flags/art/1x1/eg.ts +2 -0
- package/src/flags/art/1x1/eh.ts +2 -0
- package/src/flags/art/1x1/er.ts +2 -0
- package/src/flags/art/1x1/es-ct.ts +2 -0
- package/src/flags/art/1x1/es-ga.ts +2 -0
- package/src/flags/art/1x1/es-pv.ts +2 -0
- package/src/flags/art/1x1/es.ts +2 -0
- package/src/flags/art/1x1/et.ts +2 -0
- package/src/flags/art/1x1/eu.ts +2 -0
- package/src/flags/art/1x1/fi.ts +2 -0
- package/src/flags/art/1x1/fj.ts +2 -0
- package/src/flags/art/1x1/fk.ts +2 -0
- package/src/flags/art/1x1/fm.ts +2 -0
- package/src/flags/art/1x1/fo.ts +2 -0
- package/src/flags/art/1x1/fr.ts +2 -0
- package/src/flags/art/1x1/ga.ts +2 -0
- package/src/flags/art/1x1/gb-eng.ts +2 -0
- package/src/flags/art/1x1/gb-nir.ts +2 -0
- package/src/flags/art/1x1/gb-sct.ts +2 -0
- package/src/flags/art/1x1/gb-wls.ts +2 -0
- package/src/flags/art/1x1/gb.ts +2 -0
- package/src/flags/art/1x1/gd.ts +2 -0
- package/src/flags/art/1x1/ge.ts +2 -0
- package/src/flags/art/1x1/gf.ts +2 -0
- package/src/flags/art/1x1/gg.ts +2 -0
- package/src/flags/art/1x1/gh.ts +2 -0
- package/src/flags/art/1x1/gi.ts +2 -0
- package/src/flags/art/1x1/gl.ts +2 -0
- package/src/flags/art/1x1/gm.ts +2 -0
- package/src/flags/art/1x1/gn.ts +2 -0
- package/src/flags/art/1x1/gp.ts +2 -0
- package/src/flags/art/1x1/gq.ts +2 -0
- package/src/flags/art/1x1/gr.ts +2 -0
- package/src/flags/art/1x1/gs.ts +2 -0
- package/src/flags/art/1x1/gt.ts +2 -0
- package/src/flags/art/1x1/gu.ts +2 -0
- package/src/flags/art/1x1/gw.ts +2 -0
- package/src/flags/art/1x1/gy.ts +2 -0
- package/src/flags/art/1x1/hk.ts +2 -0
- package/src/flags/art/1x1/hm.ts +2 -0
- package/src/flags/art/1x1/hn.ts +2 -0
- package/src/flags/art/1x1/hr.ts +2 -0
- package/src/flags/art/1x1/ht.ts +2 -0
- package/src/flags/art/1x1/hu.ts +2 -0
- package/src/flags/art/1x1/ic.ts +2 -0
- package/src/flags/art/1x1/id.ts +2 -0
- package/src/flags/art/1x1/ie.ts +2 -0
- package/src/flags/art/1x1/il.ts +2 -0
- package/src/flags/art/1x1/im.ts +2 -0
- package/src/flags/art/1x1/in.ts +2 -0
- package/src/flags/art/1x1/io.ts +2 -0
- package/src/flags/art/1x1/iq.ts +2 -0
- package/src/flags/art/1x1/ir.ts +2 -0
- package/src/flags/art/1x1/is.ts +2 -0
- package/src/flags/art/1x1/it.ts +2 -0
- package/src/flags/art/1x1/je.ts +2 -0
- package/src/flags/art/1x1/jm.ts +2 -0
- package/src/flags/art/1x1/jo.ts +2 -0
- package/src/flags/art/1x1/jp.ts +2 -0
- package/src/flags/art/1x1/ke.ts +2 -0
- package/src/flags/art/1x1/kg.ts +2 -0
- package/src/flags/art/1x1/kh.ts +2 -0
- package/src/flags/art/1x1/ki.ts +2 -0
- package/src/flags/art/1x1/km.ts +2 -0
- package/src/flags/art/1x1/kn.ts +2 -0
- package/src/flags/art/1x1/kp.ts +2 -0
- package/src/flags/art/1x1/kr.ts +2 -0
- package/src/flags/art/1x1/kw.ts +2 -0
- package/src/flags/art/1x1/ky.ts +2 -0
- package/src/flags/art/1x1/kz.ts +2 -0
- package/src/flags/art/1x1/la.ts +2 -0
- package/src/flags/art/1x1/lb.ts +2 -0
- package/src/flags/art/1x1/lc.ts +2 -0
- package/src/flags/art/1x1/li.ts +2 -0
- package/src/flags/art/1x1/lk.ts +2 -0
- package/src/flags/art/1x1/lr.ts +2 -0
- package/src/flags/art/1x1/ls.ts +2 -0
- package/src/flags/art/1x1/lt.ts +2 -0
- package/src/flags/art/1x1/lu.ts +2 -0
- package/src/flags/art/1x1/lv.ts +2 -0
- package/src/flags/art/1x1/ly.ts +2 -0
- package/src/flags/art/1x1/ma.ts +2 -0
- package/src/flags/art/1x1/mc.ts +2 -0
- package/src/flags/art/1x1/md.ts +2 -0
- package/src/flags/art/1x1/me.ts +2 -0
- package/src/flags/art/1x1/mf.ts +2 -0
- package/src/flags/art/1x1/mg.ts +2 -0
- package/src/flags/art/1x1/mh.ts +2 -0
- package/src/flags/art/1x1/mk.ts +2 -0
- package/src/flags/art/1x1/ml.ts +2 -0
- package/src/flags/art/1x1/mm.ts +2 -0
- package/src/flags/art/1x1/mn.ts +2 -0
- package/src/flags/art/1x1/mo.ts +2 -0
- package/src/flags/art/1x1/mp.ts +2 -0
- package/src/flags/art/1x1/mq.ts +2 -0
- package/src/flags/art/1x1/mr.ts +2 -0
- package/src/flags/art/1x1/ms.ts +2 -0
- package/src/flags/art/1x1/mt.ts +2 -0
- package/src/flags/art/1x1/mu.ts +2 -0
- package/src/flags/art/1x1/mv.ts +2 -0
- package/src/flags/art/1x1/mw.ts +2 -0
- package/src/flags/art/1x1/mx.ts +2 -0
- package/src/flags/art/1x1/my.ts +2 -0
- package/src/flags/art/1x1/mz.ts +2 -0
- package/src/flags/art/1x1/na.ts +2 -0
- package/src/flags/art/1x1/nc.ts +2 -0
- package/src/flags/art/1x1/ne.ts +2 -0
- package/src/flags/art/1x1/nf.ts +2 -0
- package/src/flags/art/1x1/ng.ts +2 -0
- package/src/flags/art/1x1/ni.ts +2 -0
- package/src/flags/art/1x1/nl.ts +2 -0
- package/src/flags/art/1x1/no.ts +2 -0
- package/src/flags/art/1x1/np.ts +2 -0
- package/src/flags/art/1x1/nr.ts +2 -0
- package/src/flags/art/1x1/nu.ts +2 -0
- package/src/flags/art/1x1/nz.ts +2 -0
- package/src/flags/art/1x1/om.ts +2 -0
- package/src/flags/art/1x1/pa.ts +2 -0
- package/src/flags/art/1x1/pc.ts +2 -0
- package/src/flags/art/1x1/pe.ts +2 -0
- package/src/flags/art/1x1/pf.ts +2 -0
- package/src/flags/art/1x1/pg.ts +2 -0
- package/src/flags/art/1x1/ph.ts +2 -0
- package/src/flags/art/1x1/pk.ts +2 -0
- package/src/flags/art/1x1/pl.ts +2 -0
- package/src/flags/art/1x1/pm.ts +2 -0
- package/src/flags/art/1x1/pn.ts +2 -0
- package/src/flags/art/1x1/pr.ts +2 -0
- package/src/flags/art/1x1/ps.ts +2 -0
- package/src/flags/art/1x1/pt.ts +2 -0
- package/src/flags/art/1x1/pw.ts +2 -0
- package/src/flags/art/1x1/py.ts +2 -0
- package/src/flags/art/1x1/qa.ts +2 -0
- package/src/flags/art/1x1/re.ts +2 -0
- package/src/flags/art/1x1/ro.ts +2 -0
- package/src/flags/art/1x1/rs.ts +2 -0
- package/src/flags/art/1x1/ru.ts +2 -0
- package/src/flags/art/1x1/rw.ts +2 -0
- package/src/flags/art/1x1/sa.ts +2 -0
- package/src/flags/art/1x1/sb.ts +2 -0
- package/src/flags/art/1x1/sc.ts +2 -0
- package/src/flags/art/1x1/sd.ts +2 -0
- package/src/flags/art/1x1/se.ts +2 -0
- package/src/flags/art/1x1/sg.ts +2 -0
- package/src/flags/art/1x1/sh-ac.ts +2 -0
- package/src/flags/art/1x1/sh-hl.ts +2 -0
- package/src/flags/art/1x1/sh-ta.ts +2 -0
- package/src/flags/art/1x1/sh.ts +2 -0
- package/src/flags/art/1x1/si.ts +2 -0
- package/src/flags/art/1x1/sj.ts +2 -0
- package/src/flags/art/1x1/sk.ts +2 -0
- package/src/flags/art/1x1/sl.ts +2 -0
- package/src/flags/art/1x1/sm.ts +2 -0
- package/src/flags/art/1x1/sn.ts +2 -0
- package/src/flags/art/1x1/so.ts +2 -0
- package/src/flags/art/1x1/sr.ts +2 -0
- package/src/flags/art/1x1/ss.ts +2 -0
- package/src/flags/art/1x1/st.ts +2 -0
- package/src/flags/art/1x1/sv.ts +2 -0
- package/src/flags/art/1x1/sx.ts +2 -0
- package/src/flags/art/1x1/sy.ts +2 -0
- package/src/flags/art/1x1/sz.ts +2 -0
- package/src/flags/art/1x1/tc.ts +2 -0
- package/src/flags/art/1x1/td.ts +2 -0
- package/src/flags/art/1x1/tf.ts +2 -0
- package/src/flags/art/1x1/tg.ts +2 -0
- package/src/flags/art/1x1/th.ts +2 -0
- package/src/flags/art/1x1/tj.ts +2 -0
- package/src/flags/art/1x1/tk.ts +2 -0
- package/src/flags/art/1x1/tl.ts +2 -0
- package/src/flags/art/1x1/tm.ts +2 -0
- package/src/flags/art/1x1/tn.ts +2 -0
- package/src/flags/art/1x1/to.ts +2 -0
- package/src/flags/art/1x1/tr.ts +2 -0
- package/src/flags/art/1x1/tt.ts +2 -0
- package/src/flags/art/1x1/tv.ts +2 -0
- package/src/flags/art/1x1/tw.ts +2 -0
- package/src/flags/art/1x1/tz.ts +2 -0
- package/src/flags/art/1x1/ua.ts +2 -0
- package/src/flags/art/1x1/ug.ts +2 -0
- package/src/flags/art/1x1/um.ts +2 -0
- package/src/flags/art/1x1/un.ts +2 -0
- package/src/flags/art/1x1/us.ts +2 -0
- package/src/flags/art/1x1/uy.ts +2 -0
- package/src/flags/art/1x1/uz.ts +2 -0
- package/src/flags/art/1x1/va.ts +2 -0
- package/src/flags/art/1x1/vc.ts +2 -0
- package/src/flags/art/1x1/ve.ts +2 -0
- package/src/flags/art/1x1/vg.ts +2 -0
- package/src/flags/art/1x1/vi.ts +2 -0
- package/src/flags/art/1x1/vn.ts +2 -0
- package/src/flags/art/1x1/vu.ts +2 -0
- package/src/flags/art/1x1/wf.ts +2 -0
- package/src/flags/art/1x1/ws.ts +2 -0
- package/src/flags/art/1x1/xk.ts +2 -0
- package/src/flags/art/1x1/xx.ts +2 -0
- package/src/flags/art/1x1/ye.ts +2 -0
- package/src/flags/art/1x1/yt.ts +2 -0
- package/src/flags/art/1x1/za.ts +2 -0
- package/src/flags/art/1x1/zm.ts +2 -0
- package/src/flags/art/1x1/zw.ts +2 -0
- package/src/flags/art/4x3/ad.ts +2 -0
- package/src/flags/art/4x3/ae.ts +2 -0
- package/src/flags/art/4x3/af.ts +2 -0
- package/src/flags/art/4x3/ag.ts +2 -0
- package/src/flags/art/4x3/ai.ts +2 -0
- package/src/flags/art/4x3/al.ts +2 -0
- package/src/flags/art/4x3/am.ts +2 -0
- package/src/flags/art/4x3/ao.ts +2 -0
- package/src/flags/art/4x3/aq.ts +2 -0
- package/src/flags/art/4x3/ar.ts +2 -0
- package/src/flags/art/4x3/arab.ts +2 -0
- package/src/flags/art/4x3/as.ts +2 -0
- package/src/flags/art/4x3/asean.ts +2 -0
- package/src/flags/art/4x3/at.ts +2 -0
- package/src/flags/art/4x3/au.ts +2 -0
- package/src/flags/art/4x3/aw.ts +2 -0
- package/src/flags/art/4x3/ax.ts +2 -0
- package/src/flags/art/4x3/az.ts +2 -0
- package/src/flags/art/4x3/ba.ts +2 -0
- package/src/flags/art/4x3/bb.ts +2 -0
- package/src/flags/art/4x3/bd.ts +2 -0
- package/src/flags/art/4x3/be.ts +2 -0
- package/src/flags/art/4x3/bf.ts +2 -0
- package/src/flags/art/4x3/bg.ts +2 -0
- package/src/flags/art/4x3/bh.ts +2 -0
- package/src/flags/art/4x3/bi.ts +2 -0
- package/src/flags/art/4x3/bj.ts +2 -0
- package/src/flags/art/4x3/bl.ts +2 -0
- package/src/flags/art/4x3/bm.ts +2 -0
- package/src/flags/art/4x3/bn.ts +2 -0
- package/src/flags/art/4x3/bo.ts +2 -0
- package/src/flags/art/4x3/bq.ts +2 -0
- package/src/flags/art/4x3/br.ts +2 -0
- package/src/flags/art/4x3/bs.ts +2 -0
- package/src/flags/art/4x3/bt.ts +2 -0
- package/src/flags/art/4x3/bv.ts +2 -0
- package/src/flags/art/4x3/bw.ts +2 -0
- package/src/flags/art/4x3/by.ts +2 -0
- package/src/flags/art/4x3/bz.ts +2 -0
- package/src/flags/art/4x3/ca.ts +2 -0
- package/src/flags/art/4x3/cc.ts +2 -0
- package/src/flags/art/4x3/cd.ts +2 -0
- package/src/flags/art/4x3/cefta.ts +2 -0
- package/src/flags/art/4x3/cf.ts +2 -0
- package/src/flags/art/4x3/cg.ts +2 -0
- package/src/flags/art/4x3/ch.ts +2 -0
- package/src/flags/art/4x3/ci.ts +2 -0
- package/src/flags/art/4x3/ck.ts +2 -0
- package/src/flags/art/4x3/cl.ts +2 -0
- package/src/flags/art/4x3/cm.ts +2 -0
- package/src/flags/art/4x3/cn.ts +2 -0
- package/src/flags/art/4x3/co.ts +2 -0
- package/src/flags/art/4x3/cp.ts +2 -0
- package/src/flags/art/4x3/cr.ts +2 -0
- package/src/flags/art/4x3/cu.ts +2 -0
- package/src/flags/art/4x3/cv.ts +2 -0
- package/src/flags/art/4x3/cw.ts +2 -0
- package/src/flags/art/4x3/cx.ts +2 -0
- package/src/flags/art/4x3/cy.ts +2 -0
- package/src/flags/art/4x3/cz.ts +2 -0
- package/src/flags/art/4x3/de.ts +2 -0
- package/src/flags/art/4x3/dg.ts +2 -0
- package/src/flags/art/4x3/dj.ts +2 -0
- package/src/flags/art/4x3/dk.ts +2 -0
- package/src/flags/art/4x3/dm.ts +2 -0
- package/src/flags/art/4x3/do.ts +2 -0
- package/src/flags/art/4x3/dz.ts +2 -0
- package/src/flags/art/4x3/eac.ts +2 -0
- package/src/flags/art/4x3/ec.ts +2 -0
- package/src/flags/art/4x3/ee.ts +2 -0
- package/src/flags/art/4x3/eg.ts +2 -0
- package/src/flags/art/4x3/eh.ts +2 -0
- package/src/flags/art/4x3/er.ts +2 -0
- package/src/flags/art/4x3/es-ct.ts +2 -0
- package/src/flags/art/4x3/es-ga.ts +2 -0
- package/src/flags/art/4x3/es-pv.ts +2 -0
- package/src/flags/art/4x3/es.ts +2 -0
- package/src/flags/art/4x3/et.ts +2 -0
- package/src/flags/art/4x3/eu.ts +2 -0
- package/src/flags/art/4x3/fi.ts +2 -0
- package/src/flags/art/4x3/fj.ts +2 -0
- package/src/flags/art/4x3/fk.ts +2 -0
- package/src/flags/art/4x3/fm.ts +2 -0
- package/src/flags/art/4x3/fo.ts +2 -0
- package/src/flags/art/4x3/fr.ts +2 -0
- package/src/flags/art/4x3/ga.ts +2 -0
- package/src/flags/art/4x3/gb-eng.ts +2 -0
- package/src/flags/art/4x3/gb-nir.ts +2 -0
- package/src/flags/art/4x3/gb-sct.ts +2 -0
- package/src/flags/art/4x3/gb-wls.ts +2 -0
- package/src/flags/art/4x3/gb.ts +2 -0
- package/src/flags/art/4x3/gd.ts +2 -0
- package/src/flags/art/4x3/ge.ts +2 -0
- package/src/flags/art/4x3/gf.ts +2 -0
- package/src/flags/art/4x3/gg.ts +2 -0
- package/src/flags/art/4x3/gh.ts +2 -0
- package/src/flags/art/4x3/gi.ts +2 -0
- package/src/flags/art/4x3/gl.ts +2 -0
- package/src/flags/art/4x3/gm.ts +2 -0
- package/src/flags/art/4x3/gn.ts +2 -0
- package/src/flags/art/4x3/gp.ts +2 -0
- package/src/flags/art/4x3/gq.ts +2 -0
- package/src/flags/art/4x3/gr.ts +2 -0
- package/src/flags/art/4x3/gs.ts +2 -0
- package/src/flags/art/4x3/gt.ts +2 -0
- package/src/flags/art/4x3/gu.ts +2 -0
- package/src/flags/art/4x3/gw.ts +2 -0
- package/src/flags/art/4x3/gy.ts +2 -0
- package/src/flags/art/4x3/hk.ts +2 -0
- package/src/flags/art/4x3/hm.ts +2 -0
- package/src/flags/art/4x3/hn.ts +2 -0
- package/src/flags/art/4x3/hr.ts +2 -0
- package/src/flags/art/4x3/ht.ts +2 -0
- package/src/flags/art/4x3/hu.ts +2 -0
- package/src/flags/art/4x3/ic.ts +2 -0
- package/src/flags/art/4x3/id.ts +2 -0
- package/src/flags/art/4x3/ie.ts +2 -0
- package/src/flags/art/4x3/il.ts +2 -0
- package/src/flags/art/4x3/im.ts +2 -0
- package/src/flags/art/4x3/in.ts +2 -0
- package/src/flags/art/4x3/io.ts +2 -0
- package/src/flags/art/4x3/iq.ts +2 -0
- package/src/flags/art/4x3/ir.ts +2 -0
- package/src/flags/art/4x3/is.ts +2 -0
- package/src/flags/art/4x3/it.ts +2 -0
- package/src/flags/art/4x3/je.ts +2 -0
- package/src/flags/art/4x3/jm.ts +2 -0
- package/src/flags/art/4x3/jo.ts +2 -0
- package/src/flags/art/4x3/jp.ts +2 -0
- package/src/flags/art/4x3/ke.ts +2 -0
- package/src/flags/art/4x3/kg.ts +2 -0
- package/src/flags/art/4x3/kh.ts +2 -0
- package/src/flags/art/4x3/ki.ts +2 -0
- package/src/flags/art/4x3/km.ts +2 -0
- package/src/flags/art/4x3/kn.ts +2 -0
- package/src/flags/art/4x3/kp.ts +2 -0
- package/src/flags/art/4x3/kr.ts +2 -0
- package/src/flags/art/4x3/kw.ts +2 -0
- package/src/flags/art/4x3/ky.ts +2 -0
- package/src/flags/art/4x3/kz.ts +2 -0
- package/src/flags/art/4x3/la.ts +2 -0
- package/src/flags/art/4x3/lb.ts +2 -0
- package/src/flags/art/4x3/lc.ts +2 -0
- package/src/flags/art/4x3/li.ts +2 -0
- package/src/flags/art/4x3/lk.ts +2 -0
- package/src/flags/art/4x3/lr.ts +2 -0
- package/src/flags/art/4x3/ls.ts +2 -0
- package/src/flags/art/4x3/lt.ts +2 -0
- package/src/flags/art/4x3/lu.ts +2 -0
- package/src/flags/art/4x3/lv.ts +2 -0
- package/src/flags/art/4x3/ly.ts +2 -0
- package/src/flags/art/4x3/ma.ts +2 -0
- package/src/flags/art/4x3/mc.ts +2 -0
- package/src/flags/art/4x3/md.ts +2 -0
- package/src/flags/art/4x3/me.ts +2 -0
- package/src/flags/art/4x3/mf.ts +2 -0
- package/src/flags/art/4x3/mg.ts +2 -0
- package/src/flags/art/4x3/mh.ts +2 -0
- package/src/flags/art/4x3/mk.ts +2 -0
- package/src/flags/art/4x3/ml.ts +2 -0
- package/src/flags/art/4x3/mm.ts +2 -0
- package/src/flags/art/4x3/mn.ts +2 -0
- package/src/flags/art/4x3/mo.ts +2 -0
- package/src/flags/art/4x3/mp.ts +2 -0
- package/src/flags/art/4x3/mq.ts +2 -0
- package/src/flags/art/4x3/mr.ts +2 -0
- package/src/flags/art/4x3/ms.ts +2 -0
- package/src/flags/art/4x3/mt.ts +2 -0
- package/src/flags/art/4x3/mu.ts +2 -0
- package/src/flags/art/4x3/mv.ts +2 -0
- package/src/flags/art/4x3/mw.ts +2 -0
- package/src/flags/art/4x3/mx.ts +2 -0
- package/src/flags/art/4x3/my.ts +2 -0
- package/src/flags/art/4x3/mz.ts +2 -0
- package/src/flags/art/4x3/na.ts +2 -0
- package/src/flags/art/4x3/nc.ts +2 -0
- package/src/flags/art/4x3/ne.ts +2 -0
- package/src/flags/art/4x3/nf.ts +2 -0
- package/src/flags/art/4x3/ng.ts +2 -0
- package/src/flags/art/4x3/ni.ts +2 -0
- package/src/flags/art/4x3/nl.ts +2 -0
- package/src/flags/art/4x3/no.ts +2 -0
- package/src/flags/art/4x3/np.ts +2 -0
- package/src/flags/art/4x3/nr.ts +2 -0
- package/src/flags/art/4x3/nu.ts +2 -0
- package/src/flags/art/4x3/nz.ts +2 -0
- package/src/flags/art/4x3/om.ts +2 -0
- package/src/flags/art/4x3/pa.ts +2 -0
- package/src/flags/art/4x3/pc.ts +2 -0
- package/src/flags/art/4x3/pe.ts +2 -0
- package/src/flags/art/4x3/pf.ts +2 -0
- package/src/flags/art/4x3/pg.ts +2 -0
- package/src/flags/art/4x3/ph.ts +2 -0
- package/src/flags/art/4x3/pk.ts +2 -0
- package/src/flags/art/4x3/pl.ts +2 -0
- package/src/flags/art/4x3/pm.ts +2 -0
- package/src/flags/art/4x3/pn.ts +2 -0
- package/src/flags/art/4x3/pr.ts +2 -0
- package/src/flags/art/4x3/ps.ts +2 -0
- package/src/flags/art/4x3/pt.ts +2 -0
- package/src/flags/art/4x3/pw.ts +2 -0
- package/src/flags/art/4x3/py.ts +2 -0
- package/src/flags/art/4x3/qa.ts +2 -0
- package/src/flags/art/4x3/re.ts +2 -0
- package/src/flags/art/4x3/ro.ts +2 -0
- package/src/flags/art/4x3/rs.ts +2 -0
- package/src/flags/art/4x3/ru.ts +2 -0
- package/src/flags/art/4x3/rw.ts +2 -0
- package/src/flags/art/4x3/sa.ts +2 -0
- package/src/flags/art/4x3/sb.ts +2 -0
- package/src/flags/art/4x3/sc.ts +2 -0
- package/src/flags/art/4x3/sd.ts +2 -0
- package/src/flags/art/4x3/se.ts +2 -0
- package/src/flags/art/4x3/sg.ts +2 -0
- package/src/flags/art/4x3/sh-ac.ts +2 -0
- package/src/flags/art/4x3/sh-hl.ts +2 -0
- package/src/flags/art/4x3/sh-ta.ts +2 -0
- package/src/flags/art/4x3/sh.ts +2 -0
- package/src/flags/art/4x3/si.ts +2 -0
- package/src/flags/art/4x3/sj.ts +2 -0
- package/src/flags/art/4x3/sk.ts +2 -0
- package/src/flags/art/4x3/sl.ts +2 -0
- package/src/flags/art/4x3/sm.ts +2 -0
- package/src/flags/art/4x3/sn.ts +2 -0
- package/src/flags/art/4x3/so.ts +2 -0
- package/src/flags/art/4x3/sr.ts +2 -0
- package/src/flags/art/4x3/ss.ts +2 -0
- package/src/flags/art/4x3/st.ts +2 -0
- package/src/flags/art/4x3/sv.ts +2 -0
- package/src/flags/art/4x3/sx.ts +2 -0
- package/src/flags/art/4x3/sy.ts +2 -0
- package/src/flags/art/4x3/sz.ts +2 -0
- package/src/flags/art/4x3/tc.ts +2 -0
- package/src/flags/art/4x3/td.ts +2 -0
- package/src/flags/art/4x3/tf.ts +2 -0
- package/src/flags/art/4x3/tg.ts +2 -0
- package/src/flags/art/4x3/th.ts +2 -0
- package/src/flags/art/4x3/tj.ts +2 -0
- package/src/flags/art/4x3/tk.ts +2 -0
- package/src/flags/art/4x3/tl.ts +2 -0
- package/src/flags/art/4x3/tm.ts +2 -0
- package/src/flags/art/4x3/tn.ts +2 -0
- package/src/flags/art/4x3/to.ts +2 -0
- package/src/flags/art/4x3/tr.ts +2 -0
- package/src/flags/art/4x3/tt.ts +2 -0
- package/src/flags/art/4x3/tv.ts +2 -0
- package/src/flags/art/4x3/tw.ts +2 -0
- package/src/flags/art/4x3/tz.ts +2 -0
- package/src/flags/art/4x3/ua.ts +2 -0
- package/src/flags/art/4x3/ug.ts +2 -0
- package/src/flags/art/4x3/um.ts +2 -0
- package/src/flags/art/4x3/un.ts +2 -0
- package/src/flags/art/4x3/us.ts +2 -0
- package/src/flags/art/4x3/uy.ts +2 -0
- package/src/flags/art/4x3/uz.ts +2 -0
- package/src/flags/art/4x3/va.ts +2 -0
- package/src/flags/art/4x3/vc.ts +2 -0
- package/src/flags/art/4x3/ve.ts +2 -0
- package/src/flags/art/4x3/vg.ts +2 -0
- package/src/flags/art/4x3/vi.ts +2 -0
- package/src/flags/art/4x3/vn.ts +2 -0
- package/src/flags/art/4x3/vu.ts +2 -0
- package/src/flags/art/4x3/wf.ts +2 -0
- package/src/flags/art/4x3/ws.ts +2 -0
- package/src/flags/art/4x3/xk.ts +2 -0
- package/src/flags/art/4x3/xx.ts +2 -0
- package/src/flags/art/4x3/ye.ts +2 -0
- package/src/flags/art/4x3/yt.ts +2 -0
- package/src/flags/art/4x3/za.ts +2 -0
- package/src/flags/art/4x3/zm.ts +2 -0
- package/src/flags/art/4x3/zw.ts +2 -0
- package/src/flags/art/index.ts +552 -0
- package/src/flags/flags.test.tsx +140 -0
- package/src/flags/index.ts +7 -0
- package/src/flags/loadFlag.ts +29 -0
- package/src/flags/names.ts +65 -0
- package/src/flow/CLEAN-ROOM.md +110 -0
- package/src/flow/PROVENANCE.md +169 -0
- package/src/flow/README.md +117 -0
- package/src/flow/agents/AgentCreationWizard.tsx +633 -0
- package/src/flow/agents/AgentEditorDialog.tsx +751 -0
- package/src/flow/agents/agents.css +563 -0
- package/src/flow/agents/agents.test.tsx +207 -0
- package/src/flow/agents/index.ts +4 -0
- package/src/flow/agents/parts.tsx +171 -0
- package/src/flow/assistant/AssistantConversation.tsx +388 -0
- package/src/flow/assistant/AssistantVisualBlock.test.tsx +86 -0
- package/src/flow/assistant/AssistantVisualBlock.tsx +75 -0
- package/src/flow/assistant/ConversationShell.test.tsx +202 -0
- package/src/flow/assistant/ConversationShell.tsx +160 -0
- package/src/flow/assistant/LiveCanvasPanel.tsx +52 -0
- package/src/flow/assistant/MarkdownView.tsx +162 -0
- package/src/flow/assistant/ThreadHistory.tsx +156 -0
- package/src/flow/assistant/assistant.css +567 -0
- package/src/flow/assistant/index.ts +10 -0
- package/src/flow/assistant/threadDays.ts +44 -0
- package/src/flow/assistant/useAssistantSession.test.tsx +172 -0
- package/src/flow/assistant/useAssistantSession.ts +457 -0
- package/src/flow/assistant/visual.ts +205 -0
- package/src/flow/catalog/RenderCatalog.tsx +98 -0
- package/src/flow/catalog/catalog.test.tsx +162 -0
- package/src/flow/catalog/icons.ts +116 -0
- package/src/flow/catalog/kindCatalog.ts +175 -0
- package/src/flow/catalog/nodeState.ts +46 -0
- package/src/flow/catalog/palette.ts +116 -0
- package/src/flow/connectors/ConditionalConnector.css +274 -0
- package/src/flow/connectors/ConditionalConnector.tsx +288 -0
- package/src/flow/connectors/ConnectionPreviewLine.tsx +31 -0
- package/src/flow/connectors/ConnectorInsertMenu.tsx +103 -0
- package/src/flow/connectors/connectors.css +2 -0
- package/src/flow/connectors/connectors.test.tsx +218 -0
- package/src/flow/connectors/index.ts +4 -0
- package/src/flow/decision/DecisionNode.tsx +182 -0
- package/src/flow/decision/decision.css +1 -0
- package/src/flow/decision/index.ts +3 -0
- package/src/flow/decision/types.ts +60 -0
- package/src/flow/dialogs/DefinitionDialogs.test.tsx +177 -0
- package/src/flow/dialogs/DefinitionExportDialog.tsx +234 -0
- package/src/flow/dialogs/DefinitionImportDialog.tsx +303 -0
- package/src/flow/dialogs/FlowSettingsDialog.test.tsx +95 -0
- package/src/flow/dialogs/FlowSettingsDialog.tsx +242 -0
- package/src/flow/dialogs/NodeConfigDialog.test.tsx +151 -0
- package/src/flow/dialogs/NodeConfigDialog.tsx +208 -0
- package/src/flow/dialogs/dialogs.css +134 -0
- package/src/flow/dialogs/index.ts +5 -0
- package/src/flow/editor/AutosaveController.tsx +25 -0
- package/src/flow/editor/CanvasCommandBar.tsx +315 -0
- package/src/flow/editor/CanvasContextMenus.tsx +287 -0
- package/src/flow/editor/FlowEditor.test.tsx +282 -0
- package/src/flow/editor/FlowEditor.tsx +1214 -0
- package/src/flow/editor/FlowOutline.tsx +196 -0
- package/src/flow/editor/FlowPreview.tsx +149 -0
- package/src/flow/editor/FlowSwitcherBar.tsx +141 -0
- package/src/flow/editor/NodePalette.tsx +447 -0
- package/src/flow/editor/RunControls.tsx +85 -0
- package/src/flow/editor/SaveStatus.tsx +45 -0
- package/src/flow/editor/editor.css +573 -0
- package/src/flow/editor/editorTools.ts +135 -0
- package/src/flow/editor/focusOut.ts +23 -0
- package/src/flow/editor/index.ts +16 -0
- package/src/flow/editor/keyMap.ts +93 -0
- package/src/flow/editor/nodeBridge.tsx +66 -0
- package/src/flow/editor/parts.test.tsx +519 -0
- package/src/flow/editor/useEditorShortcuts.ts +122 -0
- package/src/flow/editor/useSelectionArrange.ts +135 -0
- package/src/flow/expressions/ComputeInsertPanel.tsx +123 -0
- package/src/flow/expressions/ComputeNodeForm.tsx +291 -0
- package/src/flow/expressions/ComputeTrial.tsx +105 -0
- package/src/flow/expressions/ExpressionBuilder.test.tsx +161 -0
- package/src/flow/expressions/ExpressionBuilder.tsx +71 -0
- package/src/flow/expressions/ExpressionField.tsx +157 -0
- package/src/flow/expressions/RuleEditor.tsx +645 -0
- package/src/flow/expressions/RuleNodeForm.tsx +165 -0
- package/src/flow/expressions/SimulationNodeForm.tsx +175 -0
- package/src/flow/expressions/TraceTree.test.tsx +120 -0
- package/src/flow/expressions/TraceTree.tsx +210 -0
- package/src/flow/expressions/builder/ItemList.tsx +72 -0
- package/src/flow/expressions/builder/leaves.tsx +94 -0
- package/src/flow/expressions/builder/shared.tsx +55 -0
- package/src/flow/expressions/builder/tree.tsx +221 -0
- package/src/flow/expressions/catalogContext.tsx +21 -0
- package/src/flow/expressions/computeDraft.ts +105 -0
- package/src/flow/expressions/exampleCatalog.ts +42 -0
- package/src/flow/expressions/expressions.css +520 -0
- package/src/flow/expressions/forms.test.tsx +325 -0
- package/src/flow/expressions/index.ts +15 -0
- package/src/flow/expressions/labels.ts +204 -0
- package/src/flow/expressions/model.ts +194 -0
- package/src/flow/expressions/ruleActions.ts +164 -0
- package/src/flow/expressions/ruleCondition.ts +98 -0
- package/src/flow/expressions/trace.ts +98 -0
- package/src/flow/forms/AgentNodeForm.css +29 -0
- package/src/flow/forms/AgentNodeForm.test.tsx +66 -0
- package/src/flow/forms/AgentNodeForm.tsx +177 -0
- package/src/flow/forms/DataSourceNodeForm.test.tsx +121 -0
- package/src/flow/forms/DataSourceNodeForm.tsx +519 -0
- package/src/flow/forms/DecisionNodeForm.test.tsx +72 -0
- package/src/flow/forms/DecisionNodeForm.tsx +302 -0
- package/src/flow/forms/GroupNodeForm.css +72 -0
- package/src/flow/forms/GroupNodeForm.test.tsx +55 -0
- package/src/flow/forms/GroupNodeForm.tsx +148 -0
- package/src/flow/forms/NewForms.css +256 -0
- package/src/flow/forms/NodeFormFooter.tsx +44 -0
- package/src/flow/forms/OutputSchemaBuilder.test.tsx +83 -0
- package/src/flow/forms/OutputSchemaBuilder.tsx +325 -0
- package/src/flow/forms/ReportOutputNodeForm.test.tsx +63 -0
- package/src/flow/forms/ReportOutputNodeForm.tsx +180 -0
- package/src/flow/forms/SchemaConfigForm.css +7 -0
- package/src/flow/forms/SchemaConfigForm.test.tsx +74 -0
- package/src/flow/forms/SchemaConfigForm.tsx +214 -0
- package/src/flow/forms/StartNodeForm.css +29 -0
- package/src/flow/forms/StartNodeForm.test.tsx +66 -0
- package/src/flow/forms/StartNodeForm.tsx +88 -0
- package/src/flow/forms/ToolServerListField.css +58 -0
- package/src/flow/forms/ToolServerListField.test.tsx +73 -0
- package/src/flow/forms/ToolServerListField.tsx +242 -0
- package/src/flow/forms/VariableListEditor.css +82 -0
- package/src/flow/forms/VariableListEditor.test.tsx +79 -0
- package/src/flow/forms/VariableListEditor.tsx +280 -0
- package/src/flow/forms/forms-shared.css +53 -0
- package/src/flow/forms/forms.css +9 -0
- package/src/flow/forms/index.ts +12 -0
- package/src/flow/forms/nameListModel.ts +61 -0
- package/src/flow/geometry/arrange.ts +74 -0
- package/src/flow/geometry/curve.ts +58 -0
- package/src/flow/geometry/geometry.test.ts +97 -0
- package/src/flow/geometry/guides.ts +49 -0
- package/src/flow/geometry/rect.ts +101 -0
- package/src/flow/geometry/viewport.ts +70 -0
- package/src/flow/index.ts +58 -0
- package/src/flow/internal/Announcer.tsx +63 -0
- package/src/flow/internal/DockedPanel.tsx +95 -0
- package/src/flow/internal/SectionedModal.tsx +117 -0
- package/src/flow/internal/builtInLabels.test.ts +16 -0
- package/src/flow/internal/confirm.tsx +73 -0
- package/src/flow/internal/format.ts +47 -0
- package/src/flow/internal/i18n.test.tsx +109 -0
- package/src/flow/internal/ids.ts +9 -0
- package/src/flow/internal/internal.css +152 -0
- package/src/flow/internal/labels.ts +101 -0
- package/src/flow/internal/messageFormat.ts +102 -0
- package/src/flow/internal/useControllable.ts +17 -0
- package/src/flow/layout/autoLayout.test.ts +56 -0
- package/src/flow/layout/autoLayout.ts +93 -0
- package/src/flow/layout/chainLayout.ts +66 -0
- package/src/flow/model/graph.ts +123 -0
- package/src/flow/model/types.ts +83 -0
- package/src/flow/nodes/AgentIdentity.tsx +145 -0
- package/src/flow/nodes/AgentNode.tsx +152 -0
- package/src/flow/nodes/AlignmentGuides.tsx +108 -0
- package/src/flow/nodes/ConnectionPorts.tsx +277 -0
- package/src/flow/nodes/DataSourceNode.tsx +179 -0
- package/src/flow/nodes/GenericNode.tsx +114 -0
- package/src/flow/nodes/GraphNodeCard.css +314 -0
- package/src/flow/nodes/GraphNodeCard.test.tsx +117 -0
- package/src/flow/nodes/GraphNodeCard.tsx +329 -0
- package/src/flow/nodes/GroupNode.tsx +231 -0
- package/src/flow/nodes/NodeRunIndicator.tsx +139 -0
- package/src/flow/nodes/NoteNode.tsx +134 -0
- package/src/flow/nodes/RuleNode.tsx +162 -0
- package/src/flow/nodes/flow-nodes.css +687 -0
- package/src/flow/nodes/groupLayout.ts +66 -0
- package/src/flow/nodes/index.ts +18 -0
- package/src/flow/nodes/nodeChrome.tsx +113 -0
- package/src/flow/nodes/nodes.css +3 -0
- package/src/flow/nodes/nodes.test.tsx +529 -0
- package/src/flow/nodes/ports.ts +127 -0
- package/src/flow/nodes/registry.tsx +262 -0
- package/src/flow/nodes/sourceMarks.tsx +52 -0
- package/src/flow/nodes/types.ts +85 -0
- package/src/flow/provenance/EditionCompare.tsx +292 -0
- package/src/flow/provenance/NumberTrace.tsx +208 -0
- package/src/flow/provenance/ProvenanceCertificate.tsx +263 -0
- package/src/flow/provenance/ProvenanceFilters.tsx +137 -0
- package/src/flow/provenance/ProvenanceGraph.css +1156 -0
- package/src/flow/provenance/ProvenanceGraph.test.tsx +361 -0
- package/src/flow/provenance/ProvenanceGraph.tsx +725 -0
- package/src/flow/provenance/ProvenanceInspector.tsx +201 -0
- package/src/flow/provenance/ProvenanceLegend.tsx +66 -0
- package/src/flow/provenance/ProvenanceNode.tsx +171 -0
- package/src/flow/provenance/ProvenanceShellParts.test.tsx +130 -0
- package/src/flow/provenance/ProvenanceTimeline.tsx +342 -0
- package/src/flow/provenance/ProvenanceTree.tsx +143 -0
- package/src/flow/provenance/ProvenanceViews.css +828 -0
- package/src/flow/provenance/ProvenanceViews.test.tsx +307 -0
- package/src/flow/provenance/index.ts +14 -0
- package/src/flow/provenance/labels.ts +418 -0
- package/src/flow/provenance/model.ts +381 -0
- package/src/flow/provenance/proofTypes.ts +93 -0
- package/src/flow/provenance/provenance.css +3 -0
- package/src/flow/report/ClaimTitle.tsx +15 -0
- package/src/flow/report/ProvenanceTag.test.tsx +37 -0
- package/src/flow/report/ProvenanceTag.tsx +58 -0
- package/src/flow/report/ReportView.test.tsx +59 -0
- package/src/flow/report/ReportView.tsx +359 -0
- package/src/flow/report/index.ts +4 -0
- package/src/flow/report/report.css +267 -0
- package/src/flow/run/ExecutionTimeline.tsx +478 -0
- package/src/flow/run/NumberInput.tsx +59 -0
- package/src/flow/run/RunDrawer.tsx +485 -0
- package/src/flow/run/RunInputDialog.tsx +149 -0
- package/src/flow/run/RunPanel.tsx +136 -0
- package/src/flow/run/RunPreviewPanel.tsx +269 -0
- package/src/flow/run/RunReplayDialog.tsx +278 -0
- package/src/flow/run/RunRewindDialog.tsx +197 -0
- package/src/flow/run/RunStatusMark.tsx +79 -0
- package/src/flow/run/RunTimePanel.test.tsx +55 -0
- package/src/flow/run/RunTimePanel.tsx +143 -0
- package/src/flow/run/RunViews.tsx +170 -0
- package/src/flow/run/ShortId.tsx +15 -0
- package/src/flow/run/VariableInspector.tsx +198 -0
- package/src/flow/run/VersionHistoryPanel.tsx +178 -0
- package/src/flow/run/execution.ts +187 -0
- package/src/flow/run/index.ts +18 -0
- package/src/flow/run/lineage.ts +123 -0
- package/src/flow/run/rewindPlan.ts +79 -0
- package/src/flow/run/run.css +749 -0
- package/src/flow/run/run.test.tsx +533 -0
- package/src/flow/run/runData.ts +124 -0
- package/src/flow/run/types.ts +53 -0
- package/src/flow/state/dialogStack.tsx +90 -0
- package/src/flow/state/editorState.test.tsx +110 -0
- package/src/flow/state/editorState.tsx +296 -0
- package/src/flow/state/graphEdits.ts +107 -0
- package/src/flow/state/store.ts +67 -0
- package/src/flow/steps/AddStepPicker.tsx +108 -0
- package/src/flow/steps/FlowSidePanel.tsx +318 -0
- package/src/flow/steps/IssueBar.tsx +58 -0
- package/src/flow/steps/ShapeChip.tsx +41 -0
- package/src/flow/steps/StepCard.tsx +139 -0
- package/src/flow/steps/StepListView.tsx +152 -0
- package/src/flow/steps/StepPalette.tsx +194 -0
- package/src/flow/steps/StepsContext.tsx +70 -0
- package/src/flow/steps/index.ts +15 -0
- package/src/flow/steps/researchSteps.ts +269 -0
- package/src/flow/steps/shapes.ts +46 -0
- package/src/flow/steps/stepLabels.ts +160 -0
- package/src/flow/steps/stepTools.ts +37 -0
- package/src/flow/steps/steps.css +962 -0
- package/src/flow/steps/steps.test.tsx +351 -0
- package/src/flow/steps/wiring.ts +123 -0
- package/src/flow/styles.css +23 -0
- package/src/flow/surface/CanvasSurface.test.tsx +148 -0
- package/src/flow/surface/CanvasSurface.tsx +674 -0
- package/src/flow/surface/OverviewMap.tsx +50 -0
- package/src/flow/surface/SurfaceContext.tsx +28 -0
- package/src/flow/surface/surface.css +200 -0
- package/src/flow/surface/types.ts +97 -0
- package/src/flow/surface/useElementSize.ts +29 -0
- package/src/flow/surface/useNodeMeasurement.ts +71 -0
- package/src/flow/toolbar/CanvasNodeSearch.tsx +110 -0
- package/src/flow/toolbar/CanvasToolbar.test.tsx +101 -0
- package/src/flow/toolbar/CanvasToolbar.tsx +114 -0
- package/src/flow/toolbar/canvasTools.ts +114 -0
- package/src/flow/toolbar/dockItems.test.tsx +47 -0
- package/src/flow/toolbar/dockItems.tsx +51 -0
- package/src/flow/toolbar/index.ts +5 -0
- package/src/flow/toolbar/toolbar.css +217 -0
- package/src/groups/auth-brand.css +18 -0
- package/src/groups/auth-brand.ts +17 -0
- package/src/groups/charts-geo.css +6 -0
- package/src/groups/charts-geo.ts +98 -0
- package/src/groups/data-a.css +13 -0
- package/src/groups/data-a.ts +14 -0
- package/src/groups/data-b.css +11 -0
- package/src/groups/data-b.ts +11 -0
- package/src/groups/forms-a.css +17 -0
- package/src/groups/forms-a.ts +15 -0
- package/src/groups/forms-b.css +14 -0
- package/src/groups/forms-b.ts +13 -0
- package/src/groups/overlays-nav.css +15 -0
- package/src/groups/overlays-nav.ts +16 -0
- package/src/groups/platform.css +7 -0
- package/src/groups/platform.ts +101 -0
- package/src/groups/shell.css +10 -0
- package/src/groups/shell.ts +10 -0
- package/src/groups/showcase.css +8 -0
- package/src/groups/showcase.ts +9 -0
- package/src/index.ts +68 -0
- package/src/internal/ThemeScope.tsx +28 -0
- package/src/internal/VisuallyHidden.tsx +10 -0
- package/src/internal/cx.ts +4 -0
- package/src/internal/data-a/announce.ts +38 -0
- package/src/internal/data-a/clipboard.ts +11 -0
- package/src/internal/data-b/signed.ts +34 -0
- package/src/internal/data-b/tween.ts +67 -0
- package/src/internal/dev.ts +12 -0
- package/src/internal/dom.ts +42 -0
- package/src/internal/forms-a/LiveNote.tsx +18 -0
- package/src/internal/forms-a/SearchInput.css +125 -0
- package/src/internal/forms-a/SearchInput.tsx +52 -0
- package/src/internal/forms-a/marks.tsx +18 -0
- package/src/internal/forms-a/shared.css +25 -0
- package/src/internal/forms-b/digits.ts +33 -0
- package/src/internal/forms-b/forms-b.css +341 -0
- package/src/internal/forms-b/parts.tsx +151 -0
- package/src/internal/haptics.ts +77 -0
- package/src/internal/icuCatalogue.ts +60 -0
- package/src/internal/inert.ts +15 -0
- package/src/internal/media.ts +35 -0
- package/src/internal/messages/auth-brand.ts +161 -0
- package/src/internal/messages/charts-geo.ts +289 -0
- package/src/internal/messages/core-es.ts +111 -0
- package/src/internal/messages/data-a.ts +199 -0
- package/src/internal/messages/data-b.ts +99 -0
- package/src/internal/messages/forms-a.ts +309 -0
- package/src/internal/messages/forms-b.ts +293 -0
- package/src/internal/messages/overlays-nav.ts +367 -0
- package/src/internal/messages/platform.ts +63 -0
- package/src/internal/messages/plural.ts +24 -0
- package/src/internal/messages/shell.ts +144 -0
- package/src/internal/messages/showcase.ts +12 -0
- package/src/internal/messages.ts +386 -0
- package/src/internal/overlays-nav/fuzzy.ts +115 -0
- package/src/internal/overlays-nav/hold.ts +53 -0
- package/src/internal/overlays-nav/recent.ts +73 -0
- package/src/internal/overlays-nav/state.ts +54 -0
- package/src/internal/platform/touchTrack.ts +49 -0
- package/src/internal/provider.tsx +64 -0
- package/src/internal/speech.ts +24 -0
- package/src/internal/theme.test.tsx +166 -0
- package/src/internal/theme.tsx +181 -0
- package/src/internal/types.ts +4 -0
- package/src/internal/variants.test.ts +14 -0
- package/src/internal/variants.ts +48 -0
- package/src/native-states.css +364 -0
- package/src/styles.css +59 -0
- package/src/utilities/api-error-model/apiErrors.test.ts +74 -0
- package/src/utilities/api-error-model/apiErrors.ts +192 -0
- package/src/utilities/entity-list-loader/useEntityListLoader.test.tsx +72 -0
- package/src/utilities/entity-list-loader/useEntityListLoader.ts +107 -0
- package/src/utilities/formatters/formatters.locales.test.ts +30 -0
- package/src/utilities/formatters/formatters.test.tsx +86 -0
- package/src/utilities/formatters/formatters.ts +190 -0
- package/src/utilities/haptics/haptics.test.tsx +96 -0
- package/src/utilities/haptics/haptics.tsx +79 -0
- package/src/utilities/i18n-adapter/I18nAdapter.test.tsx +70 -0
- package/src/utilities/i18n-adapter/I18nAdapter.tsx +136 -0
- package/src/utilities/i18n-adapter/icu.numeric.test.ts +39 -0
- package/src/utilities/i18n-adapter/icu.ts +207 -0
- package/src/utilities/legacy-alias-map/LEGACY-ALIASES.md +65 -0
- package/src/utilities/legacy-alias-map/legacy-alias-map.test.ts +57 -0
- package/src/utilities/motion-foundation/motion.test.tsx +76 -0
- package/src/utilities/motion-foundation/motion.tsx +119 -0
- package/src/utilities/router-adapter/Routing.test.tsx +68 -0
- package/src/utilities/router-adapter/Routing.tsx +149 -0
- package/src/utilities/view-transition/animatedChange.test.ts +72 -0
- package/src/utilities/view-transition/animatedChange.ts +90 -0
- package/dist/src-Ds9ArSaP.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements-DCGBSGS8.js","names":["SVG_NS","el","SVG","el","num","SVG_NS","el","xIcon","safe","SVG","glyph","icon","FOCUSABLE","INERT_MARK","SVG_NS","TONES","scrollLocks","lockScroll","unlockScroll","el","icon","SVG","el","SVG","el","icon","glyph","icon","text","SVG","el","searchIcon","appendMarked","parseItems","el","icon","ellipsisIcon","glyph","icon","glyph","SVG","el","glyph","icon","closeButton","FOCUSABLE","INERT_MARK","scrollLocks","lockScroll","unlockScroll","glyph","FOCUSABLE","glyph","icon","glyph","el"],"sources":["../src/elements/definition.ts","../src/elements/base.ts","../src/elements/wheel-picker/definition.ts","../src/elements/wheel-picker/element.ts","../src/elements/toast/definition.ts","../src/elements/toast/element.ts","../src/elements/tag-field/definition.ts","../src/elements/tag-field/element.ts","../src/elements/tabs/definition.ts","../src/elements/tabs/element.ts","../src/elements/skip-link/definition.ts","../src/elements/skip-link/element.ts","../src/elements/segmented-control/definition.ts","../src/elements/segmented-control/element.ts","../src/elements/section-heading/definition.ts","../src/elements/section-heading/element.ts","../src/elements/progress-bar/definition.ts","../src/elements/progress-bar/element.ts","../src/elements/page-header/definition.ts","../src/elements/page-header/element.ts","../src/elements/notification-center/definition.ts","../src/elements/notification-center/element.ts","../src/elements/markdown-view/definition.ts","../src/elements/markdown-view/element.ts","../src/elements/heading/definition.ts","../src/elements/heading/element.ts","../src/elements/data-table/definition.ts","../src/elements/data-table/element.ts","../src/elements/currency-field/definition.ts","../src/elements/currency-field/element.ts","../src/elements/command-palette/definition.ts","../src/elements/command-palette/element.ts","../src/elements/breadcrumbs/definition.ts","../src/elements/breadcrumbs/element.ts","../src/elements/brand-wordmark/definition.ts","../src/elements/brand-wordmark/element.ts","../src/elements/avatar/definition.ts","../src/elements/avatar/element.ts","../src/elements/action-menu/definition.ts","../src/elements/popover/model.ts","../src/elements/action-menu/element.ts","../src/elements/button/definition.ts","../src/elements/button/element.ts","../src/elements/checkbox/definition.ts","../src/elements/checkbox/element.ts","../src/elements/drawer/definition.ts","../src/elements/drawer/element.ts","../src/elements/gradient-mark/definition.ts","../src/elements/gradient-mark/element.ts","../src/elements/inline-notice/definition.ts","../src/elements/inline-notice/element.ts","../src/elements/link/definition.ts","../src/elements/link/element.ts","../src/elements/modal/definition.ts","../src/elements/modal/element.ts","../src/elements/popover/definition.ts","../src/elements/popover/element.ts","../src/elements/native-select/definition.ts","../src/elements/native-select/element.ts","../src/elements/separator/definition.ts","../src/elements/separator/element.ts","../src/elements/skeleton/definition.ts","../src/elements/skeleton/element.ts","../src/elements/spinner/definition.ts","../src/elements/spinner/element.ts","../src/elements/status-pill/definition.ts","../src/elements/status-pill/element.ts","../src/elements/surface/definition.ts","../src/elements/surface/element.ts","../src/elements/switch/definition.ts","../src/elements/switch/element.ts","../src/elements/tag/definition.ts","../src/elements/tag/element.ts","../src/elements/text-area/definition.ts","../src/elements/text-area/element.ts","../src/elements/text-field/definition.ts","../src/elements/text-field/element.ts","../src/elements/theme-palette/definition.ts","../src/elements/theme-palette/model.ts","../src/elements/theme-palette/element.ts","../src/elements/anatomy.ts","../src/elements/index.ts"],"sourcesContent":["// The single source of a Tympan custom element: its properties, events,\n// slots and light-DOM anatomy, as plain data. The element class reads it at\n// runtime; tools/elements/generate.mjs reads it to write the React wrappers\n// and the parity fixtures. Nothing here touches the DOM, so the generator\n// can import it in Node.\n\nexport type Scalar = string | number | boolean\n\nexport interface PropDef {\n type: 'boolean' | 'string' | 'number' | 'enum'\n /** Allowed values of an `enum` property. */\n values?: readonly string[]\n default?: Scalar\n /** Attribute on the host element (kebab case). */\n attribute: string\n doc: string\n}\n\n/**\n * A condition on the rendered instance: `prop`, `!prop`, `prop:value`\n * (equality, for enum-valued props), `slot:name` or `!slot:name`;\n * alternatives joined with `|` (`slot:default|slot:description`).\n * All listed conditions must hold.\n */\nexport type Condition = string\n\n/** Every binding may carry `when`: the attribute is left out unless the conditions hold. */\nexport type AttrBinding = (\n /** A fixed value. */\n | { value: string }\n /** The property's value as text; left out when it is undefined, empty or false. */\n | { prop: string }\n /** Present (empty) while the property is truthy (`data-busy=\"\"`). */\n | { prop: string; kind: 'flag' }\n /** `\"true\"` while the property is truthy, left out otherwise (`aria-busy`). */\n | { prop: string; kind: 'bool' }\n /** A native boolean attribute (`disabled`, `checked`). */\n | { prop: string; kind: 'boolean-attr' }\n /**\n * The prop's value mapped through `values` (`role` from `urgency`); a\n * value the map does not cover leaves the attribute out. When the prop is\n * unset, `fallback` (another prop's map) decides.\n */\n | { prop: string; kind: 'map'; values: Record<string, string>; fallback?: { prop: string; values: Record<string, string> } }\n /** An id unique to the instance: `<instance id>-<suffix>`; a non-empty `prop` value wins (a surrounding field's control id). */\n | { idref: string; prop?: string }\n /**\n * Space-joined ids (`aria-describedby`): each `{ id, when }` contributes\n * `<instance id>-<id>` while its conditions hold, each `{ prop }` the\n * property's raw value while non-empty. Left out when nothing contributes.\n */\n | { idrefs: ReadonlyArray<{ id: string; when?: Condition[] } | { prop: string }> }\n) & { when?: Condition[] }\n\nexport interface ElementNode {\n tag: string\n class?: string\n attrs?: Record<string, AttrBinding>\n when?: Condition[]\n children?: AnatomyNode[]\n}\n\n/** Where the host's own children go (the framework keeps owning them). */\nexport interface SlotNode {\n slot: string\n when?: Condition[]\n}\n\n/** Text taken from a prop's value (escaped at render), e.g. the notice's tone word. */\nexport interface TextNode {\n text: { prop: string }\n when?: Condition[]\n}\n\nexport type AnatomyNode = ElementNode | SlotNode | TextNode\n\nexport interface EventDef {\n /** DOM event type (`click`, `change`, `ty-theme-change`). */\n type: string\n /** `native`: bubbled from a native control inside; `custom`: a CustomEvent the element dispatches. */\n kind: 'native' | 'custom'\n /** Fields of a custom event's `detail`. */\n detail?: Record<string, 'string' | 'boolean' | 'number'>\n /** Prop name on the React wrapper (`onThemeChange`). */\n reactProp: string\n doc: string\n}\n\nexport interface Example {\n name: string\n props: Record<string, Scalar>\n /** Plain text for each slot (`default`, `description`, …). */\n slots: Record<string, string>\n}\n\nexport interface ElementDefinition {\n tag: string\n /** PascalCase name: `TyButton`. */\n name: string\n /**\n * `enhancing`: the host framework renders the anatomy (from this\n * definition) and the element adds behaviour without moving any node.\n * `self-rendering`: the element owns its whole subtree (data-driven\n * composites); wrappers render an empty host.\n */\n kind: 'enhancing' | 'self-rendering'\n doc: string\n props: Record<string, PropDef>\n events: EventDef[]\n slots?: Record<string, { doc: string }>\n anatomy?: ElementNode\n examples: Example[]\n}\n\nexport type Props = Record<string, Scalar | undefined>\n\n/** The props with each definition default applied. */\nexport function withDefaults(def: ElementDefinition, props: Props): Props {\n const out: Props = { ...props }\n for (const [name, prop] of Object.entries(def.props)) {\n if (out[name] === undefined && prop.default !== undefined) out[name] = prop.default\n }\n return out\n}\n\nconst truthy = (v: Scalar | undefined) => v !== undefined && v !== false && v !== ''\n\n/** Whether every condition holds for these props and filled slots. */\nexport function holds(conditions: Condition[] | undefined, props: Props, slots: ReadonlySet<string>): boolean {\n if (!conditions) return true\n const one = (c: string) => {\n const negated = c.startsWith('!')\n const body = negated ? c.slice(1) : c\n let value: boolean\n if (body.startsWith('slot:')) value = slots.has(body.slice(5))\n else if (body.includes(':')) {\n const cut = body.indexOf(':')\n value = String(props[body.slice(0, cut)]) === body.slice(cut + 1)\n } else value = truthy(props[body])\n return negated ? !value : value\n }\n return conditions.every((c) => c.split('|').some(one))\n}\n\n/**\n * The attribute value a binding yields, or `undefined` to leave the\n * attribute out. Boolean attributes and flags yield `\"\"`.\n */\nexport function bindingValue(binding: AttrBinding, props: Props, slots: ReadonlySet<string>, instanceId: string): string | undefined {\n if (!holds(binding.when, props, slots)) return undefined\n if ('value' in binding) return binding.value\n if ('idref' in binding) {\n const override = binding.prop !== undefined ? props[binding.prop] : undefined\n if (truthy(override)) return String(override)\n return `${instanceId}-${binding.idref}`\n }\n if ('idrefs' in binding) {\n const ids: string[] = []\n for (const entry of binding.idrefs) {\n if ('id' in entry) {\n if (holds(entry.when, props, slots)) ids.push(`${instanceId}-${entry.id}`)\n } else {\n const raw = props[entry.prop]\n if (truthy(raw)) ids.push(String(raw))\n }\n }\n return ids.length ? ids.join(' ') : undefined\n }\n const v = props[binding.prop]\n if (!('kind' in binding)) return truthy(v) ? String(v) : undefined\n switch (binding.kind) {\n case 'flag':\n case 'boolean-attr':\n return truthy(v) ? '' : undefined\n case 'bool':\n return truthy(v) ? 'true' : undefined\n case 'map': {\n if (truthy(v)) return binding.values[String(v)]\n if (binding.fallback) {\n const fv = props[binding.fallback.prop]\n if (truthy(fv)) return binding.fallback.values[String(fv)]\n }\n return undefined\n }\n }\n}\n\n/** Every element part (nodes with a class), depth first. */\nexport function parts(node: ElementNode): ElementNode[] {\n const out: ElementNode[] = [node]\n for (const child of node.children ?? []) if ('tag' in child) out.push(...parts(child))\n return out\n}\n\n/** kebab-case attribute name → camelCase property name. */\nexport const camel = (s: string) => s.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())\n","// Base class of every Tympan custom element (light DOM, no shadow root).\n//\n// An *enhancing* element finds its anatomy already rendered by the host\n// framework (from the same definition, through a generated wrapper) and only\n// keeps the bound attributes in step and adds behaviour: it never moves or\n// replaces a node the framework owns. Used from plain HTML with just its\n// content (`<ty-button variant=\"primary\">Save</ty-button>`), it builds the\n// anatomy itself once, moving its children into the slots, and from then on\n// re-renders it on every attribute change.\n//\n// A *self-rendering* element owns its whole subtree; frameworks render an\n// empty host and pass data as attributes.\n\nimport { bindingValue, holds, withDefaults, type ElementDefinition, type ElementNode, type AnatomyNode, type Props } from './definition.ts'\n\nlet instances = 0\n\n// Outside a browser (server rendering, the generator) there is no\n// HTMLElement to extend; the classes still load, and are never defined.\nconst ElementBase = (typeof HTMLElement === 'undefined' ? class {} : HTMLElement) as typeof HTMLElement\n\nconst firstClass = (node: ElementNode) => (node.class ?? '').split(/\\s+/)[0] ?? ''\n\nexport abstract class TyElement extends ElementBase {\n static definition: ElementDefinition\n\n static get observedAttributes(): string[] {\n return [...Object.values(this.definition.props).map((p) => p.attribute), 'data-ty-instance']\n }\n\n #instance: string | undefined\n #owned = false\n #slots = new Map<string, Node[]>()\n\n get definition(): ElementDefinition {\n return (this.constructor as typeof TyElement).definition\n }\n\n /** Suffix base of the ids the anatomy needs (`aria-describedby`); wrappers pass theirs as `data-ty-instance`. */\n get instanceId(): string {\n return this.getAttribute('data-ty-instance') || this.id || (this.#instance ??= `ty-${++instances}`)\n }\n\n /** The current props, read from the host attributes, defaults applied. */\n get props(): Props {\n const out: Props = {}\n for (const [name, prop] of Object.entries(this.definition.props)) {\n if (prop.type === 'boolean') out[name] = this.hasAttribute(prop.attribute)\n else {\n const raw = this.getAttribute(prop.attribute)\n if (raw !== null) out[name] = prop.type === 'number' ? Number(raw) : raw\n }\n }\n return withDefaults(this.definition, out)\n }\n\n /** Whether this element built its own anatomy (plain HTML use). */\n get owned(): boolean {\n return this.#owned\n }\n\n connectedCallback(): void {\n if (this.definition.kind === 'enhancing' && this.definition.anatomy) {\n if (!this.anatomyRoot()) this.#adopt()\n this.sync()\n }\n this.connected()\n }\n\n disconnectedCallback(): void {\n this.disconnected()\n }\n\n attributeChangedCallback(): void {\n if (this.isConnected && this.definition.kind === 'enhancing') this.sync()\n this.changed()\n }\n\n /** Hooks for subclasses. */\n protected connected(): void {}\n protected disconnected(): void {}\n protected changed(): void {}\n\n /** The anatomy's root element, when it is rendered. */\n anatomyRoot(): HTMLElement | null {\n const anatomy = this.definition.anatomy\n if (!anatomy) return null\n for (const child of Array.from(this.children)) if (child.classList.contains(firstClass(anatomy))) return child as HTMLElement\n return null\n }\n\n /** Bring the anatomy in step with the props. */\n sync(): void {\n const anatomy = this.definition.anatomy\n if (!anatomy) return\n if (this.#owned) {\n this.#patch(anatomy)\n return\n }\n // Framework-rendered: only the attributes of the parts that exist.\n const props = this.props\n const filled = this.#filledSlots()\n const visit = (node: ElementNode, element: Element) => {\n for (const [name, binding] of Object.entries(node.attrs ?? {})) {\n // A control's live state belongs to the framework that renders it.\n if (LIVE.has(name) && 'kind' in binding && binding.kind === 'boolean-attr') continue\n const value = bindingValue(binding, props, filled, this.instanceId)\n if (value === undefined) element.removeAttribute(name)\n else if (element.getAttribute(name) !== value) element.setAttribute(name, value)\n }\n // Same-class siblings (an icon's glyphs) each match their own\n // counterpart; `used` keeps the second path off the first.\n const used = new Set<Element>()\n for (const child of node.children ?? []) {\n if (!('tag' in child) || !child.class) continue\n const match = Array.from(element.children).find((c) => !used.has(c) && c.classList.contains(firstClass(child)))\n if (match) {\n used.add(match)\n visit(child, match)\n }\n }\n }\n const root = this.anatomyRoot()\n if (root) visit(anatomy, root)\n }\n\n /** Dispatch a bubbling, composed CustomEvent. */\n protected emit(type: string, detail?: unknown): boolean {\n return this.dispatchEvent(new CustomEvent(type, { detail, bubbles: true, composed: true, cancelable: true }))\n }\n\n #filledSlots(): Set<string> {\n if (this.#owned) return new Set([...this.#slots].filter(([, nodes]) => nodes.some(isContent)).map(([name]) => name))\n // Framework-rendered: a slot is filled when its part is rendered with content.\n const filled = new Set<string>()\n const walk = (node: AnatomyNode, element: Element | null) => {\n if ('slot' in node) {\n if (element && Array.from(element.childNodes).some(isContent)) filled.add(node.slot)\n return\n }\n if (!('tag' in node)) return\n for (const child of node.children ?? []) {\n if ('slot' in child) walk(child, element)\n else if (element && 'tag' in child && child.class) walk(child, Array.from(element.children).find((c) => c.classList.contains(firstClass(child))) ?? null)\n }\n }\n if (this.definition.anatomy) walk(this.definition.anatomy, this.anatomyRoot())\n return filled\n }\n\n /** Plain HTML: take the children as slot content and build the anatomy. */\n #adopt(): void {\n for (const node of Array.from(this.childNodes)) {\n const slot = node instanceof Element && node.hasAttribute('slot') ? node.getAttribute('slot')! : 'default'\n const list = this.#slots.get(slot) ?? []\n list.push(node)\n this.#slots.set(slot, list)\n }\n this.#owned = true\n }\n\n /**\n * Plain HTML: render the anatomy into this element, reusing every node\n * that is still wanted (matched by class) so a focused control keeps\n * focus, and moving only what changed.\n */\n #patch(anatomy: ElementNode): void {\n const props = this.props\n const filled = this.#filledSlots()\n const render = (node: AnatomyNode, existing: Element | null, svg: boolean): Node[] => {\n if (!holds(node.when, props, filled)) return []\n if ('slot' in node) return this.#slots.get(node.slot) ?? []\n if ('text' in node) {\n const value = props[node.text.prop]\n return value === undefined || value === false || value === '' ? [] : [document.createTextNode(String(value))]\n }\n const inSvg = svg || node.tag === 'svg'\n const element = existing ?? (inSvg ? document.createElementNS(SVG_NS, node.tag) : document.createElement(node.tag))\n if (!existing && node.class) element.setAttribute('class', node.class)\n for (const [name, binding] of Object.entries(node.attrs ?? {})) {\n const value = bindingValue(binding, props, filled, this.instanceId)\n // After the first render a control's state is its property: the\n // attribute stays the initial state a form reset returns to.\n if (existing && LIVE.has(name) && 'kind' in binding && binding.kind === 'boolean-attr') {\n ;(element as unknown as Record<string, boolean>)[name] = value !== undefined\n continue\n }\n if (value === undefined) element.removeAttribute(name)\n else if (element.getAttribute(name) !== value) element.setAttribute(name, value)\n }\n const used = new Set<Element>()\n const wanted: Node[] = []\n for (const child of node.children ?? []) {\n if ('slot' in child || 'text' in child) {\n wanted.push(...render(child, null, inSvg))\n continue\n }\n const match = Array.from(element.children).find((c) => !used.has(c) && c.localName === child.tag && c.classList.contains(firstClass(child))) ?? null\n if (match) used.add(match)\n wanted.push(...render(child, match, inSvg))\n }\n wanted.forEach((child, index) => {\n if (element.childNodes[index] !== child) element.insertBefore(child, element.childNodes[index] ?? null)\n })\n while (element.childNodes.length > wanted.length) element.lastChild!.remove()\n return [element]\n }\n const root = this.anatomyRoot()\n const built = render(anatomy, root, false)[0]\n if (built && built !== root) this.replaceChildren(built)\n }\n}\n\n/** Attributes whose live value is a property (`checked`), not the attribute. */\nconst LIVE = new Set(['checked', 'selected'])\n\n/** Anatomy in the SVG namespace (icons): created with `createElementNS` so plain-HTML use renders it. */\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nconst isContent = (node: Node) => node.nodeType !== Node.TEXT_NODE || (node.textContent ?? '').trim() !== ''\n\n/** Define `cls` under its tag, with a property accessor per definition prop. Idempotent. */\nexport function defineTympanElement(cls: typeof TyElement & (new () => TyElement)): void {\n const def = cls.definition\n if (typeof customElements === 'undefined' || customElements.get(def.tag)) return\n for (const [name, prop] of Object.entries(def.props)) {\n if (Object.prototype.hasOwnProperty.call(cls.prototype, name)) continue\n Object.defineProperty(cls.prototype, name, {\n configurable: true,\n get(this: HTMLElement) {\n if (prop.type === 'boolean') return this.hasAttribute(prop.attribute)\n const raw = this.getAttribute(prop.attribute)\n if (raw === null) return prop.default\n return prop.type === 'number' ? Number(raw) : raw\n },\n set(this: HTMLElement, value: unknown) {\n if (prop.type === 'boolean') this.toggleAttribute(prop.attribute, Boolean(value))\n else if (value === null || value === undefined) this.removeAttribute(prop.attribute)\n else this.setAttribute(prop.attribute, String(value))\n },\n })\n }\n customElements.define(def.tag, cls)\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-wheel-picker>`: the WheelPicker's single source (spec: wave-2/wheel-picker.md).\n *\n * Self-rendering: the choices are data (a JSON array in `options`, or one\n * entry per wheel in `columns`), which the declarative anatomy cannot\n * express (no dynamic repetition), so the element owns its whole subtree and\n * frameworks render an empty host — the theme palette precedent. `examples`\n * stays empty for the same reason: the parity renderers have no anatomy to\n * render.\n *\n * Accessibility mirrors the React WheelPicker (RAC ListBox) and the APG\n * single-select listbox: each wheel is a focusable `role=\"listbox\"` named by\n * its label, each row an `option` with `aria-selected`, the centred row named\n * by `aria-activedescendant`. The multi-column form wraps the wheels in a\n * `group` named by `label`. ArrowUp/ArrowDown move one row, PageUp/PageDown\n * move by `visibleRows`, Home/End go to the ends, and a printable character\n * jumps to the next row whose label starts with it.\n */\nexport const wheelPickerDefinition = {\n tag: 'ty-wheel-picker',\n name: 'TyWheelPicker',\n kind: 'self-rendering',\n doc: 'Touch-friendly vertical scroller that picks one value from an ordered list by centring it in a selection band (drag or flick scrolls and snaps, a tap selects, the keyboard moves by row, page or ends). With `columns`, several wheels sit side by side for compound values (day, month, year), each with its own width share.',\n props: {\n options: { type: 'string', attribute: 'options', doc: 'JSON array of the ordered choices: plain strings, or { \"value\", \"label\" } objects when the shown text differs from the reported value.' },\n value: { type: 'string', attribute: 'value', doc: 'Selected value. A value no option holds centres the first row and reports nothing until the wheel moves; programmatic changes animate the wheel to the new row.' },\n label: { type: 'string', attribute: 'label', doc: 'Accessible name of the wheel; with `columns`, of the whole group.' },\n visibleRows: { type: 'number', default: 5, attribute: 'visible-rows', doc: 'Rows visible at once; an even number rounds up to the next odd one (minimum 3).' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Shown but not changeable: the wheel stays focusable, taps, scrolling and keys do not select.' },\n columns: { type: 'string', attribute: 'columns', doc: 'Multi-column form: JSON array of { \"label\", \"options\", \"value\", \"share\"? }, one wheel per entry; `share` is its relative width. Wins over `options` and `value`.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the wheel (`data-testid`).' },\n },\n events: [\n { type: 'ty-change', kind: 'custom', detail: { value: 'string', column: 'number' }, reactProp: 'onChange', doc: 'The wheel settled on a new value, or a row was activated (tap, arrows, PageUp/PageDown, Home/End, typeahead). `value` is the option\\'s value, not its label; `column` is the wheel\\'s index (0 for a single wheel).' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { wheelPickerDefinition } from './definition.ts'\n\nconst SETTLE_MS = 120\nconst DEFAULT_ROW = 44\n\ninterface Row {\n id: string\n text: string\n}\n\ninterface Column {\n label: string\n options: Row[]\n value: string\n share?: number\n}\n\n/** Live state of one rendered wheel. */\ninterface Wheel {\n column: number\n rows: Row[]\n /** The value the wheel shows (seeded from the host, moved by interaction). */\n current: string\n /** Index of the row in the band. */\n centre: number\n wheel: HTMLElement\n list: HTMLElement\n /** True while a programmatic scroll glides; its settle is not reported. */\n programmatic: boolean\n settleTimer: ReturnType<typeof setTimeout> | undefined\n programTimer: ReturnType<typeof setTimeout> | undefined\n /** True once, right after a drag ended (the following tap is ignored). */\n moved: boolean\n}\n\nfunction el(tag: string, className?: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n if (className) node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\nfunction rowsOf(options: unknown): Row[] {\n if (!Array.isArray(options)) return []\n const rows: Row[] = []\n for (const option of options) {\n if (typeof option === 'string') rows.push({ id: option, text: option })\n else if (option && typeof option === 'object' && 'value' in option) {\n const value = String((option as { value: unknown }).value)\n const label = (option as { label?: unknown }).label\n rows.push({ id: value, text: label === undefined || label === null ? value : String(label) })\n }\n }\n return rows.filter((row) => row.id !== '')\n}\n\nfunction parseJson(raw: string | undefined): unknown {\n if (!raw) return undefined\n try {\n return JSON.parse(raw)\n } catch {\n return undefined\n }\n}\n\nconst prefersReducedMotion = (): boolean =>\n typeof window !== 'undefined' && !!window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\n/** A light selection tick; silent without the Vibration API, under reduced motion and before any user gesture. */\nfunction tick(): void {\n if (prefersReducedMotion()) return\n const nav = navigator as Navigator & { vibrate?: unknown; userActivation?: { hasBeenActive?: boolean } }\n if (nav.userActivation && nav.userActivation.hasBeenActive === false) return\n if (typeof nav.vibrate !== 'function') return\n try {\n ;(nav.vibrate as (p: number) => boolean).call(navigator, 8)\n } catch {\n /* unsupported */\n }\n}\n\n/**\n * `<ty-wheel-picker>`. The choices are data (`options`, or one entry per\n * wheel in `columns`), so the element owns its whole subtree — frameworks\n * render an empty host (spec: wave-2/wheel-picker.md):\n *\n * - **Structure** — each wheel is a `ty-wheel` (caption, viewport, selection\n * band) around a scrollable `role=\"listbox\"` of `option` rows; the\n * stylesheet (WheelPicker.css) draws the fades, the band and the distance\n * emphasis from the same `.ty-*` classes and `data-*` states the React\n * component emits.\n * - **Scrolling** — touch scrolls natively (CSS scroll snap); a mouse or pen\n * drag scrolls by pointer delta (`data-dragging` lifts the snap while\n * dragging). Each scroll recentres the emphasis and ticks as a row crosses\n * the band; 120 ms after the last scroll the wheel settles and reports the\n * centred row (`ty-change`) if it changed.\n * - **Keyboard** — ArrowUp/ArrowDown move one row, PageUp/PageDown move by\n * `visible-rows`, Home/End go to the ends and a printable character jumps\n * to the next row whose label starts with it; each move selects at once.\n * - **Controlled value** — the wheel's value is seeded from `value` (or each\n * column's) and follows attribute changes with an animated scroll (a jump\n * under reduced motion; the first placement always jumps). Interaction\n * moves the wheel itself and reports through `ty-change`.\n */\nexport class TyWheelPickerElement extends TyElement {\n static override definition = wheelPickerDefinition\n\n #wheels: Wheel[] = []\n /** Signature of the structural attributes; a change rebuilds the subtree. */\n #structure = ''\n #drags = new AbortController()\n\n protected override connected(): void {\n this.#render()\n }\n\n protected override disconnected(): void {\n for (const wheel of this.#wheels) {\n clearTimeout(wheel.settleTimer)\n clearTimeout(wheel.programTimer)\n }\n this.#wheels = []\n this.#drags.abort()\n this.#drags = new AbortController()\n }\n\n protected override changed(): void {\n if (!this.isConnected || !this.#wheels.length) return\n const structure = this.#structureSignature()\n if (structure !== this.#structure) {\n this.#render()\n return\n }\n // A value-only change animates the wheel to the new row (single wheel;\n // a column's value lives in `columns`, a structural change).\n const wheel = this.#wheels[0]\n if (wheel && !this.#columns()) {\n const value = String(this.props.value ?? '')\n if (value !== wheel.current) {\n wheel.current = value\n this.#place(wheel, wheel.rows.findIndex((row) => row.id === value), true)\n }\n }\n }\n\n #columns(): Column[] | undefined {\n const parsed = parseJson(this.getAttribute('columns') ?? undefined)\n if (!Array.isArray(parsed) || !parsed.length) return undefined\n const columns: Column[] = []\n for (const entry of parsed) {\n if (!entry || typeof entry !== 'object') continue\n const column = entry as { label?: unknown; options?: unknown; value?: unknown; share?: unknown }\n columns.push({\n label: String(column.label ?? ''),\n options: rowsOf(column.options),\n value: column.value === undefined || column.value === null ? '' : String(column.value),\n share: typeof column.share === 'number' && Number.isFinite(column.share) ? column.share : undefined,\n })\n }\n return columns.length ? columns : undefined\n }\n\n #structureSignature(): string {\n const p = this.props\n return [this.getAttribute('options') ?? '', this.getAttribute('columns') ?? '', String(p.label ?? ''), String(p.visibleRows ?? ''), p.disabled ? '1' : '0', String(p.testId ?? '')].join(\n '\u0001',\n )\n }\n\n #visibleRows(): number {\n const raw = Number(this.props.visibleRows ?? 5)\n return Math.max(3, (Number.isFinite(raw) ? Math.floor(raw) : 5) | 1)\n }\n\n #render(): void {\n this.#structure = this.#structureSignature()\n for (const wheel of this.#wheels) {\n clearTimeout(wheel.settleTimer)\n clearTimeout(wheel.programTimer)\n }\n this.#wheels = []\n const visible = this.#visibleRows()\n const columns = this.#columns()\n if (columns) {\n const group = el('div', 'ty-wheel-group', { role: 'group', 'aria-label': String(this.props.label ?? '') })\n columns.forEach((column, index) => group.append(this.#wheel(column.options, column.value, column.label, index, visible, true, column.share)))\n this.replaceChildren(group)\n } else {\n const rows = rowsOf(parseJson(this.getAttribute('options') ?? undefined))\n const wheel = this.#wheel(rows, String(this.props.value ?? ''), String(this.props.label ?? ''), 0, visible, false, undefined)\n const testId = this.props.testId\n if (testId) wheel.setAttribute('data-testid', String(testId))\n this.replaceChildren(wheel)\n }\n // The first placement jumps; later moves animate.\n for (const wheel of this.#wheels) this.#place(wheel, wheel.rows.findIndex((row) => row.id === wheel.current), false)\n }\n\n #wheel(rows: Row[], value: string, label: string, column: number, visible: number, caption: boolean, share: number | undefined): HTMLElement {\n const disabled = Boolean(this.props.disabled)\n const wheel = el('div', 'ty-wheel')\n wheel.style.setProperty('--ty-wheel-rows', String(visible))\n wheel.style.setProperty('--ty-wheel-share', String(share ?? 1))\n if (disabled) wheel.setAttribute('data-disabled', '')\n if (caption) {\n const captionNode = el('span', 'ty-wheel__caption', { 'aria-hidden': 'true' })\n captionNode.textContent = label\n wheel.append(captionNode)\n }\n const viewport = el('div', 'ty-wheel__viewport')\n viewport.append(el('span', 'ty-wheel__band', { 'aria-hidden': 'true' }))\n const list = el('div', 'ty-wheel__list', { role: 'listbox', tabindex: '0', 'aria-label': label })\n const state: Wheel = {\n column,\n rows,\n current: value,\n centre: 0,\n wheel,\n list,\n programmatic: false,\n settleTimer: undefined,\n programTimer: undefined,\n moved: false,\n }\n rows.forEach((row, index) => {\n const option = el('div', 'ty-wheel__row', { role: 'option', id: this.#rowId(column, index), 'aria-selected': String(row.id === value) })\n if (row.id === value) option.setAttribute('data-selected', '')\n option.textContent = row.text\n list.append(option)\n })\n viewport.append(list)\n wheel.append(viewport)\n\n list.addEventListener('scroll', () => this.#onScroll(state), { passive: true })\n list.addEventListener('keydown', (event) => this.#onKey(state, event))\n list.addEventListener('click', (event) => this.#onTap(state, event))\n list.addEventListener('focus', () => {\n try {\n if (list.matches(':focus-visible')) list.setAttribute('data-focus-visible', '')\n } catch {\n /* jsdom */\n }\n })\n list.addEventListener('blur', () => list.removeAttribute('data-focus-visible'))\n this.#drag(state)\n\n this.#wheels.push(state)\n return wheel\n }\n\n #rowId(column: number, index: number): string {\n return `${this.instanceId}-wheel-${column}-option-${index}`\n }\n\n #rowHeight(state: Wheel): number {\n return state.list.querySelector<HTMLElement>('[role=\"option\"]')?.offsetHeight || DEFAULT_ROW\n }\n\n /** Centre `index` (clamped; -1 centres the first row) without reporting; `animate` glides unless reduced motion. */\n #place(state: Wheel, index: number, animate: boolean): void {\n const target = Math.max(0, index)\n state.centre = target\n this.#paint(state)\n const top = target * this.#rowHeight(state)\n const behavior: ScrollBehavior = !animate || prefersReducedMotion() ? 'instant' : 'smooth'\n state.programmatic = true\n clearTimeout(state.settleTimer)\n if (typeof state.list.scrollTo === 'function') state.list.scrollTo({ top, behavior })\n else state.list.scrollTop = top\n clearTimeout(state.programTimer)\n state.programTimer = setTimeout(() => {\n state.programmatic = false\n }, 400)\n }\n\n /** A user's choice of `index` (never while disabled): selects, glides to the row and reports a change. */\n #choose(state: Wheel, index: number): void {\n const row = state.rows[index]\n if (!row) return\n const changed = row.id !== state.current\n state.current = row.id\n this.#place(state, index, true)\n if (changed) this.emit('ty-change', { value: row.id, column: state.column })\n }\n\n /** Selection and distance emphasis on the rows, the band's active descendant on the list. */\n #paint(state: Wheel): void {\n state.list.querySelectorAll<HTMLElement>('[role=\"option\"]').forEach((option, index) => {\n const selected = state.rows[index]?.id === state.current\n option.setAttribute('aria-selected', String(selected))\n if (selected) option.setAttribute('data-selected', '')\n else option.removeAttribute('data-selected')\n option.setAttribute('data-distance', String(Math.min(3, Math.abs(index - state.centre))))\n })\n if (state.rows.length) state.list.setAttribute('aria-activedescendant', this.#rowId(state.column, state.centre))\n else state.list.removeAttribute('aria-activedescendant')\n }\n\n #onScroll(state: Wheel): void {\n const at = Math.min(state.rows.length - 1, Math.max(0, Math.round(state.list.scrollTop / this.#rowHeight(state))))\n if (at !== state.centre) {\n if (!state.programmatic) tick()\n state.centre = at\n this.#paint(state)\n }\n if (state.programmatic) return\n clearTimeout(state.settleTimer)\n state.settleTimer = setTimeout(() => {\n const row = state.rows[at]\n if (row && row.id !== state.current) {\n if (this.props.disabled) return\n state.current = row.id\n this.#paint(state)\n tick()\n this.emit('ty-change', { value: row.id, column: state.column })\n }\n }, SETTLE_MS)\n }\n\n #onTap(state: Wheel, event: Event): void {\n const option = (event.target as Element | null)?.closest?.('[role=\"option\"]')\n if (!option || !state.list.contains(option)) return\n if (state.moved) {\n state.moved = false\n return\n }\n if (this.props.disabled) return\n const index = Array.prototype.indexOf.call(state.list.children, option)\n if (index >= 0) this.#choose(state, index)\n }\n\n #onKey(state: Wheel, event: KeyboardEvent): void {\n if (!state.rows.length) return\n const current = state.rows.findIndex((row) => row.id === state.current)\n const last = state.rows.length - 1\n const from = Math.max(0, current)\n let target: number | undefined\n switch (event.key) {\n case 'ArrowUp':\n target = current < 0 ? 0 : Math.max(0, from - 1)\n break\n case 'ArrowDown':\n target = current < 0 ? 0 : Math.min(last, from + 1)\n break\n case 'PageUp':\n target = Math.max(0, from - this.#visibleRows())\n break\n case 'PageDown':\n target = Math.min(last, from + this.#visibleRows())\n break\n case 'Home':\n target = 0\n break\n case 'End':\n target = last\n break\n default:\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const key = event.key.toLocaleLowerCase()\n for (let step = 1; step <= state.rows.length; step++) {\n const index = (from + step) % state.rows.length\n if (state.rows[index]!.text.toLocaleLowerCase().startsWith(key)) {\n target = index\n break\n }\n }\n }\n }\n if (target === undefined) return\n event.preventDefault()\n if (this.props.disabled) return\n if (target === current) return\n this.#choose(state, target)\n }\n\n /** Pointer-drag scrolling for mouse and pen; touch scrolls natively. */\n #drag(state: Wheel): void {\n let start: { y: number; top: number } | null = null\n state.list.addEventListener('pointerdown', (event) => {\n if (event.pointerType === 'touch') return\n start = { y: event.clientY, top: state.list.scrollTop }\n state.moved = false\n })\n window.addEventListener(\n 'pointermove',\n (event) => {\n if (!start) return\n const dy = event.clientY - start.y\n if (Math.abs(dy) > 4 && !state.moved) {\n state.moved = true\n state.wheel.setAttribute('data-dragging', '')\n }\n if (state.moved) state.list.scrollTop = start.top - dy\n },\n { signal: this.#drags.signal },\n )\n window.addEventListener(\n 'pointerup',\n () => {\n start = null\n state.wheel.removeAttribute('data-dragging')\n },\n { signal: this.#drags.signal },\n )\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-toast>`: the Toast's single source (spec: wave-1/toast.md).\n *\n * The element is the spec's provider and region in one: it owns the queue\n * and the history and renders the fixed region itself, so it is\n * self-rendering (like the theme palette) with no anatomy and no examples —\n * the queue is runtime data no renderer can express up front. Toasts arrive\n * through the element's imperative API, the hook's twin:\n * `show({ tone, title, message, action, duration, id })`, the shortcuts\n * `success` / `error` / `warning` / `info(title, options)`, `dismiss(id)`\n * and the `history` getter. The generated React wrapper forwards the host\n * element as its ref, so React consumers call the same API through it.\n *\n * The region is a landmark (a labelled `section`) holding two live-region\n * lists, not nested: errors in an assertive `role=\"alert\"` list, every other\n * tone in a polite `role=\"status\"` list. A toast never takes focus when\n * shown; F6 moves focus into the region and back out, Escape inside a\n * focused toast dismisses it, and when the last toast closes while focused,\n * focus returns to where it was. The auto-dismiss timer pauses while the\n * pointer is over the region, focus is inside it or the window is hidden.\n * Errors and toasts with an action are persistent by default (WCAG 2.2.1).\n */\nexport const toastDefinition = {\n tag: 'ty-toast',\n name: 'TyToast',\n kind: 'self-rendering',\n doc: 'Brief, non-blocking confirmation or warning after an action, shown in a fixed landmark region with one live-region politeness per tone (errors assertive, the rest polite). The element owns the queue and the history; toasts arrive through its imperative API (`show`, `success`/`error`/`warning`/`info`, `dismiss`, `history`), reachable through the host ref. Auto-dismiss pauses on hover, focus and a hidden window; errors and toasts with an action stay until dismissed.',\n props: {\n placement: { type: 'enum', values: ['top-end', 'top-center', 'bottom-center'], default: 'top-end', attribute: 'placement', doc: 'Region position (`data-placement`); `bottom-center` is recommended below 640 px.' },\n maxVisible: { type: 'number', default: 3, attribute: 'max-visible', doc: 'Toasts shown at once; the rest wait in the queue and appear as earlier ones dismiss.' },\n historyLimit: { type: 'number', default: 50, attribute: 'history-limit', doc: 'How many past toasts the history keeps (newest first); feeds the notification history.' },\n regionLabel: { type: 'string', default: 'Notifications', attribute: 'region-label', doc: 'Accessible name of the region landmark (the I18nAdapter\\'s toast.region in React).' },\n dismissLabel: { type: 'string', default: 'Dismiss notification', attribute: 'dismiss-label', doc: 'Accessible name of each toast\\'s dismiss button.' },\n },\n events: [\n { type: 'ty-toast-dismiss', kind: 'custom', detail: { id: 'string' }, reactProp: 'onDismiss', doc: 'A toast was dismissed — timeout, dismiss button, Escape, swipe, its action, or a `dismiss(id)` call; the detail carries its id (the spec\\'s `onDismiss`).' },\n { type: 'ty-toast-action', kind: 'custom', detail: { id: 'string' }, reactProp: 'onAction', doc: 'A toast\\'s action was pressed; its `onPress` ran too and the toast dismissed itself. Lets hosts that cannot pass a callback still react to the action.' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { toastDefinition } from './definition.ts'\n\nexport type ToastTone = 'success' | 'error' | 'warning' | 'info'\n\n/** Options of `show()` and the tone shortcuts — the React ToastOptions. */\nexport interface ToastOptions {\n tone?: ToastTone\n title: string\n message?: string\n /** One optional action, such as \"Undo\"; makes the toast persistent by default (WCAG 2.2.1). */\n action?: { label: string; onPress?: () => void }\n /** Auto-dismiss time in ms, or persistent. Errors and toasts with actions default to persistent. */\n duration?: number | 'persistent'\n /** A later call with the same id replaces this toast in place. */\n id?: string\n}\n\n/** A queued or past toast (the React ToastRecord). */\nexport interface ToastRecord {\n id: string\n tone: ToastTone\n title: string\n message?: string\n action?: { label: string; onPress?: () => void }\n duration: number | 'persistent'\n createdAt: number\n}\n\ntype ShortcutOptions = Omit<ToastOptions, 'title' | 'tone'>\n\ninterface TimerEntry {\n handle?: ReturnType<typeof setTimeout>\n remaining: number\n startedAt: number\n}\n\n/** Default auto-dismiss times (ms) per tone; errors never auto-dismiss. */\nconst DURATIONS: Record<ToastTone, number | 'persistent'> = {\n success: 5000,\n info: 5000,\n warning: 8000,\n error: 'persistent',\n}\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\nlet counter = 0\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** A decorative 24px lucide glyph (ISC, THIRD_PARTY_NOTICES). */\nfunction glyphIcon(className: string, children: ReadonlyArray<readonly [string, Record<string, string>]>): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n svg.setAttribute('class', className)\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const [tag, attrs] of children) {\n const node = document.createElementNS(SVG, tag)\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n svg.append(node)\n }\n return svg\n}\n\n/** The tone icons Toast.tsx composes from lucide-react. */\nconst TONE_ICONS: Record<ToastTone, () => SVGSVGElement> = {\n success: () => glyphIcon('ty-toast__icon', [['circle', { cx: '12', cy: '12', r: '10' }], ['path', { d: 'm16 9-5.5 5.5L8 12' }]]),\n error: () =>\n glyphIcon('ty-toast__icon', [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ]),\n warning: () =>\n glyphIcon('ty-toast__icon', [\n ['path', { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' }],\n ['path', { d: 'M12 9v4' }],\n ['path', { d: 'M12 17h.01' }],\n ]),\n info: () => glyphIcon('ty-toast__icon', [['circle', { cx: '12', cy: '12', r: '10' }], ['path', { d: 'M12 16v-4' }], ['path', { d: 'M12 8h.01' }]]),\n}\n\nconst closeIcon = () => glyphIcon('ty-icon', [['path', { d: 'M18 6 6 18' }], ['path', { d: 'm6 6 12 12' }]])\n\n/**\n * Arrival tick (the Haptics utility): silent without the Vibration API,\n * under reduced motion and before the page has had a user gesture.\n */\n\n// Browsers ignore navigator.vibrate before a user gesture; where the User\n// Activation API is missing, a first pointer, touch or key press opens the gate.\nlet gestureSeen = false\nconst GESTURES = ['pointerdown', 'touchstart', 'keydown', 'mousedown'] as const\n\nfunction onGesture(): void {\n gestureSeen = true\n for (const type of GESTURES) window.removeEventListener(type, onGesture, true)\n}\n\nif (typeof window !== 'undefined') {\n for (const type of GESTURES) window.addEventListener(type, onGesture, { capture: true, passive: true })\n}\n\nfunction arrivalHaptic(): void {\n try {\n if (typeof navigator === 'undefined' || typeof navigator.vibrate !== 'function') return\n const activation = (navigator as Navigator & { userActivation?: { hasBeenActive: boolean } }).userActivation\n const activated = activation && typeof activation.hasBeenActive === 'boolean' ? activation.hasBeenActive || gestureSeen : gestureSeen\n if (!activated) return\n if (typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return\n navigator.vibrate(8)\n } catch {\n /* unsupported */\n }\n}\n\nfunction num(value: unknown): number | undefined {\n if (value === undefined || value === false || value === '') return undefined\n const n = Number(value)\n return Number.isFinite(n) ? n : undefined\n}\n\n/**\n * `<ty-toast>`. Self-rendering: the element owns its whole subtree — the\n * fixed region landmark, its two live-region lists (assertive `role=\"alert\"`\n * for errors, polite `role=\"status\"` for the rest; live regions are not\n * nested) and the toasts themselves. Frameworks render an empty host and\n * drive the element through the imperative API, the spec's hook:\n *\n * - `show(options)` queues a toast (tone default `info`; duration default\n * tone-dependent — 5 s success/info, 8 s warning — or persistent for\n * errors and toasts with an action). A call with an existing `id` replaces\n * the toast in place. Returns the id.\n * - `success` / `error` / `warning` / `info(title, options)` shortcuts.\n * - `dismiss(id)` removes a toast and emits `ty-toast-dismiss`.\n * - `history` is the past toasts, newest first, capped at `history-limit`.\n *\n * At most `max-visible` toasts show; the rest wait in the queue. The\n * auto-dismiss timer pauses while the pointer is over the region, focus is\n * inside it or the window is hidden. A toast never takes focus when shown;\n * F6 moves focus into the region and back out, Escape inside a focused toast\n * dismisses it, and when the last toast closes while focused, focus returns\n * to where it was. A touch swipe toward the edge dismisses (never the only\n * way: the dismiss button and Escape always work).\n */\nexport class TyToastElement extends TyElement {\n static override definition = toastDefinition\n\n #queue: ToastRecord[] = []\n #history: ToastRecord[] = []\n #timers = new Map<string, TimerEntry>()\n #pauseReasons = new Set<string>()\n #region: HTMLElement | null = null\n #assertive: HTMLElement | null = null\n #polite: HTMLElement | null = null\n /** Visible toasts by id, for keyed reuse across renders (focus survives a queue change). */\n #items = new Map<string, { node: HTMLElement; record: ToastRecord }>()\n #returnFocus: HTMLElement | null = null\n #documentListeners: AbortController | null = null\n\n /** Queue a toast (or replace it, on an existing `id`); returns the id. */\n show(options: ToastOptions): string {\n const tone = options.tone ?? 'info'\n const id = options.id ?? `ty-toast-${++counter}`\n const duration = options.duration ?? (options.action ? 'persistent' : DURATIONS[tone])\n const record: ToastRecord = {\n id,\n tone,\n title: options.title,\n message: options.message,\n action: options.action,\n duration,\n createdAt: Date.now(),\n }\n this.#clearTimer(id)\n this.#queue = this.#queue.some((t) => t.id === id) ? this.#queue.map((t) => (t.id === id ? record : t)) : [...this.#queue, record]\n const limit = num(this.props.historyLimit) ?? 50\n this.#history = [record, ...this.#history.filter((t) => t.id !== id)].slice(0, Math.max(0, limit))\n // Silent before any user gesture (a toast can appear on its own).\n arrivalHaptic()\n this.#render()\n return id\n }\n\n success(title: string, options: ShortcutOptions = {}): string {\n return this.show({ ...options, title, tone: 'success' })\n }\n\n error(title: string, options: ShortcutOptions = {}): string {\n return this.show({ ...options, title, tone: 'error' })\n }\n\n warning(title: string, options: ShortcutOptions = {}): string {\n return this.show({ ...options, title, tone: 'warning' })\n }\n\n info(title: string, options: ShortcutOptions = {}): string {\n return this.show({ ...options, title, tone: 'info' })\n }\n\n /** Remove a toast (no-op for an unknown id) and announce the dismissal. */\n dismiss(id: string): void {\n if (!this.#queue.some((t) => t.id === id)) return\n this.#clearTimer(id)\n const focusedInside = !!this.#region && this.#region.contains(document.activeElement)\n const last = this.#visible().length === 1\n this.#queue = this.#queue.filter((t) => t.id !== id)\n this.emit('ty-toast-dismiss', { id })\n this.#render()\n // When the last toast closes while focused, focus returns to where it\n // was before entering the region (after the removal has settled).\n if (focusedInside && last) {\n const target = this.#returnFocus\n setTimeout(() => {\n if (target?.isConnected) target.focus()\n }, 0)\n }\n }\n\n /** Past toasts, newest first (feeds the notification history). */\n get history(): readonly ToastRecord[] {\n return this.#history\n }\n\n protected override connected(): void {\n const region = el('section', 'ty-toast-region')\n const assertive = el('div', 'ty-toast-region__list', { role: 'alert', 'aria-live': 'assertive', 'aria-atomic': 'false' })\n const polite = el('div', 'ty-toast-region__list', { role: 'status', 'aria-live': 'polite', 'aria-atomic': 'false' })\n region.append(assertive, polite)\n this.replaceChildren(region)\n this.#region = region\n this.#assertive = assertive\n this.#polite = polite\n this.#items.clear()\n\n region.addEventListener('pointerenter', this.#onPointerEnter)\n region.addEventListener('pointerleave', this.#onPointerLeave)\n region.addEventListener('focusin', this.#onFocusIn)\n region.addEventListener('focusout', this.#onFocusOut)\n\n const controller = new AbortController()\n this.#documentListeners = controller\n document.addEventListener('keydown', this.#onDocumentKeydown, { signal: controller.signal })\n document.addEventListener('visibilitychange', this.#onVisibilityChange, { signal: controller.signal })\n\n this.#render()\n }\n\n protected override disconnected(): void {\n this.#documentListeners?.abort()\n this.#documentListeners = null\n for (const entry of this.#timers.values()) if (entry.handle) clearTimeout(entry.handle)\n this.#timers.clear()\n this.#pauseReasons.clear()\n this.#region = null\n this.#assertive = null\n this.#polite = null\n this.#items.clear()\n this.#returnFocus = null\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#render()\n }\n\n #visible(): ToastRecord[] {\n return this.#queue.slice(0, Math.max(0, num(this.props.maxVisible) ?? 3))\n }\n\n /** Bring the region's attributes and the visible toasts in step with the props and the queue. */\n #render(): void {\n const region = this.#region\n if (!region) return\n const props = this.props\n region.setAttribute('aria-label', String(props.regionLabel))\n region.setAttribute('data-placement', String(props.placement))\n const dismissLabel = String(props.dismissLabel)\n\n const visible = this.#visible()\n // Arm the timers of newly visible, non-persistent toasts.\n for (const t of visible) {\n if (t.duration !== 'persistent' && !this.#timers.has(t.id)) this.#arm(t.id, t.duration)\n }\n\n const seen = new Set<string>()\n for (const record of visible) {\n seen.add(record.id)\n let item = this.#items.get(record.id)\n if (item && item.record !== record) {\n // Replaced in place (a show() with the same id): rebuild the node,\n // keeping focus if the old one held it.\n const hadFocus = item.node.contains(document.activeElement)\n const node = this.#build(record)\n item.node.replaceWith(node)\n item = { node, record }\n this.#items.set(record.id, item)\n if (hadFocus) node.focus()\n } else if (!item) {\n item = { node: this.#build(record), record }\n this.#items.set(record.id, item)\n }\n const dismiss = item.node.querySelector('.ty-toast__dismiss')\n if (dismiss) {\n dismiss.setAttribute('aria-label', dismissLabel)\n dismiss.setAttribute('title', dismissLabel)\n }\n // Appending moves the node; iterating the queue in order keeps each\n // list's order (errors in the assertive list, the rest in the polite).\n ;(record.tone === 'error' ? this.#assertive : this.#polite)!.append(item.node)\n }\n for (const [id, item] of [...this.#items]) {\n if (!seen.has(id)) {\n item.node.remove()\n this.#items.delete(id)\n }\n }\n }\n\n /** A toast: tone icon, title, optional message, optional action, dismiss button (Toast.tsx's ToastItem). */\n #build(record: ToastRecord): HTMLElement {\n const item = el('div', 'ty-toast', {\n 'data-tone': record.tone,\n tabindex: '0',\n role: 'group',\n 'aria-labelledby': `${record.id}-title`,\n })\n if (record.message) item.setAttribute('aria-describedby', `${record.id}-message`)\n item.append(TONE_ICONS[record.tone]())\n\n const body = el('div', 'ty-toast__body')\n const title = el('p', 'ty-toast__title', { id: `${record.id}-title` })\n title.textContent = record.title\n body.append(title)\n if (record.message) {\n const message = el('p', 'ty-toast__message', { id: `${record.id}-message` })\n message.textContent = record.message\n body.append(message)\n }\n if (record.action) {\n const actions = el('div', 'ty-toast__actions')\n const button = el('button', 'ty-button', { type: 'button', 'data-variant': 'secondary', 'data-size': 'compact' })\n const label = el('span', 'ty-button__label')\n label.textContent = record.action.label\n button.append(label)\n button.addEventListener('click', () => {\n record.action?.onPress?.()\n this.emit('ty-toast-action', { id: record.id })\n this.dismiss(record.id)\n })\n actions.append(button)\n body.append(actions)\n }\n\n const dismissLabel = String(this.props.dismissLabel)\n const dismiss = el('button', 'ty-button ty-toast__dismiss', {\n type: 'button',\n 'data-variant': 'quiet',\n 'data-size': 'compact',\n 'data-icon-only': '',\n 'aria-label': dismissLabel,\n title: dismissLabel,\n })\n const iconWrap = el('span', 'ty-button__icon', { 'aria-hidden': 'true' })\n iconWrap.append(closeIcon())\n dismiss.append(iconWrap)\n dismiss.addEventListener('click', () => this.dismiss(record.id))\n\n item.append(body, dismiss)\n\n item.addEventListener('keydown', (event) => {\n if ((event as KeyboardEvent).key !== 'Escape') return\n event.stopPropagation()\n this.dismiss(record.id)\n })\n\n // A touch swipe toward the edge dismisses (never the only way).\n let swipe: { x: number; id: number } | null = null\n let offset = 0\n item.addEventListener('pointerdown', (event) => {\n const e = event as PointerEvent\n if (e.pointerType === 'touch') swipe = { x: e.clientX, id: e.pointerId }\n })\n item.addEventListener('pointermove', (event) => {\n const e = event as PointerEvent\n if (swipe && swipe.id === e.pointerId) {\n offset = Math.max(0, e.clientX - swipe.x)\n item.style.transform = offset ? `translateX(${offset}px)` : ''\n }\n })\n const endSwipe = () => {\n if (swipe && offset > 80) this.dismiss(record.id)\n swipe = null\n offset = 0\n item.style.transform = ''\n }\n item.addEventListener('pointerup', endSwipe)\n item.addEventListener('pointercancel', endSwipe)\n\n return item\n }\n\n #clearTimer(id: string): void {\n const entry = this.#timers.get(id)\n if (entry?.handle) clearTimeout(entry.handle)\n this.#timers.delete(id)\n }\n\n #arm(id: string, ms: number): void {\n const entry: TimerEntry = { remaining: ms, startedAt: Date.now() }\n if (this.#pauseReasons.size === 0) entry.handle = setTimeout(() => this.dismiss(id), ms)\n this.#timers.set(id, entry)\n }\n\n #pause(reason: string): void {\n const wasRunning = this.#pauseReasons.size === 0\n this.#pauseReasons.add(reason)\n if (!wasRunning) return\n for (const entry of this.#timers.values()) {\n if (entry.handle) {\n clearTimeout(entry.handle)\n entry.handle = undefined\n entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.startedAt))\n }\n }\n }\n\n #resume(reason: string): void {\n if (!this.#pauseReasons.delete(reason) || this.#pauseReasons.size > 0) return\n for (const [id, entry] of this.#timers) {\n entry.startedAt = Date.now()\n entry.handle = setTimeout(() => this.dismiss(id), entry.remaining)\n }\n }\n\n #onPointerEnter = (): void => this.#pause('hover')\n\n #onPointerLeave = (): void => this.#resume('hover')\n\n #onFocusIn = (event: FocusEvent): void => {\n if (this.#region?.contains(event.relatedTarget as Node | null)) return\n if (event.relatedTarget instanceof HTMLElement) this.#returnFocus = event.relatedTarget\n this.#pause('focus')\n }\n\n #onFocusOut = (event: FocusEvent): void => {\n if (!this.#region?.contains(event.relatedTarget as Node | null)) this.#resume('focus')\n }\n\n /** F6 moves focus to the region (and back out of it). */\n #onDocumentKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'F6' || !this.#region) return\n const region = this.#region\n if (region.contains(document.activeElement)) {\n this.#returnFocus?.focus()\n } else if (region.querySelector('.ty-toast')) {\n event.preventDefault()\n this.#returnFocus = document.activeElement as HTMLElement | null\n region.querySelector<HTMLElement>('.ty-toast')?.focus()\n }\n }\n\n /** The auto-dismiss timer pauses while the window is hidden. */\n #onVisibilityChange = (): void => {\n if (document.hidden) this.#pause('hidden')\n else this.#resume('hidden')\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-tag-field>`: the TagField's single source (spec: wave-2/tag-field.md).\n *\n * Self-rendering like the theme palette: the field is data-driven (the pills\n * repeat per committed value, the suggestion popup per matching option) and\n * stateful (the draft, the popup, the highlight), which the declarative\n * anatomy cannot express, so the element owns its whole subtree and wrappers\n * render an empty host. Collections cross the attribute boundary as JSON\n * (`value`, `suggestions`, `suggestion-labels`), the `theme-labels`\n * precedent; the committed list stays controlled — the element asks for\n * changes with `ty-change` and never writes its own `value`.\n *\n * `validate` (normalise or reject an entry) is a function, so it cannot be an\n * attribute: hosts assign it as a property on the element. The remove\n * control's name is the `remove-label` template (`{value}` filled with the\n * pill's display text).\n *\n * Examples stay empty: the parity renderers could only produce the empty\n * host of a self-rendering element (the theme-palette precedent).\n */\nexport const tagFieldDefinition = {\n tag: 'ty-tag-field',\n name: 'TyTagField',\n kind: 'self-rendering',\n doc: 'Short values typed into removable pills, optionally assisted by (or restricted to) a suggestion list. Enter or comma commits the draft (or the highlighted suggestion), Backspace on an empty entry removes the last pill; duplicates (case-insensitive), values past `max` and — with `allow-free-text=\"false\"` — values outside `suggestions` are refused. With suggestions the entry is an APG combobox with list autocomplete (active descendant, wrap-around arrows).',\n props: {\n value: { type: 'string', attribute: 'value', doc: 'JSON array of the committed values (controlled); the element asks for changes with `ty-change`, it never writes its own.' },\n suggestions: { type: 'string', attribute: 'suggestions', doc: 'JSON array of known values; turns the entry into a combobox.' },\n suggestionLabels: { type: 'string', attribute: 'suggestion-labels', doc: 'JSON object of display text per value, used in the popup and on the pills.' },\n allowFreeText: { type: 'string', attribute: 'allow-free-text', doc: '`true` or `false`; unset: free text is allowed. `false`: only values present in `suggestions` are accepted (the `show-arrow` precedent for a default-true switch).' },\n max: { type: 'number', attribute: 'max', doc: 'Maximum pills; the entry is disabled at the limit and re-enabled when one is removed.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Disables the entry and every remove control.' },\n tone: { type: 'enum', values: ['neutral', 'accent'], default: 'neutral', attribute: 'tone', doc: 'Pill tint; `accent` fills with the theme accent.' },\n categoryIndex: { type: 'number', attribute: 'category-index', doc: 'A categorical token (1 to 8) as the pill tint, shown as a small colour square; normalised into range on upgrade, wins over `tone`.' },\n label: { type: 'string', attribute: 'label', doc: 'Visible label above the field, targeting the entry; if absent, `accessibleLabel` is required.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the entry when there is no visible label.' },\n placeholder: { type: 'string', attribute: 'placeholder', doc: 'Hint in the entry.' },\n helperText: { type: 'string', attribute: 'helper-text', doc: 'Help text below the field, linked as the entry\\'s description.' },\n errorText: { type: 'string', attribute: 'error-text', doc: 'Marks the field invalid; shown below the helper text and linked as description.' },\n removeLabel: { type: 'string', default: 'Remove {value}', attribute: 'remove-label', doc: 'Accessible name template of each remove control; `{value}` is the pill\\'s display text.' },\n chosenLabel: { type: 'string', default: '{field}: chosen values', attribute: 'chosen-label', doc: 'Accessible name template of the pill list; `{field}` is the label (or accessible label).' },\n suggestionsLabel: { type: 'string', default: 'Suggestions', attribute: 'suggestions-label', doc: 'Accessible name of the suggestion popup.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the root (`data-testid`).' },\n },\n events: [\n { type: 'ty-change', kind: 'custom', detail: { value: 'string' }, reactProp: 'onChange', doc: 'A value was added or removed; `value` is the next list as a JSON array. Controlled: the host writes it back to the `value` attribute.' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { tagFieldDefinition } from './definition.ts'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\n/** Case-insensitive (accent-keeping) equality, the React TagField's `same`. */\nconst same = (a: string, b: string) => a.localeCompare(b, undefined, { sensitivity: 'accent' }) === 0\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** The remove control's × (lucide strokes, ISC, THIRD_PARTY_NOTICES). */\nfunction xIcon(): SVGElement {\n const svg = document.createElementNS(SVG_NS, 'svg')\n svg.setAttribute('class', 'ty-icon')\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const d of ['M18 6 6 18', 'm6 6 12 12']) {\n const path = document.createElementNS(SVG_NS, 'path')\n path.setAttribute('d', d)\n svg.append(path)\n }\n return svg\n}\n\n/**\n * `<ty-tag-field>`. Self-rendering: the field is data-driven (a pill per\n * committed value, an option per matching suggestion) and stateful (the\n * draft, the popup, the highlight), so the element owns its whole subtree —\n * built once on connect, then kept in step with the attributes and the\n * field's own state. The DOM mirrors the React TagField's parts\n * (`ty-tag-field__well`, `__chip`, `__drop`, `__menu-layer`, …) so the\n * shared TagField.css paints both.\n *\n * The value is controlled: committing (Enter, comma, an option press) or\n * removing (a remove control, Backspace on an empty entry) only emits\n * `ty-change` with the next list as JSON; the host writes it back to the\n * `value` attribute. Every entry passes the React gate in order: trim,\n * `validate` (a property — functions cannot be attributes), then the\n * refusals (blank, invalid, duplicate ignoring case, past `max`, unlisted\n * with `allow-free-text=\"false\"`).\n *\n * With suggestions the entry is an APG combobox: focus stays in the input,\n * the highlight is `aria-activedescendant`, ArrowDown/ArrowUp move it with\n * wrap-around, Enter commits the highlighted option, Escape closes without\n * committing, and options commit on mousedown with the default prevented so\n * the input never loses focus.\n */\nexport class TyTagFieldElement extends TyElement {\n static override definition = tagFieldDefinition\n\n /** Normalises an entry (after trimming) or rejects it with null. Assigned by the host, not an attribute. */\n validate?: (raw: string) => string | null\n\n #draft = ''\n #open = false\n #active: number | null = null\n /** Signatures of the last render, so a sync rebuilds only what changed. */\n #chipsKey = ''\n #menuKey = ''\n\n #root: HTMLElement | null = null\n #caption: HTMLLabelElement | null = null\n #well: HTMLElement | null = null\n #chipList: HTMLElement | null = null\n #input: HTMLInputElement | null = null\n #menuLayer: HTMLElement | null = null\n #menu: HTMLElement | null = null\n #note: HTMLElement | null = null\n #fault: HTMLElement | null = null\n\n get field(): HTMLInputElement | null {\n return this.#input\n }\n\n /* ------------------------------------------------------------ data -- */\n\n #json<T>(raw: unknown, fallback: T): T {\n if (typeof raw !== 'string' || raw === '') return fallback\n try {\n const parsed: unknown = JSON.parse(raw)\n return (parsed ?? fallback) as T\n } catch {\n return fallback\n }\n }\n\n /** The committed values (controlled, from the `value` attribute). */\n held(): string[] {\n const list = this.#json<unknown>(this.props.value, [])\n return Array.isArray(list) ? list.filter((v): v is string => typeof v === 'string') : []\n }\n\n #suggestions(): string[] {\n const list = this.#json<unknown>(this.props.suggestions, [])\n return Array.isArray(list) ? list.filter((v): v is string => typeof v === 'string') : []\n }\n\n #labels(): Record<string, string> {\n const map = this.#json<unknown>(this.props.suggestionLabels, {})\n if (typeof map !== 'object' || map === null || Array.isArray(map)) return {}\n return Object.fromEntries(Object.entries(map).filter(([, v]) => typeof v === 'string')) as Record<string, string>\n }\n\n #freeText(): boolean {\n return String(this.props.allowFreeText ?? 'true') !== 'false'\n }\n\n #disabled(): boolean {\n return Boolean(this.props.disabled)\n }\n\n #atMax(held: readonly string[]): boolean {\n const max = this.props.max\n return max !== undefined && held.length >= Number(max)\n }\n\n /** Suggestions not yet chosen, matching the draft against value and display text. */\n #offers(): Array<{ id: string; text: string }> {\n const held = this.held()\n const labels = this.#labels()\n const query = this.#draft.trim().toLocaleLowerCase()\n return this.#suggestions().flatMap((s) => {\n if (held.some((h) => same(h, s))) return []\n const text = labels[s] ?? s\n const hit = !query || s.toLocaleLowerCase().includes(query) || text.toLocaleLowerCase().includes(query)\n return hit ? [{ id: s, text }] : []\n })\n }\n\n /** The gate every entry passes (the React TagField's `judge`): the value to commit, or null to refuse. */\n #judge(raw: string): string | null {\n const bare = raw.trim()\n if (bare === '') return null\n const shaped = this.validate ? this.validate(bare) : bare\n if (!shaped) return null\n const held = this.held()\n if (held.some((h) => same(h, shaped))) return null\n if (this.#atMax(held)) return null\n const suggestions = this.#suggestions()\n if (suggestions.length > 0 && !this.#freeText() && !suggestions.includes(shaped)) return null\n return shaped\n }\n\n /* ------------------------------------------------------------ tree -- */\n\n #build(): void {\n const instance = this.instanceId\n this.#caption = el('label', 'ty-tag-field__caption') as HTMLLabelElement\n this.#well = el('div', 'ty-tag-field__well')\n const chips = el('span', 'ty-tag-field__chips')\n this.#chipList = el('span', 'ty-tag-field__chip-list', { role: 'list' })\n chips.append(this.#chipList)\n this.#input = el('input', 'ty-tag-field__typing', { id: `${instance}-input`, type: 'text', autocomplete: 'off' }) as HTMLInputElement\n const typingHost = el('span', 'ty-tag-field__typing-host')\n typingHost.append(this.#input)\n this.#well.append(chips, typingHost)\n this.#menu = el('ul', 'ty-tag-field__menu', { id: `${instance}-listbox`, role: 'listbox' })\n this.#menuLayer = el('div', 'ty-tag-field__menu-layer', { hidden: '' })\n this.#menuLayer.append(this.#menu)\n const frame = el('div', 'ty-tag-field__frame')\n frame.append(this.#well, this.#menuLayer)\n this.#note = el('p', 'ty-tag-field__note', { id: `${instance}-note`, hidden: '' })\n this.#fault = el('p', 'ty-tag-field__fault', { id: `${instance}-fault`, hidden: '' })\n this.#root = el('div', 'ty-tag-field')\n this.#root.append(this.#caption, frame, this.#note, this.#fault)\n this.replaceChildren(this.#root)\n }\n\n /** Bring the tree in step with the attributes and the field state. */\n #sync(): void {\n this.#normaliseCategory()\n const { props } = this\n const root = this.#root\n const input = this.#input\n if (!root || !input || !this.#caption || !this.#well || !this.#chipList || !this.#menuLayer || !this.#menu || !this.#note || !this.#fault) return\n const instance = this.instanceId\n const held = this.held()\n const labels = this.#labels()\n const shown = (v: string) => labels[v] ?? v\n const disabled = this.#disabled()\n const atMax = this.#atMax(held)\n const suggestions = this.#suggestions()\n const hasSuggestions = suggestions.length > 0\n const error = props.errorText ? String(props.errorText) : ''\n const helper = props.helperText ? String(props.helperText) : ''\n const label = props.label ? String(props.label) : ''\n\n // Category wins over tone; the tint travels as the same custom property\n // the React component sets.\n const category = props.categoryIndex !== undefined && Number.isFinite(Number(props.categoryIndex)) ? Number(props.categoryIndex) : undefined\n root.setAttribute('data-tone', category !== undefined ? 'category' : String(props.tone))\n root.style.setProperty('--ty-tag-field-tint', category !== undefined ? `var(--ty-categorical-${category})` : '')\n root.toggleAttribute('data-invalid', Boolean(error))\n if (props.testId) root.setAttribute('data-testid', String(props.testId))\n else root.removeAttribute('data-testid')\n\n this.#caption.hidden = !label\n this.#caption.textContent = label\n this.#caption.htmlFor = `${instance}-input`\n this.#well.toggleAttribute('data-disabled', disabled)\n\n input.id = `${instance}-input`\n input.placeholder = props.placeholder ? String(props.placeholder) : ''\n input.disabled = disabled || atMax\n if (error) input.setAttribute('aria-invalid', 'true')\n else input.removeAttribute('aria-invalid')\n if (!label && props.accessibleLabel) input.setAttribute('aria-label', String(props.accessibleLabel))\n else input.removeAttribute('aria-label')\n input.setAttribute('aria-describedby', [helper && `${instance}-note`, error && `${instance}-fault`].filter(Boolean).join(' ') || '')\n if (!input.getAttribute('aria-describedby')) input.removeAttribute('aria-describedby')\n\n const offers = this.#offers()\n const listOpen = hasSuggestions && this.#open && offers.length > 0\n if (hasSuggestions) {\n input.setAttribute('role', 'combobox')\n input.setAttribute('aria-expanded', listOpen ? 'true' : 'false')\n input.setAttribute('aria-controls', `${instance}-listbox`)\n input.setAttribute('aria-autocomplete', 'list')\n if (listOpen && this.#active !== null && offers[this.#active]) input.setAttribute('aria-activedescendant', `${instance}-option-${this.#active}`)\n else input.removeAttribute('aria-activedescendant')\n } else {\n for (const name of ['role', 'aria-expanded', 'aria-controls', 'aria-autocomplete', 'aria-activedescendant']) input.removeAttribute(name)\n }\n\n this.#note.hidden = !helper\n this.#note.textContent = helper\n this.#note.id = `${instance}-note`\n this.#fault.hidden = !error\n this.#fault.textContent = error\n this.#fault.id = `${instance}-fault`\n this.#menu.id = `${instance}-listbox`\n this.#menu.setAttribute('aria-label', String(props.suggestionsLabel))\n\n // The pills rebuild only when they changed (a focused remove control\n // keeps its node while the draft moves).\n const chipsKey = JSON.stringify([held, labels, disabled, props.removeLabel, props.chosenLabel, label, props.accessibleLabel, instance])\n if (chipsKey !== this.#chipsKey) {\n this.#chipsKey = chipsKey\n const field = label || String(props.accessibleLabel ?? '')\n const chosen = String(props.chosenLabel).replaceAll('{field}', field)\n this.#chipList.setAttribute('aria-label', field ? chosen : chosen.replace(/^:\\s*/, ''))\n const template = String(props.removeLabel)\n this.#chipList.replaceChildren(\n ...held.map((value) => {\n const chip = el('span', 'ty-tag-field__chip', { role: 'listitem' })\n const text = el('span', 'ty-tag-field__chip-text')\n text.textContent = shown(value)\n const drop = el('button', 'ty-tag-field__drop', { type: 'button', 'aria-label': template.replaceAll('{value}', shown(value)), 'data-value': value }) as HTMLButtonElement\n drop.disabled = disabled\n drop.append(xIcon())\n chip.append(text, drop)\n return chip\n }),\n )\n }\n\n // The options are keyed by position and REUSED (attributes and text in\n // place), never rebuilt: a highlight move must land on the same node\n // the page (and a test) is holding.\n const menuKey = listOpen ? JSON.stringify([offers, instance]) : ''\n if (menuKey !== this.#menuKey) {\n this.#menuKey = menuKey\n this.#menu.replaceChildren(\n ...(!listOpen\n ? []\n : offers.map((offer) => {\n const option = el('li', 'ty-tag-field__choice', { role: 'option', 'data-value': offer.id })\n option.textContent = offer.text\n return option\n })),\n )\n }\n Array.from(this.#menu.children).forEach((node, index) => {\n const option = node as HTMLElement\n if (!option.id) option.id = `${instance}-option-${index}`\n option.setAttribute('aria-selected', this.#active === index ? 'true' : 'false')\n option.toggleAttribute('data-focused', this.#active === index)\n })\n this.#menuLayer.hidden = !listOpen\n }\n\n /* --------------------------------------------------------- behaviour -- */\n\n /** Ask the host for the next list (controlled). */\n #request(next: string[]): void {\n this.emit('ty-change', { value: JSON.stringify(next) })\n }\n\n /** A successful commit also resets the draft and closes the popup. */\n #commit(raw: string): void {\n const take = this.#judge(raw)\n if (take === null) return\n this.#request([...this.held(), take])\n this.#draft = ''\n if (this.#input) this.#input.value = ''\n this.#open = false\n this.#active = null\n this.#sync()\n }\n\n #drop(value: string): void {\n if (this.#disabled()) return\n const held = this.held()\n if (!held.includes(value)) return\n this.#request(held.filter((v) => v !== value))\n this.#input?.focus()\n }\n\n #onKeydown = (event: KeyboardEvent): void => {\n if (event.target !== this.#input || this.#disabled()) return\n const input = this.#input!\n const offers = this.#offers()\n switch (event.key) {\n case 'Enter':\n case ',': {\n // The commit keys are always ours (a comma never reaches the text).\n event.preventDefault()\n const picked = this.#open && this.#active !== null ? offers[this.#active] : undefined\n this.#commit(picked ? picked.id : input.value)\n return\n }\n case 'Backspace': {\n if (input.value !== '') return\n const held = this.held()\n if (!held.length) return\n event.preventDefault()\n this.#request(held.slice(0, -1))\n return\n }\n case 'ArrowDown':\n case 'ArrowUp': {\n if (!this.#suggestions().length || !offers.length) return\n event.preventDefault()\n const count = offers.length\n this.#active =\n event.key === 'ArrowDown'\n ? this.#active === null\n ? 0\n : (this.#active + 1) % count\n : this.#active === null || this.#active === 0\n ? count - 1\n : this.#active - 1\n this.#open = true\n this.#sync()\n const option = this.#menu?.children[this.#active]\n if (typeof (option as HTMLElement | undefined)?.scrollIntoView === 'function') (option as HTMLElement).scrollIntoView({ block: 'nearest' })\n return\n }\n case 'Escape': {\n if (!this.#open) return\n event.preventDefault()\n this.#open = false\n this.#active = null\n this.#sync()\n }\n }\n }\n\n #onInput = (event: Event): void => {\n if (event.target !== this.#input) return\n this.#draft = this.#input!.value\n if (this.#suggestions().length) this.#open = true\n // The first offer is highlighted while typing (RAC's combobox), so\n // Enter commits the filtered match without an arrow key first.\n this.#active = this.#offers().length ? 0 : null\n this.#sync()\n }\n\n #onFocus = (event: FocusEvent): void => {\n if (event.target !== this.#input || !this.#suggestions().length) return\n this.#open = true\n this.#active = this.#active ?? (this.#offers().length ? 0 : null)\n this.#sync()\n }\n\n /** The popup closes when focus leaves the field. */\n #onFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null\n if (next && this.contains(next)) return\n if (!this.#open) return\n this.#open = false\n this.#active = null\n this.#sync()\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const drop = target.closest('.ty-tag-field__drop')\n if (drop && this.contains(drop) && !(drop as HTMLButtonElement).disabled) this.#drop(drop.getAttribute('data-value') ?? '')\n // A click on the entry re-opens the suggestions: focusin alone does not\n // re-fire on an input that never lost focus.\n if (this.#input && this.#suggestions().length && target.closest('.ty-tag-field__well') && !this.#open) {\n this.#open = true\n this.#active = this.#active ?? (this.#offers().length ? 0 : null)\n this.#sync()\n }\n }\n\n /** Options commit on mousedown with the default prevented, so the entry never loses focus. */\n #onOptionPress = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const option = target.closest('.ty-tag-field__choice')\n if (!option || !this.contains(option)) return\n event.preventDefault()\n this.#commit(option.getAttribute('data-value') ?? '')\n }\n\n protected override connected(): void {\n this.#build()\n this.#sync()\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('input', this.#onInput)\n this.addEventListener('focusin', this.#onFocus)\n this.addEventListener('focusout', this.#onFocusOut)\n this.addEventListener('click', this.#onClick)\n this.addEventListener('mousedown', this.#onOptionPress)\n }\n\n protected override disconnected(): void {\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('input', this.#onInput)\n this.removeEventListener('focusin', this.#onFocus)\n this.removeEventListener('focusout', this.#onFocusOut)\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('mousedown', this.#onOptionPress)\n }\n\n protected override changed(): void {\n if (!this.isConnected || !this.#root) return\n // Normalise `category-index` into the 1–8 categorical tokens (as\n // <ty-tag>). Attributes present BEFORE the upgrade never reach\n // attributeChangedCallback, so the pass also runs from `#sync`.\n this.#normaliseCategory()\n this.#sync()\n }\n\n #normaliseCategory(): void {\n const raw = this.getAttribute('category-index')\n if (raw === null) return\n const n = Number(raw)\n if (!Number.isFinite(n)) {\n this.removeAttribute('category-index')\n return\n }\n const normalized = String(((Math.max(1, Math.round(n)) - 1) % 8) + 1)\n if (normalized !== raw) this.setAttribute('category-index', normalized)\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-tabs>`: the Tabs' single source (spec: wave-1/tabs.md).\n *\n * The anatomy covers the shell: the root and the tab list. The tabs\n * themselves repeat per entry of the `tabs` prop, which the declarative\n * anatomy cannot express (no dynamic repetition), so the element composes\n * them into the list on upgrade — as the skeleton composes its presets.\n * Panels are the host's own children (the default slot), each keyed to a tab\n * by `data-panel`; the element wires their role, id, `aria-labelledby` and\n * visibility. Examples therefore show the shell only: the parity renderers\n * could not produce the composed tabs or the wired panels.\n */\nexport const tabsDefinition = {\n tag: 'ty-tabs',\n name: 'TyTabs',\n kind: 'enhancing',\n doc: 'Sibling views of one object, one panel at a time (the APG tabs pattern). The tab list is one tab stop: the arrow keys move along the `orientation` axis, wrapping and skipping disabled tabs, Home and End jump, and Left/Right follow the reading direction. `activation` decides whether moving focus also selects. Selection is controlled with `selected-key` or uncontrolled from `default-selected-key` (the first enabled tab when neither is set); a different selection is reported with `ty-selection-change`.',\n props: {\n selectedKey: { type: 'string', attribute: 'selected-key', doc: 'Controlled selection: the selected tab\\'s id. The element asks for a change with `ty-selection-change`; the host flips the attribute.' },\n defaultSelectedKey: { type: 'string', attribute: 'default-selected-key', doc: 'Initial selection of an uncontrolled list; the first enabled tab when unset.' },\n orientation: { type: 'enum', values: ['horizontal', 'vertical'], default: 'horizontal', attribute: 'orientation', doc: 'Layout of the list and the arrow-key axis: Left/Right (following the reading direction), or Up/Down when vertical.' },\n activation: { type: 'enum', values: ['automatic', 'manual'], default: 'automatic', attribute: 'activation', doc: 'Automatic selects on focus; manual needs Enter or Space on the focused tab.' },\n label: { type: 'string', attribute: 'label', doc: 'Accessible name of the tab list (required).' },\n tabs: { type: 'string', attribute: 'tabs', doc: 'JSON array of the tabs: [{ \"id\", \"label\", \"count\"?, \"disabled\"? }]. The count follows the label and joins the accessible name; a disabled tab cannot be selected and the arrow keys skip it. (The React component\\'s decorative icon has no attribute form.)' },\n keepMounted: { type: 'boolean', attribute: 'keep-mounted', doc: 'Keep inactive panels in the DOM (hidden) to preserve their state. The element always keeps them — their nodes belong to the host — so the attribute only tells a wrapper it may unmount.' },\n },\n events: [\n { type: 'ty-selection-change', kind: 'custom', detail: { key: 'string' }, reactProp: 'onSelectionChange', doc: 'A different tab was selected (a click, or the keyboard per `activation`). Uncontrolled, the element has already applied it; controlled (`selected-key`), the host flips the attribute.' },\n ],\n slots: {\n default: { doc: 'The panels: one element per tab, keyed by `data-panel` (the tab\\'s id). The element wires the role, id, `aria-labelledby` and visibility; only the selected panel shows.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-tabs',\n attrs: {\n 'data-orientation': { prop: 'orientation' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-tabs__list',\n attrs: {\n role: { value: 'tablist' },\n 'aria-label': { prop: 'label' },\n 'aria-orientation': { prop: 'orientation' },\n 'data-orientation': { prop: 'orientation' },\n },\n },\n { slot: 'default' },\n ],\n },\n examples: [\n { name: 'horizontal', props: { label: 'Run sections' }, slots: {} },\n { name: 'vertical', props: { label: 'Run sections', orientation: 'vertical' }, slots: {} },\n { name: 'manual', props: { label: 'Run sections', activation: 'manual' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { tabsDefinition } from './definition.ts'\n\n/** One entry of the `tabs` JSON prop (the React TabItem, minus the icon component). */\ninterface TabItem {\n id: string\n label: string\n count?: number\n disabled?: boolean\n}\n\n/** A key made safe for the id of an aria reference (a space would split an idrefs list). */\nconst safe = (key: string) => key.replace(/[^a-zA-Z0-9_-]/g, '-')\n\n/** The label/count signature each composed tab button last rendered. */\nconst rendered = new WeakMap<Element, string>()\n\n/**\n * `<ty-tabs>`. The anatomy — rendered by the host framework or built from\n * plain HTML — is the shell (the root and the tab list); the element adds\n * what the declarative anatomy cannot express and the APG tabs behaviour\n * (spec: wave-1/tabs.md):\n *\n * - **Composition** — a native `<button role=\"tab\">` per entry of the\n * `tabs` JSON prop, composed into the list and kept in step with it\n * (reusing nodes by key, so a recompose does not disturb focus). The\n * count follows the label and joins the accessible name (\"Runs 4\").\n * - **Panels** — the default slot's children, keyed by `data-panel`, get\n * the `tabpanel` role, an id the tab's `aria-controls` names, the tab's\n * `aria-labelledby`, and the `ty-tabs__panel` class; only the selected\n * panel shows (the rest stay mounted, `hidden` and `data-inert`, so their\n * state survives a switch).\n * - **Selection** — controlled through `selected-key` (the element asks\n * with `ty-selection-change`, the host flips the attribute) or\n * uncontrolled from `default-selected-key`, falling back to the first\n * enabled tab.\n * - **Keyboard** — one tab stop (roving tabindex on the focused, else the\n * selected tab); the arrow keys move along the orientation axis, wrapping\n * and skipping disabled tabs, Home and End jump, Left/Right follow the\n * reading direction. Automatic activation selects on focus; manual needs\n * Enter or Space (a native button press).\n *\n * Panels are the host's own children, which no host attribute reports, so a\n * MutationObserver re-runs the reconcile for panel changes; the pass only\n * writes differences, and settles after one extra run.\n */\nexport class TyTabsElement extends TyElement {\n static override definition = tabsDefinition\n\n /** Uncontrolled selection (controlled: the `selected-key` attribute). */\n #selected: string | undefined\n /** The tab holding DOM focus while the list has it (the roving tabindex). */\n #focused: string | undefined\n #observer: MutationObserver | null = null\n\n protected override connected(): void {\n this.addEventListener('click', this.#onClick)\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('focusin', this.#onFocusIn)\n this.addEventListener('focusout', this.#onFocusOut)\n this.#observer = new MutationObserver(() => this.#reconcile())\n this.#observer.observe(this, { childList: true, subtree: true })\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('focusin', this.#onFocusIn)\n this.removeEventListener('focusout', this.#onFocusOut)\n this.#observer?.disconnect()\n this.#observer = null\n }\n\n override sync(): void {\n const active = document.activeElement\n const refocus = active instanceof HTMLElement ? this.#keyOfTab(active) : undefined\n super.sync()\n this.#reconcile()\n // Plain HTML re-renders the anatomy on every attribute change, which\n // rebuilds the composed tabs; give the focus back to the tab that held it.\n if (refocus && !this.contains(document.activeElement)) this.#tabButton(refocus)?.focus()\n }\n\n #items(): TabItem[] {\n const raw = this.getAttribute('tabs')\n if (!raw) return []\n try {\n const parsed: unknown = JSON.parse(raw)\n if (!Array.isArray(parsed)) throw new Error('not an array')\n const items: TabItem[] = []\n for (const entry of parsed) {\n if (typeof entry !== 'object' || entry === null) continue\n const { id, label, count, disabled } = entry as Record<string, unknown>\n if (typeof id !== 'string' || !id || typeof label !== 'string') continue\n items.push({ id, label, count: typeof count === 'number' ? count : undefined, disabled: disabled === true })\n }\n return items\n } catch {\n console.warn('ty-tabs: `tabs` must be a JSON array of { id, label, count?, disabled? }.')\n return []\n }\n }\n\n #reconcile(): void {\n const root = this.anatomyRoot()\n if (!root) return\n const list = root.querySelector('.ty-tabs__list')\n if (!(list instanceof HTMLElement)) return\n const props = this.props\n const items = this.#items()\n const controlled = this.hasAttribute('selected-key')\n if (!controlled && this.#selected === undefined) {\n const wanted = props.defaultSelectedKey ? String(props.defaultSelectedKey) : undefined\n this.#selected = wanted && items.some((i) => i.id === wanted) ? wanted : items.find((i) => !i.disabled)?.id\n }\n let selected = controlled && props.selectedKey !== undefined ? String(props.selectedKey) : this.#selected\n if (selected !== undefined && !items.some((i) => i.id === selected)) {\n selected = items.find((i) => !i.disabled)?.id\n if (!controlled) this.#selected = selected\n }\n\n this.#compose(list, items)\n const buttons = this.#buttons(list)\n // Roving focus: the focused tab while the list has focus, else the\n // selected one; a disabled tab never takes the tab stop.\n const roving = this.#focused ?? selected\n const rovingKey = items.some((i) => i.id === roving && !i.disabled) ? roving : selected\n for (const button of buttons) {\n const key = button.dataset.tabKey!\n const item = items.find((i) => i.id === key)!\n button.setAttribute('aria-selected', key === selected ? 'true' : 'false')\n button.toggleAttribute('data-selected', key === selected)\n button.disabled = item.disabled === true\n button.toggleAttribute('data-disabled', item.disabled === true)\n button.tabIndex = key === rovingKey && item.disabled !== true ? 0 : -1\n }\n\n const panels = new Map<string, HTMLElement>()\n for (const child of Array.from(root.children)) {\n if (child instanceof HTMLElement && child.hasAttribute('data-panel')) panels.set(child.getAttribute('data-panel')!, child)\n }\n for (const [key, panel] of panels) {\n panel.classList.add('ty-tabs__panel')\n panel.setAttribute('role', 'tabpanel')\n if (!panel.id) panel.id = `${this.instanceId}-panel-${safe(key)}`\n const tab = buttons.find((b) => b.dataset.tabKey === key)\n if (tab) {\n panel.setAttribute('aria-labelledby', tab.id)\n tab.setAttribute('aria-controls', panel.id)\n }\n const shown = key === selected\n panel.hidden = !shown\n panel.toggleAttribute('data-inert', !shown)\n // Tab from the list lands in the selected panel (spec: it is focusable).\n if (shown) panel.setAttribute('tabindex', '0')\n else panel.removeAttribute('tabindex')\n }\n for (const button of buttons) {\n if (!panels.has(button.dataset.tabKey!)) button.removeAttribute('aria-controls')\n }\n }\n\n /** One button per item, reused by key and reordered to match; leftovers go. */\n #compose(list: HTMLElement, items: TabItem[]): void {\n const existing = new Map<string, HTMLButtonElement>()\n for (const child of Array.from(list.children)) {\n if (child instanceof HTMLButtonElement && child.dataset.tabKey !== undefined) existing.set(child.dataset.tabKey, child)\n }\n const wanted: HTMLButtonElement[] = []\n for (const item of items) {\n let button = existing.get(item.id)\n if (!button) {\n button = document.createElement('button')\n button.type = 'button'\n button.className = 'ty-tabs__tab'\n button.setAttribute('role', 'tab')\n button.dataset.tabKey = item.id\n }\n existing.delete(item.id)\n button.id = `${this.instanceId}-tab-${safe(item.id)}`\n this.#fillTab(button, item)\n wanted.push(button)\n }\n for (const leftover of existing.values()) leftover.remove()\n wanted.forEach((button, index) => {\n if (list.children[index] !== button) list.insertBefore(button, list.children[index] ?? null)\n })\n }\n\n /** The label, and the count after a separating space so it joins the accessible name. */\n #fillTab(button: HTMLButtonElement, item: TabItem): void {\n const counted = typeof item.count === 'number'\n const signature = `${item.label} ${counted ? item.count : ''}`\n if (rendered.get(button) === signature) return\n rendered.set(button, signature)\n const label = document.createElement('span')\n label.className = 'ty-tabs__label'\n label.textContent = item.label\n if (!counted) {\n button.replaceChildren(label)\n return\n }\n const count = document.createElement('span')\n count.className = 'ty-tabs__count'\n count.textContent = String(item.count)\n button.replaceChildren(label, document.createTextNode(' '), count)\n }\n\n #buttons(list?: HTMLElement | null): HTMLButtonElement[] {\n const scope = list ?? this.anatomyRoot()?.querySelector('.ty-tabs__list')\n if (!(scope instanceof HTMLElement)) return []\n return Array.from(scope.children).filter((c): c is HTMLButtonElement => c instanceof HTMLButtonElement && c.dataset.tabKey !== undefined)\n }\n\n #tabButton(key: string): HTMLButtonElement | undefined {\n return this.#buttons().find((b) => b.dataset.tabKey === key)\n }\n\n /** The tab key an element belongs to, when it is a tab of this list. */\n #keyOfTab(node: Element | null): string | undefined {\n const tab = node?.closest('.ty-tabs__tab')\n return tab instanceof HTMLElement && this.contains(tab) ? tab.dataset.tabKey : undefined\n }\n\n #rtl(): boolean {\n let node: HTMLElement | null = this\n while (node) {\n const dir = node.getAttribute('dir')\n if (dir) return dir.toLowerCase() === 'rtl'\n node = node.parentElement\n }\n return getComputedStyle(this).direction === 'rtl'\n }\n\n /** Select a tab the user activated; a no-op for the current or a disabled tab. */\n #select(key: string): void {\n const item = this.#items().find((i) => i.id === key)\n if (!item || item.disabled) return\n const current = this.hasAttribute('selected-key') ? String(this.props.selectedKey ?? '') : this.#selected\n if (key === current) return\n if (this.hasAttribute('selected-key')) {\n // Controlled: the host flips `selected-key`.\n this.emit('ty-selection-change', { key })\n return\n }\n this.#selected = key\n this.#reconcile()\n this.emit('ty-selection-change', { key })\n }\n\n #focusTab(key: string): void {\n this.#focused = key\n this.#reconcile()\n const button = this.#tabButton(key)\n button?.focus()\n // An overflowing list scrolls the tab into view instead of wrapping.\n button?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' })\n }\n\n #onClick = (event: Event): void => {\n const key = this.#keyOfTab(event.target as Element)\n if (key) this.#select(key)\n }\n\n #onKeydown = (event: KeyboardEvent): void => {\n const list = this.anatomyRoot()?.querySelector('.ty-tabs__list')\n if (!(list instanceof HTMLElement) || !list.contains(event.target as Node)) return\n const vertical = String(this.props.orientation) === 'vertical'\n const rtl = this.#rtl()\n let move: 'home' | 'end' | number | null = null\n switch (event.key) {\n case 'ArrowRight':\n if (!vertical) move = rtl ? -1 : 1\n break\n case 'ArrowLeft':\n if (!vertical) move = rtl ? 1 : -1\n break\n case 'ArrowDown':\n if (vertical) move = 1\n break\n case 'ArrowUp':\n if (vertical) move = -1\n break\n case 'Home':\n move = 'home'\n break\n case 'End':\n move = 'end'\n break\n default:\n return\n }\n if (move === null) return\n event.preventDefault()\n const enabled = this.#items().filter((i) => !i.disabled)\n if (!enabled.length) return\n const current = this.#keyOfTab(document.activeElement as Element) ?? this.#selected\n const index = Math.max(0, enabled.findIndex((i) => i.id === current))\n const next = move === 'home' ? enabled[0]! : move === 'end' ? enabled[enabled.length - 1]! : enabled[(index + move + enabled.length) % enabled.length]!\n this.#focusTab(next.id)\n if (String(this.props.activation) === 'automatic') this.#select(next.id)\n }\n\n #onFocusIn = (event: FocusEvent): void => {\n const key = this.#keyOfTab(event.target as Element)\n if (!key || key === this.#focused) return\n this.#focused = key\n this.#reconcile()\n }\n\n #onFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null\n const list = this.anatomyRoot()?.querySelector('.ty-tabs__list')\n if (next && list instanceof HTMLElement && list.contains(next)) return\n if (this.#focused === undefined) return\n this.#focused = undefined\n this.#reconcile()\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-skip-link>`: the SkipLink's single source (spec: wave-1/skip-link.md). */\nexport const skipLinkDefinition = {\n tag: 'ty-skip-link',\n name: 'TySkipLink',\n kind: 'enhancing',\n doc: 'First focusable element of the page: jumps past the navigation straight to the main content (WCAG 2.4.1 Bypass Blocks). A native anchor to the target\\'s fragment, visually hidden until focused — never `display: none`, so it stays in the accessibility tree. On activation the element moves focus to the target (a temporary negative tabindex when the target is not natively focusable) and scrolls it clear of the sticky top bar.',\n props: {\n targetId: { type: 'string', default: 'main-content', attribute: 'target-id', doc: 'Id of the main content element; the anchor\\'s href is its fragment (`#main-content`).' },\n label: { type: 'string', default: 'Skip to main content', attribute: 'label', doc: 'Link text (the I18n adapter\\'s default); translate through this attribute.' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onClick', doc: 'The native click of the anchor, before the focus move.' }],\n anatomy: {\n tag: 'a',\n class: 'ty-skip-link',\n // No href binding: the fragment (`#` + targetId) is derived, which the\n // definition language cannot express; the element applies it on upgrade.\n attrs: {},\n children: [{ text: { prop: 'label' } }],\n },\n examples: [\n { name: 'default', props: {}, slots: {} },\n { name: 'translated', props: { targetId: 'conteudo', label: 'Ir para o conteúdo' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { skipLinkDefinition } from './definition.ts'\n\n/**\n * `<ty-skip-link>`. A native anchor to the target's fragment, so keyboard\n * activation and the accessibility tree are the platform's; the stylesheet\n * hides it until focus (never `display: none`) and raises it above every\n * layer when visible. The element adds what markup cannot (mirroring the\n * React SkipLink's `focusSkipTarget`):\n *\n * - the derived `href` (`#` + `target-id`), applied after the first paint so\n * the upgrade never rewrites the rendered anatomy (see <ty-text-field>);\n * - the activation behaviour: focus moves to the target — a temporary\n * negative tabindex when the target is not natively focusable, removed on\n * blur, so the next Tab continues from there — and the target scrolls to\n * the start, where the document's `scroll-padding-top` keeps it clear of\n * the sticky top bar (§2.6). The address bar's fragment is updated without\n * a history entry.\n */\nexport class TySkipLinkElement extends TyElement {\n static override definition = skipLinkDefinition\n\n /** False until the first paint: the derived href is not applied during the upgrade the parity renderers compare. */\n #ready = false\n\n override sync(): void {\n super.sync()\n if (this.#ready) this.#applyTarget()\n }\n\n protected override connected(): void {\n this.addEventListener('click', this.#onClick)\n requestAnimationFrame(() => {\n if (!this.isConnected) return\n this.#ready = true\n this.#applyTarget()\n })\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n }\n\n /** The anchor points at the target's fragment. */\n #applyTarget(): void {\n const link = this.querySelector('a')\n const href = `#${String(this.props.targetId)}`\n if (link && link.getAttribute('href') !== href) link.setAttribute('href', href)\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n const anchor = target && typeof target.closest === 'function' ? target.closest('a') : null\n if (!anchor || !this.contains(anchor)) return\n const targetId = String(this.props.targetId)\n if (!focusSkipTarget(targetId)) return\n event.preventDefault()\n if (typeof history !== 'undefined' && history.replaceState) history.replaceState(history.state, '', `#${targetId}`)\n }\n}\n\n/** Moves focus to `targetId`, making it programmatically focusable when needed (the React SkipLink's `focusSkipTarget`). */\nexport function focusSkipTarget(targetId: string): boolean {\n const target = document.getElementById(targetId)\n if (!target) return false\n const needsTabIndex = !target.hasAttribute('tabindex') && target.tabIndex < 0\n if (needsTabIndex) {\n target.setAttribute('tabindex', '-1')\n target.addEventListener('blur', () => target.removeAttribute('tabindex'), { once: true })\n }\n target.focus({ preventScroll: true })\n // scroll-padding-top on the document keeps the target clear of the sticky top bar (§2.6).\n target.scrollIntoView?.({ block: 'start' })\n return true\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-segmented-control>`: the SegmentedControl's single source (spec:\n * wave-1/segmented-control.md).\n *\n * APG Radio Group: one tab stop on the selected segment, the arrow keys move\n * the selection and the focus (wrapping, direction following the reading\n * direction), Home/End jump. No live region — the `aria-checked` state\n * conveys the change.\n *\n * The anatomy is the track only (the labelled group with its size, width and\n * disabled states); the segments are a dynamic repetition the declarative\n * anatomy cannot express, so the element composes them from `options` on\n * upgrade, the way the skeleton composes its presets. The segment nodes the\n * element renders mirror the React SegmentedControl exactly (`.ty-segmented-\n * control__segment` with `data-selected`, a `.ty-segmented-control__label`\n * span, an optional lucide-style stroke icon) so the one component CSS\n * covers every renderer. `options` is a JSON array — a string is both value\n * and label, an object is `{ value, label, icon? }` with `icon` the `d` of a\n * 24×24 stroke path.\n */\nexport const segmentedControlDefinition = {\n tag: 'ty-segmented-control',\n name: 'TySegmentedControl',\n kind: 'enhancing',\n doc: 'Exactly one of a small set (two to five) of mutually exclusive options, changed in place — a radio group painted as segments. The segments are composed by the element from `options` (JSON); selecting the selected segment again does nothing. With `value` the control is controlled (the host answers `ty-change`); without it the element keeps the selection and mirrors it into the `value` attribute.',\n props: {\n options: { type: 'string', attribute: 'options', doc: 'The segments as a JSON array of `string` (both value and label) or `{ \"value\", \"label\", \"icon\"? }`; `icon` is the `d` of a 24×24 stroke path (lucide style).' },\n value: { type: 'string', attribute: 'value', doc: 'The selected value (controlled). Unset, the element keeps the selection itself and mirrors it here.' },\n defaultValue: { type: 'string', attribute: 'default-value', doc: 'The initially selected value when uncontrolled; the first option when unset.' },\n label: { type: 'string', attribute: 'label', doc: 'Accessible name of the group (required).' },\n size: { type: 'enum', values: ['compact', 'regular', 'large'], default: 'regular', attribute: 'size', doc: 'Visible height; the hit area stays at least 44 px on every size.' },\n fullWidth: { type: 'boolean', attribute: 'full-width', doc: 'The segments share the available width equally; labels truncate with the full label as the accessible name.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'The whole control disabled; the group is exposed as disabled and nothing selects.' },\n iconOnly: { type: 'boolean', attribute: 'icon-only', doc: 'Hide the labels visually; each label stays the segment\\'s accessible name.' },\n },\n events: [\n { type: 'ty-change', kind: 'custom', detail: { value: 'string' }, reactProp: 'onChange', doc: 'The selection changed; `value` is the new value. Only real changes fire it — re-selecting the selected segment does nothing.' },\n ],\n anatomy: {\n tag: 'div',\n class: 'ty-segmented-control',\n attrs: {\n role: { value: 'radiogroup' },\n 'aria-label': { prop: 'label' },\n 'aria-disabled': { prop: 'disabled', kind: 'bool' },\n 'data-size': { prop: 'size' },\n 'data-full-width': { prop: 'fullWidth', kind: 'flag' },\n 'data-icon-only': { prop: 'iconOnly', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n },\n // The segments are composed by the element from `options`.\n children: [],\n },\n examples: [\n { name: 'period-week', props: { label: 'Period', options: '[\"Day\",\"Week\",\"Month\"]', value: 'Week' }, slots: {} },\n { name: 'objects-compact', props: { label: 'View', size: 'compact', defaultValue: 'chart', options: '[{\"value\":\"table\",\"label\":\"Table\"},{\"value\":\"chart\",\"label\":\"Chart\"}]' }, slots: {} },\n { name: 'full-width-large', props: { label: 'Mode', size: 'large', fullWidth: true, options: '[\"Preview\",\"Code\"]' }, slots: {} },\n { name: 'disabled', props: { label: 'Period', disabled: true, value: 'Day', options: '[\"Day\",\"Week\"]' }, slots: {} },\n {\n name: 'icon-only',\n props: {\n label: 'Layout',\n iconOnly: true,\n value: 'grid',\n options: '[{\"value\":\"list\",\"label\":\"List\",\"icon\":\"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01\"},{\"value\":\"grid\",\"label\":\"Grid\",\"icon\":\"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z\"}]',\n },\n slots: {},\n },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { segmentedControlDefinition } from './definition.ts'\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\n/** One segment of the control: a string option is both value and label. */\ninterface Segment {\n value: string\n label: string\n /** The `d` of a 24×24 stroke path (lucide style). */\n icon?: string\n}\n\n/**\n * `<ty-segmented-control>`. The track (the labelled radio group with its\n * size, width and disabled states) is the anatomy, rendered by the host\n * framework or built from plain HTML; the element composes the segments from\n * the `options` JSON — a dynamic repetition the declarative anatomy cannot\n * express, the skeleton-preset pattern — and adds the behaviour (spec:\n * wave-1/segmented-control.md):\n *\n * - **Selection** — a press selects the segment; selecting the selected one\n * again does nothing. With `value` the control is controlled: the element\n * only emits `ty-change` and the host answers with a new `value`. Without\n * it the element keeps the selection (starting at `default-value`, else\n * the first option) and mirrors it into the `value` attribute.\n * - **Keyboard** — one tab stop (the selected segment); the arrow keys move\n * the selection and the focus, wrapping, Left/Right following the reading\n * direction; Home/End jump to the ends.\n *\n * The composed segments are the element's own (the anatomy has no children),\n * so they are recomposed freely; nodes keyed by `data-value` are reused, so\n * a framework-rendered tree keeps a focused segment across re-renders.\n */\nexport class TySegmentedControlElement extends TyElement {\n static override definition = segmentedControlDefinition\n\n /** Controlled from birth: `value` present when the element connected. */\n #controlled = false\n\n override sync(): void {\n // The base patch pass prunes what the anatomy does not list — the\n // composed segments — so the focus a keyboard move just landed is\n // captured here and restored once the segments are recomposed.\n const active = document.activeElement\n const refocus =\n active instanceof HTMLElement && this.contains(active) ? active.getAttribute('data-value') : null\n super.sync()\n this.#compose()\n if (refocus !== null) {\n const now = document.activeElement\n const stillOnSegment = now instanceof Element && now.closest('.ty-segmented-control__segment') !== null\n if (!stillOnSegment) this.#segmentFor(refocus)?.focus()\n }\n }\n\n protected override connected(): void {\n this.#controlled = this.hasAttribute('value')\n this.addEventListener('click', this.#onClick)\n this.addEventListener('keydown', this.#onKeydown)\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('keydown', this.#onKeydown)\n }\n\n /** The parsed `options` JSON; an invalid value warns and renders nothing. */\n #options(): Segment[] {\n const raw = this.getAttribute('options')\n if (!raw) return []\n try {\n const parsed: unknown = JSON.parse(raw)\n if (!Array.isArray(parsed)) throw new Error('not an array')\n return parsed.flatMap((entry): Segment[] => {\n if (typeof entry === 'string') return entry ? [{ value: entry, label: entry }] : []\n if (entry && typeof entry === 'object') {\n const { value, label, icon } = entry as Segment\n if (typeof value === 'string' && value && typeof label === 'string') {\n return [{ value, label, ...(typeof icon === 'string' ? { icon } : {}) }]\n }\n }\n return []\n })\n } catch {\n console.warn('<ty-segmented-control>: options must be a JSON array of strings or { \"value\", \"label\", \"icon\"? } objects.')\n return []\n }\n }\n\n /** The selected value: the controlled `value`, else `default-value`, else the first option. */\n #current(options: Segment[]): string {\n return this.getAttribute('value') ?? this.getAttribute('default-value') ?? options[0]?.value ?? ''\n }\n\n #segmentFor(value: string): HTMLElement | null {\n return this.querySelector(`.ty-segmented-control__segment[data-value=\"${CSS.escape(value)}\"]`)\n }\n\n /**\n * Select `next`: emit `ty-change` on a real change only. Uncontrolled, the\n * element mirrors the selection into `value` (which re-renders through the\n * attribute change); controlled, the host answers the event. `moveFocus`\n * (the arrow keys) lands the focus after any re-render.\n */\n #commit(next: string, moveFocus = false): void {\n if (this.hasAttribute('disabled')) return\n const options = this.#options()\n if (!options.some((o) => o.value === next)) return\n if (next !== this.#current(options)) {\n // A short tick on touch devices, the React component's requestHaptic('light'); called from a user gesture.\n try {\n ;(navigator as Navigator & { vibrate?: (pattern: number) => boolean }).vibrate?.(8)\n } catch {\n /* unsupported */\n }\n // Uncontrolled (no `value` at birth): mirror freely — a one-shot\n // mirror would freeze the selection after the first keyboard move.\n // Controlled: the host answers ty-change by writing the attribute.\n if (!this.#controlled) this.setAttribute('value', next)\n this.emit('ty-change', { value: next })\n }\n if (moveFocus) this.#segmentFor(next)?.focus()\n }\n\n #onClick = (event: MouseEvent): void => {\n if (!(event.target instanceof Element)) return\n const segment = event.target.closest('.ty-segmented-control__segment')\n if (!segment || !this.contains(segment)) return\n const value = segment.getAttribute('data-value')\n if (value !== null) this.#commit(value)\n }\n\n #onKeydown = (event: KeyboardEvent): void => {\n if (this.hasAttribute('disabled')) return\n if (!(event.target instanceof Element) || !event.target.closest('.ty-segmented-control__segment')) return\n const options = this.#options()\n if (!options.length) return\n const rtl = this.#rtl()\n let delta: number | null = null\n switch (event.key) {\n case 'ArrowRight':\n delta = rtl ? -1 : 1\n break\n case 'ArrowLeft':\n delta = rtl ? 1 : -1\n break\n case 'ArrowDown':\n delta = 1\n break\n case 'ArrowUp':\n delta = -1\n break\n }\n const current = this.#current(options)\n const from = Math.max(0, options.findIndex((o) => o.value === current))\n let to: number\n if (event.key === 'Home') to = 0\n else if (event.key === 'End') to = options.length - 1\n else if (delta !== null) to = (from + delta + options.length) % options.length\n else return\n event.preventDefault()\n this.#commit(options[to]!.value, true)\n }\n\n /** The reading direction, from a `dir` attribute up the tree or the computed style. */\n #rtl(): boolean {\n const dir = this.closest('[dir]')?.getAttribute('dir') ?? document.documentElement.getAttribute('dir')\n if (dir) return dir.toLowerCase() === 'rtl'\n return getComputedStyle(this).direction === 'rtl'\n }\n\n /** Compose the segments into the track, reusing the nodes keyed by `data-value`. */\n #compose(): void {\n const root = this.anatomyRoot()\n if (!root) return\n const options = this.#options()\n const current = this.#current(options)\n const disabled = this.hasAttribute('disabled')\n const iconOnly = this.hasAttribute('icon-only')\n const stretched = this.hasAttribute('full-width')\n const used = new Set<Element>()\n const wanted: HTMLElement[] = []\n for (const option of options) {\n const existing = Array.from(root.children).find((c) => !used.has(c) && c.getAttribute('data-value') === option.value)\n const segment = existing instanceof HTMLElement ? existing : this.#segment()\n used.add(segment)\n this.#syncSegment(segment, option, current === option.value, disabled, iconOnly, stretched)\n wanted.push(segment)\n }\n wanted.forEach((segment, index) => {\n if (root.children[index] !== segment) root.insertBefore(segment, root.children[index] ?? null)\n })\n while (root.children.length > wanted.length) root.lastElementChild!.remove()\n }\n\n #segment(): HTMLElement {\n const button = document.createElement('button')\n button.type = 'button'\n button.setAttribute('role', 'radio')\n button.className = 'ty-segmented-control__segment'\n return button\n }\n\n /** Bring one segment in step, touching only what changed (a focused segment keeps focus). */\n #syncSegment(segment: HTMLElement, option: Segment, selected: boolean, disabled: boolean, iconOnly: boolean, stretched: boolean): void {\n segment.setAttribute('data-value', option.value)\n segment.setAttribute('aria-checked', String(selected))\n segment.toggleAttribute('data-selected', selected)\n if (disabled) {\n segment.setAttribute('disabled', '')\n segment.setAttribute('data-disabled', '')\n segment.tabIndex = -1\n } else {\n segment.removeAttribute('disabled')\n segment.removeAttribute('data-disabled')\n segment.tabIndex = selected ? 0 : -1\n }\n if (stretched) segment.setAttribute('title', option.label)\n else segment.removeAttribute('title')\n if (iconOnly) segment.setAttribute('aria-label', option.label)\n else segment.removeAttribute('aria-label')\n\n let icon = segment.querySelector(':scope > svg.ty-icon')\n if (option.icon) {\n if (!icon) {\n icon = document.createElementNS(SVG, 'svg')\n icon.setAttribute('class', 'ty-icon')\n icon.setAttribute('viewBox', '0 0 24 24')\n icon.setAttribute('fill', 'none')\n icon.setAttribute('stroke', 'currentColor')\n icon.setAttribute('stroke-width', '2')\n icon.setAttribute('stroke-linecap', 'round')\n icon.setAttribute('stroke-linejoin', 'round')\n icon.setAttribute('aria-hidden', 'true')\n icon.setAttribute('focusable', 'false')\n icon.append(document.createElementNS(SVG, 'path'))\n segment.prepend(icon)\n }\n const path = icon.querySelector('path')!\n if (path.getAttribute('d') !== option.icon) path.setAttribute('d', option.icon)\n } else icon?.remove()\n\n let label = segment.querySelector(':scope > span')\n if (!label) {\n label = document.createElement('span')\n segment.append(label)\n }\n const labelClass = iconOnly ? 'ty-visually-hidden' : 'ty-segmented-control__label'\n if (label.getAttribute('class') !== labelClass) label.setAttribute('class', labelClass)\n if (label.textContent !== option.label) label.textContent = option.label\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** `<ty-section-heading>`: the SectionHeading's single source (spec: wave-1/section-heading.md). */\nexport const sectionHeadingDefinition = {\n tag: 'ty-section-heading',\n name: 'TySectionHeading',\n kind: 'enhancing',\n doc: 'Heads a section inside a page or a sheet: the title at the section level (h2 by default, h3 or h4 inside a sheet), an optional subtitle line (plain meta text, not a heading), an optional decorative leading icon, and a `trailing` slot for the section\\'s own actions, a count, a toggle or a link. The title wraps by default; `truncate` clips it to one line with the full text as a tooltip. The heading id (`heading-id`, generated otherwise) lets the enclosing section name itself with `aria-labelledby`.',\n props: {\n title: { type: 'string', attribute: 'title', doc: 'Section name; the heading text, and the tooltip when `truncate` clips it.' },\n level: { type: 'enum', values: ['2', '3', '4'], default: '2', attribute: 'level', doc: 'Heading level (2, 3 or 4, as its attribute spelling); level 2 uses the h2 step, 3 and 4 the h3 step (§2.2).' },\n subtitle: { type: 'string', attribute: 'subtitle', doc: 'Supporting line under the title; plain meta text in reading order, not a heading.' },\n truncate: { type: 'boolean', attribute: 'truncate', doc: 'Clip the title to one line with an ellipsis; the full text stays accessible and becomes the tooltip. Wraps by default.' },\n headingId: { type: 'string', attribute: 'heading-id', doc: 'Id of the heading element, so the enclosing section can be a region labelled by it; `<instance>-heading` when unset.' },\n },\n events: [],\n slots: {\n icon: { doc: 'A decorative leading icon (`aria-hidden`).' },\n trailing: { doc: 'Section actions, a count, a toggle or a link; follows the title in DOM order and wraps under it when it does not fit.' },\n default: { doc: 'Extra content under the heading row.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-section-heading',\n attrs: {\n 'data-level': { prop: 'level' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-section-heading__row',\n children: [\n {\n tag: 'span',\n class: 'ty-section-heading__icon',\n when: ['slot:icon'],\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [{ slot: 'icon' }],\n },\n {\n tag: 'div',\n class: 'ty-section-heading__text',\n children: [\n ...([2, 3, 4] as const).map((n): ElementNode => ({\n tag: `h${n}`,\n class: 'ty-section-heading__title',\n when: [`level:${n}`],\n attrs: {\n id: { idref: 'heading', prop: 'headingId' },\n 'data-truncate': { prop: 'truncate', kind: 'flag' },\n title: { prop: 'title', when: ['truncate'] },\n },\n children: [{ text: { prop: 'title' } }],\n })),\n { tag: 'p', class: 'ty-section-heading__subtitle', when: ['subtitle'], children: [{ text: { prop: 'subtitle' } }] },\n ],\n },\n {\n tag: 'div',\n class: 'ty-section-heading__trailing',\n when: ['slot:trailing'],\n children: [{ slot: 'trailing' }],\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-section-heading__extra',\n when: ['slot:default'],\n children: [{ slot: 'default' }],\n },\n ],\n },\n examples: [\n { name: 'title', props: { title: 'Members' }, slots: {} },\n { name: 'level-3-subtitle', props: { title: 'API keys', level: '3', subtitle: 'Keys of every integration' }, slots: {} },\n { name: 'icon-trailing', props: { title: 'Webhooks' }, slots: { icon: '⚡', trailing: 'Add' } },\n { name: 'truncate', props: { title: 'A section name that runs well past the width of its container', truncate: true }, slots: {} },\n { name: 'extra', props: { title: 'Filters' }, slots: { trailing: 'Clear all', default: 'Status: active' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { sectionHeadingDefinition } from './definition.ts'\n\n/**\n * `<ty-section-heading>`. All presentation: the host framework renders the\n * anatomy (the heading row with icon, title, subtitle and trailing slot,\n * plus the extra slot under it) and the stylesheet lays it out — the row\n * wraps, so the trailing slot lands under the title when it does not fit.\n * Not a widget — no keyboard or events; the base class builds and patches\n * the anatomy for plain-HTML use (swapping the heading tag when `level`\n * changes) and keeps the bound attributes in step.\n */\nexport class TySectionHeadingElement extends TyElement {\n static override definition = sectionHeadingDefinition\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-progress-bar>`: the ProgressBar's single source (spec: wave-1/progress-bar.md).\n *\n * The anatomy carries everything declarative: the `progressbar` role, its\n * name (the visible label by `aria-labelledby`, `accessibleLabel` without\n * one), the range and the in-range value, the tone/size/indeterminate\n * states. The element adds what the definition language cannot compute: the\n * clamped value outside the range, the percentage value text (visible and\n * `aria-valuetext`), the \"in progress\" text of an indeterminate bar, the\n * complete state and the fill's inline size. `showValue` is a string like\n * the popover's `showArrow`: `'true'` or `'false'`, unset shows the value.\n */\nexport const progressBarDefinition = {\n tag: 'ty-progress-bar',\n name: 'TyProgressBar',\n kind: 'enhancing',\n doc: 'Determinate or indeterminate task progress (upload, batch run, profile completion). Not focusable; the host announces completion through a Toast or status message, not through the bar. Values outside the range are clamped on upgrade; the fill width changes with `--ty-dur-quick`, instantly under reduced motion, where the indeterminate sweep becomes a static partial fill with the label still stating \"in progress\".',\n props: {\n value: { type: 'number', default: 0, attribute: 'value', doc: 'Current value; clamped into the range on upgrade.' },\n minValue: { type: 'number', default: 0, attribute: 'min-value', doc: 'Start of the range.' },\n maxValue: { type: 'number', default: 100, attribute: 'max-value', doc: 'End of the range; reaching it is the complete state.' },\n label: { type: 'string', attribute: 'label', doc: 'Visible and accessible name (required unless `accessibleLabel` is given).' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label (`aria-label`).' },\n valueLabel: { type: 'string', attribute: 'value-label', doc: 'Custom value text, such as \"3 of 8 steps\"; the computed percentage when unset.' },\n showValue: { type: 'string', attribute: 'show-value', doc: '`true` or `false`; unset: the value text shows. An indeterminate bar always shows its \"in progress\" text.' },\n indeterminate: { type: 'boolean', attribute: 'indeterminate', doc: 'Unknown progress: no `aria-valuenow` and no percentage, the value text states \"in progress\".' },\n inProgressLabel: { type: 'string', default: 'In progress', attribute: 'in-progress-label', doc: 'Value text of an indeterminate bar; translate through this attribute.' },\n tone: { type: 'enum', values: ['accent', 'success', 'warning', 'danger'], default: 'accent', attribute: 'tone', doc: 'Semantic tone of the fill; never the only signal (pair with value text or a status word).' },\n size: { type: 'enum', values: ['thin', 'regular'], default: 'regular', attribute: 'size', doc: 'Track thickness.' },\n },\n events: [],\n anatomy: {\n tag: 'div',\n class: 'ty-progress',\n attrs: {\n role: { value: 'progressbar' },\n 'aria-labelledby': { idref: 'label', when: ['label'] },\n 'aria-label': { prop: 'accessibleLabel', when: ['!label'] },\n 'aria-valuemin': { prop: 'minValue' },\n 'aria-valuemax': { prop: 'maxValue' },\n 'aria-valuenow': { prop: 'value', when: ['!indeterminate'] },\n 'aria-valuetext': { prop: 'valueLabel', when: ['!indeterminate'] },\n 'data-tone': { prop: 'tone' },\n 'data-size': { prop: 'size' },\n 'data-indeterminate': { prop: 'indeterminate', kind: 'flag' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-progress__header',\n when: ['label|indeterminate|!showValue:false'],\n children: [\n {\n tag: 'span',\n class: 'ty-progress__label',\n when: ['label'],\n attrs: { id: { idref: 'label' } },\n children: [{ text: { prop: 'label' } }],\n },\n {\n tag: 'span',\n class: 'ty-progress__value',\n when: ['indeterminate|!showValue:false'],\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-progress__track',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [{ tag: 'div', class: 'ty-progress__fill' }],\n },\n ],\n },\n examples: [\n { name: 'determinate', props: { value: 40, label: 'Upload' }, slots: {} },\n { name: 'custom-value-label', props: { value: 3, maxValue: 8, valueLabel: '3 of 8 steps', label: 'Setup' }, slots: {} },\n { name: 'indeterminate', props: { indeterminate: true, label: 'Import' }, slots: {} },\n { name: 'complete-success-thin', props: { value: 100, label: 'Upload', tone: 'success', size: 'thin' }, slots: {} },\n { name: 'unlabelled-hidden-value', props: { value: 20, accessibleLabel: 'Storage used', showValue: 'false' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { progressBarDefinition } from './definition.ts'\n\n/**\n * `<ty-progress-bar>`. The anatomy (rendered by the host framework, or built\n * from plain HTML) carries the progressbar role, its name, the range and an\n * in-range value; the stylesheet draws the track and fill, including the\n * indeterminate sweep and its reduced-motion and forced-colours fallbacks.\n * The element adds the computed state the definition language cannot\n * express (mirroring the React ProgressBar, which gets it from React Aria):\n *\n * - **clamping** — a value outside the range is pulled back in\n * (`aria-valuenow`); in-range values never touch the rendered attribute;\n * - **value text** — the visible text and `aria-valuetext`: `valueLabel`\n * when given, the rounded percentage otherwise; an indeterminate bar\n * states `inProgressLabel` instead;\n * - **complete** — `data-complete` while a determinate value reaches the\n * maximum;\n * - **the fill's inline size** — the percentage of the range (an\n * indeterminate fill is sized and animated by the stylesheet).\n *\n * The first pass runs after the first paint, so the upgrade never rewrites\n * the rendered anatomy (see <ty-text-field>); attribute changes apply at\n * once.\n */\nexport class TyProgressBarElement extends TyElement {\n static override definition = progressBarDefinition\n\n /** False until the first paint: the computed state is not applied during the upgrade the parity renderers compare. */\n #ready = false\n\n override sync(): void {\n super.sync()\n if (this.#ready) this.#update()\n }\n\n protected override connected(): void {\n requestAnimationFrame(() => {\n if (!this.isConnected) return\n this.#ready = true\n this.#update()\n })\n }\n\n #update(): void {\n const root = this.anatomyRoot()\n if (!root) return\n const props = this.props\n const indeterminate = Boolean(props.indeterminate)\n const min = Number(props.minValue ?? 0)\n const max = Number(props.maxValue ?? 100)\n const clamped = Math.min(Math.max(Number(props.value ?? 0), min), max)\n const range = max - min\n const percentage = range > 0 ? Math.round(((clamped - min) / range) * 100) : 100\n\n if (indeterminate) root.removeAttribute('aria-valuenow')\n else {\n // super.sync() bound the raw value; only an out-of-range one needs the clamp.\n const now = String(clamped)\n if (root.getAttribute('aria-valuenow') !== now) root.setAttribute('aria-valuenow', now)\n const valueText = props.valueLabel !== undefined && props.valueLabel !== '' ? String(props.valueLabel) : `${percentage}%`\n if (root.getAttribute('aria-valuetext') !== valueText) root.setAttribute('aria-valuetext', valueText)\n }\n root.toggleAttribute('data-complete', !indeterminate && clamped >= max)\n\n const value = root.querySelector('.ty-progress__value')\n if (value) {\n const text = indeterminate\n ? String(props.inProgressLabel ?? 'In progress')\n : props.valueLabel !== undefined && props.valueLabel !== ''\n ? String(props.valueLabel)\n : `${percentage}%`\n if (value.textContent !== text) value.textContent = text\n }\n\n const fill = root.querySelector<HTMLElement>('.ty-progress__fill')\n if (fill) {\n const size = indeterminate ? '' : `${percentage}%`\n if (fill.style.inlineSize !== size) fill.style.inlineSize = size\n }\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/**\n * `<ty-page-header>`: the PageHeader's single source (spec: wave-1/page-header.md).\n *\n * The wave-1 (standard) variant: breadcrumbs, eyebrow, leading icon, title,\n * summary, metadata row, actions and extra content. The wave-4 editorial\n * variant of the React component (`variant`, `trail`, `lead`, `divider`)\n * is intentionally not part of this element.\n *\n * The data-driven parts of the React component become slots: `breadcrumbs`\n * takes the breadcrumb navigation, `meta` the `li.ty-page-header__meta-item`\n * items, `icon` the decorative leading icon and `actions` the page actions\n * (at most one primary button, §2.10).\n *\n * With `editable`, the title is an input that looks like the title\n * (editorial screens); a visually hidden heading of the same level keeps\n * the document outline (one h1 per page). The input is named by\n * `title-label`; typing is the platform's, reported as the native `input`\n * event. The `error` slot marks the title invalid and is announced.\n */\nexport const pageHeaderDefinition = {\n tag: 'ty-page-header',\n name: 'TyPageHeader',\n kind: 'enhancing',\n doc: 'The single top-of-page block that names the page: optional breadcrumbs, eyebrow, leading icon, title, reading summary, metadata row and page actions, plus a free slot below for tags, tabs or filters. `scale` picks the type step (`page` the h1 step, `display` for login and public pages, `section` inside a section); `heading-level` the document level. With `editable` the title is an input named by `title-label` and a visually hidden heading keeps the outline. Below 640 px the actions move under the summary and span the width (stylesheet).',\n props: {\n title: { type: 'string', attribute: 'title', doc: 'Page title; the heading text. Not needed with `editable` (`value` carries the text).' },\n headingLevel: { type: 'enum', values: ['1', '2', '3'], default: '1', attribute: 'heading-level', doc: 'Heading level of the title (1, 2 or 3, as its attribute spelling); exactly one level-1 heading per page, which the header provides by default.' },\n scale: { type: 'enum', values: ['page', 'display', 'section'], default: 'page', attribute: 'scale', doc: '`page` uses the h1 step; `display` the display step (login, public page only); `section` the h3 step.' },\n eyebrow: { type: 'string', attribute: 'eyebrow', doc: 'Short uppercase context line above the title (the §2.2 eyebrow token).' },\n summary: { type: 'string', attribute: 'summary', doc: 'One or two sentences (body-lg, max 60ch) saying what the screen shows.' },\n editable: { type: 'boolean', attribute: 'editable', doc: 'The title is an input that looks like the title (editorial screens); a visually hidden heading of the same level keeps the document outline.' },\n value: { type: 'string', attribute: 'value', doc: 'The editable title\\'s text (controlled); the element mirrors it into the input (while the user types, the live value is the input\\'s own).' },\n titlePlaceholder: { type: 'string', attribute: 'title-placeholder', doc: 'Placeholder of the editable title (the empty state); also the hidden heading\\'s text while empty.' },\n titleLabel: { type: 'string', default: 'Page title', attribute: 'title-label', doc: 'Accessible name of the editable title input.' },\n headingId: { type: 'string', attribute: 'heading-id', doc: 'Id of the title heading, for `aria-labelledby` of the page region; `<instance>-title` when unset.' },\n },\n events: [\n { type: 'input', kind: 'native', detail: { value: 'string' }, reactProp: 'onTitleChange', doc: 'Typing in the editable title; `value` is the whole text.' },\n ],\n slots: {\n breadcrumbs: { doc: 'The breadcrumb navigation, rendered above the title.' },\n icon: { doc: 'A decorative leading icon, in an accent-soft container (`aria-hidden`).' },\n meta: { doc: 'The metadata row: `li.ty-page-header__meta-item` items of icon plus short text (owner, date, count); icons decorative, text in reading order.' },\n actions: { doc: 'Page actions, aligned to the end: at most one primary button plus secondary buttons (§2.10); below 640 px they move under the summary and span the width.' },\n error: { doc: 'Host-provided validation message under the editable title; marks it invalid and is announced.' },\n default: { doc: 'Extra content below the header (tags, tabs, filters).' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-page-header',\n attrs: {\n 'data-scale': { prop: 'scale' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-page-header__breadcrumbs',\n when: ['slot:breadcrumbs'],\n children: [{ slot: 'breadcrumbs' }],\n },\n {\n tag: 'div',\n class: 'ty-page-header__row',\n children: [\n {\n tag: 'span',\n class: 'ty-page-header__icon',\n when: ['slot:icon'],\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [{ slot: 'icon' }],\n },\n {\n tag: 'div',\n class: 'ty-page-header__text',\n children: [\n { tag: 'p', class: 'ty-page-header__eyebrow', when: ['eyebrow'], children: [{ text: { prop: 'eyebrow' } }] },\n // Static title: the page's heading.\n ...([1, 2, 3] as const).map((n): ElementNode => ({\n tag: `h${n}`,\n class: 'ty-page-header__title',\n when: ['!editable', `headingLevel:${n}`],\n attrs: { id: { idref: 'title', prop: 'headingId' } },\n children: [{ text: { prop: 'title' } }],\n })),\n // Editable title: a visually hidden heading keeps the outline.\n ...([1, 2, 3] as const).map((n): ElementNode => ({\n tag: `h${n}`,\n class: 'ty-heading ty-visually-hidden',\n when: ['editable', `headingLevel:${n}`],\n attrs: { id: { idref: 'title', prop: 'headingId' } },\n children: [\n { text: { prop: 'value' }, when: ['value'] },\n { text: { prop: 'titlePlaceholder' }, when: ['!value'] },\n ],\n })),\n {\n tag: 'input',\n class: 'ty-page-header__title-input ty-page-header__title',\n when: ['editable'],\n attrs: {\n 'aria-label': { prop: 'titleLabel' },\n placeholder: { prop: 'titlePlaceholder' },\n 'aria-invalid': { value: 'true', when: ['slot:error'] },\n 'aria-describedby': { idrefs: [{ id: 'error', when: ['slot:error'] }] },\n 'data-invalid': { value: '', when: ['slot:error'] },\n },\n },\n {\n tag: 'p',\n class: 'ty-page-header__error',\n when: ['editable', 'slot:error'],\n attrs: { id: { idref: 'error' } },\n children: [{ slot: 'error' }],\n },\n { tag: 'p', class: 'ty-page-header__summary', when: ['summary'], children: [{ text: { prop: 'summary' } }] },\n {\n tag: 'ul',\n class: 'ty-page-header__meta',\n when: ['slot:meta'],\n children: [{ slot: 'meta' }],\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-page-header__actions',\n when: ['slot:actions'],\n children: [{ slot: 'actions' }],\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-page-header__extra',\n when: ['slot:default'],\n children: [{ slot: 'default' }],\n },\n ],\n },\n examples: [\n { name: 'minimal', props: { title: 'Sources' }, slots: {} },\n { name: 'reading-summary', props: { title: 'Sources', eyebrow: 'Datasets', summary: 'Every dataset this workspace reads, and when each was last synced.' }, slots: { meta: 'Owner: Data team' } },\n { name: 'breadcrumbs-actions', props: { title: 'Sources' }, slots: { breadcrumbs: 'Datasets', actions: 'Add source', icon: '◈' } },\n { name: 'section-scale', props: { title: 'Connection', headingLevel: '2', scale: 'section' }, slots: { default: 'Status: connected' } },\n { name: 'display', props: { title: 'Welcome to Alidade', scale: 'display', summary: 'Sign in to continue.' }, slots: {} },\n { name: 'editable', props: { editable: true, value: 'Untitled report', titlePlaceholder: 'Name the report', titleLabel: 'Report title' }, slots: { actions: 'Share' } },\n { name: 'editable-error', props: { editable: true, titlePlaceholder: 'Name the report', titleLabel: 'Report title' }, slots: { error: 'A name is required.' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { pageHeaderDefinition } from './definition.ts'\n\n/**\n * `<ty-page-header>`. Almost all presentation: the host framework renders\n * the anatomy (breadcrumbs, the row of icon, text and actions, the extra\n * slot) and the stylesheet lays it out, including the below-640px stacking\n * of the actions. The element adds the one dynamic part: with `editable`,\n * it mirrors the `value` attribute into the title input — a no-op while\n * the user types, so the caret stays put (the live value is the input's\n * own; typing is reported as the native `input` event).\n */\nexport class TyPageHeaderElement extends TyElement {\n static override definition = pageHeaderDefinition\n\n /** The editable title's input, when rendered. */\n get titleInput(): HTMLInputElement | null {\n return this.querySelector('.ty-page-header__title-input')\n }\n\n /** Controlled text in, without disturbing the caret while typing. */\n #applyValue = () => {\n const input = this.titleInput\n if (!input) return\n const value = this.getAttribute('value')\n if (value !== null && input.value !== value) input.value = value\n }\n\n protected override connected(): void {\n this.#applyValue()\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyValue()\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-notification-center__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative 24px icon (lucide strokes). */\nconst icon = (children: ElementNode[], className = 'ty-icon'): ElementNode => ({\n tag: 'svg',\n class: className,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/** The bell (lucide `bell`): the trigger and the drawer header. */\nconst bellIcon = icon([\n glyph('path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }),\n glyph('path', { d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326' }),\n])\n\n/** The crossed-out bell (lucide `bell-off`): the empty view. */\nconst bellOffIcon = icon([\n glyph('path', { d: 'M10.268 21a2 2 0 0 0 3.464 0' }),\n glyph('path', { d: 'M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742' }),\n glyph('path', { d: 'm2 2 20 20' }),\n glyph('path', { d: 'M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05' }),\n])\n\n/** The close X (lucide `x`). */\nconst xIcon = icon([glyph('path', { d: 'M18 6 6 18' }), glyph('path', { d: 'm6 6 12 12' })])\n\n/**\n * `<ty-notification-center>`: the NotificationCenter's single source (spec:\n * wave-2/notification-center.md).\n *\n * The anatomy covers the static shell: the bell trigger, and the drawer\n * (backdrop, dialog, header with title/clear-all/close, the empty view, the\n * list container, the polite status). What the anatomy cannot express — the\n * unseen CountBadge on the bell and the history entries in the list — the\n * element composes from the `notices` JSON on upgrade, the way the skeleton\n * composes its presets. Examples therefore stay out of `notices` states\n * (the parity renderers could not produce them); the attribute is left\n * unset whenever the history is empty, so the static conditions\n * (`notices` / `!notices`) agree with the element's parsed entries.\n *\n * Accessibility mirrors the React NotificationCenter: the bell is an APG\n * button with `aria-haspopup=\"dialog\"` (and `aria-expanded` while open),\n * named with the unseen count; the drawer is an APG modal dialog labelled\n * by its heading; the cleared announcement lives in a visually-hidden\n * `role=\"status\"`.\n */\nexport const notificationCenterDefinition = {\n tag: 'ty-notification-center',\n name: 'TyNotificationCenter',\n kind: 'enhancing',\n doc: 'Bell button with an unseen count and the session\\'s notification history in a modal drawer (review, dismiss one, clear all). The host owns the history and feeds it through `notices` (JSON, newest first); the element composes the badge and the entries, asks to open or close with `ty-open-change` (controlled: the host flips `open`), and reports a dismiss (`ty-dismiss`) or a clear (`ty-clear`) so the host can update its own state. Focus moves into the drawer on open, is trapped while open, Escape asks to close, and focus returns to the bell; after a dismissal focus lands on the next entry\\'s dismiss button (or the previous one, or the heading when the list became empty).',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Drawer shown (controlled). The anatomy stays mounted but `hidden` while closed, so nothing reaches the accessibility tree.' },\n notices: { type: 'string', attribute: 'notices', doc: 'The history as a JSON array, newest first: `[{ \"id\", \"tone\", \"title\", \"message\"?, \"createdAt\" }]`, `tone` one of `success`/`error`/`warning`/`info`, `createdAt` a Unix ms timestamp. Left unset (not `\"[]\"`) while the history is empty. The element renders at most `historyLimit` entries; it never raises toasts itself — the same call that shows a toast feeds this list.' },\n historyLimit: { type: 'number', default: 50, attribute: 'history-limit', doc: 'Cap of the rendered history (the newest survive).' },\n bellLabel: { type: 'string', default: 'Notifications', attribute: 'bell-label', doc: 'Accessible name of the bell; with unseen entries the `unreadLabel` phrase is appended.' },\n unreadLabel: { type: 'string', default: '{count} unread', attribute: 'unread-label', doc: 'Unseen phrase appended to the bell name and carried by the badge; `{count}` is replaced.' },\n titleLabel: { type: 'string', default: 'Notifications', attribute: 'title-label', doc: 'Heading of the drawer; also its accessible name (aria-labelledby).' },\n clearAllLabel: { type: 'string', default: 'Clear all', attribute: 'clear-all-label', doc: 'Name of the clear-all button (shown only with entries).' },\n closeLabel: { type: 'string', default: 'Close', attribute: 'close-label', doc: 'Accessible name of the close button.' },\n dismissLabel: { type: 'string', default: 'Dismiss, {title}', attribute: 'dismiss-label', doc: 'Accessible name of an entry\\'s dismiss button; `{title}` is replaced by the entry\\'s title.' },\n emptyLabel: { type: 'string', default: 'There are no notifications in this session.', attribute: 'empty-label', doc: 'The empty view\\'s sentence.' },\n clearedLabel: { type: 'string', default: 'Notifications cleared', attribute: 'cleared-label', doc: 'Announced politely after clear all (no confirmation: history only).' },\n toneSuccess: { type: 'string', default: 'Success', attribute: 'tone-success', doc: 'Tone word of a success entry.' },\n toneError: { type: 'string', default: 'Error', attribute: 'tone-error', doc: 'Tone word of an error entry.' },\n toneWarning: { type: 'string', default: 'Warning', attribute: 'tone-warning', doc: 'Tone word of a warning entry.' },\n toneInfo: { type: 'string', default: 'Information', attribute: 'tone-info', doc: 'Tone word of an information entry.' },\n timeJustNow: { type: 'string', default: 'just now', attribute: 'time-just-now', doc: 'Relative time of an entry less than a minute old.' },\n timeMinutesAgo: { type: 'string', default: '{count} minutes ago', attribute: 'time-minutes-ago', doc: 'Relative time of an entry minutes old; `{count}` is replaced.' },\n timeHoursAgo: { type: 'string', default: '{count} hours ago', attribute: 'time-hours-ago', doc: 'Relative time of an entry hours old; `{count}` is replaced.' },\n timeDaysAgo: { type: 'string', default: '{count} days ago', attribute: 'time-days-ago', doc: 'Relative time of an entry days old; `{count}` is replaced.' },\n },\n events: [\n { type: 'ty-open-change', kind: 'custom', detail: { open: 'boolean' }, reactProp: 'onOpenChange', doc: 'The element asks the host to change visibility — `open: true` on a bell press, `open: false` on Escape, the close button, a backdrop press or a second bell press. Controlled: the element does not toggle itself; the host flips `open`.' },\n { type: 'ty-dismiss', kind: 'custom', detail: { id: 'string' }, reactProp: 'onDismiss', doc: 'An entry\\'s dismiss button was pressed. The element drops the entry from its rendered history at once; the host removes it from its own state.' },\n { type: 'ty-clear', kind: 'custom', reactProp: 'onClear', doc: 'Clear all was pressed (no confirmation: history only). The element empties its rendered history and announces the `clearedLabel` politely; the host clears its own state.' },\n ],\n anatomy: {\n tag: 'span',\n class: 'ty-notification-center',\n attrs: {},\n children: [\n {\n tag: 'span',\n class: 'ty-notification-center__bell',\n attrs: {},\n children: [\n {\n tag: 'button',\n class: 'ty-button ty-notification-center__trigger',\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'bellLabel' },\n 'aria-haspopup': { value: 'dialog' },\n // Mirrored by the element: `true` while open, left out while closed.\n 'aria-expanded': { prop: 'open', kind: 'bool' },\n 'aria-controls': { idref: 'dialog' },\n 'data-variant': { value: 'quiet' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [bellIcon],\n },\n ],\n },\n // The unseen CountBadge is composed here by the element.\n ],\n },\n {\n tag: 'div',\n class: 'ty-notification-center__backdrop',\n // Always rendered (a framework's closed drawer has an anatomy to\n // find); `hidden` while closed, so nothing reaches the tree.\n attrs: { hidden: { value: '', when: ['!open'] } },\n children: [\n {\n tag: 'div',\n class: 'ty-notification-center__drawer',\n attrs: {},\n children: [\n {\n tag: 'div',\n class: 'ty-notification-center__dialog',\n attrs: {\n role: { value: 'dialog' },\n 'aria-modal': { value: 'true' },\n tabindex: { value: '-1' },\n id: { idref: 'dialog' },\n 'aria-labelledby': { idref: 'title' },\n },\n children: [\n {\n tag: 'header',\n class: 'ty-notification-center__head',\n attrs: {},\n children: [\n bellIcon,\n {\n tag: 'h2',\n class: 'ty-notification-center__heading',\n attrs: { id: { idref: 'title' }, tabindex: { value: '-1' } },\n children: [{ text: { prop: 'titleLabel' } }],\n },\n {\n tag: 'button',\n class: 'ty-button ty-notification-center__clear',\n attrs: {\n type: { value: 'button' },\n hidden: { value: '', when: ['!notices'] },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n },\n children: [{ text: { prop: 'clearAllLabel' } }],\n },\n {\n tag: 'button',\n class: 'ty-button ty-notification-center__close',\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'closeLabel' },\n title: { prop: 'closeLabel' },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n 'data-shape': { value: 'circle' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [xIcon],\n },\n ],\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-notification-center__empty',\n attrs: { hidden: { value: '', when: ['notices'] } },\n children: [\n bellOffIcon,\n { tag: 'p', class: 'ty-notification-center__empty-text', children: [{ text: { prop: 'emptyLabel' } }] },\n ],\n },\n {\n tag: 'ul',\n class: 'ty-notification-center__list',\n // Filled by the element from `notices`.\n attrs: { hidden: { value: '', when: ['!notices'] } },\n },\n ],\n },\n ],\n },\n ],\n },\n {\n tag: 'span',\n class: 'ty-visually-hidden ty-notification-center__status',\n attrs: { role: { value: 'status' } },\n },\n ],\n },\n examples: [\n { name: 'closed', props: {}, slots: {} },\n { name: 'open-empty', props: { open: true }, slots: {} },\n {\n name: 'translated',\n props: { open: true, bellLabel: 'Notificações', titleLabel: 'Notificações', clearAllLabel: 'Limpar tudo', closeLabel: 'Fechar', emptyLabel: 'Não há notificações nesta sessão.' },\n slots: {},\n },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { notificationCenterDefinition } from './definition.ts'\n\n/** One history entry, as the `notices` JSON carries it. */\nexport interface Notice {\n id: string\n tone: 'success' | 'error' | 'warning' | 'info'\n title: string\n message?: string\n createdAt: number\n}\n\n/** Elements that may take keyboard focus inside the dialog. */\nconst FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Marker of the elements this element made inert (a host's own inert is left alone). */\nconst INERT_MARK = 'data-ty-notification-center-inert'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nconst TONES = new Set(['success', 'error', 'warning', 'info'])\n\n/** Tone word prop per tone. */\nconst TONE_PROP = { success: 'toneSuccess', error: 'toneError', warning: 'toneWarning', info: 'toneInfo' } as const\n\ntype Paths = ReadonlyArray<readonly [string, Record<string, string>]>\n\n/** Tone glyphs (lucide circle-check, circle-alert, triangle-alert, info). */\nconst TONE_PATHS: Record<Notice['tone'], Paths> = {\n success: [\n ['path', { d: 'M21.801 10A10 10 0 1 1 17 3.335' }],\n ['path', { d: 'm9 11 3 3L22 4' }],\n ],\n error: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ],\n warning: [\n ['path', { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z' }],\n ['path', { d: 'M12 9v4' }],\n ['path', { d: 'M12 17h.01' }],\n ],\n info: [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n}\n\n/** The dismiss X (lucide `x`). */\nconst X_PATHS: Paths = [\n ['path', { d: 'M18 6 6 18' }],\n ['path', { d: 'm6 6 12 12' }],\n]\n\n/** Open drawers share one page scroll lock; the last one to close releases it. */\nlet scrollLocks = 0\n\nconst lockScroll = () => {\n if (++scrollLocks === 1) document.documentElement.setAttribute('data-ty-notification-center-open', '')\n}\nconst unlockScroll = () => {\n if (scrollLocks > 0 && --scrollLocks === 0) document.documentElement.removeAttribute('data-ty-notification-center-open')\n}\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** A decorative 24px icon (lucide strokes), as the definition renders the static ones. */\nfunction icon(paths: Paths, className: string): SVGSVGElement {\n const svg = document.createElementNS(SVG_NS, 'svg')\n svg.setAttribute('class', className)\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const [tag, attrs] of paths) {\n const node = document.createElementNS(SVG_NS, tag)\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n svg.append(node)\n }\n return svg\n}\n\n/**\n * `<ty-notification-center>`. The host framework renders the anatomy (bell,\n * drawer with header, empty view, list container, polite status) from the\n * definition; the element adds what the declarative anatomy cannot (spec:\n * wave-2/notification-center.md):\n *\n * - **Composition** — the unseen CountBadge on the bell and the history\n * entries in the list are composed from the `notices` JSON (newest\n * first, capped at `history-limit`). A dismissal or a clear is reflected\n * in the rendered history at once (a removed/cleared ledger, like the\n * React provider's) and reported to the host (`ty-dismiss` / `ty-clear`),\n * which owns the history and feeds the next `notices`.\n * - **Unseen count** — entries created since the drawer last opened; the\n * bell's name carries it (\"Notifications, 3 unread\") and the badge shows\n * it. Opening the drawer marks everything seen.\n * - **Modal behaviour** (the `<ty-modal>`/`<ty-drawer>` contract) — focus\n * moves into the drawer on open and is trapped; Escape, the close button\n * and a backdrop press ask to close (`ty-open-change`, `open: false`);\n * the bell toggles (`open: true` while closed, `false` while open).\n * Controlled: the host flips `open`. On close, focus returns to the bell.\n * The page behind is `inert` and does not scroll while open\n * (`data-ty-notification-center-open` on the root).\n * - **Focus after removal** — dismissing an entry moves focus to the next\n * entry's dismiss button, else the previous one, else the drawer heading;\n * clear all moves it to the heading. A recompose from a new `notices`\n * (a toast arriving while the drawer is open) keeps focus on the entry\n * it was on.\n *\n * The open animation is `data-entering`, applied after the first frame and\n * removed when it ends.\n */\nexport class TyNotificationCenterElement extends TyElement {\n static override definition = notificationCenterDefinition\n\n /** Entries dismissed here, waiting for the host's next `notices`. */\n #removed = new Set<string>()\n /** Entries created at or before this time were cleared here. */\n #clearedAt = Number.NEGATIVE_INFINITY\n /** When the drawer last opened: entries created later are unseen. */\n #seenAt = Number.NEGATIVE_INFINITY\n /** Unseen count of the previous compose (the badge flashes on a rise). */\n #lastUnseen: number | null = null\n /** The entries of the latest compose (focus keeps its entry across one). */\n #rendered: Notice[] = []\n #wasOpen = false\n #returnFocus: HTMLElement | null = null\n #inerted: Element[] = []\n #pressOnBackdrop = false\n /** Dismiss index to focus after the compose it triggered (-1: the heading). */\n #pendingFocus: number | null = null\n\n protected override connected(): void {\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('mousedown', this.#onMousedown)\n this.addEventListener('click', this.#onClick)\n if (this.props.open) this.#activate()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('mousedown', this.#onMousedown)\n this.removeEventListener('click', this.#onClick)\n this.#deactivate(true)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n if (this.props.open) this.#activate()\n else this.#deactivate(true)\n }\n\n override sync(): void {\n super.sync()\n if (this.anatomyRoot()) this.#compose()\n }\n\n // --- Data ------------------------------------------------------------\n\n /** The parsed `notices` JSON (malformed entries are skipped). */\n #notices(): Notice[] {\n const raw = this.getAttribute('notices')\n if (!raw) return []\n let parsed: unknown\n try {\n parsed = JSON.parse(raw)\n } catch {\n console.warn('ty-notification-center: `notices` is not valid JSON.')\n return []\n }\n if (!Array.isArray(parsed)) return []\n const notices: Notice[] = []\n for (const item of parsed) {\n if (!item || typeof item !== 'object') continue\n const { id, tone, title, message, createdAt } = item as Record<string, unknown>\n if ((typeof id !== 'string' && typeof id !== 'number') || typeof title !== 'string' || !title) continue\n notices.push({\n id: String(id),\n tone: TONES.has(String(tone)) ? (String(tone) as Notice['tone']) : 'info',\n title,\n message: typeof message === 'string' && message ? message : undefined,\n createdAt: typeof createdAt === 'number' && Number.isFinite(createdAt) ? createdAt : 0,\n })\n }\n return notices\n }\n\n /** The rendered history: the ledger applied, capped at `history-limit`. */\n #entries(): Notice[] {\n const raw = Number(this.props.historyLimit)\n const limit = Number.isFinite(raw) && raw >= 0 ? Math.floor(raw) : 50\n return this.#notices()\n .filter((n) => n.createdAt > this.#clearedAt && !this.#removed.has(n.id))\n .slice(0, limit)\n }\n\n /** Entries created since the drawer last opened; none while it is open. */\n #unseen(entries: Notice[]): number {\n if (this.props.open) return 0\n return entries.filter((n) => n.createdAt > this.#seenAt).length\n }\n\n #unreadPhrase(count: number): string {\n return String(this.props.unreadLabel).replace('{count}', String(count))\n }\n\n /** Localised \"5 minutes ago\" style phrase (the React relativeNoticeTime). */\n #time(createdAt: number): string {\n const p = this.props\n const minutes = Math.floor(Math.max(0, Date.now() - createdAt) / 60000)\n if (minutes < 1) return String(p.timeJustNow)\n if (minutes < 60) return String(p.timeMinutesAgo).replace('{count}', String(minutes))\n const hours = Math.floor(minutes / 60)\n if (hours < 24) return String(p.timeHoursAgo).replace('{count}', String(hours))\n return String(p.timeDaysAgo).replace('{count}', String(Math.floor(hours / 24)))\n }\n\n // --- Composition -------------------------------------------------------\n\n /** Bring the badge, the bell's name and the entries in step with `notices`. */\n #compose(): void {\n const p = this.props\n const entries = this.#entries()\n const unseen = this.#unseen(entries)\n const trigger = this.querySelector('.ty-notification-center__trigger')\n if (trigger) {\n if (p.open) trigger.setAttribute('aria-expanded', 'true')\n else trigger.removeAttribute('aria-expanded')\n const name = unseen > 0 ? `${String(p.bellLabel)}, ${this.#unreadPhrase(unseen)}` : String(p.bellLabel)\n if (trigger.getAttribute('aria-label') !== name) trigger.setAttribute('aria-label', name)\n }\n this.#composeBadge(unseen)\n const clear = this.querySelector<HTMLElement>('.ty-notification-center__clear')\n if (clear) clear.hidden = entries.length === 0\n const empty = this.querySelector<HTMLElement>('.ty-notification-center__empty')\n if (empty) empty.hidden = entries.length > 0\n const list = this.querySelector<HTMLElement>('.ty-notification-center__list')\n if (list) {\n list.hidden = entries.length === 0\n this.#fillList(list, entries)\n }\n this.#lastUnseen = unseen\n }\n\n /** The unseen CountBadge pinned to the bell (the React CountBadge's markup). */\n #composeBadge(unseen: number): void {\n const bell = this.querySelector('.ty-notification-center__bell')\n if (!bell) return\n let badge = bell.querySelector<HTMLElement>('.ty-count-badge')\n if (unseen <= 0) {\n badge?.remove()\n return\n }\n if (!badge) {\n badge = el('span', 'ty-count-badge', { 'data-tone': 'attention' })\n badge.append(el('span', 'ty-count-badge__value', { 'aria-hidden': 'true' }), el('span', 'ty-visually-hidden'))\n bell.append(badge)\n }\n // Locale digits and the \"99+\" cap are the service's formatting; the\n // attribute carries plain digits.\n badge.querySelector('.ty-count-badge__value')!.textContent = unseen > 99 ? '99+' : String(unseen)\n badge.querySelector('.ty-visually-hidden')!.textContent = this.#unreadPhrase(unseen)\n if (this.#lastUnseen !== null && unseen > this.#lastUnseen) {\n badge.setAttribute('data-changed', '')\n badge.addEventListener('animationend', () => badge.removeAttribute('data-changed'), { once: true })\n }\n }\n\n /** One history entry: tone glyph, tone word, title, message, time, dismiss. */\n #entry(notice: Notice): HTMLElement {\n const p = this.props\n const li = el('li', 'ty-notification-center__entry', { 'data-tone': notice.tone })\n li.append(icon(TONE_PATHS[notice.tone], 'ty-icon ty-notification-center__glyph'))\n const text = el('div', 'ty-notification-center__text')\n const tone = el('p', 'ty-notification-center__tone')\n tone.textContent = String(p[TONE_PROP[notice.tone]])\n const title = el('p', 'ty-notification-center__title')\n title.textContent = notice.title\n text.append(tone, title)\n if (notice.message) {\n const message = el('p', 'ty-notification-center__message')\n message.textContent = notice.message\n text.append(message)\n }\n const time = el('p', 'ty-notification-center__time')\n time.textContent = this.#time(notice.createdAt)\n text.append(time)\n const dismiss = el('button', 'ty-button ty-notification-center__dismiss', {\n type: 'button',\n 'aria-label': String(p.dismissLabel).replace('{title}', notice.title),\n 'data-variant': 'quiet',\n 'data-size': 'compact',\n 'data-shape': 'circle',\n 'data-icon-only': '',\n })\n const wrap = el('span', 'ty-button__icon', { 'aria-hidden': 'true' })\n wrap.append(icon(X_PATHS, 'ty-icon'))\n dismiss.append(wrap)\n li.append(text, dismiss)\n return li\n }\n\n #dismissAt(list: Element, index: number): HTMLElement | null {\n return list.children[index]?.querySelector<HTMLElement>('.ty-notification-center__dismiss') ?? null\n }\n\n /** Refill the list, keeping focus on its entry (or moving it after a dismissal). */\n #fillList(list: Element, entries: Notice[]): void {\n const active = document.activeElement\n let refocus: number | null = null\n if (active && list.contains(active)) {\n const li = (active as Element).closest?.('.ty-notification-center__entry')\n const index = li ? Array.from(list.children).indexOf(li as Element) : -1\n const id = index >= 0 ? this.#rendered[index]?.id : undefined\n if (id !== undefined) {\n const next = entries.findIndex((n) => n.id === id)\n if (next >= 0) refocus = next\n }\n }\n list.replaceChildren(...entries.map((n) => this.#entry(n)))\n this.#rendered = entries\n if (this.#pendingFocus !== null) {\n const index = this.#pendingFocus\n this.#pendingFocus = null\n const target =\n index >= 0 && entries.length > 0\n ? this.#dismissAt(list, Math.min(index, entries.length - 1))\n : this.querySelector<HTMLElement>('.ty-notification-center__heading')\n target?.focus()\n } else if (refocus !== null) {\n this.#dismissAt(list, refocus)?.focus()\n }\n }\n\n // --- Dismiss and clear --------------------------------------------------\n\n /** Drop one entry from the rendered history and report it (the host owns the data). */\n #dismiss(index: number): void {\n const entry = this.#entries()[index]\n if (!entry) return\n this.#removed.add(entry.id)\n this.emit('ty-dismiss', { id: entry.id })\n this.#pendingFocus = index\n this.#compose()\n }\n\n /** Empty the rendered history, announce it politely and report it. */\n #clear(): void {\n this.#clearedAt = Date.now()\n this.#removed.clear()\n this.emit('ty-clear')\n this.#pendingFocus = -1\n const status = this.querySelector('.ty-notification-center__status')\n if (status) {\n // A fresh text node after clearing makes screen readers repeat identical messages.\n status.textContent = ''\n const text = String(this.props.clearedLabel)\n queueMicrotask(() => {\n status.textContent = text\n })\n }\n this.#compose()\n }\n\n // --- Open and close (controlled; the modal contract) --------------------\n\n /** Ask the host to change visibility; the host flips `open`. */\n #requestOpen(open: boolean): void {\n this.emit('ty-open-change', { open })\n }\n\n #dialog(): HTMLElement | null {\n return this.querySelector('.ty-notification-center__dialog')\n }\n\n #backdrop(): HTMLElement | null {\n return this.querySelector('.ty-notification-center__backdrop')\n }\n\n #tabbables(): HTMLElement[] {\n const dialog = this.#dialog()\n if (!dialog) return []\n return Array.from(dialog.querySelectorAll<HTMLElement>(FOCUSABLE)).filter((node) => !node.closest('[hidden]'))\n }\n\n #activate(): void {\n if (this.#wasOpen) return\n this.#wasOpen = true\n // Opening marks everything seen.\n this.#seenAt = Date.now()\n const active = document.activeElement\n this.#returnFocus = active instanceof HTMLElement && !this.contains(active) ? active : this.querySelector('.ty-notification-center__trigger')\n lockScroll()\n this.#applyInert()\n // The anatomy may land a beat after the `open` attribute (a framework\n // commits children and host attributes separately), so focus and the\n // entering animation wait a frame.\n requestAnimationFrame(() => {\n if (!this.isConnected || !this.props.open) return\n this.#focusInitial()\n for (const part of this.querySelectorAll('.ty-notification-center__backdrop, .ty-notification-center__drawer')) {\n part.setAttribute('data-entering', '')\n part.addEventListener('animationend', () => part.removeAttribute('data-entering'), { once: true })\n }\n })\n }\n\n #deactivate(restoreFocus: boolean): void {\n if (!this.#wasOpen) return\n this.#wasOpen = false\n unlockScroll()\n for (const element of this.#inerted) {\n if (element.getAttribute(INERT_MARK) !== null) {\n element.removeAttribute('inert')\n element.removeAttribute(INERT_MARK)\n }\n }\n this.#inerted = []\n const target = this.#returnFocus\n this.#returnFocus = null\n // Focus returns to the bell (or to what had it, if that was outside);\n // the return waits a frame, like the modal's.\n if (restoreFocus && target?.isConnected) {\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus()\n })\n }\n }\n\n /** Everything between this element and `<body>` gets inert siblings. */\n #applyInert(): void {\n let node: Element | null = this\n while (node && node !== document.body) {\n const parent: Element | null = node.parentElement\n if (!parent) break\n for (const sibling of Array.from(parent.children)) {\n if (sibling === node || sibling.hasAttribute('inert')) continue\n sibling.setAttribute('inert', '')\n sibling.setAttribute(INERT_MARK, '')\n this.#inerted.push(sibling)\n }\n node = parent\n }\n }\n\n #focusInitial(): void {\n const dialog = this.#dialog()\n if (!dialog) return\n const active = document.activeElement\n if (active instanceof HTMLElement && dialog.contains(active)) return\n const heading = this.querySelector<HTMLElement>('.ty-notification-center__heading')\n ;(this.#tabbables()[0] ?? heading ?? dialog).focus()\n }\n\n #onKeydown = (event: Event): void => {\n const key = (event as KeyboardEvent).key\n if (key === 'Escape') {\n if ((event as KeyboardEvent).isComposing || !this.props.open) return\n event.preventDefault()\n event.stopPropagation()\n this.#requestOpen(false)\n return\n }\n if (key !== 'Tab' || !this.props.open) return\n const dialog = this.#dialog()\n if (!dialog) return\n event.preventDefault()\n event.stopPropagation()\n const tabbables = this.#tabbables()\n const backwards = (event as KeyboardEvent).shiftKey\n if (!tabbables.length) {\n dialog.focus()\n return\n }\n const current = tabbables.indexOf(document.activeElement as HTMLElement)\n const next = current === -1 ? (backwards ? tabbables.length - 1 : 0) : (current + (backwards ? -1 : 1) + tabbables.length) % tabbables.length\n tabbables[next]!.focus()\n }\n\n #onMousedown = (event: Event): void => {\n this.#pressOnBackdrop = event.target === this.#backdrop()\n // Keep focus inside the dialog: a press on the backdrop must not move focus to the body.\n if (this.#pressOnBackdrop) event.preventDefault()\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const trigger = target.closest('.ty-notification-center__trigger')\n if (trigger && this.contains(trigger)) {\n this.#requestOpen(!this.props.open)\n return\n }\n const close = target.closest('.ty-notification-center__close')\n if (close && this.contains(close)) {\n this.#requestOpen(false)\n return\n }\n const clear = target.closest('.ty-notification-center__clear')\n if (clear && this.contains(clear)) {\n this.#clear()\n return\n }\n const dismiss = target.closest('.ty-notification-center__dismiss')\n if (dismiss && this.contains(dismiss)) {\n const list = this.querySelector('.ty-notification-center__list')\n const li = dismiss.closest('.ty-notification-center__entry')\n const index = list && li ? Array.from(list.children).indexOf(li as Element) : -1\n if (index >= 0) this.#dismiss(index)\n return\n }\n if (target === this.#backdrop() && this.#pressOnBackdrop) this.#requestOpen(false)\n this.#pressOnBackdrop = false\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-markdown-view>`: the MarkdownView's single source (spec:\n * wave-2/markdown-view.md).\n *\n * Self-rendering: the whole subtree is data-driven — parsed from the `text`\n * Markdown source on upgrade and on every attribute change — so the\n * declarative anatomy cannot express it (no parsing, no repetition), and the\n * wrappers render an empty host. The element shares the parser with the\n * React MarkdownView (`components/markdown-view/parse.ts`): one grammar, one\n * data tree, and no HTML string anywhere — the tree is built with\n * `createElement` and text nodes only, so markup in the source can only ever\n * reach the page as text. Links exist solely for absolute http(s) URLs (any\n * other scheme renders as literal text), open in a new tab with\n * `rel=\"noopener noreferrer\"`, and carry the external icon and the hidden\n * new-tab hint, as `<ty-link>` renders them. Examples stay empty: parity\n * rendering does not apply to a self-rendering element.\n */\nexport const markdownViewDefinition = {\n tag: 'ty-markdown-view',\n name: 'TyMarkdownView',\n kind: 'self-rendering',\n doc: 'Safely renders a small, product-relevant subset of Markdown written by people or produced by models, without ever interpreting raw HTML: paragraphs, lists, headings (real `h2`–`h6`, offset by `headingBase`), fenced code blocks, and inline code, strong, emphasis and http(s) links; everything else is literal text. Static — links are the only focusable content, plus a code block that overflows (a labelled scroll region).',\n props: {\n text: { type: 'string', attribute: 'text', doc: 'Markdown source (the supported subset; anything else renders as literal text). Empty renders nothing.' },\n headingBase: { type: 'number', default: 3, attribute: 'heading-base', doc: 'Level used for a Markdown level-1 heading (2 to 6); deeper levels follow, capped at 6.' },\n density: { type: 'enum', values: ['regular', 'compact'], default: 'regular', attribute: 'density', doc: 'Spacing between blocks.' },\n codeBlockLabel: { type: 'string', default: 'Code block', attribute: 'code-block-label', doc: 'Accessible name of a code block that overflows (a scroll region) when it has no language tag; translate through this attribute.' },\n codeBlockLanguageLabel: { type: 'string', default: 'Code block, {language}', attribute: 'code-block-language-label', doc: 'Accessible name of an overflowing code block with a language tag; `{language}` is replaced by the tag.' },\n newTabLabel: { type: 'string', default: '(opens in a new tab)', attribute: 'new-tab-label', doc: 'Screen-reader hint appended to every link (all links open in a new tab); translate through this attribute.' },\n },\n events: [],\n examples: [],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { markdownViewDefinition } from './definition.ts'\nimport { readBlocks, type Block, type Inline } from '../../components/markdown-view/parse.ts'\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** The external-link glyph (lucide strokes, ISC, THIRD_PARTY_NOTICES), as `<ty-link>` renders it. */\nfunction externalIcon(): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n svg.setAttribute('class', 'ty-icon ty-mirror-rtl ty-link__external')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n svg.setAttribute('width', '24')\n svg.setAttribute('height', '24')\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n for (const d of ['M15 3h6v6', 'M10 14 21 3', 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6']) {\n const path = document.createElementNS(SVG, 'path')\n path.setAttribute('d', d)\n svg.append(path)\n }\n return svg\n}\n\n/** `headingBase` clamped to the spec range (2 to 6). */\nfunction headingLevel(raw: unknown, depth: number): number {\n const n = Number(raw)\n const base = Number.isFinite(n) ? Math.min(6, Math.max(2, Math.floor(n))) : 3\n return Math.min(6, base + depth - 1)\n}\n\n/**\n * `<ty-markdown-view>`. Self-rendering: on connect and on every attribute\n * change the element parses `text` with the shared MarkdownView parser and\n * builds the whole subtree as elements and text nodes — never from an HTML\n * string, so source markup stays text. The output mirrors the React\n * MarkdownView node for node (`.ty-markdown` root with `data-density`,\n * real headings offset by `heading-base`, lists, sunken code blocks with\n * their language tag), and its links mirror an external `<ty-link>`\n * (`target=\"_blank\"`, `rel=\"noopener noreferrer\"`, the icon and the hidden\n * new-tab hint from `new-tab-label`). A code block becomes a focusable,\n * labelled scroll region only when it overflows.\n */\nexport class TyMarkdownViewElement extends TyElement {\n static override definition = markdownViewDefinition\n\n protected override connected(): void {\n this.#render()\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#render()\n }\n\n #render(): void {\n const props = this.props\n const source = typeof props.text === 'string' ? props.text : ''\n const blocks = readBlocks(source)\n if (blocks.length === 0) {\n this.replaceChildren()\n return\n }\n const root = el('div', 'ty-markdown', { 'data-density': String(props.density) })\n for (const block of blocks) root.append(this.#block(block, props.headingBase))\n this.replaceChildren(root)\n this.#labelOverflowingCodeBlocks(root)\n }\n\n #block(block: Block, base: unknown): HTMLElement {\n if (block.kind === 'heading') {\n const heading = el(`h${headingLevel(base, block.depth)}`, 'ty-markdown__heading', {\n 'data-depth': String(block.depth),\n dir: 'auto',\n })\n heading.append(...this.#inline(block.content))\n return heading\n }\n if (block.kind === 'list') {\n const list = el(block.ordered ? 'ol' : 'ul', 'ty-markdown__list')\n for (const item of block.items) {\n const li = document.createElement('li')\n li.setAttribute('dir', 'auto')\n li.append(...this.#inline(item))\n list.append(li)\n }\n return list\n }\n if (block.kind === 'code') return this.#codeBlock(block)\n const paragraph = el('p', 'ty-markdown__paragraph', { dir: 'auto' })\n paragraph.append(...this.#inline(block.content))\n return paragraph\n }\n\n /** Inline nodes as DOM: text stays text; only the parser's own elements are created. */\n #inline(nodes: Inline[]): Node[] {\n return nodes.map((node) => {\n switch (node.kind) {\n case 'text':\n return document.createTextNode(node.value)\n case 'code': {\n const code = el('code', 'ty-markdown__code-span')\n code.textContent = node.value\n return code\n }\n case 'strong': {\n const strong = document.createElement('strong')\n strong.append(...this.#inline(node.children))\n return strong\n }\n case 'em': {\n const em = document.createElement('em')\n em.append(...this.#inline(node.children))\n return em\n }\n case 'link':\n return this.#link(node)\n }\n })\n }\n\n /**\n * A safe link: the parser only produces absolute http(s) hrefs, and every\n * one opens in a new tab with no opener and no referrer, with the external\n * icon and the hidden hint — the external `<ty-link>` anatomy.\n */\n #link(node: { href: string; children: Inline[] }): HTMLElement {\n const link = el('a', 'ty-link', {\n href: node.href,\n target: '_blank',\n rel: 'noopener noreferrer',\n 'data-emphasis': 'underlined',\n })\n link.append(...this.#inline(node.children))\n link.append(externalIcon())\n const hint = el('span', 'ty-visually-hidden ty-link__hint')\n hint.textContent = ` ${String(this.props.newTabLabel)}`\n link.append(hint)\n return link\n }\n\n /** A fenced code block: sunken surface, mono text, the language tag as meta. */\n #codeBlock(block: { language?: string; value: string }): HTMLElement {\n const wrap = el('div', 'ty-markdown__code-block')\n if (block.language) {\n const tag = el('span', 'ty-markdown__language', { 'aria-hidden': 'true' })\n tag.textContent = block.language\n wrap.append(tag)\n }\n const pre = el('pre', 'ty-markdown__pre', { dir: 'ltr' })\n if (block.language) pre.setAttribute('data-language', block.language)\n const code = document.createElement('code')\n code.textContent = block.value\n pre.append(code)\n wrap.append(pre)\n return wrap\n }\n\n /** A code block that scrolls is a focusable region with an accessible name; one that fits stays passive. */\n #labelOverflowingCodeBlocks(root: HTMLElement): void {\n const props = this.props\n for (const pre of root.querySelectorAll('pre.ty-markdown__pre')) {\n if (pre.scrollWidth <= pre.clientWidth) continue\n const language = pre.getAttribute('data-language')\n const label = language\n ? String(props.codeBlockLanguageLabel).replaceAll('{language}', language)\n : String(props.codeBlockLabel)\n pre.setAttribute('tabindex', '0')\n pre.setAttribute('role', 'region')\n pre.setAttribute('aria-label', label)\n }\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/**\n * `<ty-heading>`: the Heading's single source (spec: wave-1/heading.md).\n *\n * The document level (`level`, h1 to h6) and the visual step (`appearance`)\n * are independent; unset, the step derives from the level (1 → h1, 2 → h2,\n * 3 and deeper → h3). The convenience Subheading of the React component is\n * this element with `level=\"2\" appearance=\"h3\"`. The optional `eyebrow`\n * renders before, and outside, the heading element, so the heading's\n * accessible name stays the heading text alone. The heading carries a\n * stable id (`heading-id`, generated from the instance otherwise) so\n * sections and dialogs can label themselves by it.\n *\n * The anatomy root is always the group wrapper (the React component renders\n * it only with an eyebrow); it adds no box beyond the column gap, and\n * keeping it unconditional lets every renderer express one tree.\n */\nexport const headingDefinition = {\n tag: 'ty-heading',\n name: 'TyHeading',\n kind: 'enhancing',\n doc: 'Section title whose document level (`level`, h1 to h6) and visual step (`appearance`: display, h1, h2, h3 or label) are set independently; unset, the step derives from the level. An optional `eyebrow` labels the section above the heading, outside the heading element. The heading id (`heading-id`, generated otherwise) lets a section or dialog reference it with `aria-labelledby`. `level=\"2\" appearance=\"h3\"` is the Subheading.',\n props: {\n level: { type: 'enum', values: ['1', '2', '3', '4', '5', '6'], default: '1', attribute: 'level', doc: 'Document outline level (1 to 6, as its attribute spelling); one h1 per page, no skipped levels.' },\n appearance: { type: 'enum', values: ['display', 'h1', 'h2', 'h3', 'label'], attribute: 'appearance', doc: 'Visual step from the type scale of §2.2, decoupled from `level`; derived from the level when unset (1 → h1, 2 → h2, 3+ → h3).' },\n eyebrow: { type: 'string', attribute: 'eyebrow', doc: 'Small uppercase label rendered before, and outside, the heading element (the §2.2 eyebrow token); the heading text alone stays the accessible name.' },\n headingId: { type: 'string', attribute: 'heading-id', doc: 'Stable id of the heading element, for `aria-labelledby` of the enclosing section or dialog; `<instance>-heading` when unset.' },\n },\n events: [],\n slots: {\n default: { doc: 'The heading text.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-heading-group',\n children: [\n { tag: 'p', class: 'ty-heading__eyebrow', when: ['eyebrow'], children: [{ text: { prop: 'eyebrow' } }] },\n ...([1, 2, 3, 4, 5, 6] as const).map((n): ElementNode => ({\n tag: `h${n}`,\n class: 'ty-heading',\n when: [`level:${n}`],\n attrs: {\n id: { idref: 'heading', prop: 'headingId' },\n 'data-appearance': {\n prop: 'appearance',\n kind: 'map',\n values: { display: 'display', h1: 'h1', h2: 'h2', h3: 'h3', label: 'label' },\n fallback: { prop: 'level', values: { '1': 'h1', '2': 'h2', '3': 'h3', '4': 'h3', '5': 'h3', '6': 'h3' } },\n },\n },\n children: [{ slot: 'default' }],\n })),\n ],\n },\n examples: [\n { name: 'page-title', props: {}, slots: { default: 'Sources' } },\n { name: 'level-3', props: { level: '3' }, slots: { default: 'Field mapping' } },\n { name: 'small-level-big-step', props: { level: '2', appearance: 'h1' }, slots: { default: 'Workspace' } },\n { name: 'eyebrow', props: { level: '2', eyebrow: 'Datasets' }, slots: { default: 'Revenue by state' } },\n { name: 'label-step', props: { level: '4', appearance: 'label' }, slots: { default: 'Owner' } },\n { name: 'subheading', props: { level: '2', appearance: 'h3' }, slots: { default: 'Recent runs' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { headingDefinition } from './definition.ts'\n\n/**\n * `<ty-heading>`. All presentation: the host framework renders the anatomy\n * (the optional eyebrow and the heading of the chosen level) and the\n * stylesheet draws the type steps, including the narrow h1 and the\n * forced-colours fallback. Not a widget — no keyboard or events; the base\n * class builds and patches the anatomy for plain-HTML use (swapping the\n * heading tag when `level` changes) and keeps the bound attributes in step.\n */\nexport class TyHeadingElement extends TyElement {\n static override definition = headingDefinition\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-data-table>`: the DataTable's single source (spec: wave-1/data-table.md).\n *\n * A data-driven composite — records as rows, attributes as columns — so the\n * element is self-rendering (the theme palette's precedent): the host\n * framework renders an empty host and passes the data as JSON attributes\n * (`columns`, `rows`, `selected-keys`), and the element owns the whole\n * subtree: the caption, the sortable header, the selection column, the\n * skeleton rows, the empty state and the data rows themselves. The dynamic\n * parts (sort cycle, selection set, loading and empty states, row\n * activation) are events the element emits and controlled props the host\n * writes back, the same contract as `<ty-popover>`'s `open`.\n *\n * There is no declarative anatomy (the tree depends on the data, which the\n * definition language cannot express) and no examples (the parity renderers\n * could not produce data-driven output); behaviour is covered by\n * packages/ui/test/elements/data-table.test.tsx.\n */\nexport const dataTableDefinition = {\n tag: 'ty-data-table',\n name: 'TyDataTable',\n kind: 'self-rendering',\n doc: 'Records as rows and attributes as columns, with sorting, optional row selection, row navigation, loading and empty states, in three densities. Data arrives as JSON attributes; sort, selection and row activation are controlled: the element emits `ty-sort-change`, `ty-selection-change` and `ty-row-action`, and the host writes the new `sort-column`/`sort-direction`/`selected-keys` back.',\n props: {\n caption: { type: 'string', attribute: 'caption', doc: 'Accessible name of the table (required); visually hidden unless `captionVisible`.' },\n captionVisible: { type: 'boolean', attribute: 'caption-visible', doc: 'Show the caption above the table; it always names the table.' },\n columns: { type: 'string', attribute: 'columns', doc: 'JSON array of column definitions: { id, header, sortable?, align?: \"start\"|\"end\", numeric? }. `numeric` implies end alignment and tabular figures.' },\n rows: { type: 'string', attribute: 'rows', doc: 'JSON array of rows: { id, cells: { \"<columnId>\": \"<text>\" }, href?, label? }. `href` makes the whole row the target (one link per row in the tab order); `label` names the row link.' },\n density: { type: 'enum', values: ['comfortable', 'standard', 'compact'], default: 'standard', attribute: 'density', doc: 'Row height and cell padding: comfortable 52 px, standard 44 px, compact 36 px.' },\n sortColumn: { type: 'string', attribute: 'sort-column', doc: 'The currently sorted column id (controlled).' },\n sortDirection: { type: 'enum', values: ['ascending', 'descending'], attribute: 'sort-direction', doc: 'Direction of `sortColumn` (controlled); unset: no sort.' },\n selectionMode: { type: 'enum', values: ['none', 'multiple'], default: 'none', attribute: 'selection-mode', doc: '`multiple` adds a checkbox column and a select-all header checkbox.' },\n selectedKeys: { type: 'string', attribute: 'selected-keys', doc: 'JSON array of the selected row ids (controlled).' },\n loading: { type: 'boolean', attribute: 'loading', doc: 'Show skeleton rows instead of data; the table is `aria-busy` and a polite status announces `loadingLabel`.' },\n loadingRowCount: { type: 'number', default: 10, attribute: 'loading-row-count', doc: 'Number of skeleton rows while loading.' },\n loadingLabel: { type: 'string', default: 'Loading the list', attribute: 'loading-label', doc: 'Polite status announced while loading.' },\n emptyLabel: { type: 'string', default: 'No rows to show', attribute: 'empty-label', doc: 'Title of the built-in empty state, shown in a single cell spanning all columns when not loading and rows are empty.' },\n emptyDescription: { type: 'string', attribute: 'empty-description', doc: 'Optional description under the empty title.' },\n selectAllLabel: { type: 'string', default: 'Select all rows', attribute: 'select-all-label', doc: 'Accessible name of the header checkbox.' },\n selectRowLabel: { type: 'string', default: 'Select {label}', attribute: 'select-row-label', doc: 'Accessible name template of a row checkbox; `{label}` is the row label.' },\n actionable: { type: 'boolean', attribute: 'actionable', doc: 'Rows are activatable: Enter or a press on a row without `href` emits `ty-row-action` (the presence of the spec\\'s `onRowAction`).' },\n stickyFirstColumn: { type: 'string', attribute: 'sticky-first-column', doc: '`true` or `false`; unset: the first column stays visible while scrolling horizontally.' },\n showColumnLines: { type: 'boolean', attribute: 'show-column-lines', doc: 'Vertical dividers between columns.' },\n maxBlockSize: { type: 'string', attribute: 'max-block-size', doc: 'Maximum height of the scroll container, enabling the sticky header.' },\n },\n events: [\n { type: 'ty-sort-change', kind: 'custom', detail: { column: 'string', direction: 'string' }, reactProp: 'onSortChange', doc: 'A sortable header cycled (none → ascending → descending → none). `direction` is `ascending`, `descending` or null when the sort cleared (the attribute reads an empty string for the cleared state). Controlled: the host writes `sort-column`/`sort-direction`.' },\n { type: 'ty-selection-change', kind: 'custom', detail: { keys: 'string' }, reactProp: 'onSelectionChange', doc: 'The selection changed (a row checkbox, the select-all header checkbox, or Space on a focused row); `keys` is a JSON array of the selected row ids. Controlled: the host writes `selected-keys`.' },\n { type: 'ty-row-action', kind: 'custom', detail: { id: 'string' }, reactProp: 'onRowAction', doc: 'A row without `href` was activated (Enter or a press).' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { dataTableDefinition } from './definition.ts'\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\ninterface ColumnDef {\n id: string\n header: string\n sortable?: boolean\n align?: 'start' | 'end'\n numeric?: boolean\n}\n\ninterface RowDef {\n id: string\n cells: Record<string, string>\n href?: string\n label?: string\n}\n\ntype Direction = 'ascending' | 'descending' | null\n\nfunction el<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string, attrs: Record<string, string> = {}): HTMLElementTagNameMap[K] {\n const node = document.createElement(tag)\n if (className) node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** A decorative lucide icon (ISC, THIRD_PARTY_NOTICES): strokes only. */\nfunction icon(className: string, paths: string[]): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n svg.setAttribute('class', className)\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const d of paths) {\n const path = document.createElementNS(SVG, 'path')\n path.setAttribute('d', d)\n svg.append(path)\n }\n return svg\n}\n\nconst SORT_ICONS: Record<'ascending' | 'descending' | 'none', string[]> = {\n ascending: ['m5 12 7-7 7 7', 'M12 19V5'],\n descending: ['M12 5v14', 'm19 12-7 7-7-7'],\n none: ['m21 16-4 4-4-4', 'M17 20V4', 'm3 8 4-4 4 4', 'M7 4v16'],\n}\nconst CHECK = ['M20 6 9 17l-5-5']\nconst MINUS = ['M5 12h14']\nconst INBOX = ['M22 12h-6l-2 3h-4l-2-3H2', 'M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z']\n\n/** The sort cycle of a column: none → ascending → descending → none. */\nfunction nextDirection(current: Direction, sameColumn: boolean): Direction {\n if (!sameColumn || current === null) return 'ascending'\n return current === 'ascending' ? 'descending' : null\n}\n\n/**\n * `<ty-data-table>`. Self-rendering (the theme palette's precedent): the\n * host framework renders an empty host with the data as JSON attributes and\n * the element owns the whole subtree (spec: wave-1/data-table.md):\n *\n * - **Structure** — `.ty-table-wrap` (density, sticky-first-column and\n * column-lines states) around the scroll container and a native `<table>`\n * named by the caption; the first cell of each row is a row header. The\n * table is read-only (the APG Table pattern) until rows are selectable,\n * linked or actionable — then it is a grid: rows are focusable, the arrow\n * keys, Home and End move between them, Enter activates, Space selects.\n * - **Sorting** — a sortable header is a button carrying the direction\n * icon; activating it cycles none → ascending → descending → none and\n * emits `ty-sort-change`. Controlled: the host writes `sort-column` and\n * `sort-direction` back; the element reflects them in `aria-sort`.\n * - **Selection** — `selection-mode=\"multiple\"` adds a native-checkbox\n * column and a select-all header checkbox (indeterminate while some rows\n * are selected). Changes are emitted as `ty-selection-change` with the\n * new keys as JSON; the host writes `selected-keys` back. Selected rows\n * carry `data-selected` (and `aria-selected` in grid mode).\n * - **States** — while `loading`, skeleton rows replace the data, the table\n * is `aria-busy` and a visually-hidden status announces `loadingLabel`;\n * with no rows, one cell spanning every column holds the empty state.\n * - **Row activation** — a row with `href` renders one link (named by the\n * row's `label`) and forwards presses and Enter to it; a row without\n * `href` emits `ty-row-action` instead.\n *\n * Every attribute change re-renders the owned subtree (focus returns to\n * the control that had it, matched by its `data-focus-key`).\n */\nexport class TyDataTableElement extends TyElement {\n static override definition = dataTableDefinition\n\n protected override connected(): void {\n this.addEventListener('click', this.#onClick)\n this.addEventListener('change', this.#onChange)\n this.addEventListener('keydown', this.#onKeydown)\n this.#render()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('change', this.#onChange)\n this.removeEventListener('keydown', this.#onKeydown)\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#render()\n }\n\n // --- data -----------------------------------------------------------------\n\n #columns(): ColumnDef[] {\n const parsed = this.#json<ColumnDef[]>('columns')\n if (!Array.isArray(parsed)) return []\n return parsed.filter((c) => c && typeof c.id === 'string')\n }\n\n #rows(): RowDef[] {\n const parsed = this.#json<RowDef[]>('rows')\n if (!Array.isArray(parsed)) return []\n return parsed.filter((r) => r && typeof r.id === 'string')\n }\n\n #selected(): Set<string> {\n const parsed = this.#json<string[]>('selected-keys')\n return new Set(Array.isArray(parsed) ? parsed.filter((k) => typeof k === 'string') : [])\n }\n\n #json<T>(attribute: string): T | undefined {\n const raw = this.getAttribute(attribute)\n if (!raw) return undefined\n try {\n return JSON.parse(raw) as T\n } catch {\n console.warn(`ty-data-table: ${attribute} is not valid JSON.`)\n return undefined\n }\n }\n\n #direction(column: string): Direction {\n if (this.getAttribute('sort-column') !== column) return null\n const dir = this.getAttribute('sort-direction')\n return dir === 'ascending' || dir === 'descending' ? dir : null\n }\n\n /** Selectable, linked or actionable rows make the table a grid. */\n #interactive(selectable: boolean, rows: RowDef[]): boolean {\n return selectable || this.hasAttribute('actionable') || rows.some((r) => r.href)\n }\n\n #rowLabel(row: RowDef, columns: ColumnDef[]): string {\n return row.label ?? row.cells[columns[0]?.id ?? ''] ?? row.id\n }\n\n // --- rendering -------------------------------------------------------------\n\n #render(): void {\n const active = document.activeElement\n const focusKey = active instanceof HTMLElement && this.contains(active) ? active.dataset.focusKey : undefined\n\n const p = this.props\n const columns = this.#columns()\n const rows = this.#rows()\n const selected = this.#selected()\n const selectable = String(p.selectionMode) === 'multiple'\n const loading = Boolean(p.loading)\n const interactive = this.#interactive(selectable, rows)\n const colSpan = columns.length + (selectable ? 1 : 0)\n\n const wrap = el('div', 'ty-table-wrap', { 'data-density': String(p.density) })\n if (this.getAttribute('sticky-first-column') !== 'false') wrap.setAttribute('data-sticky-first', '')\n if (p.showColumnLines) wrap.setAttribute('data-column-lines', '')\n if (selectable) wrap.setAttribute('data-selectable', '')\n\n const caption = String(p.caption ?? '')\n const captionId = `${this.instanceId}-caption`\n if (p.captionVisible) {\n const captionNode = el('div', 'ty-table__caption', { id: captionId })\n captionNode.textContent = caption\n wrap.append(captionNode)\n }\n if (loading) {\n const status = el('span', 'ty-visually-hidden', { role: 'status' })\n status.textContent = String(p.loadingLabel)\n wrap.append(status)\n }\n\n const scroll = el('div', 'ty-table-scroll')\n const maxBlockSize = String(p.maxBlockSize ?? '')\n if (maxBlockSize) scroll.style.maxBlockSize = maxBlockSize\n const table = el('table', 'ty-table')\n if (interactive) table.setAttribute('role', 'grid')\n if (p.captionVisible) table.setAttribute('aria-labelledby', captionId)\n else {\n const hidden = el('caption', 'ty-visually-hidden')\n hidden.textContent = caption\n table.append(hidden)\n }\n if (loading) table.setAttribute('aria-busy', 'true')\n\n table.append(this.#head(columns, selectable, rows, selected, loading))\n table.append(this.#body(columns, rows, selected, selectable, loading, interactive, colSpan))\n scroll.append(table)\n wrap.append(scroll)\n this.replaceChildren(wrap)\n\n if (focusKey) this.querySelector<HTMLElement>(`[data-focus-key=\"${focusKey}\"]`)?.focus()\n }\n\n #head(columns: ColumnDef[], selectable: boolean, rows: RowDef[], selected: Set<string>, loading: boolean): HTMLElement {\n const head = el('thead', 'ty-table__head')\n const row = el('tr', 'ty-table__row ty-table__row--head')\n if (selectable) {\n const th = el('th', 'ty-table__column ty-table__column--select', { scope: 'col' })\n const all = rows.length > 0 && rows.every((r) => selected.has(r.id))\n const some = !all && rows.some((r) => selected.has(r.id))\n const box = this.#checkbox(String(this.props.selectAllLabel), all, some, loading || rows.length === 0)\n box.input.setAttribute('data-select-all', '')\n box.input.dataset.focusKey = 'select:all'\n th.append(box.shell)\n row.append(th)\n }\n for (const col of columns) {\n const dir = this.#direction(col.id)\n const th = el('th', 'ty-table__column', {\n scope: 'col',\n 'data-align': col.numeric || col.align === 'end' ? 'end' : 'start',\n })\n if (col.sortable) {\n th.setAttribute('aria-sort', dir ?? 'none')\n const button = el('button', 'ty-table__sort', { type: 'button', 'data-column': col.id })\n button.dataset.focusKey = `sort:${col.id}`\n const text = el('span')\n text.textContent = col.header\n button.append(text, icon('ty-table__sort-icon', SORT_ICONS[dir ?? 'none']))\n th.append(button)\n } else {\n th.textContent = col.header\n }\n row.append(th)\n }\n head.append(row)\n return head\n }\n\n #body(columns: ColumnDef[], rows: RowDef[], selected: Set<string>, selectable: boolean, loading: boolean, interactive: boolean, colSpan: number): HTMLElement {\n const body = el('tbody', 'ty-table__body')\n if (loading) {\n const count = Math.max(0, Math.floor(Number(this.props.loadingRowCount ?? 10)))\n for (let i = 0; i < count; i++) {\n const row = el('tr', 'ty-table__row', { 'data-loading': 'true', 'aria-hidden': 'true' })\n if (selectable) {\n const cell = el('td', 'ty-table__cell ty-table__cell--select')\n cell.append(el('span', 'ty-table__checkbox-box', { 'aria-hidden': 'true' }))\n row.append(cell)\n }\n for (const col of columns) {\n const cell = el('td', 'ty-table__cell')\n cell.append(el('span', 'ty-skeleton', { 'data-shape': 'line', 'data-width': col.numeric ? 'short' : 'long' }))\n row.append(cell)\n }\n body.append(row)\n }\n return body\n }\n if (rows.length === 0) {\n const row = el('tr', 'ty-table__row ty-table__row--empty')\n const cell = el('td', 'ty-table__cell ty-table__cell--empty', { colspan: String(colSpan) })\n const empty = el('div', 'ty-empty', { 'data-framing': 'inline' })\n empty.append(icon('ty-empty__icon', INBOX))\n const title = el('h4', 'ty-empty__title')\n title.textContent = String(this.props.emptyLabel)\n empty.append(title)\n const description = String(this.props.emptyDescription ?? '')\n if (description) {\n const text = el('p', 'ty-empty__description')\n text.textContent = description\n empty.append(text)\n }\n cell.append(empty)\n row.append(cell)\n body.append(row)\n return body\n }\n for (const data of rows) {\n const row = el('tr', 'ty-table__row', { 'data-row-id': data.id })\n if (selected.has(data.id)) row.setAttribute('data-selected', '')\n if (data.href || this.hasAttribute('actionable')) row.setAttribute('data-actionable', '')\n if (interactive) {\n row.setAttribute('tabindex', '0')\n row.dataset.focusKey = `row:${data.id}`\n if (selectable) row.setAttribute('aria-selected', String(selected.has(data.id)))\n }\n if (selectable) {\n const cell = el('td', 'ty-table__cell ty-table__cell--select')\n const label = String(this.props.selectRowLabel).replace('{label}', this.#rowLabel(data, columns))\n const box = this.#checkbox(label, selected.has(data.id), false, false)\n box.input.setAttribute('data-row-id', data.id)\n box.input.dataset.focusKey = `select:${data.id}`\n cell.append(box.shell)\n row.append(cell)\n }\n columns.forEach((col, index) => {\n const align = col.numeric || col.align === 'end' ? 'end' : 'start'\n const value = data.cells[col.id] ?? ''\n const cell = el(index === 0 ? 'th' : 'td', index === 0 ? 'ty-table__cell ty-table__cell--row-header' : 'ty-table__cell', { 'data-align': align })\n if (index === 0) cell.setAttribute('scope', 'row')\n if (col.numeric) cell.setAttribute('data-numeric', '')\n const clamp = el('span', 'ty-table__clamp', { title: value })\n clamp.textContent = value\n if (index === 0 && data.href) {\n const link = el('a', 'ty-table__row-link', { href: data.href, 'aria-label': this.#rowLabel(data, columns) })\n link.append(clamp)\n cell.append(link)\n } else {\n cell.append(clamp)\n }\n row.append(cell)\n })\n body.append(row)\n }\n return body\n }\n\n /** A native checkbox in the `.ty-table__checkbox` shell; the stylesheet hides the input and draws the box from its state. */\n #checkbox(label: string, checked: boolean, indeterminate: boolean, disabled: boolean): { shell: HTMLElement; input: HTMLInputElement } {\n const shell = el('label', 'ty-table__checkbox')\n const input = el('input', 'ty-table__checkbox-input', { type: 'checkbox', 'aria-label': label })\n input.checked = checked\n input.indeterminate = indeterminate\n input.disabled = disabled\n const box = el('span', 'ty-table__checkbox-box', { 'aria-hidden': 'true' })\n box.append(icon('ty-table__check', CHECK), icon('ty-table__minus', MINUS))\n shell.append(input, box)\n return { shell, input }\n }\n\n // --- behaviour -------------------------------------------------------------\n\n #requestSort(column: string): void {\n const direction = nextDirection(this.#direction(column), this.getAttribute('sort-column') === column)\n this.emit('ty-sort-change', { column, direction })\n }\n\n #toggleRow(id: string): void {\n const selected = this.#selected()\n if (selected.has(id)) selected.delete(id)\n else selected.add(id)\n this.emit('ty-selection-change', { keys: JSON.stringify([...selected]) })\n }\n\n #toggleAll(): void {\n const rows = this.#rows()\n const selected = this.#selected()\n const all = rows.length > 0 && rows.every((r) => selected.has(r.id))\n this.emit('ty-selection-change', { keys: JSON.stringify(all ? [] : rows.map((r) => r.id)) })\n }\n\n /** Row activation: a row link is clicked (the host navigates); a row without href asks for an action. */\n #activate(id: string): void {\n const row = this.#rows().find((r) => r.id === id)\n if (row?.href) {\n this.querySelector<HTMLAnchorElement>(`tr[data-row-id=\"${CSS.escape(id)}\"] .ty-table__row-link`)?.click()\n return\n }\n if (this.hasAttribute('actionable')) this.emit('ty-row-action', { id })\n }\n\n #dataRow(target: Element): HTMLElement | null {\n const row = target.closest('tr.ty-table__row[data-row-id]')\n return row instanceof HTMLElement && this.contains(row) ? row : null\n }\n\n #onClick = (event: MouseEvent): void => {\n const target = event.target\n if (!(target instanceof Element)) return\n const sort = target.closest('button.ty-table__sort')\n if (sort instanceof HTMLElement && this.contains(sort)) {\n const column = sort.getAttribute('data-column')\n if (column) this.#requestSort(column)\n return\n }\n // Native controls (a row link, a checkbox, its label) handle themselves.\n if (target.closest('a, button, input, label')) return\n const row = this.#dataRow(target)\n if (!row) return\n const id = row.getAttribute('data-row-id')!\n if (String(this.props.selectionMode) === 'multiple') this.#toggleRow(id)\n else this.#activate(id)\n }\n\n #onChange = (event: Event): void => {\n const input = event.target\n if (!(input instanceof HTMLInputElement) || !input.classList.contains('ty-table__checkbox-input')) return\n if (input.hasAttribute('data-select-all')) this.#toggleAll()\n else {\n const id = input.getAttribute('data-row-id')\n if (id) this.#toggleRow(id)\n }\n }\n\n #onKeydown = (event: KeyboardEvent): void => {\n const target = event.target\n if (!(target instanceof Element)) return\n const row = this.#dataRow(target)\n if (!row) return\n const rows = Array.from(this.querySelectorAll<HTMLElement>('tr.ty-table__row[data-row-id]'))\n const index = rows.indexOf(row)\n const move = (to: number) => {\n event.preventDefault()\n rows[Math.min(Math.max(to, 0), rows.length - 1)]?.focus()\n }\n switch (event.key) {\n case 'ArrowDown':\n return move(index + 1)\n case 'ArrowUp':\n return move(index - 1)\n case 'Home':\n return move(0)\n case 'End':\n return move(rows.length - 1)\n // Enter and Space on the row itself; nested controls keep their native keys.\n case 'Enter':\n if (target !== row) return\n event.preventDefault()\n this.#activate(row.getAttribute('data-row-id')!)\n return\n case ' ':\n if (target !== row || String(this.props.selectionMode) !== 'multiple') return\n event.preventDefault()\n this.#toggleRow(row.getAttribute('data-row-id')!)\n return\n }\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-currency-field__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative 24px icon (lucide strokes). */\nconst icon = (children: ElementNode[], className = 'ty-icon'): ElementNode => ({\n tag: 'svg',\n class: className,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/** `<ty-currency-field>`: the CurrencyField's single source (spec: wave-2/currency-field.md). */\nexport const currencyFieldDefinition = {\n tag: 'ty-currency-field',\n name: 'TyCurrencyField',\n kind: 'enhancing',\n doc: 'Money or count entry with live grouping in the locale\\'s separators; reports a plain canonical number (digits, an optional dot and decimals, never grouped). A native <input> inside, so typing, keyboard, autofill and form participation are the platform\\'s; the element regroups the display on every edit, keeps the caret after the same digit, shows the currency symbol and names the currency to assistive technology.',\n props: {\n value: { type: 'string', attribute: 'value', doc: 'Canonical value: digits with an optional dot and decimals, never grouped (\"1500000.5\"); \"\" when empty. The element mirrors it into the control as grouped display text (while the user types, the live value is the control\\'s own).' },\n defaultValue: { type: 'string', attribute: 'default-value', doc: 'Initial canonical value of an uncontrolled field, applied once on connect; a form reset returns to it.' },\n currency: { type: 'string', attribute: 'currency', doc: 'ISO 4217 code (\"BRL\"); the symbol is shown (visual only) and the currency name is announced as part of the description. Omit for plain counts.' },\n decimals: { type: 'number', default: 2, attribute: 'decimals', doc: 'Maximum fraction digits; 0 means integers only (the decimal separator is ignored and the mobile keyboard is numeric).' },\n locale: { type: 'string', attribute: 'locale', doc: 'Locale that decides the group and decimal separators (\"pt-BR\"); the document language, then the browser locale, when unset. Changing it changes only the display, never the canonical value.' },\n size: { type: 'enum', values: ['small', 'medium', 'large', 'display'], default: 'medium', attribute: 'size', doc: 'Type scale step; `display` uses the KPI numeral style.' },\n currencyLabel: { type: 'string', default: 'Currency: {currency}', attribute: 'currency-label', doc: 'Template of the visually hidden currency note; `{currency}` is filled with the locale\\'s currency name (\"Currency: Brazilian real\").' },\n required: { type: 'boolean', attribute: 'required', doc: 'Native required.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n readOnly: { type: 'boolean', attribute: 'read-only', doc: 'Shown but not changeable.' },\n invalid: { type: 'boolean', attribute: 'invalid', doc: 'Painted and announced as invalid without an error message (a surrounding field marks it).' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name.' },\n placeholder: { type: 'string', attribute: 'placeholder', doc: 'Native placeholder.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n labelledBy: { type: 'string', attribute: 'labelled-by', doc: '`aria-labelledby` from a surrounding field (used when there is no visible label and no `accessibleLabel`).' },\n describedBy: { type: 'string', attribute: 'described-by', doc: '`aria-describedby` from a surrounding field, joined before the field\\'s own parts.' },\n controlId: { type: 'string', attribute: 'control-id', doc: 'Explicit id of the control (a surrounding field\\'s control id); `<instance>-input` otherwise.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the root (`data-testid`).' },\n },\n events: [\n { type: 'ty-value-change', kind: 'custom', detail: { value: 'string' }, reactProp: 'onValueChange', doc: 'After every edit; `value` is the canonical number (digits, an optional dot and decimals, never grouped; \"\" when empty). The display text is never reported.' },\n ],\n slots: {\n label: { doc: 'The visible label, targeting the input.' },\n hint: { doc: 'Help text above the group, announced as the description.' },\n error: { doc: 'The error message; marks the field invalid and is announced.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-currency-field',\n attrs: {\n 'data-size': { prop: 'size' },\n 'data-invalid': { value: '', when: ['invalid|slot:error'] },\n 'data-readonly': { prop: 'readOnly', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-currency-field__field',\n children: [\n {\n tag: 'label',\n class: 'ty-fb-line',\n when: ['slot:label'],\n attrs: { 'data-line': { value: 'label' }, for: { idref: 'input', prop: 'controlId' } },\n children: [{ slot: 'label' }],\n },\n {\n tag: 'p',\n class: 'ty-fb-line',\n when: ['slot:hint'],\n attrs: { 'data-line': { value: 'hint' }, id: { idref: 'hint' } },\n children: [{ slot: 'hint' }],\n },\n {\n tag: 'div',\n class: 'ty-currency-field__box',\n children: [\n {\n tag: 'span',\n class: 'ty-currency-field__symbol',\n when: ['currency'],\n attrs: { 'aria-hidden': { value: 'true' } },\n },\n {\n tag: 'input',\n class: 'ty-currency-field__input',\n attrs: {\n id: { idref: 'input', prop: 'controlId' },\n type: { value: 'text' },\n name: { prop: 'name' },\n placeholder: { prop: 'placeholder' },\n autocomplete: { value: 'off' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n readonly: { prop: 'readOnly', kind: 'boolean-attr' },\n required: { prop: 'required', kind: 'boolean-attr' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:label'] },\n 'aria-labelledby': { prop: 'labelledBy', when: ['!slot:label', '!accessibleLabel'] },\n 'aria-describedby': {\n idrefs: [\n { prop: 'describedBy' },\n { id: 'hint', when: ['slot:hint'] },\n { id: 'currency', when: ['currency'] },\n { id: 'error', when: ['slot:error'] },\n ],\n },\n 'aria-invalid': { value: 'true', when: ['invalid|slot:error'] },\n },\n },\n ],\n },\n {\n tag: 'span',\n class: 'ty-visually-hidden ty-currency-field__currency',\n when: ['currency'],\n attrs: { id: { idref: 'currency' } },\n },\n {\n tag: 'p',\n class: 'ty-fb-line',\n when: ['slot:error'],\n attrs: { 'data-line': { value: 'error' }, id: { idref: 'error' } },\n children: [\n icon([\n glyph('circle', { cx: '12', cy: '12', r: '10' }),\n glyph('line', { x1: '12', y1: '8', x2: '12', y2: '12' }),\n glyph('line', { x1: '12', y1: '16', x2: '12.01', y2: '16' }),\n ]),\n { tag: 'span', class: 'ty-currency-field__error-text', children: [{ slot: 'error' }] },\n ],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'count', props: { decimals: 0, locale: 'pt-BR', value: '3000', name: 'seats' }, slots: { label: 'Vagas' } },\n { name: 'brl', props: { currency: 'BRL', locale: 'pt-BR', value: '1500000.5', name: 'price', placeholder: '0,00' }, slots: { label: 'Preço', hint: 'Em reais' } },\n { name: 'usd', props: { currency: 'USD', locale: 'en-US', value: '1500000.5', name: 'amount' }, slots: { label: 'Amount' } },\n { name: 'display', props: { size: 'display', currency: 'BRL', locale: 'pt-BR', value: '99.9' }, slots: { label: 'Total' } },\n { name: 'error', props: { value: '12', required: true }, slots: { label: 'Amount', error: 'Required' } },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Amount', testId: 'amount' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { asciiDigits, isDigit, localeDigits, withLocaleDigits } from '../../internal/forms-b/digits.ts'\nimport { currencyFieldDefinition } from './definition.ts'\n\ninterface Separators {\n group: string\n decimal: string\n}\n\nconst separatorsOf = (locale: string): Separators => {\n const parts = new Intl.NumberFormat(locale).formatToParts(1234567.5)\n return {\n group: parts.find((p) => p.type === 'group')?.value ?? ',',\n decimal: parts.find((p) => p.type === 'decimal')?.value ?? '.',\n }\n}\n\nconst symbolOf = (currency: string, locale: string): string => {\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).formatToParts(0).find((p) => p.type === 'currency')?.value ?? currency\n } catch {\n return currency\n }\n}\n\nconst currencyName = (currency: string, locale: string): string => {\n try {\n return new Intl.DisplayNames(locale, { type: 'currency' }).of(currency) ?? currency\n } catch {\n return currency\n }\n}\n\n/** Reading of typed text: integer digits, whether a decimal mark was typed, fraction digits. */\ninterface Reading {\n whole: string\n mark: boolean\n fraction: string\n}\n\n/** Keeps digits and the first locale decimal mark; drops extra fraction digits and leading zeros. */\nconst readTyped = (raw: string, decimal: string, decimals: number): Reading => {\n const out: Reading = { whole: '', mark: false, fraction: '' }\n for (const ch of asciiDigits(raw)) {\n if (ch >= '0' && ch <= '9') {\n if (!out.mark) out.whole += ch\n else if (out.fraction.length < decimals) out.fraction += ch\n } else if (ch === decimal && decimals > 0 && !out.mark) {\n out.mark = true\n }\n }\n out.whole = out.whole.replace(/^0+(?=\\d)/, '')\n if (out.mark && !out.whole) out.whole = '0'\n return out\n}\n\n/** Canonical, machine-readable form of a reading (\"1500000.5\"). */\nconst canonicalOf = (r: Reading): string => (r.whole === '' && !r.mark ? '' : r.fraction ? `${r.whole}.${r.fraction}` : r.whole)\n\n/** Parses a canonical value back into a reading. */\nconst readCanonical = (value: string, decimals: number): Reading => {\n const [whole = '', fraction = ''] = value.split('.')\n return { whole: whole.replace(/\\D/g, ''), mark: value.includes('.') && decimals > 0, fraction: fraction.replace(/\\D/g, '').slice(0, decimals) }\n}\n\n/** Groups the integer part with the locale separator and shows the locale's digits. */\nconst display = (r: Reading, sep: Separators, digits: string[]): string => {\n const grouped = r.whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, sep.group)\n return withLocaleDigits(r.mark ? `${grouped}${sep.decimal}${r.fraction}` : grouped, digits)\n}\n\n/** Count of meaningful characters (digits and the decimal mark) before `pos`. */\nconst meaningfulBefore = (text: string, pos: number, decimal: string): number => {\n let n = 0\n for (const ch of text.slice(0, pos)) if (isDigit(ch) || ch === decimal) n++\n return n\n}\n\n/** Position in `text` just after the `count`-th meaningful character. */\nconst positionAfter = (text: string, count: number, decimal: string): number => {\n if (count <= 0) return 0\n let seen = 0\n for (let i = 0; i < text.length; i++) {\n const ch = text[i]!\n if (isDigit(ch) || ch === decimal) seen++\n if (seen === count) return i + 1\n }\n return text.length\n}\n\n/**\n * `<ty-currency-field>`. A native `<input>` inside, so typing, keyboard,\n * autofill and form participation are the platform's. The element parses the\n * typed text (digits and the first locale decimal mark; extra fraction\n * digits and leading zeros dropped), regroups the display on every edit\n * with the caret after the same digit, and reports the canonical value\n * (\"1500000.5\", \"\" when empty) as `ty-value-change`. The `value` attribute\n * is canonical too: it is mirrored in as grouped display text (a no-op\n * while the user types, so a trailing decimal mark and the caret survive\n * the controlled echo), and `default-value` seeds an uncontrolled field\n * (the value a form reset returns to). Changing `locale` re-formats the\n * display only, never the canonical value. The currency symbol is visual\n * (`aria-hidden`); a visually hidden note names the currency through the\n * `currency-label` template, joined into the description. While an input\n * method composes text, edits are ignored and the field is reformatted once\n * at `compositionend`.\n */\nexport class TyCurrencyFieldElement extends TyElement {\n static override definition = currencyFieldDefinition\n\n #defaultApplied = false\n #draft: Reading | null = null\n #reported: string | null = null\n #reportedDecimals: number | null = null\n #composing = false\n #formatLocale: string | null = null\n #sep: Separators | null = null\n #digits: string[] | null = null\n\n get field(): HTMLInputElement | null {\n return this.querySelector('input')\n }\n\n /** The prop locale, else the document language, else the browser's; a bad tag falls back to en-US. */\n #locale(): string {\n const wanted = (this.props.locale as string | undefined) || document.documentElement.lang || (typeof navigator !== 'undefined' ? navigator.language : '') || 'en-US'\n try {\n new Intl.NumberFormat(wanted)\n return wanted\n } catch {\n return 'en-US'\n }\n }\n\n /** The separators and digits of the active locale, recomputed when it changes. */\n #format(): { sep: Separators; digits: string[] } {\n const locale = this.#locale()\n if (this.#formatLocale !== locale) {\n this.#formatLocale = locale\n this.#sep = separatorsOf(locale)\n this.#digits = localeDigits(locale)\n }\n return { sep: this.#sep!, digits: this.#digits! }\n }\n\n #decimals(): number {\n const raw = Number(this.props.decimals)\n return Number.isFinite(raw) && raw >= 0 ? Math.floor(raw) : 2\n }\n\n /** Canonical value in, as grouped display text, without disturbing the caret while typing. */\n #applyValue = () => {\n const field = this.field\n if (!field) return\n const { sep, digits } = this.#format()\n const decimals = this.#decimals()\n const value = this.getAttribute('value')\n if (value !== null) {\n // An echo of the last reported value keeps the draft: its trailing\n // decimal mark is display state the canonical value cannot carry.\n const keep = this.#draft !== null && value === this.#reported && decimals === this.#reportedDecimals\n const reading = keep ? this.#draft! : readCanonical(value, decimals)\n this.#draft = reading\n this.#reported = value\n this.#reportedDecimals = decimals\n const text = display(reading, sep, digits)\n if (field.value !== text) field.value = text\n return\n }\n if (this.#defaultApplied) return\n this.#defaultApplied = true\n const initial = this.getAttribute('default-value')\n if (initial === null) return\n const text = display(readCanonical(initial, decimals), sep, digits)\n field.defaultValue = text\n if (field.value === '') field.value = text\n }\n\n /** Parse, regroup, restore the caret and report the canonical value. */\n #reformat = () => {\n const field = this.field\n if (!field) return\n const { sep, digits } = this.#format()\n const decimals = this.#decimals()\n const raw = field.value\n const caret = field.selectionStart ?? raw.length\n let count = meaningfulBefore(raw, caret, sep.decimal)\n const reading = readTyped(raw, sep.decimal, decimals)\n // Leading zeros dropped before the caret shift it left.\n const typedWhole = raw.split(sep.decimal)[0]!.replace(/\\D/g, '')\n const dropped = typedWhole.length - reading.whole.length\n if (dropped > 0) count = Math.max(0, count - dropped)\n const canonical = canonicalOf(reading)\n this.#draft = reading\n this.#reported = canonical\n this.#reportedDecimals = decimals\n const text = display(reading, sep, digits)\n if (field.value !== text) field.value = text\n const at = positionAfter(field.value, count, sep.decimal)\n if (field.selectionStart !== at || field.selectionEnd !== at) field.setSelectionRange(at, at)\n this.emit('ty-value-change', { value: canonical })\n }\n\n /** The currency symbol (visual) and the hidden note that names the currency. */\n #applyCurrency = () => {\n const currency = this.props.currency as string | undefined\n if (!currency) return\n const locale = this.#locale()\n const symbol = this.querySelector('.ty-currency-field__symbol')\n if (symbol) {\n const text = symbolOf(currency, locale)\n if (symbol.textContent !== text) symbol.textContent = text\n }\n const note = this.querySelector('.ty-currency-field__currency')\n if (note) {\n const text = String(this.props.currencyLabel).replaceAll('{currency}', currencyName(currency, locale))\n if (note.textContent !== text) note.textContent = text\n }\n }\n\n /** Numeric mobile keyboard for integers, decimal otherwise. */\n #applyInputMode = () => {\n const field = this.field\n if (!field) return\n const mode = this.#decimals() === 0 ? 'numeric' : 'decimal'\n if (field.getAttribute('inputmode') !== mode) field.setAttribute('inputmode', mode)\n }\n\n #onInput = (event: Event) => {\n if (event.target !== this.field || this.#composing) return\n this.#reformat()\n }\n\n #onCompositionStart = (event: Event) => {\n if (event.target === this.field) this.#composing = true\n }\n\n #onCompositionEnd = (event: Event) => {\n if (event.target !== this.field) return\n this.#composing = false\n this.#reformat()\n }\n\n protected override connected(): void {\n this.addEventListener('input', this.#onInput)\n this.addEventListener('compositionstart', this.#onCompositionStart)\n this.addEventListener('compositionend', this.#onCompositionEnd)\n this.#applyInputMode()\n this.#applyCurrency()\n this.#applyValue()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('input', this.#onInput)\n this.removeEventListener('compositionstart', this.#onCompositionStart)\n this.removeEventListener('compositionend', this.#onCompositionEnd)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyInputMode()\n this.#applyCurrency()\n this.#applyValue()\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\nconst text = (attribute: string, fallback: string, doc: string) => ({ type: 'string', attribute, default: fallback, doc }) as const\n\n/**\n * `<ty-command-palette>`: the CommandPalette's single source (spec:\n * wave-2/command-palette.md). The global \"jump to anything\" dialog: a search\n * field over grouped commands, fuzzy-matched and highlighted, narrowed by\n * optional scopes, with per-item secondary actions, fallback actions when\n * nothing matches, and a remembered list of recent choices.\n *\n * The content is data-driven (groups of items, scopes, fallback actions),\n * which the declarative anatomy cannot express, so the element is\n * self-rendering like `<ty-theme-palette>`: while `open`, a native `<dialog>`\n * in the top layer holds the palette and the element composes the rows. Rows\n * carry ids, never callbacks (the same source can be rebuilt from any\n * catalogue); a choice is reported as `ty-select` and the host decides what\n * the id means. Row icons are text glyphs in the JSON form (`icon`) or 24×24\n * SVG path data (`iconPath`, which wins). Examples stay empty: the\n * parity renderers could not produce the composed rows.\n */\nexport const commandPaletteDefinition = {\n tag: 'ty-command-palette',\n name: 'TyCommandPalette',\n kind: 'self-rendering',\n doc: 'Global search-and-commands dialog in the top layer: a combobox field over grouped, fuzzy-matched results with scopes, per-item actions, fallback actions and recents. The query, the highlight and the actions sub-list reset on each open.',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Shown (a modal dialog in the top layer). The element closes itself after a choice or the stepped-back Escape — removing the attribute and asking the host with `ty-close` — so a controlled host follows the attribute.' },\n groups: { type: 'string', attribute: 'groups', doc: 'JSON array of groups: `{ id, heading, scopeId?, items: [{ id, label, description?, icon?, iconPath?, keywords?, hint?, shortcut?, scopeId?, actions?: [{ id, label, icon?, iconPath?, shortcut? }] }] }`. `keywords` are matched but not shown; `icon` is a text glyph; `iconPath` is an SVG icon as 24×24 path data rendered in the standard icon frame — when both are present `iconPath` wins, and subpaths separated by \" | \" become one `<path>` each. Unparseable or missing: no groups.' },\n scopes: { type: 'string', attribute: 'scopes', doc: 'JSON array of scopes: `[{ id, label, icon? }]`; empty means no scoping (no scope column, no scope keys).' },\n activeScope: { type: 'string', attribute: 'active-scope', doc: 'The active scope id; unset: everything. The element reflects user changes back to this attribute and reports them with `ty-scope-change`.' },\n loading: { type: 'boolean', attribute: 'loading', doc: 'Shows skeleton rows and announces the loading label instead of results.' },\n fallbackActions: { type: 'string', attribute: 'fallback-actions', doc: 'JSON array of actions offered when the query matches nothing: `[{ id, label, icon?, iconPath?, shortcut? }]`; `{query}` in a label is replaced by the query. `iconPath` is as in `groups` (an SVG icon wins over the `icon` text glyph).' },\n recentKey: { type: 'string', attribute: 'recent-key', doc: 'Browser-storage key of the recent store; enables it. Records the chosen item id with a count and a time, tolerant of storage being unavailable.' },\n recentVisible: { type: 'number', default: 5, attribute: 'recent-visible', doc: 'Recents shown when the query is empty, most chosen first (ties: most recent).' },\n recentKeep: { type: 'number', default: 12, attribute: 'recent-keep', doc: 'Most recent ids the store keeps.' },\n label: text('label', 'Search and commands', 'Accessible name of the dialog and the field.'),\n placeholder: text('placeholder', 'Search or type a command', 'Field placeholder.'),\n emptyLabel: text('empty-label', 'Type to search records, sources and screens.', 'Shown on an empty query with nothing to list.'),\n noResultsLabel: text('no-results-label', 'Nothing matches “{query}”.', 'Shown and announced when the query matches nothing; {query} is replaced.'),\n loadingLabel: text('loading-label', 'Loading results', 'Announced in the status region while `loading`.'),\n removeScopeLabel: text('remove-scope-label', 'Remove scope {scope}', 'Accessible name of the scope chip; {scope} is replaced by the scope label.'),\n actionsForLabel: text('actions-for-label', 'Actions for {label}', 'Heading of the actions sub-list; {label} is replaced by the item label.'),\n recentLabel: text('recent-label', 'Recent', 'Heading of the recent group.'),\n resultsLabel: text('results-label', '{count} results', 'Announced result count; {count} is replaced.'),\n scopesLabel: text('scopes-label', 'Scopes', 'Accessible name of the scope column.'),\n fallbackLabel: text('fallback-label', 'Other actions', 'Heading of the fallback group.'),\n hintNavigate: text('hint-navigate', 'move', 'Footer hint beside ↑↓.'),\n hintSelect: text('hint-select', 'open', 'Footer hint beside ↵.'),\n hintActions: text('hint-actions', 'actions', 'Footer hint beside →.'),\n hintBack: text('hint-back', 'back', 'Footer hint beside ←.'),\n hintClose: text('hint-close', 'close', 'Footer hint beside esc.'),\n },\n events: [\n { type: 'ty-select', kind: 'custom', detail: { id: 'string', kind: 'string', itemId: 'string' }, reactProp: 'onSelect', doc: 'A row was chosen: an item (`kind: \"item\"`, `id` the item id), a secondary action (`kind: \"action\"`, `id` the action id, `itemId` its item) or a fallback action (`kind: \"fallback\"`). `itemId` is empty except for actions. The palette then closes itself and asks the host with `ty-close`.' },\n { type: 'ty-scope-change', kind: 'custom', detail: { scope: 'string' }, reactProp: 'onScopeChange', doc: 'The active scope changed (a scope button, the chip, Tab or Backspace); `scope` is the scope id, empty when cleared. The element reflects it to the `active-scope` attribute.' },\n { type: 'ty-close', kind: 'custom', reactProp: 'onClose', doc: 'The palette asks to close (the stepped-back Escape reaching the top level, a press outside, or after a choice). The element closes itself too.' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","import { fuzzyHit, markPieces } from '../../internal/overlays-nav/fuzzy.ts'\nimport { orderChoices, readChoices, recordChoice, type ChoiceStat } from '../../internal/overlays-nav/recent.ts'\nimport { TyElement } from '../base.ts'\nimport { commandPaletteDefinition } from './definition.ts'\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\n/** A secondary or fallback action, as the `groups` / `fallback-actions` JSON carries it. */\nexport interface CommandActionData {\n id: string\n label: string\n icon?: string\n /** SVG path data (24×24, subpaths separated by \" | \"); wins over `icon`. */\n iconPath?: string\n shortcut?: string\n}\n\n/** One command row, as the `groups` JSON carries it. */\nexport interface CommandItemData {\n id: string\n label: string\n description?: string\n /** A text glyph. */\n icon?: string\n /** SVG path data (24×24, subpaths separated by \" | \"); wins over `icon`. */\n iconPath?: string\n /** Matched but not shown. */\n keywords?: string[]\n hint?: string\n shortcut?: string\n scopeId?: string\n actions?: CommandActionData[]\n}\n\n/** A group of commands, as the `groups` JSON carries it. */\nexport interface CommandGroupData {\n id: string\n heading: string\n scopeId?: string\n items: CommandItemData[]\n}\n\n/** A scope, as the `scopes` JSON carries it. */\nexport interface CommandScopeData {\n id: string\n label: string\n icon?: string\n}\n\ntype RowKind = 'item' | 'action' | 'fallback'\n\ninterface Row {\n /** DOM-safe option key, unique in the list. */\n key: string\n kind: RowKind\n /** `ty-select` detail: the chosen item or action id. */\n id: string\n /** `ty-select` detail: the parent item of an action (empty otherwise). */\n itemId: string\n label: string\n description?: string\n icon?: string\n iconPath?: string\n hint?: string\n shortcut?: string\n /** Matched label indices to mark. */\n marks: number[]\n item?: CommandItemData\n}\n\ninterface Section {\n key: string\n heading: string\n rows: Row[]\n}\n\nfunction el<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string, attrs: Record<string, string> = {}): HTMLElementTagNameMap[K] {\n const node = document.createElement(tag)\n if (className) node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** A decorative 24px icon (lucide strokes). */\nfunction svgIcon(className: string | undefined, paths: string[]): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n if (className) svg.setAttribute('class', className)\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const d of paths) {\n const path = document.createElementNS(SVG, 'path')\n path.setAttribute('d', d)\n svg.append(path)\n }\n return svg\n}\n\nfunction searchIcon(): SVGSVGElement {\n const svg = svgIcon('ty-palette__search-icon', ['m20 20-3.5-3.5'])\n const circle = document.createElementNS(SVG, 'circle')\n circle.setAttribute('cx', '11')\n circle.setAttribute('cy', '11')\n circle.setAttribute('r', '7')\n svg.prepend(circle)\n return svg\n}\n\n/** Tolerant JSON list parse: anything broken reads as empty. */\nfunction parseList<T>(raw: unknown): T[] {\n if (typeof raw !== 'string' || !raw) return []\n try {\n const value: unknown = JSON.parse(raw)\n return Array.isArray(value) ? (value as T[]) : []\n } catch {\n return []\n }\n}\n\n/** Replaces every `{token}` in a label template. */\nconst tpl = (template: unknown, token: string, value: string): string => String(template ?? '').split(token).join(value)\n\n/** Option ids are DOM-safe (`recent-` / group / action prefixes plus the host's ids). */\nconst safe = (key: string) => key.replace(/[^a-zA-Z0-9_-]/g, '-')\n\n/** Best score of an item over its label, description, keywords and group heading (the React model's rule). */\nfunction scoreItem(query: string, item: CommandItemData, heading: string, locale?: string): { score: number; marks: number[] } | null {\n const label = fuzzyHit(query, item.label, locale)\n let best = label ? label.score : -Infinity\n for (const other of [item.description, ...(item.keywords ?? []), heading]) {\n if (!other) continue\n const hit = fuzzyHit(query, other, locale)\n if (hit && hit.score - 1 > best) best = hit.score - 1\n }\n if (best === -Infinity) return null\n return { score: best, marks: label?.at ?? [] }\n}\n\nfunction appendMarked(target: HTMLElement, text: string, marks: number[]): void {\n if (!marks.length) {\n target.textContent = text\n return\n }\n for (const piece of markPieces(text, marks)) {\n if (piece.marked) {\n const mark = el('mark', 'ty-palette__mark')\n mark.textContent = piece.text\n target.append(mark)\n } else target.append(piece.text)\n }\n}\n\n/**\n * `<ty-command-palette>`. While `open`, a native `<dialog>` (top layer: no\n * ancestor can clip it, the rest of the page is inert, Escape cancels) holds\n * the palette: a combobox field over a listbox of grouped commands,\n * navigated with the arrow keys, Home, End, Enter and Escape, following the\n * React CommandPalette and the spec (wave-2/command-palette.md):\n *\n * - **Matching** — the query's characters must appear in order in the label,\n * description, keywords or group heading (the shared subsequence scorer);\n * contiguous runs, word starts and early positions rank higher, and only\n * label matches are marked (`mark`).\n * - **Keyboard** — Down/Up move the highlight and wrap, Home/End jump, Enter\n * runs the highlighted row and closes. Right Arrow (inline end) or the row\n * chevron opens the item's actions sub-list, Left Arrow returns. Tab on an\n * empty query activates the first scope; with a typed prefix matching a\n * scope label, Tab activates it and clears the query; Backspace on an\n * empty query removes the scope. Escape steps back: the sub-list, then the\n * scope, then the dialog.\n * - **Scopes** — the active scope shows as a removable chip before the text\n * and a pressed button in the scope column; activating the active scope\n * again clears it.\n * - **Recents** — with `recent-key`, chosen item ids are counted in browser\n * storage (tolerant of it failing) and shown first on an empty query,\n * most chosen then most recent.\n * - **Fallback** — a query that matches nothing offers the `fallback-actions`\n * with `{query}` replaced.\n *\n * Rows carry ids, never callbacks: a choice is `ty-select` (`id`, `kind`,\n * `itemId`), the scope is `ty-scope-change`, and closing is `ty-close` — the\n * element closes itself too (removing `open`), so a controlled host follows\n * the attribute. Query, highlight and sub-list reset on each open.\n */\nexport class TyCommandPaletteElement extends TyElement {\n static override definition = commandPaletteDefinition\n\n #dialog: HTMLDialogElement | null = null\n #input: HTMLInputElement | null = null\n #field: HTMLElement | null = null\n #main: HTMLElement | null = null\n #scopesBox: HTMLElement | null = null\n #results: HTMLElement | null = null\n #list: HTMLElement | null = null\n #status: HTMLElement | null = null\n #query = ''\n #cursor = 0\n #sub: CommandItemData | null = null\n #recent: ChoiceStat[] = []\n #rows: Row[] = []\n\n /** The active scope: the attribute is the state, so host writes and user changes agree. */\n get #scope(): string | null {\n return this.getAttribute('active-scope')\n }\n\n protected override connected(): void {\n this.#reconcile()\n }\n\n protected override disconnected(): void {\n this.#close(false)\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#reconcile()\n }\n\n #reconcile(): void {\n if (this.props.open && !this.#dialog) this.#open()\n else if (!this.props.open && this.#dialog) this.#close(false)\n else if (this.#dialog) this.#refresh()\n }\n\n #groups(): CommandGroupData[] {\n return parseList<CommandGroupData>(this.props.groups)\n }\n\n #scopes(): CommandScopeData[] {\n return parseList<CommandScopeData>(this.props.scopes)\n }\n\n #open(): void {\n const p = this.props\n const id = this.instanceId\n const name = String(p.label)\n const dialog = el('dialog', 'ty-palette', { 'aria-label': name })\n const body = el('div', 'ty-palette__dialog')\n const field = el('div', 'ty-palette__field')\n const input = el('input', 'ty-palette__input', {\n role: 'combobox',\n 'aria-label': name,\n 'aria-autocomplete': 'list',\n 'aria-expanded': 'false',\n 'aria-controls': `${id}-list`,\n placeholder: String(p.placeholder),\n autocomplete: 'off',\n spellcheck: 'false',\n type: 'text',\n })\n field.append(searchIcon(), input)\n const main = el('div', 'ty-palette__main')\n const results = el('div', 'ty-palette__results')\n const list = el('div', 'ty-palette__list', { id: `${id}-list`, role: 'listbox', 'aria-label': name })\n results.append(list)\n main.append(results)\n const footer = el('div', 'ty-palette__footer', { 'aria-hidden': 'true' })\n for (const [keys, hint] of [\n ['↑↓', p.hintNavigate],\n ['↵', p.hintSelect],\n ['→', p.hintActions],\n ['←', p.hintBack],\n ['esc', p.hintClose],\n ] as const) {\n const span = el('span')\n const kbd = el('kbd', 'ty-palette__kbd')\n kbd.textContent = keys\n span.append(kbd, ` ${String(hint)}`)\n footer.append(span)\n }\n const status = el('span', 'ty-visually-hidden', { role: 'status' })\n body.append(field, main, footer, status)\n dialog.append(body)\n\n input.addEventListener('input', () => {\n this.#query = input.value\n this.#cursor = 0\n this.#sub = null\n this.#renderRows()\n })\n input.addEventListener('keydown', this.#onKey)\n dialog.addEventListener('cancel', (event) => {\n event.preventDefault()\n this.#close(true)\n })\n // A press on the dialog box itself (outside the palette's content) is a press outside.\n dialog.addEventListener('click', (event) => {\n if (event.target === dialog) this.#close(true)\n })\n\n this.#dialog = dialog\n this.#input = input\n this.#field = field\n this.#main = main\n this.#scopesBox = null\n this.#results = results\n this.#list = list\n this.#status = status\n this.#query = ''\n this.#cursor = 0\n this.#sub = null\n const key = p.recentKey ? String(p.recentKey) : ''\n this.#recent = key ? readChoices(key) : []\n this.replaceChildren(dialog)\n this.#refresh()\n if (typeof dialog.showModal === 'function') dialog.showModal()\n else dialog.setAttribute('open', '')\n input.focus()\n }\n\n #close(announce: boolean): void {\n const dialog = this.#dialog\n if (!dialog) return\n this.#dialog = null\n this.#input = null\n this.#field = null\n this.#main = null\n this.#scopesBox = null\n this.#results = null\n this.#list = null\n this.#status = null\n this.#sub = null\n if (dialog.open && typeof dialog.close === 'function') dialog.close()\n dialog.remove()\n if (this.hasAttribute('open')) this.removeAttribute('open')\n if (announce) this.emit('ty-close')\n }\n\n /** Re-render the regions the attributes drive (chip, scopes, rows, labels). */\n #refresh(): void {\n const p = this.props\n const name = String(p.label)\n this.#dialog?.setAttribute('aria-label', name)\n this.#input?.setAttribute('aria-label', name)\n this.#input?.setAttribute('placeholder', String(p.placeholder))\n this.#list?.setAttribute('aria-label', name)\n this.#renderChip()\n this.#renderScopes()\n this.#renderRows()\n }\n\n /** The active scope as a removable chip before the text. */\n #renderChip(): void {\n const field = this.#field\n const input = this.#input\n if (!field || !input) return\n field.querySelector('.ty-palette__chip')?.remove()\n const scope = this.#scope\n if (!scope) return\n const label = this.#scopes().find((s) => s.id === scope)?.label\n if (!label) return\n const chip = el('button', 'ty-palette__chip', { type: 'button', 'aria-label': tpl(this.props.removeScopeLabel, '{scope}', label) })\n chip.append(label, svgIcon(undefined, ['M18 6 6 18', 'm6 6 12 12']))\n chip.addEventListener('click', () => {\n this.#setScope(null)\n this.#input?.focus()\n })\n field.insertBefore(chip, input)\n }\n\n #renderScopes(): void {\n const main = this.#main\n if (!main) return\n const scopes = this.#scopes()\n let box = this.#scopesBox\n if (!scopes.length) {\n if (box) {\n box.remove()\n this.#scopesBox = null\n }\n return\n }\n if (!box) {\n box = el('div', 'ty-palette__scopes', { role: 'group' })\n main.prepend(box)\n this.#scopesBox = box\n }\n box.setAttribute('aria-label', String(this.props.scopesLabel))\n box.replaceChildren(\n ...scopes.map((s) => {\n const button = el('button', 'ty-palette__scope', { type: 'button', 'aria-pressed': String(this.#scope === s.id), tabindex: '-1' })\n if (s.icon) {\n const icon = el('span', undefined, { 'aria-hidden': 'true' })\n icon.textContent = s.icon\n button.append(icon)\n }\n button.append(s.label)\n button.addEventListener('click', () => this.#pickScope(s.id))\n return button\n }),\n )\n }\n\n /** Reflect the scope to the attribute and report it; the attribute change re-renders. */\n #setScope(id: string | null): void {\n if (id) this.setAttribute('active-scope', id)\n else this.removeAttribute('active-scope')\n this.emit('ty-scope-change', { scope: id ?? '' })\n }\n\n /** A scope button toggles: activating the active scope again clears it. */\n #pickScope(id: string): void {\n this.#activateScope(this.#scope === id ? null : id)\n }\n\n /** Activate (or clear) a scope and reset the search, focus back on the field. */\n #activateScope(id: string | null): void {\n this.#setScope(id)\n this.#query = ''\n this.#sub = null\n this.#cursor = 0\n if (this.#input) this.#input.value = ''\n this.#renderRows()\n this.#input?.focus()\n }\n\n /** The sections to show: the sub-list, the empty-query view or the filtered view. */\n #sections(): Section[] {\n const p = this.props\n const groups = this.#groups()\n const scope = this.#scope\n const locale = document.documentElement.lang || undefined\n const inScope = (group: CommandGroupData, item: CommandItemData) => scope === null || (item.scopeId ?? group.scopeId ?? group.id) === scope\n const itemRow = (item: CommandItemData, prefix: string, marks: number[] = []): Row => ({\n key: `${prefix}${item.id}`,\n kind: 'item',\n id: item.id,\n itemId: '',\n label: item.label,\n description: item.description,\n icon: item.icon,\n iconPath: item.iconPath,\n hint: item.hint,\n shortcut: item.shortcut,\n marks,\n item,\n })\n if (this.#sub) {\n const sub = this.#sub\n return [\n {\n key: 'sub',\n heading: tpl(p.actionsForLabel, '{label}', sub.label),\n rows: (sub.actions ?? []).map((a) => ({ key: `action-${a.id}`, kind: 'action' as const, id: a.id, itemId: sub.id, label: a.label, icon: a.icon, iconPath: a.iconPath, shortcut: a.shortcut, marks: [] })),\n },\n ]\n }\n const q = this.#query.trim()\n const sections: Section[] = []\n if (!q) {\n const byId = new Map<string, CommandItemData>()\n for (const g of groups) for (const it of g.items) if (inScope(g, it)) byId.set(it.id, it)\n const recentRows = orderChoices(this.#recent)\n .map((r) => byId.get(r.id))\n .filter((it): it is CommandItemData => !!it)\n .slice(0, Number(p.recentVisible ?? 5))\n .map((it) => itemRow(it, 'recent-'))\n if (recentRows.length) sections.push({ key: 'recent', heading: String(p.recentLabel), rows: recentRows })\n for (const g of groups) {\n const rows = g.items.filter((it) => inScope(g, it)).map((it) => itemRow(it, `${g.id}-`))\n if (rows.length) sections.push({ key: g.id, heading: g.heading, rows })\n }\n return sections\n }\n // The ranking is global: every group's scored items compete on score,\n // and consecutive same-group items share one headed section (the React\n // model's rule — a strong match from a later group outranks a weak one\n // from the first).\n const scored = groups\n .flatMap((g) =>\n g.items\n .filter((it) => inScope(g, it))\n .map((it) => ({ it, g, hit: scoreItem(q, it, g.heading, locale) })),\n )\n .filter((x): x is { it: CommandItemData; g: CommandGroupData; hit: { score: number; marks: number[] } } => x.hit !== null)\n .sort((a, b) => b.hit.score - a.hit.score)\n for (const x of scored) {\n const last = sections[sections.length - 1]\n if (last && last.key === x.g.id) last.rows.push(itemRow(x.it, `${x.g.id}-`, x.hit.marks))\n else sections.push({ key: x.g.id, heading: x.g.heading, rows: [itemRow(x.it, `${x.g.id}-`, x.hit.marks)] })\n }\n if (!sections.length) {\n const fallback = parseList<CommandActionData>(p.fallbackActions)\n if (fallback.length) {\n sections.push({\n key: 'fallback',\n heading: String(p.fallbackLabel),\n rows: fallback.map((a) => ({ key: `fallback-${a.id}`, kind: 'fallback' as const, id: a.id, itemId: '', label: a.label.split('{query}').join(q), icon: a.icon, iconPath: a.iconPath, shortcut: a.shortcut, marks: [] })),\n })\n }\n }\n return sections\n }\n\n #renderRows(): void {\n const list = this.#list\n const input = this.#input\n const results = this.#results\n if (!list || !input || !results) return\n const p = this.props\n const id = this.instanceId\n const loading = Boolean(p.loading)\n const sections = loading ? [] : this.#sections()\n this.#rows = sections.flatMap((s) => s.rows)\n if (this.#cursor >= this.#rows.length) this.#cursor = Math.max(0, this.#rows.length - 1)\n const current = this.#rows.length ? this.#rows[this.#cursor] : undefined\n\n const loadingEl = results.querySelector('.ty-palette__loading')\n if (loading && !loadingEl) {\n const block = el('div', 'ty-palette__loading', { 'aria-hidden': 'true' })\n for (let i = 0; i < 3; i++) block.append(el('span', 'ty-skeleton', { 'data-shape': 'line' }))\n results.prepend(block)\n } else if (!loading && loadingEl) loadingEl.remove()\n\n list.replaceChildren(\n ...sections.map((section) => {\n const group = el('div', 'ty-palette__group', { role: 'group', 'aria-labelledby': `${id}-${section.key}` })\n const heading = el('div', 'ty-palette__heading', { id: `${id}-${section.key}`, role: 'presentation' })\n heading.textContent = section.heading\n group.append(heading)\n for (const row of section.rows) {\n const on = row === current\n const option = el('div', 'ty-palette__option', {\n id: `${id}-${safe(row.key)}`,\n role: 'option',\n 'aria-selected': String(on),\n 'data-kind': row.kind,\n })\n if (on) option.setAttribute('data-highlighted', '')\n if (row.iconPath) {\n const icon = el('span', 'ty-palette__icon', { 'aria-hidden': 'true' })\n icon.append(svgIcon('ty-icon', row.iconPath.split(' | ')))\n option.append(icon)\n } else if (row.icon) {\n const icon = el('span', 'ty-palette__icon', { 'aria-hidden': 'true' })\n icon.textContent = row.icon\n option.append(icon)\n }\n const text = el('span', 'ty-palette__text')\n const label = el('span', 'ty-palette__label')\n appendMarked(label, row.label, row.marks)\n text.append(label)\n if (row.description) {\n const description = el('span', 'ty-palette__description')\n description.textContent = row.description\n text.append(description)\n }\n option.append(text)\n if (row.hint) {\n const hint = el('span', 'ty-palette__hint')\n hint.textContent = row.hint\n option.append(hint)\n }\n if (row.shortcut) {\n const kbd = el('kbd', 'ty-palette__kbd')\n kbd.textContent = row.shortcut\n option.append(kbd)\n }\n if (row.item?.actions?.length && !this.#sub) {\n const chevron = el('span', 'ty-palette__chevron', { 'aria-hidden': 'true' })\n chevron.append(svgIcon('ty-mirror-rtl', ['m9 18 6-6-6-6']))\n chevron.addEventListener('click', (event) => {\n event.stopPropagation()\n if (row.item) {\n this.#sub = row.item\n this.#cursor = 0\n this.#renderRows()\n }\n })\n option.append(chevron)\n }\n option.addEventListener('pointermove', () => {\n const index = this.#rows.indexOf(row)\n if (index !== -1 && index !== this.#cursor) {\n this.#cursor = index\n this.#renderRows()\n }\n })\n option.addEventListener('mousedown', (event) => event.preventDefault())\n option.addEventListener('click', () => this.#run(row))\n group.append(option)\n }\n return group\n }),\n )\n\n input.setAttribute('aria-expanded', String(this.#rows.length > 0))\n if (current) input.setAttribute('aria-activedescendant', `${id}-${safe(current.key)}`)\n else input.removeAttribute('aria-activedescendant')\n\n const emptyEl = results.querySelector<HTMLElement>('.ty-palette__empty')\n if (!loading && !this.#rows.length) {\n const message = this.#query.trim() ? tpl(p.noResultsLabel, '{query}', this.#query.trim()) : String(p.emptyLabel)\n if (emptyEl) emptyEl.textContent = message\n else {\n const paragraph = el('p', 'ty-palette__empty')\n paragraph.textContent = message\n results.append(paragraph)\n }\n } else emptyEl?.remove()\n\n if (this.#status) {\n const q = this.#query.trim()\n this.#status.textContent = loading\n ? String(p.loadingLabel)\n : q\n ? this.#rows.length\n ? tpl(p.resultsLabel, '{count}', String(this.#rows.length))\n : tpl(p.noResultsLabel, '{query}', q)\n : ''\n }\n if (current) document.getElementById(`${id}-${safe(current.key)}`)?.scrollIntoView?.({ block: 'nearest' })\n }\n\n #run(row: Row): void {\n const key = this.props.recentKey ? String(this.props.recentKey) : ''\n if (row.kind === 'item' && key) recordChoice(key, row.id, Number(this.props.recentKeep ?? 12))\n this.emit('ty-select', { id: row.id, kind: row.kind, itemId: row.itemId })\n this.#close(true)\n }\n\n #onKey = (event: KeyboardEvent): void => {\n const count = this.#rows.length\n const empty = this.#query.length === 0\n const scopes = this.#scopes()\n const scope = this.#scope\n const step = (to: number) => {\n event.preventDefault()\n if (count) {\n this.#cursor = (to + count) % count\n this.#renderRows()\n }\n }\n // Inline-axis keys follow the reading direction: \"into\" the sub-list is the inline end.\n const mirrored: Record<string, string> = { ArrowLeft: 'ArrowRight', ArrowRight: 'ArrowLeft' }\n const rtl = this.closest('[dir]')?.getAttribute('dir') === 'rtl'\n switch (rtl ? (mirrored[event.key] ?? event.key) : event.key) {\n case 'ArrowDown':\n return step(this.#cursor + 1)\n case 'ArrowUp':\n return step(this.#cursor - 1)\n case 'Home':\n return step(0)\n case 'End':\n return step(count - 1)\n case 'Enter': {\n event.preventDefault()\n const row = this.#rows[this.#cursor]\n if (row) this.#run(row)\n return\n }\n case 'ArrowRight': {\n const current = this.#rows[this.#cursor]\n if (!this.#sub && current?.item?.actions?.length) {\n event.preventDefault()\n this.#sub = current.item\n this.#cursor = 0\n this.#renderRows()\n } else if (empty && !scope && scopes[0]) {\n event.preventDefault()\n this.#pickScope(scopes[0].id)\n }\n return\n }\n case 'ArrowLeft':\n if (this.#sub) {\n event.preventDefault()\n this.#sub = null\n this.#cursor = 0\n this.#renderRows()\n }\n return\n case 'Tab': {\n if (!scopes.length || event.shiftKey) return\n const typed = this.#query.trim().toLocaleLowerCase()\n const target = empty ? (scope ? undefined : scopes[0]) : scopes.find((s) => s.label.toLocaleLowerCase().startsWith(typed))\n if (target) {\n event.preventDefault()\n this.#activateScope(target.id)\n }\n return\n }\n case 'Backspace':\n if (empty && scope) {\n event.preventDefault()\n this.#setScope(null)\n }\n return\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n if (this.#sub) {\n this.#sub = null\n this.#cursor = 0\n this.#renderRows()\n } else if (scope) this.#setScope(null)\n else this.#close(true)\n return\n }\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-breadcrumbs>`: the Breadcrumbs' single source (spec: wave-1/breadcrumbs.md).\n *\n * The anatomy is the chrome both modes share: the labelled navigation\n * landmark, the trail's ordered list and the compact bar with its slots.\n * The element composes what the definition language cannot express (the\n * skeleton preset precedent): the trail items from the JSON `items`, the\n * collapsed overflow menu (`maxVisible`), the compact back link and title,\n * and the resolution of `mode=\"auto\"` against the 640 px breakpoint (§2.8).\n * Examples therefore carry no `items` — the composed items could not be\n * produced by the parity renderers.\n */\nexport const breadcrumbsDefinition = {\n tag: 'ty-breadcrumbs',\n name: 'TyBreadcrumbs',\n kind: 'enhancing',\n doc: 'Shows where the current page sits in the hierarchy and goes up one or more levels. A trail at 640 px and above, a compact back link (with optional centred title and trailing actions) below. The last item is the current page — static text marked `aria-current=\"page\"`, never a link; separators are decorative. Long labels truncate with an ellipsis, the full label kept in `title` and as the accessible name. Activating a link emits a cancelable `ty-navigate`: a host with a client-side router prevents the default and navigates through its adapter.',\n props: {\n items: { type: 'string', attribute: 'items', doc: 'JSON array of `{ \"label\": string, \"href\": string }`, ancestors first and the current page last. Composed by the element on upgrade (the theme palette\\'s `theme-labels` precedent).' },\n label: { type: 'string', default: 'Breadcrumb', attribute: 'label', doc: 'Accessible name of the navigation landmark (the I18n adapter\\'s default); translate through this attribute.' },\n mode: { type: 'enum', values: ['trail', 'compact', 'auto'], default: 'auto', attribute: 'mode', doc: '`auto` shows the trail at 640 px and above, the compact bar below; the element resolves it live.' },\n rootHref: { type: 'string', attribute: 'root-href', doc: 'Parent href of the compact back link when there is only one item.' },\n rootLabel: { type: 'string', attribute: 'root-label', doc: 'Parent label of the compact back link when there is only one item (with `rootHref`).' },\n maxVisible: { type: 'number', attribute: 'max-visible', doc: 'Collapses middle items into an overflow menu when the trail exceeds this many entries (the first and the last `maxVisible - 1` stay visible).' },\n backLabel: { type: 'string', default: 'Back to {parent}', attribute: 'back-label', doc: 'Accessible-name template of the compact back link; `{parent}` is filled with the parent\\'s label.' },\n overflowLabel: { type: 'string', default: 'Show hidden levels', attribute: 'overflow-label', doc: 'Accessible name of the overflow menu\\'s toggle; translate through this attribute.' },\n },\n events: [\n { type: 'ty-navigate', kind: 'custom', detail: { href: 'string' }, reactProp: 'onNavigate', doc: 'A trail, overflow or back link was activated; `href` is its destination. Cancelable: a host with a client-side router calls `preventDefault()` and navigates through its adapter; uncanceled, the native anchor navigates.' },\n ],\n slots: {\n center: { doc: 'Replaces the centred title of the compact bar (the current page\\'s label when empty).' },\n actions: { doc: 'Trailing actions of the compact bar (narrow screens use it as a top bar).' },\n },\n anatomy: {\n tag: 'nav',\n class: 'ty-breadcrumbs',\n attrs: {\n 'aria-label': { prop: 'label' },\n // The raw mode; the element resolves `auto` into `trail`/`compact` on upgrade.\n 'data-mode': { prop: 'mode' },\n },\n children: [\n // The trail's list: the element composes the items into it. Rendered\n // for `trail` and `auto`; `auto` below 640 px hides it on upgrade.\n { tag: 'ol', class: 'ty-breadcrumbs__list', when: ['!mode:compact'] },\n // The compact bar: the element composes the back link and the title.\n {\n tag: 'div',\n class: 'ty-breadcrumbs__bar',\n when: ['mode:compact|mode:auto'],\n children: [\n { tag: 'div', class: 'ty-breadcrumbs__back' },\n {\n tag: 'div',\n class: 'ty-breadcrumbs__center',\n when: ['slot:center|slot:actions'],\n children: [\n { slot: 'center', when: ['slot:center'] },\n {\n tag: 'span',\n class: 'ty-breadcrumbs__title',\n when: ['!slot:center'],\n attrs: { 'aria-current': { value: 'page' } },\n },\n ],\n },\n {\n tag: 'div',\n class: 'ty-breadcrumbs__actions',\n when: ['slot:actions'],\n children: [{ slot: 'actions' }],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'auto-empty', props: {}, slots: {} },\n { name: 'trail-empty', props: { mode: 'trail' }, slots: {} },\n { name: 'compact-bar', props: { mode: 'compact' }, slots: { center: 'Sources', actions: 'Share' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { breadcrumbsDefinition } from './definition.ts'\n\ninterface BreadcrumbItem {\n label: string\n href: string\n}\n\ntype Entry = { kind: 'item'; item: BreadcrumbItem; index: number } | { kind: 'overflow'; items: BreadcrumbItem[] }\n\n/** The trail entries with the middle collapsed into one overflow (the React Breadcrumbs' `visibleEntries`). */\nfunction visibleEntries(items: BreadcrumbItem[], maxVisible?: number): Entry[] {\n const all: Entry[] = items.map((item, index) => ({ kind: 'item', item, index }))\n if (!maxVisible || items.length <= maxVisible || maxVisible < 2) return all\n const tail = maxVisible - 1\n return [all[0]!, { kind: 'overflow', items: items.slice(1, items.length - tail) }, ...all.slice(items.length - tail)]\n}\n\n/** Parses the JSON `items` attribute; malformed data warns and renders an empty trail. */\nfunction parseItems(raw: string | null): BreadcrumbItem[] {\n if (!raw) return []\n try {\n const parsed: unknown = JSON.parse(raw)\n if (!Array.isArray(parsed)) throw new Error('not an array')\n return parsed.filter(\n (entry): entry is BreadcrumbItem =>\n typeof entry === 'object' && entry !== null && typeof (entry as BreadcrumbItem).label === 'string' && typeof (entry as BreadcrumbItem).href === 'string',\n )\n } catch {\n console.warn('ty-breadcrumbs: `items` is not a JSON array of { label, href }.')\n return []\n }\n}\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n if (className) node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\n/** A decorative 24px icon (lucide strokes, ISC, THIRD_PARTY_NOTICES). */\nfunction icon(className: string, glyphs: Array<[tag: string, attrs: Record<string, string>]>): SVGSVGElement {\n const svg = document.createElementNS(SVG_NS, 'svg')\n svg.setAttribute('class', className)\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const [tag, attrs] of glyphs) {\n const glyph = document.createElementNS(SVG_NS, tag)\n for (const [name, value] of Object.entries(attrs)) glyph.setAttribute(name, value)\n svg.append(glyph)\n }\n return svg\n}\n\nconst separatorIcon = () => icon('ty-icon ty-mirror-rtl ty-breadcrumbs__separator', [['path', { d: 'm9 18 6-6-6-6' }]])\nconst backIcon = () => icon('ty-icon ty-mirror-rtl', [['path', { d: 'm12 19-7-7 7-7' }], ['path', { d: 'M19 12H5' }]])\nconst ellipsisIcon = () =>\n icon('ty-icon', [\n ['circle', { cx: '12', cy: '12', r: '1' }],\n ['circle', { cx: '19', cy: '12', r: '1' }],\n ['circle', { cx: '5', cy: '12', r: '1' }],\n ])\n\n/**\n * `<ty-breadcrumbs>`. The host framework renders the anatomy (the labelled\n * navigation landmark, the trail's list, the compact bar with its slots)\n * and the stylesheet paints it; the element composes what the declarative\n * anatomy cannot express — the skeleton preset precedent: composition fills\n * containers the anatomy rendered empty, and everything composed is\n * recomposed wholesale on change, never moving a node the framework owns.\n *\n * - **Trail** — the `items` (a JSON attribute) become the ordered list: a\n * subtle link per ancestor, the current page as static text marked\n * `aria-current=\"page\"`, decorative chevrons between entries, and the\n * middle collapsed into a native `<details>` overflow menu past\n * `maxVisible` (the first and the last `maxVisible - 1` stay visible).\n * - **Compact bar** — a single back link to the parent (or to `rootHref`\n * with one item), named from the `backLabel` template (\"Back to\n * {parent}\"), and the current label as the centred title.\n * - **Mode** — `auto` resolves live against the 640 px breakpoint (§2.8):\n * the resolved mode lands on `data-mode` and the unused container is\n * `hidden`.\n * - **Navigation** — activating any composed link emits a cancelable\n * `ty-navigate` with the href: a host with a client-side router prevents\n * the default and navigates through its adapter; uncanceled, the native\n * anchor navigates.\n *\n * The first composition runs after the first paint, so the upgrade never\n * rewrites the rendered anatomy (see <ty-text-field>); attribute changes\n * compose at once.\n */\nexport class TyBreadcrumbsElement extends TyElement {\n static override definition = breadcrumbsDefinition\n\n /** False until the first paint: nothing is composed during the upgrade the parity renderers compare. */\n #ready = false\n /** `auto` resolves against the small breakpoint (§2.8). */\n #media: MediaQueryList | null = null\n\n override sync(): void {\n super.sync()\n if (this.#ready) this.#compose()\n }\n\n protected override connected(): void {\n this.addEventListener('click', this.#onClick)\n this.#media = typeof matchMedia === 'undefined' ? null : matchMedia('(min-width: 640px)')\n this.#media?.addEventListener('change', this.#onMedia)\n requestAnimationFrame(() => {\n if (!this.isConnected) return\n this.#ready = true\n this.#compose()\n })\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n this.#media?.removeEventListener('change', this.#onMedia)\n this.#media = null\n }\n\n #onMedia = (): void => {\n if (this.#ready) this.#compose()\n }\n\n /** A composed link's activation goes through the host's router adapter (`ty-navigate`, cancelable). */\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n const anchor = target && typeof target.closest === 'function' ? target.closest('a[href]') : null\n if (!anchor || !this.contains(anchor)) return\n const href = anchor.getAttribute('href')!\n if (!this.emit('ty-navigate', { href })) event.preventDefault()\n }\n\n #compose(): void {\n const root = this.anatomyRoot()\n if (!root) return\n const props = this.props\n const mode = String(props.mode)\n const compact = mode === 'compact' || (mode === 'auto' && !(this.#media?.matches ?? true))\n const resolved = compact ? 'compact' : 'trail'\n if (root.getAttribute('data-mode') !== resolved) root.setAttribute('data-mode', resolved)\n const list = root.querySelector('.ty-breadcrumbs__list')\n const bar = root.querySelector('.ty-breadcrumbs__bar')\n list?.toggleAttribute('hidden', compact)\n bar?.toggleAttribute('hidden', !compact)\n const items = parseItems(this.getAttribute('items'))\n if (!compact && list) this.#composeTrail(list, items)\n if (compact && bar) this.#composeBar(bar, items)\n }\n\n /** The ordered trail: links, the static current page, separators and the overflow menu. */\n #composeTrail(list: Element, items: BreadcrumbItem[]): void {\n const max = Number(this.props.maxVisible ?? 0)\n const entries = visibleEntries(items, max || undefined)\n const nodes: HTMLElement[] = []\n entries.forEach((entry, index) => {\n const li = el('li', 'ty-breadcrumbs__item')\n if (entry.kind === 'overflow') {\n li.append(this.#overflow(entry.items))\n } else if (entry.index === items.length - 1) {\n const current = el('span', 'ty-breadcrumbs__current', { 'aria-current': 'page', title: entry.item.label })\n current.textContent = entry.item.label\n li.append(current)\n } else {\n const link = el('a', 'ty-link ty-breadcrumbs__link', { href: entry.item.href, 'data-emphasis': 'subtle' })\n const label = el('span', 'ty-breadcrumbs__label', { title: entry.item.label })\n label.textContent = entry.item.label\n link.append(label)\n li.append(link)\n }\n if (index < entries.length - 1) li.append(separatorIcon())\n nodes.push(li)\n })\n list.replaceChildren(...nodes)\n }\n\n /** The collapsed middle levels: a native disclosure of links, named by `overflowLabel`. */\n #overflow(items: BreadcrumbItem[]): HTMLElement {\n const details = el('details', 'ty-breadcrumbs__overflow')\n const summary = el('summary', 'ty-breadcrumbs__overflow-toggle', { 'aria-label': String(this.props.overflowLabel) })\n summary.append(ellipsisIcon())\n const menu = el('ul', 'ty-breadcrumbs__overflow-list')\n for (const item of items) {\n const li = el('li', 'ty-breadcrumbs__overflow-item')\n const link = el('a', 'ty-link', { href: item.href, 'data-emphasis': 'subtle', title: item.label })\n link.textContent = item.label\n li.append(link)\n menu.append(li)\n }\n details.append(summary, menu)\n return details\n }\n\n /** The compact bar: the back link to the parent (or `rootHref` with one item) and the centred title. */\n #composeBar(bar: Element, items: BreadcrumbItem[]): void {\n const props = this.props\n const back = bar.querySelector('.ty-breadcrumbs__back')\n if (back) {\n const parent =\n items.length > 1\n ? items[items.length - 2]!\n : props.rootHref\n ? { href: String(props.rootHref), label: String(props.rootLabel ?? '') }\n : undefined\n if (!parent) back.replaceChildren()\n else {\n const name = String(props.backLabel).replaceAll('{parent}', parent.label)\n const link = el('a', 'ty-link', { href: parent.href, 'data-emphasis': 'subtle', 'data-standalone': '', 'aria-label': name })\n const label = el('span', 'ty-breadcrumbs__back-label')\n label.textContent = parent.label\n link.append(backIcon(), label)\n back.replaceChildren(link)\n }\n }\n const title = bar.querySelector('.ty-breadcrumbs__title')\n if (title) {\n const text = items[items.length - 1]?.label ?? ''\n if (title.textContent !== text) title.textContent = text\n }\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-brand-wordmark>`: the BrandWordmark's single source (element-first; see docs/design/single-source-components.md). */\nexport const brandWordmarkDefinition = {\n tag: 'ty-brand-wordmark',\n name: 'TyBrandWordmark',\n kind: 'enhancing',\n doc: 'Two-tone product wordmark: the plain part (`text`) in ink and the accent part (`accent`) in the brand gradient (`background-clip: text`). Plain text for assistive tech as-is; `label` turns it into an img role with that name (a logo lockup).',\n props: {\n text: { type: 'string', attribute: 'text', doc: 'The plain part of the wordmark, in ink.' },\n accent: { type: 'string', attribute: 'accent', doc: 'The accent part of the wordmark, in the brand gradient; rendered right after `text`.' },\n size: { type: 'enum', values: ['small', 'medium', 'large'], default: 'medium', attribute: 'size', doc: 'Type step of the wordmark.' },\n label: { type: 'string', attribute: 'label', doc: 'Accessible name as an img role (a logo lockup); left out, the wordmark is plain text read as-is.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the wordmark (`data-testid`).' },\n },\n events: [],\n anatomy: {\n tag: 'span',\n class: 'ty-brand-wordmark',\n attrs: {\n role: { value: 'img', when: ['label'] },\n 'aria-label': { prop: 'label' },\n 'data-size': { prop: 'size' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n { tag: 'span', class: 'ty-brand-wordmark__text', when: ['text'], children: [{ text: { prop: 'text' } }] },\n { tag: 'span', class: 'ty-brand-wordmark__accent', when: ['accent'], children: [{ text: { prop: 'accent' } }] },\n ],\n },\n examples: [\n { name: 'default', props: { text: 'North', accent: 'star' }, slots: {} },\n { name: 'small', props: { text: 'North', accent: 'star', size: 'small' }, slots: {} },\n { name: 'large-labelled', props: { text: 'North', accent: 'star', size: 'large', label: 'Northstar' }, slots: {} },\n { name: 'accent-only', props: { accent: 'Solo' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { brandWordmarkDefinition } from './definition.ts'\n\n/**\n * `<ty-brand-wordmark>`. All presentation: the host framework renders the\n * anatomy (ink text, gradient accent) and the stylesheet draws it, including\n * the forced-colours fallback. Not a widget — no keyboard or events; the\n * base class builds and patches the anatomy for plain-HTML use and keeps the\n * bound attributes in step.\n */\nexport class TyBrandWordmarkElement extends TyElement {\n static override definition = brandWordmarkDefinition\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-avatar__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative fallback icon (lucide strokes), sized by the frame's `.ty-avatar__icon` rule. */\nconst icon = (children: ElementNode[], when: string[]): ElementNode => ({\n tag: 'svg',\n class: 'ty-avatar__icon',\n when,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/**\n * The picture and the fallback it covers, shared by the static frame and\n * the two pressable controls. The fallback is `hidden` while the picture\n * holds; the element swaps them when the picture fails.\n */\nconst content = (): ElementNode[] => [\n // The picture. Decorative, or inside a named control: no text of its own.\n {\n tag: 'img',\n class: 'ty-avatar__image',\n when: ['src', 'decorative|pressable|href'],\n attrs: { src: { prop: 'src' }, alt: { value: '' } },\n },\n {\n tag: 'img',\n class: 'ty-avatar__image',\n when: ['src', '!decorative', '!pressable', '!href'],\n attrs: { src: { prop: 'src' }, alt: { prop: 'name' } },\n },\n {\n tag: 'span',\n class: 'ty-avatar__fallback',\n attrs: { hidden: { value: '', when: ['src'] } },\n children: [\n // Agents: a bot mark, never initials (§2.11).\n icon(\n [\n glyph('path', { d: 'M12 8V4H8' }),\n glyph('rect', { width: '16', height: '12', x: '4', y: '8', rx: '2' }),\n glyph('path', { d: 'M2 14h2' }),\n glyph('path', { d: 'M20 14h2' }),\n glyph('path', { d: 'M15 13v2' }),\n glyph('path', { d: 'M9 13v2' }),\n ],\n ['actorKind:agent'],\n ),\n {\n tag: 'span',\n class: 'ty-avatar__initials',\n when: ['actorKind:person', 'fallbackText'],\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [{ text: { prop: 'fallbackText' } }],\n },\n icon(\n [\n glyph('path', { d: 'M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2' }),\n glyph('circle', { cx: '12', cy: '7', r: '4' }),\n ],\n ['actorKind:person', '!fallbackText'],\n ),\n ],\n },\n]\n\n/** The frame (circle or agent square); the static one carries the img role and the name. */\nconst frame = (when: string[], pressable: boolean): ElementNode => ({\n tag: 'span',\n class: 'ty-avatar',\n when: when.length ? when : undefined,\n attrs: pressable\n ? {\n 'data-kind': { prop: 'actorKind' },\n 'data-size': { prop: 'size' },\n 'data-tint': { prop: 'tint' },\n 'data-image': { value: '', when: ['src'] },\n // Inside a named control the visual is decorative.\n 'aria-hidden': { value: 'true' },\n }\n : {\n 'data-kind': { prop: 'actorKind' },\n 'data-size': { prop: 'size' },\n 'data-tint': { prop: 'tint' },\n 'data-image': { value: '', when: ['src'] },\n 'aria-hidden': { value: 'true', when: ['decorative'] },\n role: { value: 'img', when: ['!decorative', '!src'] },\n 'aria-label': { prop: 'name', when: ['!decorative', '!src'] },\n },\n children: content(),\n})\n\n/** `<ty-avatar>`: the Avatar's single source (spec: wave-1/avatar.md). */\nexport const avatarDefinition = {\n tag: 'ty-avatar',\n name: 'TyAvatar',\n kind: 'enhancing',\n doc: 'Represents a person or an agent with a picture or fallback initials, optionally as a pressable control. Static, the frame is an image role named by `name` (hidden when `decorative`); pressable, it is a link (`href`) or a button (`pressable`) named by `actionLabel`, with a 44 px hit area at every size. The fallback (initials for a person, a bot mark for an agent, a user mark otherwise) shows while there is no picture and when the picture fails to load.',\n props: {\n src: { type: 'string', attribute: 'src', doc: 'Image URL; on load error the fallback shows.' },\n fallbackText: { type: 'string', attribute: 'fallback-text', doc: 'One or two characters shown when there is no image (derived by the host from a name); the element keeps the first two grapheme clusters.' },\n name: { type: 'string', attribute: 'name', doc: 'Accessible name; required unless `decorative`. Initials are never read as letters while it is set.' },\n decorative: { type: 'boolean', attribute: 'decorative', doc: 'Hides the avatar from assistive tech when the name is already shown next to it.' },\n actorKind: { type: 'enum', values: ['person', 'agent'], default: 'person', attribute: 'actor-kind', doc: '`person`: circle with initials. `agent`: rounded square with a bot icon and a dashed border, never initials (§2.11).' },\n size: { type: 'enum', values: ['xsmall', 'small', 'regular', 'large'], default: 'regular', attribute: 'size', doc: 'Size step.' },\n tint: { type: 'enum', values: ['accent', 'neutral'], default: 'accent', attribute: 'tint', doc: 'Fallback background: accent-soft or neutral (§2.3).' },\n pressable: { type: 'boolean', attribute: 'pressable', doc: 'The avatar is one press target (a button); set it when `onPress` is wired. Implied by `href`.' },\n href: { type: 'string', attribute: 'href', doc: 'Makes the avatar a link to this destination (wins over `pressable`).' },\n actionLabel: { type: 'string', default: 'Open profile of {name}', attribute: 'action-label', doc: 'Accessible name of a pressable avatar; `{name}` is filled in. Translate through this attribute.' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onPress', doc: 'The native click of the pressable avatar (its link or button).' }],\n anatomy: {\n // A boxless root (display: contents): the static frame and the two\n // pressable controls are mutually exclusive alternatives (the surface's\n // link-or-button precedent); only one renders at a time.\n tag: 'span',\n class: 'ty-avatar-root',\n attrs: {},\n children: [\n frame(['!pressable', '!href'], false),\n {\n tag: 'a',\n class: 'ty-avatar-control',\n when: ['href'],\n attrs: { href: { prop: 'href' }, 'data-size': { prop: 'size' } },\n children: [frame([], true)],\n },\n {\n tag: 'button',\n class: 'ty-avatar-control',\n when: ['!href', 'pressable'],\n attrs: { type: { value: 'button' }, 'data-size': { prop: 'size' } },\n children: [frame([], true)],\n },\n ],\n },\n examples: [\n { name: 'initials', props: { name: 'Natália Mesquita', fallbackText: 'NM' }, slots: {} },\n { name: 'image', props: { src: '/avatars/natalia.png', name: 'Natália Mesquita', fallbackText: 'NM' }, slots: {} },\n { name: 'agent', props: { actorKind: 'agent', name: 'stage-counter', size: 'small' }, slots: {} },\n { name: 'decorative-neutral', props: { decorative: true, fallbackText: 'NM', tint: 'neutral' }, slots: {} },\n { name: 'pressable', props: { pressable: true, name: 'Natália Mesquita', fallbackText: 'NM' }, slots: {} },\n { name: 'link', props: { href: '/users/natalia', name: 'Natália Mesquita', src: '/avatars/natalia.png' }, slots: {} },\n { name: 'translated-action', props: { pressable: true, name: 'Natália Mesquita', fallbackText: 'NM', actionLabel: 'Abrir perfil de {name}' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { avatarDefinition } from './definition.ts'\n\n/** The first `count` user-perceived characters (grapheme clusters), so marks and emoji stay whole. */\nfunction leadingGraphemes(text: string, count: number): string {\n const Segmenter = (Intl as { Segmenter?: typeof Intl.Segmenter }).Segmenter\n if (!Segmenter) return Array.from(text).slice(0, count).join('')\n let out = ''\n let taken = 0\n for (const { segment } of new Segmenter(undefined, { granularity: 'grapheme' }).segment(text)) {\n if (taken === count) break\n out += segment\n taken += 1\n }\n return out\n}\n\n/**\n * `<ty-avatar>`. The anatomy (the frame with its picture and fallback, or a\n * link/button control around it) is purely presentational; the element adds\n * what load state and naming need (spec: wave-1/avatar.md):\n *\n * - **Image failure** — an `error` from the picture swaps it for the\n * fallback (both are always rendered; `hidden` picks the visible one),\n * drops `data-image`, and a static frame takes `role=\"img\"` with the\n * name, exactly as if no `src` were given. A new `src` resets.\n * - **Naming** — a pressable control is named from `action-label` with\n * `{name}` filled in (\"Open profile of {name}\"); the frame inside stays\n * `aria-hidden`, so the initials are never read as letters.\n * - **Initials** — the fallback text is kept to two grapheme clusters.\n */\nexport class TyAvatarElement extends TyElement {\n static override definition = avatarDefinition\n\n /** The src whose picture failed to load; a different src resets. */\n #failedFor: string | null = null\n\n #onError = (event: Event) => {\n const target = event.target\n if (!(target instanceof HTMLImageElement) || !this.contains(target)) return\n this.#failedFor = target.getAttribute('src')\n this.#applyImageState()\n }\n\n /** Picture vs fallback, `data-image`, and the static frame's img role after a failure. */\n #applyImageState = () => {\n const src = this.getAttribute('src')\n const failed = src !== null && src === this.#failedFor\n const decorative = this.hasAttribute('decorative')\n const pressable = this.hasAttribute('pressable') || this.hasAttribute('href')\n for (const frame of this.querySelectorAll('.ty-avatar')) {\n const image = frame.querySelector('img')\n if (image) {\n image.toggleAttribute('hidden', failed)\n // The anatomy leaves `alt` out only when there is no name to give.\n if (!image.hasAttribute('alt')) image.setAttribute('alt', '')\n }\n frame.querySelector('.ty-avatar__fallback')?.toggleAttribute('hidden', src !== null && !failed)\n frame.toggleAttribute('data-image', src !== null && !failed)\n if (!decorative && !pressable && (src === null || failed)) {\n frame.setAttribute('role', 'img')\n const name = this.getAttribute('name')\n if (name) frame.setAttribute('aria-label', name)\n } else if (src !== null && !failed) {\n frame.removeAttribute('role')\n frame.removeAttribute('aria-label')\n }\n }\n }\n\n /** The control's accessible name: the action label with the name filled in. */\n #applyLabel = () => {\n const control = this.querySelector('.ty-avatar-control')\n if (!control) return\n const label = String(this.props.actionLabel ?? '')\n .replaceAll('{name}', this.getAttribute('name') ?? '')\n .trim()\n if (label) control.setAttribute('aria-label', label)\n else control.removeAttribute('aria-label')\n }\n\n /** Initials are one or two grapheme clusters, however long the attribute. */\n #applyInitials = () => {\n const text = this.getAttribute('fallback-text')\n if (text === null) return\n const short = leadingGraphemes(text, 2)\n for (const initials of this.querySelectorAll('.ty-avatar__initials')) {\n if (initials.textContent !== short) initials.textContent = short\n }\n }\n\n protected override connected(): void {\n if (!this.hasAttribute('decorative') && !this.hasAttribute('name')) {\n console.warn('<ty-avatar>: `name` is required unless `decorative`.')\n }\n this.addEventListener('error', this.#onError, { capture: true })\n this.#applyImageState()\n this.#applyLabel()\n this.#applyInitials()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('error', this.#onError, { capture: true })\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyImageState()\n this.#applyLabel()\n this.#applyInitials()\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-action-menu__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** The built-in trigger's ellipsis (lucide strokes), used only in trigger mode when the trigger slot is empty. */\nconst ellipsisIcon: ElementNode = {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [\n glyph('circle', { cx: '12', cy: '12', r: '1' }),\n glyph('circle', { cx: '19', cy: '12', r: '1' }),\n glyph('circle', { cx: '5', cy: '12', r: '1' }),\n ],\n}\n\n/**\n * `<ty-action-menu>`: the ActionMenu's single source (spec: wave-1/action-menu.md).\n *\n * The entries are data (`items`, JSON), which the declarative anatomy cannot\n * express (no dynamic repetition), so — as the skeleton composes its presets\n * — the element composes the item rows into the anatomy's empty\n * `.ty-action-menu__menu` on upgrade. Examples therefore stay closed: an open\n * example would render its rows only after the element runs, and the parity\n * renderers could not produce them.\n */\nexport const actionMenuDefinition = {\n tag: 'ty-action-menu',\n name: 'TyActionMenu',\n kind: 'enhancing',\n doc: 'A list of commands opened from a trigger button (mode `trigger`, the APG Menu Button pattern) or at a pointer position over a target (mode `context`: secondary click, Shift+F10, the ContextMenu key, or a long press on touch). Opening moves focus to the first enabled item (ArrowUp from the trigger: the last); ArrowDown/ArrowUp move with wrapping, Home/End jump, typing a character moves to the next enabled item starting with it, Enter/Space activate, Escape closes and returns focus to the origin, Tab and an outside press close. Disabled items are skipped and announced as disabled. In context mode the surface is clamped so it never overflows the viewport. Visibility is controlled: the element asks with `ty-open-change`, the host flips `open`.',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Shown (controlled). The anatomy stays mounted but `hidden` while closed, so nothing reaches the accessibility tree.' },\n mode: { type: 'enum', values: ['trigger', 'context'], default: 'trigger', attribute: 'mode', doc: '`trigger`: opens from the trigger button; `context`: opens at a viewport point over the trigger slot\\'s target.' },\n label: { type: 'string', attribute: 'label', doc: 'Accessible name of the menu (required by the spec).' },\n triggerLabel: { type: 'string', default: 'More actions', attribute: 'trigger-label', doc: 'Accessible name of the built-in icon-only trigger (the React messages.moreActions default), used in trigger mode when the trigger slot is empty.' },\n items: { type: 'string', attribute: 'items', doc: 'JSON array of entries in order: an item `{ id, label, icon?, iconPath?, tone?, disabled?, shortcut? }` (`icon` a decorative text glyph; `iconPath` an SVG icon as 24×24 path data rendered in the standard icon frame — when both are present `iconPath` wins, and subpaths separated by \" | \" become one `<path>` each; `tone` \"danger\" marks a destructive command, `shortcut` a displayed hint only), `{ \"type\": \"separator\" }`, or `{ \"type\": \"section\", \"id\", \"title\", \"items\": [...] }`. The element composes the rows on upgrade.' },\n position: { type: 'string', attribute: 'position', doc: 'Context mode: the viewport point the menu opens at, \"x,y\" in CSS pixels (controlled); the last context-request point when unset. Clamped so the menu stays inside the viewport.' },\n },\n events: [\n { type: 'ty-action', kind: 'custom', detail: { id: 'string' }, reactProp: 'onAction', doc: 'An item was activated (pointer, Enter or Space); the element then asks to close. A disabled item never fires.' },\n { type: 'ty-open-change', kind: 'custom', detail: { open: 'boolean' }, reactProp: 'onOpenChange', doc: 'The element asks the host to change visibility — `open: true` on a trigger activation or a context request (secondary click, Shift+F10, the ContextMenu key, a long press), `open: false` on Escape, Tab, an outside press or after an action. Controlled: the element does not toggle itself; the host flips `open`.' },\n ],\n slots: {\n trigger: { doc: 'Trigger mode: the host\\'s own toggle — any single focusable element, wired with aria-haspopup=\"menu\" and aria-expanded. Context mode: the target that receives the context request (secondary click, Shift+F10, long press). Empty in trigger mode: the built-in ellipsis button named by `triggerLabel`.' },\n },\n anatomy: {\n tag: 'span',\n class: 'ty-action-menu__target',\n attrs: { 'data-mode': { prop: 'mode' } },\n children: [\n // The built-in trigger (only in trigger mode, only when the trigger\n // slot is empty): a quiet, icon-only button with the ellipsis glyph —\n // exactly the chrome ActionMenu.tsx composes.\n {\n tag: 'button',\n class: 'ty-button ty-action-menu__trigger',\n when: ['!slot:trigger', 'mode:trigger'],\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'triggerLabel' },\n 'aria-haspopup': { value: 'menu' },\n 'data-variant': { value: 'quiet' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [ellipsisIcon],\n },\n ],\n },\n { slot: 'trigger', when: ['slot:trigger'] },\n {\n tag: 'div',\n class: 'ty-action-menu',\n // Always rendered (a framework's closed menu has an anatomy to\n // find); `hidden` while closed, so nothing reaches the tree.\n attrs: {\n hidden: { value: '', when: ['!open'] },\n 'data-mode': { prop: 'mode' },\n },\n children: [\n // Rendered empty: the element composes the item rows from the\n // `items` JSON on upgrade (the anatomy cannot repeat).\n {\n tag: 'div',\n class: 'ty-action-menu__menu',\n attrs: {\n id: { idref: 'menu' },\n role: { value: 'menu' },\n 'aria-label': { prop: 'label' },\n 'aria-orientation': { value: 'vertical' },\n tabindex: { value: '-1' },\n },\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'closed', props: { label: 'Item actions' }, slots: {} },\n { name: 'own-trigger', props: { label: 'Run actions' }, slots: { trigger: 'More' } },\n { name: 'context', props: { mode: 'context', label: 'File actions' }, slots: { trigger: 'report.csv' } },\n { name: 'translated', props: { label: 'Ações do item', triggerLabel: 'Mais ações' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","// Anchored placement for `<ty-popover>`: where a panel of a known size goes\n// next to a trigger rectangle so it stays inside the viewport. Pure\n// geometry in CSS pixels (what getBoundingClientRect reports and\n// position:fixed consumes), so the rules are unit-tested without layout.\n// Mirrors components/placement.rs on the Astrlabe side: preferred side,\n// flip on collision, viewport clamp, arrow offset.\n\n/** An axis-aligned rectangle in viewport pixels. */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n}\n\n/** A width and height in pixels. */\nexport interface Size {\n width: number\n height: number\n}\n\n/** The physical side of the trigger the panel sits on. */\nexport type Side = 'top' | 'bottom' | 'left' | 'right'\n\n/** Alignment along the chosen side. */\nexport type Align = 'start' | 'center' | 'end'\n\nexport interface Placed {\n x: number\n y: number\n /** The side actually used — the preferred one or its opposite after a flip. */\n side: Side\n /** Distance from the panel's left (vertical sides) or top (horizontal sides) edge to the arrow's centre. */\n arrow: number\n}\n\n/** Pixels kept between the panel and every viewport edge (the spec's 16 px gutter; RAC's containerPadding). */\nexport const VIEWPORT_MARGIN = 16\n/** Least distance between the arrow's centre and a panel corner, so it never sits on the rounding. */\nexport const ARROW_INSET = 14\n\n/** Spacing scale steps in px (the `offset` prop is a step index), as Popover.tsx maps them. */\nexport const SPACE_STEPS = [0, 4, 8, 12, 16, 24, 32, 48, 64, 96]\n\n/** The gap in px for an `offset` step; the arrow adds 6 px (Popover.tsx). */\nexport function offsetPx(step: number, showArrow: boolean): number {\n return (SPACE_STEPS[Math.trunc(step)] ?? 8) + (showArrow ? 6 : 0)\n}\n\n/** The logical `placement` as a physical side in the current reading direction. */\nexport function physicalSide(placement: string, rtl: boolean): Side {\n switch (placement) {\n case 'top':\n return 'top'\n case 'end':\n return rtl ? 'left' : 'right'\n case 'start':\n return rtl ? 'right' : 'left'\n default:\n return 'bottom'\n }\n}\n\nconst OPPOSITE: Record<Side, Side> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' }\nconst VERTICAL = new Set<Side>(['top', 'bottom'])\n\n/** Free space between the anchor and the viewport edge on `side`, after the margin. */\nfunction space(anchor: Rect, viewport: Size, side: Side): number {\n switch (side) {\n case 'top':\n return anchor.y - VIEWPORT_MARGIN\n case 'bottom':\n return viewport.height - (anchor.y + anchor.height) - VIEWPORT_MARGIN\n case 'left':\n return anchor.x - VIEWPORT_MARGIN\n case 'right':\n return viewport.width - (anchor.x + anchor.width) - VIEWPORT_MARGIN\n }\n}\n\n/** The preferred side when the panel fits, the opposite when it has more room, else the preferred. */\nexport function resolveSide(anchor: Rect, panel: Size, viewport: Size, preferred: Side, offset: number): Side {\n const needed = offset + (VERTICAL.has(preferred) ? panel.height : panel.width)\n const preferredSpace = space(anchor, viewport, preferred)\n if (preferredSpace >= needed) return preferred\n const opposite = OPPOSITE[preferred]\n return space(anchor, viewport, opposite) > preferredSpace ? opposite : preferred\n}\n\nfunction crossStart(anchorStart: number, anchorLen: number, panelLen: number, align: Align): number {\n switch (align) {\n case 'start':\n return anchorStart\n case 'end':\n return anchorStart + anchorLen - panelLen\n default:\n return anchorStart + (anchorLen - panelLen) / 2\n }\n}\n\n/** Keep the panel `VIEWPORT_MARGIN` from the edges; a panel larger than the viewport pins to the leading margin. */\nfunction clampAxis(start: number, panelLen: number, viewportLen: number): number {\n const max = viewportLen - VIEWPORT_MARGIN - panelLen\n return Math.min(Math.max(start, VIEWPORT_MARGIN), Math.max(max, VIEWPORT_MARGIN))\n}\n\n/** The arrow's centre along the panel edge facing the anchor, kept off the rounded corners. */\nfunction arrowOffset(anchorCentre: number, panelLen: number): number {\n return Math.min(Math.max(anchorCentre, ARROW_INSET), Math.max(panelLen - ARROW_INSET, ARROW_INSET))\n}\n\n/** Place `panel` next to `anchor` inside `viewport` — see the module doc. */\nexport function place(anchor: Rect, panel: Size, viewport: Size, preferred: Side, align: Align, offset: number): Placed {\n const side = resolveSide(anchor, panel, viewport, preferred, offset)\n let rawX: number\n let rawY: number\n switch (side) {\n case 'top':\n rawX = crossStart(anchor.x, anchor.width, panel.width, align)\n rawY = anchor.y - offset - panel.height\n break\n case 'bottom':\n rawX = crossStart(anchor.x, anchor.width, panel.width, align)\n rawY = anchor.y + anchor.height + offset\n break\n case 'left':\n rawX = anchor.x - offset - panel.width\n rawY = crossStart(anchor.y, anchor.height, panel.height, align)\n break\n case 'right':\n rawX = anchor.x + anchor.width + offset\n rawY = crossStart(anchor.y, anchor.height, panel.height, align)\n break\n }\n const x = clampAxis(rawX, panel.width, viewport.width)\n const y = clampAxis(rawY, panel.height, viewport.height)\n const arrow = VERTICAL.has(side)\n ? arrowOffset(anchor.x + anchor.width / 2 - x, panel.width)\n : arrowOffset(anchor.y + anchor.height / 2 - y, panel.height)\n return { x, y, side, arrow }\n}\n","import { TyElement } from '../base.ts'\nimport { actionMenuDefinition } from './definition.ts'\nimport { place, type Rect, type Size } from '../popover/model.ts'\n\n/** Pixels kept between the surface and every viewport edge in context mode (ActionMenu.tsx's GUTTER). */\nconst GUTTER = 8\n/** Gap between trigger and surface in trigger mode (ActionMenu.tsx's Popover offset). */\nconst TRIGGER_OFFSET = 8\n/** Touch: a press held this long over the target is a context request (ActionMenu.tsx's LONG_PRESS_MS). */\nconst LONG_PRESS_MS = 500\n\nconst SVG = 'http://www.w3.org/2000/svg'\n\n/** One actionable entry of the `items` JSON (ActionMenuItem: `icon` a text glyph, `iconPath` SVG path data). */\ninterface Item {\n type?: 'item'\n id: string\n label: string\n icon?: string\n /** SVG path data (24×24, subpaths separated by \" | \"); wins over `icon`. */\n iconPath?: string\n tone?: 'default' | 'danger'\n disabled?: boolean\n shortcut?: string\n}\ninterface SeparatorEntry {\n type: 'separator'\n}\ninterface SectionEntry {\n type: 'section'\n id: string\n title: string\n items: Item[]\n}\ntype Entry = Item | SeparatorEntry | SectionEntry\n\n/** A composed item row, for roving focus and activation. */\ninterface Rendered {\n id: string\n label: string\n disabled: boolean\n el: HTMLElement\n}\n\n/** Why the element asked to close; an outside press and Tab must not steal focus back. */\ntype CloseReason = 'escape' | 'action' | 'trigger' | 'outside' | 'tab'\n\nfunction el<K extends keyof HTMLElementTagNameMap>(tag: K, className: string, attrs: Record<string, string> = {}): HTMLElementTagNameMap[K] {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\nfunction parseItems(raw: string): Entry[] {\n if (!raw.trim()) return []\n try {\n const parsed: unknown = JSON.parse(raw)\n return Array.isArray(parsed) ? (parsed as Entry[]) : []\n } catch {\n console.warn('ty-action-menu: `items` is not valid JSON.')\n return []\n }\n}\n\n/**\n * An item's `iconPath` as the standard icon frame: one `<path>` per\n * \" | \"-separated subpath, the `d` always set as an attribute so the JSON\n * stays inert data (never parsed as markup).\n */\nfunction iconSvg(iconPath: string): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n svg.setAttribute('class', 'ty-icon')\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('stroke-linecap', 'round')\n svg.setAttribute('stroke-linejoin', 'round')\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('focusable', 'false')\n for (const d of iconPath.split(' | ')) {\n const path = document.createElementNS(SVG, 'path')\n path.setAttribute('d', d)\n svg.append(path)\n }\n return svg\n}\n\n/**\n * `<ty-action-menu>`. The host framework renders the anatomy (the built-in\n * trigger or the trigger slot, the hidden surface with its empty menu) from\n * the definition; the element adds what the anatomy cannot (spec:\n * wave-1/action-menu.md):\n *\n * - **Composition** — the item rows are data (`items` JSON): items (icon\n * glyph, label, shortcut hint, danger tone, disabled), separators and\n * named sections are composed into `.ty-action-menu__menu`, recomposed\n * when the attribute changes or a re-render dropped them.\n * - **Opening** — trigger mode: the trigger (its own slotted control or the\n * built-in ellipsis button) toggles, with ArrowDown/ArrowUp opening onto\n * the first/last item. Context mode: a secondary click, Shift+F10, the\n * ContextMenu key or a touch long press on the trigger slot's target opens\n * at that point, clamped inside the viewport. Both only ask\n * (`ty-open-change`); the host flips `open`.\n * - **Roving focus** — opening focuses the first enabled item;\n * ArrowDown/ArrowUp move with wrapping, Home/End jump, a printable\n * character moves to the next enabled item starting with it, all skipping\n * disabled items (`aria-disabled`). Enter/Space activate (`ty-action`,\n * then ask to close); Escape asks to close and focus returns to the\n * origin (the trigger, or the element that received the context request);\n * Tab and an outside press ask to close without stealing focus.\n * - **Placement** — trigger mode: below the trigger, aligned to its end,\n * flipping and clamping through the shared placement model; context mode:\n * the requested point clamped so the surface never overflows the\n * viewport. Recomputed on resize and scroll while open.\n */\nexport class TyActionMenuElement extends TyElement {\n static override definition = actionMenuDefinition\n\n #rendered: Rendered[] = []\n #renderedKey: string | null = null\n #controller: AbortController | null = null\n #origin: HTMLElement | null = null\n #pendingFocus: 'first' | 'last' = 'first'\n #closeReason: CloseReason | null = null\n #point = { x: 0, y: 0 }\n #raf = 0\n #longPress: number | undefined\n /** Modality of the last interaction, for `data-focus-visible`. */\n #keyboard = true\n\n override sync(): void {\n super.sync()\n if (this.isConnected) this.#compose()\n }\n\n protected override connected(): void {\n this.addEventListener('click', this.#onClick)\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('contextmenu', this.#onContextMenu)\n this.addEventListener('pointerdown', this.#onPointerDown)\n this.addEventListener('pointerup', this.#onPointerUp)\n this.addEventListener('pointercancel', this.#cancelLongPress)\n this.addEventListener('pointermove', this.#cancelLongPress)\n this.addEventListener('pointerover', this.#onPointerOver)\n this.addEventListener('pointerout', this.#onPointerOut)\n this.addEventListener('focusin', this.#onFocusIn)\n this.addEventListener('focusout', this.#onFocusOut)\n this.#reconcile()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('contextmenu', this.#onContextMenu)\n this.removeEventListener('pointerdown', this.#onPointerDown)\n this.removeEventListener('pointerup', this.#onPointerUp)\n this.removeEventListener('pointercancel', this.#cancelLongPress)\n this.removeEventListener('pointermove', this.#cancelLongPress)\n this.removeEventListener('pointerover', this.#onPointerOver)\n this.removeEventListener('pointerout', this.#onPointerOut)\n this.removeEventListener('focusin', this.#onFocusIn)\n this.removeEventListener('focusout', this.#onFocusOut)\n this.#teardown()\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#reconcile()\n }\n\n #reconcile(): void {\n if (!this.anatomyRoot()) return\n this.#compose()\n this.#wireTrigger()\n if (this.props.open) this.#activate()\n else this.#deactivate(true)\n }\n\n /** The toggle: the built-in trigger, else the trigger slot's first element (the context-mode target). */\n #trigger(): HTMLElement | null {\n const root = this.anatomyRoot()\n if (!root) return null\n const builtIn = root.querySelector('.ty-action-menu__trigger')\n if (builtIn instanceof HTMLElement) return builtIn\n for (const child of Array.from(root.children)) {\n if (child.classList.contains('ty-action-menu')) continue\n if (child instanceof HTMLElement) return child\n }\n return null\n }\n\n #surface(): HTMLElement | null {\n return this.querySelector('.ty-action-menu')\n }\n\n #menu(): HTMLElement | null {\n return this.querySelector('.ty-action-menu__menu')\n }\n\n /** The trigger reflects open state and controls the menu. */\n #wireTrigger(): void {\n const trigger = this.#trigger()\n if (!trigger) return\n trigger.setAttribute('aria-haspopup', 'menu')\n trigger.setAttribute('aria-expanded', this.props.open ? 'true' : 'false')\n const menu = this.#menu()\n if (menu?.id) trigger.setAttribute('aria-controls', menu.id)\n }\n\n /**\n * Compose the rows from the `items` JSON into the anatomy's empty menu.\n * The menu's children are all the element's (the anatomy renders none), so\n * it recomposes freely — but only when the JSON changed or a re-render\n * dropped the rows, so an open menu keeps its focused item.\n */\n #compose(): void {\n const menu = this.#menu()\n if (!menu) return\n const raw = this.getAttribute('items') ?? ''\n const entries = parseItems(raw)\n if (raw === this.#renderedKey && (menu.childElementCount > 0 || entries.length === 0)) return\n const id = this.instanceId\n const rendered: Rendered[] = []\n const nodes: HTMLElement[] = []\n for (const entry of entries) {\n if (entry.type === 'separator') {\n nodes.push(el('div', 'ty-action-menu__separator', { role: 'separator' }))\n continue\n }\n if (entry.type === 'section') {\n const section = el('div', 'ty-action-menu__section', { role: 'group', 'aria-labelledby': `${id}-section-${entry.id}` })\n const title = el('div', 'ty-action-menu__section-title', { id: `${id}-section-${entry.id}` })\n title.textContent = String(entry.title ?? '')\n section.append(title)\n for (const item of entry.items ?? []) section.append(this.#row(item, rendered))\n nodes.push(section)\n continue\n }\n nodes.push(this.#row(entry, rendered))\n }\n menu.replaceChildren(...nodes)\n this.#rendered = rendered\n this.#renderedKey = raw\n }\n\n /** One item row: role menuitem, tone and disabled as data/aria, the icon (SVG from `iconPath`, else the text glyph), label, shortcut hint. */\n #row(item: Item, rendered: Rendered[]): HTMLElement {\n const row = el('div', 'ty-action-menu__item', { role: 'menuitem', tabindex: '-1' })\n row.setAttribute('data-tone', item.tone ?? 'default')\n const disabled = Boolean(item.disabled)\n if (disabled) {\n row.setAttribute('aria-disabled', 'true')\n row.setAttribute('data-disabled', '')\n }\n if (item.iconPath) {\n const icon = el('span', 'ty-action-menu__icon', { 'aria-hidden': 'true' })\n icon.append(iconSvg(item.iconPath))\n row.append(icon)\n } else if (item.icon) {\n const icon = el('span', 'ty-action-menu__icon', { 'aria-hidden': 'true' })\n icon.textContent = item.icon\n row.append(icon)\n }\n const label = el('span', 'ty-action-menu__label')\n label.textContent = String(item.label ?? '')\n row.append(label)\n if (item.shortcut) {\n // Decorative: the shortcut must stay out of the item's accessible\n // name (\"Rename\", not \"Rename F2\").\n const shortcut = el('kbd', 'ty-action-menu__shortcut', { 'aria-hidden': 'true' })\n shortcut.textContent = item.shortcut\n row.append(shortcut)\n }\n rendered.push({ id: String(item.id ?? ''), label: String(item.label ?? ''), disabled, el: row })\n return row\n }\n\n #enabled(): Rendered[] {\n return this.#rendered.filter((r) => !r.disabled)\n }\n\n /** Ask the host to open (controlled); the focus target and origin are remembered for the frame after the flip. */\n #askOpen(focus: 'first' | 'last', origin: HTMLElement | null): void {\n if (this.props.open) return\n this.#pendingFocus = focus\n this.#origin = origin\n this.emit('ty-open-change', { open: true })\n }\n\n /** Ask the host to close; the reason decides whether focus returns to the origin. */\n #askClose(reason: CloseReason): void {\n if (!this.props.open) return\n this.#closeReason = reason\n this.emit('ty-open-change', { open: false })\n }\n\n /** A context request at a viewport point; an open menu re-anchors without asking again. */\n #askContext(point: { x: number; y: number }, origin?: HTMLElement | null): void {\n this.#point = point\n const active = document.activeElement\n this.#origin =\n origin ?? (active instanceof HTMLElement && this.contains(active) && !this.#surface()?.contains(active) ? active : this.#trigger())\n if (this.props.open && this.#controller) {\n this.#place()\n return\n }\n this.#pendingFocus = 'first'\n this.emit('ty-open-change', { open: true })\n }\n\n /** Activate an item: report it and ask to close; a disabled item does neither. */\n #choose(record: Rendered): void {\n if (record.disabled) return\n this.emit('ty-action', { id: record.id })\n this.#askClose('action')\n }\n\n #activate(): void {\n if (this.#controller) return\n const controller = new AbortController()\n this.#controller = controller\n if (!this.#origin) {\n const active = document.activeElement\n this.#origin = active instanceof HTMLElement && this.contains(active) && !this.#surface()?.contains(active) ? active : this.#trigger()\n }\n // A press that starts outside closes; one that starts inside does not.\n document.addEventListener(\n 'pointerdown',\n (event) => {\n if (!this.contains(event.target as Node)) this.#askClose('outside')\n },\n { signal: controller.signal },\n )\n const reposition = () => this.#place()\n window.addEventListener('resize', reposition, { signal: controller.signal })\n window.addEventListener('scroll', reposition, { capture: true, passive: true, signal: controller.signal })\n // The anatomy may land a beat after the `open` attribute (a framework\n // commits children and host attributes separately), so placement and\n // focus wait a frame.\n this.#raf = requestAnimationFrame(() => {\n this.#raf = 0\n if (!this.isConnected || !this.props.open) return\n this.#compose()\n this.#place()\n const surface = this.#surface()\n if (surface) {\n surface.setAttribute('data-entering', '')\n surface.addEventListener('animationend', () => surface.removeAttribute('data-entering'), { once: true })\n }\n const enabled = this.#enabled()\n const pending = this.#pendingFocus\n this.#pendingFocus = 'first'\n if (!enabled.length) this.#menu()?.focus()\n else (pending === 'last' ? enabled[enabled.length - 1]! : enabled[0]!).el.focus()\n })\n }\n\n #deactivate(restoreFocus: boolean): void {\n if (!this.#controller) return\n this.#teardown()\n const reason = this.#closeReason\n this.#closeReason = null\n const origin = this.#origin\n this.#origin = null\n // Escape, an action and a trigger toggle return focus to the origin; an\n // outside press and Tab leave focus where it is going. The return waits\n // a frame: a framework keeps owning focus across the commit that closed\n // the menu (the modal's pattern).\n if (restoreFocus && origin?.isConnected && reason !== 'outside' && reason !== 'tab') {\n requestAnimationFrame(() => {\n if (origin.isConnected) origin.focus()\n })\n }\n }\n\n #teardown(): void {\n this.#controller?.abort()\n this.#controller = null\n if (this.#raf) cancelAnimationFrame(this.#raf)\n this.#raf = 0\n window.clearTimeout(this.#longPress)\n const surface = this.#surface()\n if (surface) {\n surface.removeAttribute('data-entering')\n surface.style.removeProperty('position')\n surface.style.removeProperty('left')\n surface.style.removeProperty('top')\n }\n }\n\n /** The context point: the controlled `position` attribute (\"x,y\"), else the last request's point. */\n #position(): { x: number; y: number } {\n const raw = this.getAttribute('position')\n if (raw) {\n const [x, y] = raw.split(',').map((part) => Number(part.trim()))\n if (Number.isFinite(x) && Number.isFinite(y)) return { x: x!, y: y! }\n }\n return this.#point\n }\n\n #place(): void {\n const surface = this.#surface()\n if (!surface || !this.props.open) return\n const size: Size = { width: surface.offsetWidth, height: surface.offsetHeight }\n const viewport: Size = { width: window.innerWidth, height: window.innerHeight }\n surface.style.position = 'fixed'\n if (this.props.mode === 'context') {\n const point = this.#position()\n // Clamped so the whole menu stays inside the viewport (clampToViewport in ActionMenu.tsx).\n surface.style.left = `${Math.round(Math.max(GUTTER, Math.min(point.x, viewport.width - size.width - GUTTER)))}px`\n surface.style.top = `${Math.round(Math.max(GUTTER, Math.min(point.y, viewport.height - size.height - GUTTER)))}px`\n return\n }\n const trigger = this.#trigger()\n if (!trigger) return\n const rect = trigger.getBoundingClientRect()\n const anchor: Rect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height }\n const placed = place(anchor, size, viewport, 'bottom', 'end', TRIGGER_OFFSET)\n surface.style.left = `${Math.round(placed.x)}px`\n surface.style.top = `${Math.round(placed.y)}px`\n surface.dataset.side = placed.side\n }\n\n #step(delta: 1 | -1): void {\n const items = this.#enabled()\n if (!items.length) return\n const current = items.findIndex((r) => r.el === document.activeElement)\n const next = current === -1 ? (delta === 1 ? 0 : items.length - 1) : (current + delta + items.length) % items.length\n items[next]!.el.focus()\n }\n\n #jump(last: boolean): void {\n const items = this.#enabled()\n ;(last ? items[items.length - 1] : items[0])?.el.focus()\n }\n\n /** Type-ahead: the next enabled item (wrapping, after the current one) whose label starts with the character. */\n #typeahead(char: string): void {\n const items = this.#enabled()\n if (!items.length) return\n const current = items.findIndex((r) => r.el === document.activeElement)\n const needle = char.toLowerCase()\n for (let step = 1; step <= items.length; step++) {\n const candidate = items[(current + step + items.length) % items.length]!\n if (candidate.label.trim().toLowerCase().startsWith(needle)) {\n candidate.el.focus()\n return\n }\n }\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const surface = this.#surface()\n if (surface?.contains(target)) {\n const row = target.closest('.ty-action-menu__item')\n if (row && surface.contains(row)) {\n const record = this.#rendered.find((r) => r.el === row)\n if (record) this.#choose(record)\n }\n return\n }\n if (this.props.mode !== 'trigger') return\n const trigger = this.#trigger()\n if (trigger && (target === trigger || trigger.contains(target))) {\n // The host's own button already handles its activation semantics; the\n // element only asks for the toggle.\n event.preventDefault()\n if (this.props.open) this.#askClose('trigger')\n else this.#askOpen('first', trigger)\n }\n }\n\n #onKeydown = (event: Event): void => {\n const e = event as KeyboardEvent\n this.#keyboard = true\n const target = e.target as Node\n const surface = this.#surface()\n if (this.props.open && surface?.contains(target)) {\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault()\n this.#step(1)\n return\n case 'ArrowUp':\n e.preventDefault()\n this.#step(-1)\n return\n case 'Home':\n e.preventDefault()\n this.#jump(false)\n return\n case 'End':\n e.preventDefault()\n this.#jump(true)\n return\n case 'Enter':\n case ' ': {\n e.preventDefault()\n const record = this.#rendered.find((r) => r.el === document.activeElement)\n if (record) this.#choose(record)\n return\n }\n case 'Escape':\n e.preventDefault()\n e.stopPropagation()\n this.#askClose('escape')\n return\n case 'Tab':\n // Focus moves on naturally; the menu only asks to close.\n this.#askClose('tab')\n return\n default:\n if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {\n e.preventDefault()\n this.#typeahead(e.key)\n }\n return\n }\n }\n if (this.props.mode === 'context' && ((e.shiftKey && e.key === 'F10') || e.key === 'ContextMenu')) {\n e.preventDefault()\n const focused = e.target instanceof HTMLElement ? e.target : this.#trigger()\n const rect = focused?.getBoundingClientRect()\n this.#askContext({ x: rect?.left ?? 0, y: rect?.bottom ?? 0 }, focused)\n return\n }\n if (this.props.mode === 'trigger' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {\n const trigger = this.#trigger()\n if (trigger && (target === trigger || trigger.contains(target))) {\n e.preventDefault()\n this.#askOpen(e.key === 'ArrowUp' ? 'last' : 'first', trigger)\n }\n }\n }\n\n #onContextMenu = (event: Event): void => {\n if (this.props.mode !== 'context') return\n event.preventDefault()\n if (this.#surface()?.contains(event.target as Node)) return\n const e = event as MouseEvent\n this.#askContext({ x: e.clientX, y: e.clientY })\n }\n\n #onPointerDown = (event: Event): void => {\n this.#keyboard = false\n const e = event as PointerEvent\n const target = e.target as Element | null\n const row = typeof target?.closest === 'function' ? target.closest('.ty-action-menu__item') : null\n if (row && this.#surface()?.contains(row)) row.setAttribute('data-pressed', '')\n if (this.props.mode !== 'context' || e.pointerType !== 'touch') return\n if (this.#surface()?.contains(e.target as Node)) return\n const point = { x: e.clientX, y: e.clientY }\n window.clearTimeout(this.#longPress)\n this.#longPress = window.setTimeout(() => this.#askContext(point), LONG_PRESS_MS)\n }\n\n #onPointerUp = (): void => {\n this.#cancelLongPress()\n for (const row of this.#surface()?.querySelectorAll('.ty-action-menu__item[data-pressed]') ?? []) {\n row.removeAttribute('data-pressed')\n }\n }\n\n #cancelLongPress = (): void => {\n window.clearTimeout(this.#longPress)\n }\n\n #onPointerOver = (event: Event): void => {\n const target = event.target as Element | null\n const row = typeof target?.closest === 'function' ? target.closest('.ty-action-menu__item') : null\n if (row && this.#surface()?.contains(row)) row.setAttribute('data-hovered', '')\n }\n\n #onPointerOut = (event: Event): void => {\n const target = event.target as Element | null\n const row = typeof target?.closest === 'function' ? target.closest('.ty-action-menu__item') : null\n if (!row) return\n row.removeAttribute('data-hovered')\n row.removeAttribute('data-pressed')\n }\n\n #onFocusIn = (event: Event): void => {\n const target = event.target as Element | null\n const row = typeof target?.closest === 'function' ? target.closest('.ty-action-menu__item') : null\n if (!row || !this.#surface()?.contains(row)) return\n for (const other of this.#surface()!.querySelectorAll('.ty-action-menu__item[data-focused]')) {\n other.removeAttribute('data-focused')\n other.removeAttribute('data-focus-visible')\n }\n row.setAttribute('data-focused', '')\n if (this.#keyboard) row.setAttribute('data-focus-visible', '')\n }\n\n #onFocusOut = (event: Event): void => {\n const target = event.target as Element | null\n const row = typeof target?.closest === 'function' ? target.closest('.ty-action-menu__item') : null\n if (!row) return\n row.removeAttribute('data-focused')\n row.removeAttribute('data-focus-visible')\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-button>`: the Button's single source (spec: wave-1/button.md). */\nexport const buttonDefinition = {\n tag: 'ty-button',\n name: 'TyButton',\n kind: 'enhancing',\n doc: 'Triggers one action. A native <button> inside, so focus, keyboard activation and form submission are the platform\\'s.',\n props: {\n variant: { type: 'enum', values: ['primary', 'secondary', 'quiet', 'danger'], default: 'secondary', attribute: 'variant', doc: 'Visual weight; at most one primary per view.' },\n size: { type: 'enum', values: ['compact', 'regular', 'large'], default: 'regular', attribute: 'size', doc: 'Height step.' },\n shape: { type: 'enum', values: ['rounded', 'pill', 'circle'], default: 'rounded', attribute: 'shape', doc: '`circle` only for icon-only buttons.' },\n iconOnly: { type: 'boolean', attribute: 'icon-only', doc: 'Hides the label; `accessibleLabel` is then required.' },\n fullWidth: { type: 'boolean', attribute: 'full-width', doc: 'Stretches to the container width.' },\n busy: { type: 'boolean', attribute: 'busy', doc: 'Shows the busy indicator and blocks presses (`aria-busy`, `aria-disabled`).' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n type: { type: 'enum', values: ['button', 'submit', 'reset'], default: 'button', attribute: 'type', doc: 'Native button type; `submit` submits the enclosing form.' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name sent with a submit.' },\n value: { type: 'string', attribute: 'value', doc: 'Form field value sent with a submit.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label; also the tooltip of an icon-only button.' },\n pressed: { type: 'string', attribute: 'pressed', doc: 'A toggle button\\'s state, `true` or `false` (`aria-pressed`); left out for an ordinary button.' },\n expanded: { type: 'string', attribute: 'expanded', doc: '`true` or `false` while the button shows or hides a popup or region (`aria-expanded`).' },\n controls: { type: 'string', attribute: 'controls', doc: 'Id of the element the button controls (`aria-controls`).' },\n haspopup: { type: 'string', attribute: 'haspopup', doc: 'The kind of popup the button opens (`aria-haspopup`: `menu`, `dialog`, `listbox`, …).' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the native button (`data-testid`).' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onClick', doc: 'The native click (not fired while busy or disabled).' }],\n slots: {\n default: { doc: 'The label.' },\n icon: { doc: 'A leading icon (decorative).' },\n 'trailing-icon': { doc: 'A trailing icon (decorative).' },\n },\n anatomy: {\n tag: 'button',\n class: 'ty-button',\n attrs: {\n type: { prop: 'type' },\n name: { prop: 'name' },\n value: { prop: 'value' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n 'aria-busy': { prop: 'busy', kind: 'bool' },\n 'aria-disabled': { prop: 'busy', kind: 'bool' },\n 'aria-label': { prop: 'accessibleLabel' },\n 'aria-pressed': { prop: 'pressed' },\n 'aria-expanded': { prop: 'expanded' },\n 'aria-controls': { prop: 'controls' },\n 'aria-haspopup': { prop: 'haspopup' },\n 'data-testid': { prop: 'testId' },\n title: { prop: 'accessibleLabel', when: ['iconOnly'] },\n 'data-variant': { prop: 'variant' },\n 'data-size': { prop: 'size' },\n 'data-shape': { prop: 'shape' },\n 'data-icon-only': { prop: 'iconOnly', kind: 'flag' },\n 'data-full-width': { prop: 'fullWidth', kind: 'flag' },\n 'data-busy': { prop: 'busy', kind: 'flag' },\n },\n children: [\n { tag: 'span', class: 'ty-button__busy', attrs: { 'aria-hidden': { value: 'true' } }, when: ['busy'] },\n { tag: 'span', class: 'ty-button__icon', attrs: { 'aria-hidden': { value: 'true' } }, when: ['!busy', 'slot:icon'], children: [{ slot: 'icon' }] },\n { tag: 'span', class: 'ty-button__label', when: ['!iconOnly'], children: [{ slot: 'default' }] },\n { tag: 'span', class: 'ty-button__icon', attrs: { 'aria-hidden': { value: 'true' } }, when: ['!iconOnly', 'slot:trailing-icon'], children: [{ slot: 'trailing-icon' }] },\n ],\n },\n examples: [\n { name: 'secondary', props: {}, slots: { default: 'Cancel' } },\n { name: 'primary-large', props: { variant: 'primary', size: 'large' }, slots: { default: 'Save' } },\n { name: 'submit', props: { variant: 'primary', type: 'submit', name: 'intent', value: 'publish' }, slots: { default: 'Publish' } },\n { name: 'busy', props: { variant: 'primary', busy: true }, slots: { default: 'Saving' } },\n { name: 'danger-disabled', props: { variant: 'danger', disabled: true }, slots: { default: 'Delete' } },\n { name: 'icon-only', props: { variant: 'quiet', iconOnly: true, shape: 'circle', accessibleLabel: 'Close' }, slots: { icon: '×' } },\n { name: 'full-width-pill', props: { fullWidth: true, shape: 'pill' }, slots: { default: 'Continue', 'trailing-icon': '→' } },\n { name: 'toggle', props: { variant: 'quiet', pressed: 'false', expanded: 'false', controls: 'panel', haspopup: 'dialog', testId: 'toggle' }, slots: { default: 'Filters' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { buttonDefinition } from './definition.ts'\n\n/**\n * `<ty-button>`. The native button inside does focus, keyboard activation\n * and form submission; the element keeps the variant attributes in step and\n * blocks presses while busy (the button stays focusable, `aria-disabled`).\n */\nexport class TyButtonElement extends TyElement {\n static override definition = buttonDefinition\n\n #guard = (event: Event) => {\n if (!this.hasAttribute('busy')) return\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n\n protected override connected(): void {\n this.addEventListener('click', this.#guard, { capture: true })\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#guard, { capture: true })\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-checkbox>`: the Checkbox's single source (spec: wave-1/checkbox.md). */\nexport const checkboxDefinition = {\n tag: 'ty-checkbox',\n name: 'TyCheckbox',\n kind: 'enhancing',\n doc: 'A labelled choice that submits with its form. A native checkbox inside a <label> row, so labelling, keyboard (Space) and form participation are the platform\\'s. The indicator holds both marks; CSS shows the check while the input is :checked, the minus while it is :indeterminate, so every renderer (and the page before upgrade) shows the right state.',\n props: {\n checked: { type: 'boolean', attribute: 'checked', doc: 'On.' },\n indeterminate: { type: 'boolean', attribute: 'indeterminate', doc: 'Mixed state for \"select all\" rows (the input\\'s `indeterminate` property); cleared by the next toggle.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n required: { type: 'boolean', attribute: 'required', doc: 'Native required; the form will not submit while off.' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name; the value is sent while on.' },\n value: { type: 'string', attribute: 'value', doc: 'Form value sent while on (the browser sends \"on\" without one).' },\n appearance: { type: 'enum', values: ['tile', 'bare'], default: 'tile', attribute: 'appearance', doc: '`tile` draws a surface around the row; `bare` is indicator plus text.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the native checkbox (`data-testid`).' },\n },\n events: [{ type: 'change', kind: 'native', detail: { checked: 'boolean' }, reactProp: 'onChange', doc: 'The native change of the checkbox; `checked` is the new state.' }],\n slots: {\n default: { doc: 'The visible label.' },\n description: { doc: 'A secondary line, announced as the description.' },\n error: { doc: 'The error message; marks the checkbox invalid (`aria-invalid`, `aria-errormessage`).' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-checkbox',\n attrs: {\n 'data-appearance': { prop: 'appearance' },\n },\n children: [\n {\n tag: 'label',\n class: 'ty-checkbox__row',\n attrs: {\n 'data-selected': { prop: 'checked', kind: 'flag' },\n 'data-indeterminate': { prop: 'indeterminate', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n },\n children: [\n {\n tag: 'input',\n class: 'ty-visually-hidden',\n attrs: {\n type: { value: 'checkbox' },\n name: { prop: 'name' },\n value: { prop: 'value' },\n checked: { prop: 'checked', kind: 'boolean-attr' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n required: { prop: 'required', kind: 'boolean-attr' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:default'] },\n 'aria-labelledby': { idref: 'label', when: ['slot:default'] },\n 'aria-describedby': { idref: 'description', when: ['slot:description'] },\n 'aria-invalid': { value: 'true', when: ['slot:error'] },\n 'aria-errormessage': { idref: 'error', when: ['slot:error'] },\n 'data-testid': { prop: 'testId' },\n },\n },\n {\n tag: 'span',\n class: 'ty-checkbox__indicator',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [\n { tag: 'path', class: 'ty-checkbox__check', attrs: { d: { value: 'M20 6 9 17l-5-5' } } },\n { tag: 'path', class: 'ty-checkbox__minus', attrs: { d: { value: 'M5 12h14' } } },\n ],\n },\n ],\n },\n {\n tag: 'span',\n class: 'ty-checkbox__text',\n when: ['slot:default|slot:description'],\n children: [\n { tag: 'span', class: 'ty-checkbox__label', attrs: { id: { idref: 'label' } }, when: ['slot:default'], children: [{ slot: 'default' }] },\n { tag: 'span', class: 'ty-checkbox__description', attrs: { id: { idref: 'description' } }, when: ['slot:description'], children: [{ slot: 'description' }] },\n ],\n },\n ],\n },\n {\n tag: 'p',\n class: 'ty-checkbox__error',\n attrs: { id: { idref: 'error' }, 'aria-live': { value: 'polite' } },\n when: ['slot:error'],\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [\n { tag: 'path', class: 'ty-checkbox__error-glyph', attrs: { d: { value: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20ZM12 8v4M12 16h.01' } } },\n ],\n },\n { tag: 'span', class: 'ty-checkbox__error-text', children: [{ slot: 'error' }] },\n ],\n },\n ],\n },\n examples: [\n { name: 'off', props: {}, slots: { default: 'Notify me' } },\n { name: 'on-with-description', props: { checked: true, name: 'notify', value: 'email' }, slots: { default: 'Notify me', description: 'By email' } },\n { name: 'bare', props: { appearance: 'bare', testId: 'newsletter' }, slots: { default: 'Newsletter' } },\n { name: 'indeterminate', props: { indeterminate: true }, slots: { default: 'Select all' } },\n { name: 'invalid-required', props: { required: true }, slots: { default: 'I accept the terms', error: 'Required' } },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Notifications' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { checkboxDefinition } from './definition.ts'\n\n/**\n * `<ty-checkbox>`. A native checkbox inside a `<label>` row: the label names\n * it, Space toggles it and forms submit it natively. The element reflects the\n * state to the `checked` attribute, mirrors `indeterminate` to the input's\n * property (CSS `:indeterminate` shows the minus mark), clears the mixed\n * state on the next toggle, and follows a form reset.\n */\nexport class TyCheckboxElement extends TyElement {\n static override definition = checkboxDefinition\n\n #form: HTMLFormElement | null = null\n\n get input(): HTMLInputElement | null {\n return this.querySelector('.ty-checkbox__row > input')\n }\n\n #onChange = (event: Event) => {\n const input = this.input\n if (event.target !== input || !input) return\n this.toggleAttribute('checked', input.checked)\n if (this.hasAttribute('indeterminate')) {\n this.removeAttribute('indeterminate')\n input.indeterminate = false\n }\n }\n\n #onReset = () => {\n // The reset runs after the event; read the restored state then.\n setTimeout(() => {\n const input = this.input\n if (input) this.toggleAttribute('checked', input.checked)\n })\n }\n\n #applyIndeterminate() {\n const input = this.input\n if (input) input.indeterminate = this.hasAttribute('indeterminate')\n }\n\n protected override connected(): void {\n this.addEventListener('change', this.#onChange)\n this.#form = this.input?.form ?? null\n this.#form?.addEventListener('reset', this.#onReset)\n this.#applyIndeterminate()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('change', this.#onChange)\n this.#form?.removeEventListener('reset', this.#onReset)\n this.#form = null\n }\n\n protected override changed(): void {\n this.#applyIndeterminate()\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-drawer__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative 24px icon (lucide strokes). */\nconst icon = (children: ElementNode[], className = 'ty-icon'): ElementNode => ({\n tag: 'svg',\n class: className,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/**\n * The close control — always rendered (spec: backdrop, Escape and drag are\n * never the only way out): a quiet, compact, icon-only button, exactly the\n * Button chrome Drawer.tsx composes.\n */\nconst closeButton: ElementNode = {\n tag: 'button',\n class: 'ty-button ty-drawer__close',\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'closeLabel' },\n title: { prop: 'closeLabel' },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n 'data-shape': { value: 'circle' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [icon([glyph('path', { d: 'M18 6 6 18' }), glyph('path', { d: 'm6 6 12 12' })])],\n },\n ],\n}\n\n/** `<ty-drawer>`: the Drawer's single source (spec: wave-1/drawer.md). */\nexport const drawerDefinition = {\n tag: 'ty-drawer',\n name: 'TyDrawer',\n kind: 'enhancing',\n doc: 'Modal panel sliding in from an edge of the viewport for a secondary task: a backdrop, a panel anchored to the bottom (sheet) or end (side panel) edge, a header with the title and an always-present close button, an optional grab handle, a scrolling body and a bottom safe-area inset. Controlled through `open`; the element asks to close with `ty-open-change` (Escape, close button, an allowed backdrop press, a drag past the threshold) and the host flips `open`. Focus moves into the panel on open, is trapped while open, and returns to the invoking element on close; the page behind is inert and does not scroll.',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Shown (controlled). The anatomy stays mounted but `hidden` while closed, so nothing reaches the accessibility tree.' },\n placement: { type: 'enum', values: ['bottom', 'end'], default: 'bottom', attribute: 'placement', doc: 'The edge the panel attaches to; `end` follows the reading direction.' },\n width: { type: 'enum', values: ['medium', 'large', 'wide'], default: 'medium', attribute: 'width', doc: 'Maximum width step of an end-placed panel.' },\n maxHeight: { type: 'string', attribute: 'max-height', doc: 'Maximum height of a bottom-placed panel (a CSS length, e.g. `85dvh`); applied to the panel on upgrade.' },\n showHandle: { type: 'string', attribute: 'show-handle', doc: '`true` or `false`; unset: the grab handle shows on bottom placement.' },\n dismissible: { type: 'string', attribute: 'dismissible', doc: '`true` or `false`; unset (or `true`): a backdrop press and a drag past the threshold dismiss. Escape and the close button always work.' },\n closeLabel: { type: 'string', default: 'Close', attribute: 'close-label', doc: 'Accessible name of the close button.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the dialog when the title slot is empty.' },\n panelTestId: { type: 'string', attribute: 'panel-test-id', doc: 'Test hook on the panel (`data-testid`).' },\n backdropTestId: { type: 'string', attribute: 'backdrop-test-id', doc: 'Test hook on the backdrop (`data-testid`).' },\n },\n events: [\n { type: 'ty-open-change', kind: 'custom', detail: { open: 'boolean' }, reactProp: 'onOpenChange', doc: 'The element asks the host to change visibility — `open: false` on Escape, the close button, an allowed backdrop press or a drag past the threshold. Controlled: the element does not close itself; the host flips `open`.' },\n ],\n slots: {\n title: { doc: 'The visible heading; also the accessible name (`accessibleLabel` when empty).' },\n default: { doc: 'The body; scrolls when long.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-drawer__backdrop',\n // Always rendered (a framework's closed drawer has an anatomy to find);\n // `hidden` while closed, so nothing reaches the accessibility tree.\n attrs: {\n hidden: { value: '', when: ['!open'] },\n 'data-placement': { prop: 'placement' },\n 'data-testid': { prop: 'backdropTestId' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-drawer',\n attrs: {\n 'data-placement': { prop: 'placement' },\n 'data-width': { prop: 'width' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-drawer__dialog',\n attrs: {\n role: { value: 'dialog' },\n 'aria-modal': { value: 'true' },\n tabindex: { value: '-1' },\n 'aria-labelledby': { idref: 'title', when: ['slot:title'] },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:title'] },\n 'data-testid': { prop: 'panelTestId' },\n },\n children: [\n {\n tag: 'header',\n class: 'ty-drawer__header',\n children: [\n {\n tag: 'span',\n class: 'ty-drawer__handle',\n when: ['placement:bottom', '!showHandle:false'],\n attrs: { 'aria-hidden': { value: 'true' } },\n },\n {\n tag: 'h2',\n class: 'ty-drawer__title',\n when: ['slot:title'],\n attrs: { id: { idref: 'title' } },\n children: [{ slot: 'title' }],\n },\n closeButton,\n ],\n },\n {\n tag: 'div',\n class: 'ty-drawer__body',\n when: ['slot:default'],\n children: [{ slot: 'default' }],\n },\n {\n tag: 'div',\n class: 'ty-drawer__inset',\n when: ['placement:bottom'],\n attrs: { 'aria-hidden': { value: 'true' } },\n },\n ],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'closed', props: {}, slots: {} },\n { name: 'bottom', props: { open: true }, slots: { title: 'Language', default: 'Pick a locale.' } },\n { name: 'end-wide', props: { open: true, placement: 'end', width: 'wide' }, slots: { title: 'Run details', default: 'Timeline.' } },\n { name: 'no-handle', props: { open: true, showHandle: 'false' }, slots: { title: 'Filters', default: 'Filter rows.' } },\n { name: 'not-dismissible', props: { open: true, dismissible: 'false' }, slots: { title: 'Required step', default: 'Finish the form.' } },\n { name: 'max-height', props: { open: true, maxHeight: '60dvh' }, slots: { title: 'Shortcuts', default: 'Keys.' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { drawerDefinition } from './definition.ts'\n\n/** Elements that may take keyboard focus inside the panel. */\nconst FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Marker of the elements this element made inert (a host's own inert is left alone). */\nconst INERT_MARK = 'data-ty-drawer-inert'\n\n/** Open drawers share one page scroll lock; the last one to close releases it. */\nlet scrollLocks = 0\n\nconst lockScroll = () => {\n if (++scrollLocks === 1) document.documentElement.setAttribute('data-ty-drawer-open', '')\n}\nconst unlockScroll = () => {\n if (scrollLocks > 0 && --scrollLocks === 0) document.documentElement.removeAttribute('data-ty-drawer-open')\n}\n\n/** Distance (px) or velocity (px/ms) past which a released drag closes the drawer (Drawer.tsx). */\nconst DRAG_DISTANCE = 120\nconst DRAG_VELOCITY = 0.6\n/** Panel travel over which the backdrop fades to its dimmest still-visible opacity. */\nconst DRAG_FADE = 400\n\n/**\n * `<ty-drawer>`. The host framework renders the anatomy (backdrop, panel,\n * header with handle/title/close, body, inset) from the definition while\n * `open`; the element adds the modal behaviour (the same contract as\n * `<ty-modal>`):\n *\n * - **Focus** — on open, focus moves to a `[data-autofocus]` control, else\n * the first tabbable element, else the dialog itself; Tab and Shift+Tab\n * wrap inside the panel; on close, focus returns to the element that had\n * it when the drawer opened.\n * - **Dismissal** — Escape and the close button always ask to close\n * (`ty-open-change`, `open: false`); a backdrop press and a downward drag\n * past the threshold do too, unless `dismissible=\"false\"`. A press that\n * starts inside the panel and is released outside (selecting text) is not\n * a backdrop press.\n * - **Drag** (bottom placement, while dismissible) — pressing the header\n * (the grab area, never a button inside it) starts a drag: the panel\n * follows the pointer down at full speed (`data-dragging`), the backdrop\n * fades with the distance, and a release past 120 px or 0.6 px/ms asks to\n * close; anything else — and a cancelled pointer — snaps back through the\n * panel's CSS transition.\n * - **Isolation** — the page behind is `inert` and does not scroll while\n * open (`data-ty-drawer-open` on the root, a shared counter for stacked\n * drawers).\n *\n * Visibility is controlled: the element never closes itself, the host flips\n * `open`. `max-height` is applied to the panel on upgrade (a bottom\n * placement only). The open animation is `data-entering`, applied after the\n * first frame and removed when it ends.\n */\nexport class TyDrawerElement extends TyElement {\n static override definition = drawerDefinition\n\n #wasOpen = false\n #returnFocus: HTMLElement | null = null\n #inerted: Element[] = []\n #pressOnBackdrop = false\n #drag: { y: number; t: number } | null = null\n\n protected override connected(): void {\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('mousedown', this.#onMousedown)\n this.addEventListener('click', this.#onClick)\n this.addEventListener('pointerdown', this.#onPointerDown)\n this.addEventListener('pointermove', this.#onPointerMove)\n this.addEventListener('pointerup', this.#onPointerUp)\n this.addEventListener('pointercancel', this.#onPointerUp)\n requestAnimationFrame(() => this.#applyMaxHeight())\n if (this.props.open) this.#activate()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('mousedown', this.#onMousedown)\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('pointerdown', this.#onPointerDown)\n this.removeEventListener('pointermove', this.#onPointerMove)\n this.removeEventListener('pointerup', this.#onPointerUp)\n this.removeEventListener('pointercancel', this.#onPointerUp)\n this.#deactivate(true)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n // After the first paint, like the text field's counter: the upgrade\n // never rewrites the rendered anatomy before it can be compared.\n requestAnimationFrame(() => this.#applyMaxHeight())\n if (this.props.open) this.#activate()\n else this.#deactivate(true)\n }\n\n /** `dismissible=\"false\"` keeps the backdrop and drag from closing; Escape and the close button always work. */\n get #dismissible(): boolean {\n return this.getAttribute('dismissible') !== 'false'\n }\n\n #backdrop(): HTMLElement | null {\n return this.querySelector('.ty-drawer__backdrop')\n }\n\n #panel(): HTMLElement | null {\n return this.querySelector('.ty-drawer')\n }\n\n #dialog(): HTMLElement | null {\n return this.querySelector('.ty-drawer__dialog')\n }\n\n /** `max-height` is a CSS length, which attribute bindings cannot carry; the panel gets it here. */\n #applyMaxHeight(): void {\n const panel = this.#panel()\n if (!panel) return\n const value = this.props.placement === 'bottom' ? String(this.props.maxHeight ?? '') : ''\n if (panel.style.maxBlockSize !== value) panel.style.maxBlockSize = value\n }\n\n #activate(): void {\n if (this.#wasOpen) return\n this.#wasOpen = true\n const active = document.activeElement\n this.#returnFocus = active instanceof HTMLElement && !this.contains(active) ? active : null\n lockScroll()\n this.#applyInert()\n // The anatomy may land a beat after the `open` attribute (a framework\n // commits children and host attributes separately), so focus and the\n // entering animation wait a frame.\n requestAnimationFrame(() => {\n if (!this.isConnected || !this.props.open) return\n this.#focusInitial()\n for (const part of this.querySelectorAll('.ty-drawer__backdrop, .ty-drawer')) {\n part.setAttribute('data-entering', '')\n part.addEventListener('animationend', () => part.removeAttribute('data-entering'), { once: true })\n }\n })\n }\n\n #deactivate(restoreFocus: boolean): void {\n if (!this.#wasOpen) return\n this.#wasOpen = false\n this.#endDrag()\n unlockScroll()\n for (const element of this.#inerted) {\n if (element.getAttribute(INERT_MARK) !== null) {\n element.removeAttribute('inert')\n element.removeAttribute(INERT_MARK)\n }\n }\n this.#inerted = []\n const target = this.#returnFocus\n this.#returnFocus = null\n // A framework keeps owning focus across the commit that closed the\n // drawer (React re-focuses what was active before its mutations), so\n // the return waits a frame; an overlay opened in between still wins,\n // its own frame callback running later.\n if (restoreFocus && target?.isConnected) {\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus()\n })\n }\n }\n\n /** Everything between this element and `<body>` gets inert siblings. */\n #applyInert(): void {\n let node: Element | null = this\n while (node && node !== document.body) {\n const parent: Element | null = node.parentElement\n if (!parent) break\n for (const sibling of Array.from(parent.children)) {\n if (sibling === node || sibling.hasAttribute('inert')) continue\n sibling.setAttribute('inert', '')\n sibling.setAttribute(INERT_MARK, '')\n this.#inerted.push(sibling)\n }\n node = parent\n }\n }\n\n #tabbables(): HTMLElement[] {\n const panel = this.#panel()\n if (!panel) return []\n return Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE)).filter((el) => !el.closest('[hidden]'))\n }\n\n #focusInitial(): void {\n const dialog = this.#dialog()\n if (!dialog) return\n const active = document.activeElement\n if (active instanceof HTMLElement && dialog.contains(active)) return\n const chosen = dialog.querySelector<HTMLElement>('[data-autofocus]')\n if (chosen) {\n chosen.focus()\n return\n }\n ;(this.#tabbables()[0] ?? dialog).focus()\n }\n\n /** Ask the host to close; the host flips `open` (controlled visibility). */\n #requestClose(): void {\n this.emit('ty-open-change', { open: false })\n }\n\n #onKeydown = (event: Event): void => {\n const key = (event as KeyboardEvent).key\n if (key === 'Escape') {\n if ((event as KeyboardEvent).isComposing) return\n event.preventDefault()\n event.stopPropagation()\n this.#requestClose()\n return\n }\n if (key !== 'Tab') return\n const tabbables = this.#tabbables()\n const dialog = this.#dialog()\n if (!dialog) return\n event.preventDefault()\n event.stopPropagation()\n const backwards = (event as KeyboardEvent).shiftKey\n if (!tabbables.length) {\n dialog.focus()\n return\n }\n const current = tabbables.indexOf(document.activeElement as HTMLElement)\n const next = current === -1 ? (backwards ? tabbables.length - 1 : 0) : (current + (backwards ? -1 : 1) + tabbables.length) % tabbables.length\n tabbables[next]!.focus()\n }\n\n #onMousedown = (event: Event): void => {\n this.#pressOnBackdrop = event.target === this.#backdrop()\n // Keep focus inside the dialog: a press on the backdrop must not move\n // focus to the body (Escape is listened for on the panel's subtree).\n if (this.#pressOnBackdrop) event.preventDefault()\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const close = target.closest('.ty-drawer__close')\n if (close && this.contains(close)) {\n this.#requestClose()\n return\n }\n if (target === this.#backdrop() && this.#pressOnBackdrop && this.#dismissible) this.#requestClose()\n this.#pressOnBackdrop = false\n }\n\n // --- Drag to dismiss (bottom placement; spec: wave-1/drawer.md) -------\n\n #onPointerDown = (event: Event): void => {\n const pointer = event as PointerEvent\n if (!this.props.open || !this.#dismissible || this.props.placement !== 'bottom') return\n if (pointer.button !== undefined && pointer.button > 0) return\n const header = this.querySelector('.ty-drawer__header')\n const target = pointer.target as Element | null\n if (!header || !target || typeof target.closest !== 'function') return\n // The header is the grab area; a press on a control inside it (the\n // close button) is not a drag.\n if (target.closest('.ty-drawer__header') !== header || target.closest('button')) return\n this.#drag = { y: pointer.clientY, t: pointer.timeStamp || performance.now() }\n header.setPointerCapture?.(pointer.pointerId)\n }\n\n #onPointerMove = (event: Event): void => {\n const drag = this.#drag\n if (!drag) return\n const panel = this.#panel()\n const backdrop = this.#backdrop()\n const distance = Math.max(0, (event as PointerEvent).clientY - drag.y)\n if (panel) {\n panel.style.transition = 'none'\n panel.style.transform = distance > 0 ? `translateY(${distance}px)` : ''\n panel.toggleAttribute('data-dragging', distance > 0)\n }\n if (backdrop) backdrop.style.opacity = String(Math.max(0.2, 1 - distance / DRAG_FADE))\n }\n\n #onPointerUp = (event: Event): void => {\n const drag = this.#drag\n if (!drag) return\n const pointer = event as PointerEvent\n const cancelled = event.type === 'pointercancel'\n const distance = Math.max(0, pointer.clientY - drag.y)\n const elapsed = Math.max(1, (pointer.timeStamp || performance.now()) - drag.t)\n this.#endDrag()\n if (!cancelled && (distance >= DRAG_DISTANCE || distance / elapsed >= DRAG_VELOCITY)) this.#requestClose()\n }\n\n /** End the drag: clearing the inline styles lets the CSS transition snap the panel back. */\n #endDrag(): void {\n this.#drag = null\n const panel = this.#panel()\n if (panel) {\n panel.style.transition = ''\n panel.style.transform = ''\n panel.removeAttribute('data-dragging')\n }\n const backdrop = this.#backdrop()\n if (backdrop) backdrop.style.opacity = ''\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-gradient-mark>`: the GradientMark's single source (element-first; see docs/design/single-source-components.md). */\nexport const gradientMarkDefinition = {\n tag: 'ty-gradient-mark',\n name: 'TyGradientMark',\n kind: 'enhancing',\n doc: 'App-icon style badge: a rounded square filled with the brand gradient, holding an arbitrary glyph (the default slot). Named by `label` (an img role) or decorative without one. The gradient and corner radius default to token values and can be overridden per instance with CSS values.',\n props: {\n label: { type: 'string', attribute: 'label', doc: 'Accessible name; set it and the badge is an img role, leave it out and the badge is decorative (`aria-hidden`).' },\n size: { type: 'enum', values: ['small', 'medium', 'large'], default: 'medium', attribute: 'size', doc: 'Badge size step (24 / 32 / 48 px from the spacing scale).' },\n gradient: { type: 'string', attribute: 'gradient', doc: 'CSS gradient image of the badge (e.g. `linear-gradient(135deg, #e11d48, #7c3aed)`); the default is the token brand gradient (`--ty-info` → `--ty-brand` → `--ty-brand-strong`). Applied as the `--ty-gradient-mark-gradient` custom property when the element upgrades.' },\n radius: { type: 'string', attribute: 'radius', doc: 'CSS corner-radius override (a length or `50%` for a circle); the default is a squircle scaled from the size. Applied as the `--ty-gradient-mark-radius` custom property when the element upgrades.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the badge (`data-testid`).' },\n },\n events: [],\n slots: {\n default: { doc: 'The glyph inside the badge (an icon or an initial); decorative — the badge is named by `label`.' },\n },\n anatomy: {\n tag: 'span',\n class: 'ty-gradient-mark',\n attrs: {\n role: { value: 'img', when: ['label'] },\n 'aria-label': { prop: 'label' },\n 'aria-hidden': { value: 'true', when: ['!label'] },\n 'data-size': { prop: 'size' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n { tag: 'span', class: 'ty-gradient-mark__glyph', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:default'], children: [{ slot: 'default' }] },\n ],\n },\n examples: [\n { name: 'default', props: { label: 'Northstar' }, slots: { default: 'N' } },\n { name: 'small', props: { label: 'Northstar', size: 'small' }, slots: { default: 'N' } },\n { name: 'large', props: { label: 'Northstar', size: 'large' }, slots: { default: 'N' } },\n { name: 'decorative', props: {}, slots: { default: '◆' } },\n { name: 'no-glyph', props: { label: 'Northstar' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { gradientMarkDefinition } from './definition.ts'\n\n/**\n * `<ty-gradient-mark>`. All presentation: the host framework renders the\n * anatomy and the stylesheet draws the token gradient. The element adds what\n * markup cannot: a per-instance `gradient` or `radius` CSS value becomes the\n * badge's custom property on upgrade, so a custom gradient paints while\n * server-rendered markup shows the default token gradient.\n */\nexport class TyGradientMarkElement extends TyElement {\n static override definition = gradientMarkDefinition\n\n override sync(): void {\n super.sync()\n const root = this.anatomyRoot()\n if (!root) return\n this.#customProperty(root, 'gradient', '--ty-gradient-mark-gradient')\n this.#customProperty(root, 'radius', '--ty-gradient-mark-radius')\n }\n\n #customProperty(root: HTMLElement, attribute: string, property: string): void {\n const value = this.getAttribute(attribute)\n if (value === null || value === '') root.style.removeProperty(property)\n else root.style.setProperty(property, value)\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\nconst TONES = ['danger', 'warning', 'info', 'success'] as const\nconst TITLE_TAGS = ['p', 'h2', 'h3', 'h4'] as const\n\nconst pascal = (s: string) => s[0]!.toUpperCase() + s.slice(1)\n\n/** The visually hidden tone word of one tone, in the title or, without a title, in the message. */\nconst toneWordSpans = (withoutTitle: boolean): ElementNode[] =>\n TONES.map((tone) => ({\n tag: 'span',\n class: 'ty-visually-hidden',\n when: withoutTitle ? ['!slot:title', `tone:${tone}`] : [`tone:${tone}`],\n children: [{ text: { prop: `toneWord${pascal(tone)}` } }],\n }))\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-notice__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** The tone's default icon, shown while the icon slot is empty. */\nconst toneIcon = (tone: string, children: ElementNode[]): ElementNode => ({\n tag: 'svg',\n class: 'ty-icon',\n when: ['!slot:icon', `tone:${tone}`],\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\nconst CIRCLE = glyph('circle', { cx: '12', cy: '12', r: '10' })\n\n/** `<ty-inline-notice>`: the InlineNotice's single source (spec: wave-1/inline-notice.md). */\nexport const inlineNoticeDefinition = {\n tag: 'ty-inline-notice',\n name: 'TyInlineNotice',\n kind: 'enhancing',\n doc: 'Short message about the state of a form, section or page. Assertive tones (danger and warning unless `urgency` says otherwise) are `role=\"alert\"`, polite ones `role=\"status\"`; a visually hidden tone word precedes the message. Dismissal is the host\\'s: the element emits `ty-dismiss` and moves focus to the next logical element.',\n props: {\n tone: { type: 'enum', values: TONES, default: 'info', attribute: 'tone', doc: 'Semantic tone; colours the surface and picks the default icon and tone word.' },\n align: { type: 'enum', values: ['start', 'centre'], default: 'start', attribute: 'align', doc: '`centre` only for short single-message confirmations.' },\n urgency: { type: 'enum', values: ['polite', 'assertive', 'none'], attribute: 'urgency', doc: 'How the notice is announced when it appears; unset: assertive for danger and warning, polite otherwise. `none` (no live role) for notices present on page load.' },\n titleAs: { type: 'enum', values: TITLE_TAGS, default: 'p', attribute: 'title-as', doc: 'Element for the title; a plain strong paragraph unless configured.' },\n dismissible: { type: 'boolean', attribute: 'dismissible', doc: 'Shows the dismiss button; the host removes the notice on `ty-dismiss`.' },\n dismissLabel: { type: 'string', attribute: 'dismiss-label', default: 'Dismiss', doc: 'Accessible name of the dismiss button.' },\n toneWordDanger: { type: 'string', attribute: 'tone-word-danger', default: 'Error: ', doc: 'Visually hidden word announced before a danger notice.' },\n toneWordWarning: { type: 'string', attribute: 'tone-word-warning', default: 'Warning: ', doc: 'Visually hidden word announced before a warning notice.' },\n toneWordInfo: { type: 'string', attribute: 'tone-word-info', default: 'Information: ', doc: 'Visually hidden word announced before an info notice.' },\n toneWordSuccess: { type: 'string', attribute: 'tone-word-success', default: 'Success: ', doc: 'Visually hidden word announced before a success notice.' },\n },\n events: [\n { type: 'ty-dismiss', kind: 'custom', reactProp: 'onDismiss', doc: 'The dismiss button was pressed; the host removes the notice. Focus has moved to the next logical element.' },\n ],\n slots: {\n default: { doc: 'The message body.' },\n title: { doc: 'Short heading above the message.' },\n icon: { doc: \"Overrides the tone's icon (decorative).\" },\n actions: { doc: 'Buttons or links below the message (up to two).' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-notice',\n attrs: {\n role: {\n prop: 'urgency',\n kind: 'map',\n values: { assertive: 'alert', polite: 'status' },\n fallback: { prop: 'tone', values: { danger: 'alert', warning: 'alert', info: 'status', success: 'status' } },\n },\n 'data-tone': { prop: 'tone' },\n 'data-align': { prop: 'align' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-notice__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [\n toneIcon('danger', [CIRCLE, glyph('line', { x1: '12', x2: '12', y1: '8', y2: '12' }), glyph('line', { x1: '12', x2: '12.01', y1: '16', y2: '16' })]),\n toneIcon('warning', [\n glyph('path', { d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' }),\n glyph('path', { d: 'M12 9v4' }),\n glyph('path', { d: 'M12 17h.01' }),\n ]),\n toneIcon('info', [CIRCLE, glyph('path', { d: 'M12 16v-4' }), glyph('path', { d: 'M12 8h.01' })]),\n toneIcon('success', [CIRCLE, glyph('path', { d: 'm16 9-5.5 5.5L8 12' })]),\n { slot: 'icon', when: ['slot:icon'] },\n ],\n },\n {\n tag: 'div',\n class: 'ty-notice__body',\n children: [\n ...TITLE_TAGS.map(\n (tag): ElementNode => ({\n tag,\n class: 'ty-notice__title',\n when: ['slot:title', `titleAs:${tag}`],\n children: [...toneWordSpans(false), { slot: 'title' }],\n }),\n ),\n {\n tag: 'div',\n class: 'ty-notice__message',\n children: [...toneWordSpans(true), { slot: 'default' }],\n },\n { tag: 'div', class: 'ty-notice__actions', when: ['slot:actions'], children: [{ slot: 'actions' }] },\n ],\n },\n {\n tag: 'button',\n class: 'ty-button ty-notice__dismiss',\n when: ['dismissible'],\n attrs: {\n type: { value: 'button' },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n 'data-icon-only': { value: '' },\n 'aria-label': { prop: 'dismissLabel' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [glyph('path', { d: 'M18 6 6 18' }), glyph('path', { d: 'm6 6 12 12' })],\n },\n ],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'info', props: {}, slots: { default: 'Unseal the vault to run workflows that use credentials.' } },\n { name: 'danger-title', props: { tone: 'danger' }, slots: { title: 'Vault sealed', default: 'Unseal it to run workflows that use credentials.' } },\n { name: 'warning-heading', props: { tone: 'warning', titleAs: 'h3' }, slots: { title: 'Two sources unavailable', default: 'Results may be incomplete.' } },\n { name: 'success-dismissible', props: { tone: 'success', dismissible: true }, slots: { default: 'Version 12 is live.' } },\n { name: 'centred-actions', props: { align: 'centre', urgency: 'none' }, slots: { default: 'Nothing to review.', actions: 'Help' } },\n { name: 'custom-icon', props: {}, slots: { icon: '★', default: 'Starred runs appear first.' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { inlineNoticeDefinition } from './definition.ts'\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/**\n * `<ty-inline-notice>`. The notice is painted by the stylesheet from\n * `tone`; the element adds dismissal: a press of the dismiss button emits\n * `ty-dismiss` (the host removes the notice) and moves focus to the next\n * logical element, not the document body.\n */\nexport class TyInlineNoticeElement extends TyElement {\n static override definition = inlineNoticeDefinition\n\n #dismiss = (event: Event) => {\n const button = (event.target as Element | null)?.closest?.('.ty-notice__dismiss')\n if (!button || !this.contains(button)) return\n // Focus moves to the next logical element, not the document body.\n const all = Array.from(document.querySelectorAll<HTMLElement>(FOCUSABLE))\n const next =\n all.find((el) => !this.contains(el) && this.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING) ??\n [...all].reverse().find((el) => !this.contains(el)) ??\n null\n this.emit('ty-dismiss')\n if (next) setTimeout(() => next.isConnected && next.focus(), 0)\n }\n\n protected override connected(): void {\n this.addEventListener('click', this.#dismiss)\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#dismiss)\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-link>`: the Link's single source (spec: wave-1/link.md). */\nexport const linkDefinition = {\n tag: 'ty-link',\n name: 'TyLink',\n kind: 'enhancing',\n doc: 'Moves to another location. A native <a> inside, so focus, keyboard activation and opening in a new context are the platform\\'s; an external destination opens in a new context with a safe rel, an icon and a screen-reader hint.',\n props: {\n href: { type: 'string', attribute: 'href', doc: 'Destination. The element is a navigation link; an inline action without one is a plain <button class=\"ty-link\" data-action=\"\">' },\n emphasis: { type: 'enum', values: ['underlined', 'subtle'], default: 'underlined', attribute: 'emphasis', doc: '`subtle` hides the underline at rest (only where the context makes the link obvious).' },\n external: { type: 'boolean', attribute: 'external', doc: 'Opens in a new context with `rel=\"noopener noreferrer\"`, an icon and a screen-reader hint. Inferred on upgrade from absolute URLs to another origin; hosts render it explicitly.' },\n current: { type: 'boolean', attribute: 'current', doc: 'Marks the link as the current page (`aria-current=\"page\"`).' },\n standalone: { type: 'boolean', attribute: 'standalone', doc: 'Standalone links (lists, footers) get a 44 px tall hit area; inline prose links do not.' },\n newTabLabel: { type: 'string', attribute: 'new-tab-label', default: '(opens in a new tab)', doc: 'Screen-reader hint appended to an external link\\'s name on upgrade; translate through this attribute.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when the visible text is not enough (`aria-label`).' },\n describedBy: { type: 'string', attribute: 'described-by', doc: 'Id of an element describing the link (`aria-describedby`).' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onClick', doc: 'The native click of the anchor.' }],\n slots: {\n default: { doc: 'The link text.' },\n },\n anatomy: {\n tag: 'a',\n class: 'ty-link',\n attrs: {\n href: { prop: 'href' },\n target: { value: '_blank', when: ['external'] },\n rel: { value: 'noopener noreferrer', when: ['external'] },\n 'aria-current': { value: 'page', when: ['current'] },\n 'aria-label': { prop: 'accessibleLabel' },\n 'aria-describedby': { prop: 'describedBy' },\n 'data-emphasis': { prop: 'emphasis' },\n 'data-standalone': { prop: 'standalone', kind: 'flag' },\n },\n children: [\n { slot: 'default' },\n {\n tag: 'svg',\n class: 'ty-icon ty-mirror-rtl ty-link__external',\n when: ['external'],\n attrs: {\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n width: { value: '24' },\n height: { value: '24' },\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n },\n children: [\n { tag: 'path', attrs: { d: { value: 'M15 3h6v6' } } },\n { tag: 'path', attrs: { d: { value: 'M10 14 21 3' } } },\n { tag: 'path', attrs: { d: { value: 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6' } } },\n ],\n },\n { tag: 'span', class: 'ty-visually-hidden ty-link__hint', when: ['external'] },\n ],\n },\n examples: [\n { name: 'inline', props: { href: '/runs' }, slots: { default: 'Runs' } },\n { name: 'subtle-standalone', props: { href: '/runs/01HX', emphasis: 'subtle', standalone: true }, slots: { default: 'Details' } },\n { name: 'external', props: { href: 'https://example.org/report', external: true }, slots: { default: 'Report' } },\n { name: 'current', props: { href: '/overview', current: true }, slots: { default: 'Overview' } },\n { name: 'translated-hint', props: { href: 'https://example.org/relatorio', external: true, newTabLabel: '(abre em nova aba)', describedBy: 'report-hint' }, slots: { default: 'Relatório' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport type { Props } from '../definition.ts'\nimport { linkDefinition } from './definition.ts'\n\n/** True for absolute http(s) URLs pointing to another origin (the React Link's `isExternalHref`). */\nfunction isExternalHref(href: string): boolean {\n if (!/^https?:\\/\\//i.test(href)) return false\n try {\n const origin = typeof window !== 'undefined' ? window.location.origin : ''\n return new URL(href).origin !== origin\n } catch {\n return false\n }\n}\n\n/**\n * `<ty-link>`. The native anchor inside does focus, keyboard activation and\n * opening in a new context; the element keeps the bound attributes in step,\n * infers `external` from absolute URLs to another origin (a host renders\n * `external` itself when it knows) and fills the external link's\n * screen-reader hint from `new-tab-label`.\n */\nexport class TyLinkElement extends TyElement {\n static override definition = linkDefinition\n\n override get props(): Props {\n const props = super.props\n if (!this.hasAttribute('external') && typeof props.href === 'string') props.external = isExternalHref(props.href)\n return props\n }\n\n override sync(): void {\n super.sync()\n const hint = this.querySelector('.ty-link__hint')\n if (!hint) return\n const label = this.getAttribute('new-tab-label') ?? String(linkDefinition.props.newTabLabel.default)\n const text = ` ${label}`\n if (hint.textContent !== text) hint.textContent = text\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-modal-dialog__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative 24px icon (lucide strokes). */\nconst icon = (children: ElementNode[], className = 'ty-icon'): ElementNode => ({\n tag: 'svg',\n class: className,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/**\n * The close control: a quiet, compact, icon-only button, exactly the\n * Button chrome ModalDialog.tsx composes (`variant=\"quiet\" size=\"compact\"\n * shape=\"circle\" iconOnly`).\n */\nconst closeButton: ElementNode = {\n tag: 'button',\n class: 'ty-button ty-modal-dialog__close',\n // Unset: shown on a dialog, hidden on an alertdialog. `show-close-button`\n // overrides both ways.\n when: ['!showCloseButton:false', 'showCloseButton:true|!role:alertdialog'],\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'closeLabel' },\n title: { prop: 'closeLabel' },\n disabled: { prop: 'busy', kind: 'boolean-attr' },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n 'data-shape': { value: 'circle' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [icon([glyph('path', { d: 'M18 6 6 18' }), glyph('path', { d: 'm6 6 12 12' })])],\n },\n ],\n}\n\n/** `<ty-modal>`: the ModalDialog's single source (spec: wave-1/modal-dialog.md). */\nexport const modalDefinition = {\n tag: 'ty-modal',\n name: 'TyModal',\n kind: 'enhancing',\n doc: 'Focused modal window for a decision or a short form: a backdrop and a panel (title, optional description, scrolling body, actions row, optional close button). Controlled through `open`; the element asks to close with `ty-open-change` (Escape, the close button, an allowed backdrop press) and the host flips `open`. Focus moves into the panel on open, is trapped while open, and returns to the invoking element on close; the page behind is inert and does not scroll.',\n props: {\n isOpen: { type: 'boolean', attribute: 'open', doc: 'Shown (controlled). The anatomy stays mounted but `hidden` while closed, so nothing reaches the accessibility tree.' },\n width: { type: 'enum', values: ['narrow', 'regular', 'wide', 'xwide'], default: 'regular', attribute: 'width', doc: 'Maximum panel width step.' },\n role: { type: 'enum', values: ['dialog', 'alertdialog'], default: 'dialog', attribute: 'dialog-role', doc: '`alertdialog` for destructive or blocking confirmations: the backdrop never dismisses it and the close button is hidden, unless the props below say otherwise.' },\n dismissOnBackdrop: { type: 'string', attribute: 'dismiss-on-backdrop', doc: '`true` or `false`; unset: the backdrop dismisses a `dialog`, never an `alertdialog`.' },\n showCloseButton: { type: 'string', attribute: 'show-close-button', doc: '`true` or `false`; unset: shown on a `dialog`, hidden on an `alertdialog`.' },\n initialFocus: { type: 'enum', values: ['first', 'title'], default: 'first', attribute: 'initial-focus', doc: 'Where focus lands on open; a `[data-autofocus]` control inside wins either way. Unset on an `alertdialog`: the first action (the least destructive, by convention).' },\n busy: { type: 'boolean', attribute: 'busy', doc: 'An action is pending: closing (Escape, the backdrop, the close button) is disabled and the panel is `aria-busy`.' },\n closeLabel: { type: 'string', default: 'Close', attribute: 'close-label', doc: 'Accessible name of the close button.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the panel when the title slot is empty and no `labelledBy` is given.' },\n labelledBy: { type: 'string', attribute: 'labelled-by', doc: '`aria-labelledby` of the panel (a host that renders its own title element), joined before the title slot\\'s heading.' },\n describedBy: { type: 'string', attribute: 'described-by', doc: '`aria-describedby` of the panel, joined before the description slot\\'s paragraph.' },\n panelTestId: { type: 'string', attribute: 'panel-test-id', doc: 'Test hook on the panel (`data-testid`).' },\n backdropTestId: { type: 'string', attribute: 'backdrop-test-id', doc: 'Test hook on the backdrop (`data-testid`).' },\n },\n events: [\n { type: 'ty-open-change', kind: 'custom', detail: { open: 'boolean' }, reactProp: 'onOpenChange', doc: 'The element asks the host to change visibility — `open: false` on Escape, the close button or an allowed backdrop press. Controlled: the element does not close itself; the host flips `isOpen`.' },\n ],\n slots: {\n title: { doc: 'The accessible name, rendered as the panel\\'s heading (required by the spec; `accessibleLabel` or `labelledBy` names the panel when it is empty).' },\n description: { doc: 'Accessible description under the header.' },\n default: { doc: 'The body; scrolls when long while the header and the actions stay visible.' },\n actions: { doc: 'The actions row (primary last on the end side). Pressing an action runs its own handler; the dialog stays open unless the host flips `isOpen`.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-modal-dialog__backdrop',\n // Always rendered (a framework's closed modal has an anatomy to find);\n // `hidden` while closed, so nothing reaches the accessibility tree.\n attrs: { hidden: { value: '', when: ['!isOpen'] }, 'data-testid': { prop: 'backdropTestId' } },\n children: [\n {\n tag: 'div',\n class: 'ty-modal-dialog',\n attrs: { 'data-width': { prop: 'width' } },\n children: [\n {\n tag: 'div',\n class: 'ty-modal-dialog__panel',\n attrs: {\n role: { prop: 'role' },\n 'aria-modal': { value: 'true' },\n tabindex: { value: '-1' },\n 'aria-labelledby': {\n idrefs: [{ prop: 'labelledBy' }, { id: 'title', when: ['slot:title'] }],\n },\n 'aria-describedby': {\n idrefs: [{ prop: 'describedBy' }, { id: 'description', when: ['slot:description'] }],\n },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:title', '!labelledBy'] },\n 'data-busy': { prop: 'busy', kind: 'flag' },\n 'data-testid': { prop: 'panelTestId' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-modal-dialog__inner',\n attrs: { 'aria-busy': { prop: 'busy', kind: 'bool' } },\n children: [\n {\n tag: 'header',\n class: 'ty-modal-dialog__header',\n // The header holds the title and the close button; with\n // neither there is no header.\n when: ['slot:title|showCloseButton:true|!role:alertdialog', 'slot:title|!showCloseButton:false'],\n children: [\n {\n tag: 'h2',\n class: 'ty-modal-dialog__title',\n when: ['slot:title'],\n attrs: { id: { idref: 'title' }, tabindex: { value: '-1' } },\n children: [{ slot: 'title' }],\n },\n closeButton,\n ],\n },\n {\n tag: 'p',\n class: 'ty-modal-dialog__description',\n when: ['slot:description'],\n attrs: { id: { idref: 'description' } },\n children: [{ slot: 'description' }],\n },\n {\n tag: 'div',\n class: 'ty-modal-dialog__body',\n when: ['slot:default'],\n children: [{ slot: 'default' }],\n },\n {\n tag: 'footer',\n class: 'ty-modal-dialog__actions',\n when: ['slot:actions'],\n children: [{ slot: 'actions' }],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'closed', props: {}, slots: {} },\n { name: 'open', props: { isOpen: true }, slots: { title: 'Delete file?', default: 'This cannot be undone.', actions: 'Delete' } },\n { name: 'open-description', props: { isOpen: true }, slots: { title: 'Invite member', description: 'They get an email with a link.', default: 'Form fields', actions: 'Invite' } },\n { name: 'alertdialog', props: { isOpen: true, role: 'alertdialog' }, slots: { title: 'Discard changes?', default: 'Your edits are not saved.', actions: 'Discard' } },\n { name: 'wide-busy', props: { isOpen: true, width: 'wide', busy: true }, slots: { title: 'Publishing', default: 'Uploading the bundle.' } },\n { name: 'no-close-button', props: { isOpen: true, showCloseButton: 'false' }, slots: { title: 'Terms of service', default: 'Scroll to the end.', actions: 'Accept' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { modalDefinition } from './definition.ts'\n\n/** Elements that may take keyboard focus inside the panel. */\nconst FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Marker of the elements this element made inert (a host's own inert is left alone). */\nconst INERT_MARK = 'data-ty-modal-inert'\n\n/** Open modals share one page scroll lock; the last one to close releases it. */\nlet scrollLocks = 0\n\nconst lockScroll = () => {\n if (++scrollLocks === 1) document.documentElement.setAttribute('data-ty-modal-open', '')\n}\nconst unlockScroll = () => {\n if (scrollLocks > 0 && --scrollLocks === 0) document.documentElement.removeAttribute('data-ty-modal-open')\n}\n\n/**\n * `<ty-modal>`. The host framework renders the anatomy (backdrop, panel,\n * header, body, actions) from the definition while `open`; the element adds\n * the modal behaviour:\n *\n * - **Focus** — on open, focus moves to a `[data-autofocus]` control, else\n * the title (`initial-focus=\"title\"`), else the first tabbable element\n * (an `alertdialog` without `initial-focus` starts on its first action,\n * the least destructive by convention), else the panel itself. Tab and\n * Shift+Tab wrap inside the panel. On close, focus returns to the element\n * that had it when the modal opened.\n * - **Escape** asks to close (`ty-open-change`, `open: false`) unless\n * `busy`; the close button and an allowed backdrop press do the same. A\n * press that starts inside the panel and is released outside (selecting\n * text) does not count as a backdrop press. An `alertdialog` never closes\n * through the backdrop.\n * - **Isolation** — the page behind is `inert` and does not scroll while\n * open (`data-ty-modal-open` on the root, a shared counter for stacked\n * modals).\n *\n * Visibility is controlled: the element never closes itself, the host flips\n * `open` (the spec's `isOpen`/`onOpenChange`). The open animation is\n * `data-entering`, applied after the first frame and removed when it ends.\n */\nexport class TyModalElement extends TyElement {\n static override definition = modalDefinition\n\n #wasOpen = false\n #returnFocus: HTMLElement | null = null\n #inerted: Element[] = []\n #pressOnBackdrop = false\n\n protected override connected(): void {\n this.addEventListener('keydown', this.#onKeydown)\n this.addEventListener('mousedown', this.#onMousedown)\n this.addEventListener('click', this.#onClick)\n if (this.props.isOpen) this.#activate()\n }\n\n protected override disconnected(): void {\n this.removeEventListener('keydown', this.#onKeydown)\n this.removeEventListener('mousedown', this.#onMousedown)\n this.removeEventListener('click', this.#onClick)\n this.#deactivate(true)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n if (this.props.isOpen) this.#activate()\n else this.#deactivate(true)\n }\n\n /** The backdrop press dismisses a dialog unless told otherwise; an alertdialog never. */\n get #dismissOnBackdrop(): boolean {\n const value = this.getAttribute('dismiss-on-backdrop')\n if (value !== null) return value !== 'false'\n return this.props.role !== 'alertdialog'\n }\n\n #activate(): void {\n if (this.#wasOpen) return\n this.#wasOpen = true\n const active = document.activeElement\n this.#returnFocus = active instanceof HTMLElement && !this.contains(active) ? active : null\n lockScroll()\n this.#applyInert()\n // The anatomy may land a beat after the `open` attribute (a framework\n // commits children and host attributes separately), so focus and the\n // entering animation wait a frame.\n requestAnimationFrame(() => {\n if (!this.isConnected || !this.props.isOpen) return\n this.#focusInitial()\n for (const part of this.querySelectorAll('.ty-modal-dialog__backdrop, .ty-modal-dialog')) {\n part.setAttribute('data-entering', '')\n part.addEventListener('animationend', () => part.removeAttribute('data-entering'), { once: true })\n }\n })\n }\n\n #deactivate(restoreFocus: boolean): void {\n if (!this.#wasOpen) return\n this.#wasOpen = false\n unlockScroll()\n for (const element of this.#inerted) {\n if (element.getAttribute(INERT_MARK) !== null) {\n element.removeAttribute('inert')\n element.removeAttribute(INERT_MARK)\n }\n }\n this.#inerted = []\n const target = this.#returnFocus\n this.#returnFocus = null\n // A framework keeps owning focus across the commit that closed the\n // modal (React re-focuses what was active before its mutations), so the\n // return waits a frame; a modal opened in between still wins, its own\n // frame callback running later.\n if (restoreFocus && target?.isConnected) {\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus()\n })\n }\n }\n\n /** Everything between this element and `<body>` gets inert siblings. */\n #applyInert(): void {\n let node: Element | null = this\n while (node && node !== document.body) {\n const parent: Element | null = node.parentElement\n if (!parent) break\n for (const sibling of Array.from(parent.children)) {\n if (sibling === node || sibling.hasAttribute('inert')) continue\n sibling.setAttribute('inert', '')\n sibling.setAttribute(INERT_MARK, '')\n this.#inerted.push(sibling)\n }\n node = parent\n }\n }\n\n #panel(): HTMLElement | null {\n return this.querySelector('.ty-modal-dialog__panel')\n }\n\n #tabbables(): HTMLElement[] {\n const panel = this.#panel()\n if (!panel) return []\n return Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE)).filter((el) => !el.closest('[hidden]'))\n }\n\n #focusInitial(): void {\n const panel = this.#panel()\n if (!panel) return\n const active = document.activeElement\n if (active instanceof HTMLElement && panel.contains(active)) return\n const chosen = panel.querySelector<HTMLElement>('[data-autofocus]')\n if (chosen) {\n chosen.focus()\n return\n }\n if (this.props.initialFocus === 'title') {\n panel.querySelector<HTMLElement>('.ty-modal-dialog__title')?.focus()\n return\n }\n const tabbables = this.#tabbables()\n // An alertdialog without explicit initial focus starts on its first\n // action (the least destructive, by convention).\n if (this.props.role === 'alertdialog' && !this.hasAttribute('initial-focus')) {\n const action = panel.querySelector<HTMLElement>('.ty-modal-dialog__actions button:not([disabled])')\n if (action) {\n action.focus()\n return\n }\n }\n ;(tabbables[0] ?? panel).focus()\n }\n\n /** Ask the host to close; the host flips `open` (controlled visibility). */\n #requestClose(): void {\n if (this.props.busy) return\n this.emit('ty-open-change', { open: false })\n }\n\n #onKeydown = (event: Event): void => {\n const key = (event as KeyboardEvent).key\n if (key === 'Escape') {\n if ((event as KeyboardEvent).isComposing || this.props.busy) return\n event.preventDefault()\n event.stopPropagation()\n this.#requestClose()\n return\n }\n if (key !== 'Tab') return\n const tabbables = this.#tabbables()\n const panel = this.#panel()\n if (!panel) return\n event.preventDefault()\n event.stopPropagation()\n const backwards = (event as KeyboardEvent).shiftKey\n if (!tabbables.length) {\n panel.focus()\n return\n }\n const current = tabbables.indexOf(document.activeElement as HTMLElement)\n const next = current === -1 ? (backwards ? tabbables.length - 1 : 0) : (current + (backwards ? -1 : 1) + tabbables.length) % tabbables.length\n tabbables[next]!.focus()\n }\n\n #onMousedown = (event: Event): void => {\n this.#pressOnBackdrop = event.target === this.querySelector('.ty-modal-dialog__backdrop')\n // Keep focus inside the dialog: a press on the backdrop must not move\n // focus to the body (Escape is listened for on the panel's subtree).\n if (this.#pressOnBackdrop) event.preventDefault()\n }\n\n #onClick = (event: Event): void => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const close = target.closest('.ty-modal-dialog__close')\n if (close && this.contains(close)) {\n this.#requestClose()\n return\n }\n const backdrop = this.querySelector('.ty-modal-dialog__backdrop')\n if (target === backdrop && this.#pressOnBackdrop && this.#dismissOnBackdrop) this.#requestClose()\n this.#pressOnBackdrop = false\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES). */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-popover__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** The built-in info trigger's \"i\" (lucide strokes), used only when the trigger slot is empty. */\nconst infoIcon: ElementNode = {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [\n glyph('circle', { cx: '12', cy: '12', r: '10' }),\n glyph('path', { d: 'M12 16v-4' }),\n glyph('path', { d: 'M12 8h.01' }),\n ],\n}\n\n/**\n * The built-in trigger (only when the trigger slot is empty): a quiet,\n * compact, icon-only button carrying the info glyph — exactly the chrome\n * Popover.tsx composes.\n */\n/** `<ty-popover>`: the Popover's single source (spec: wave-1/popover.md). */\nexport const popoverDefinition = {\n tag: 'ty-popover',\n name: 'TyPopover',\n kind: 'enhancing',\n doc: 'Non-modal floating panel anchored to a trigger, for short explanations or arbitrary small content (help text, a mini form, a brand menu). The trigger is the host\\'s own focusable element in the trigger slot — or the built-in info button when the slot is empty and `triggerLabel` names it. The element wires aria-expanded on the trigger, places the panel with the shared placement model (side preference, collision flip, viewport clamp, arrow inset), and asks to close with `ty-open-change` on Escape, an outside press, or focus leaving the panel; the host flips `open`. Not a focus trap — content that needs one is a dialog, not a popover.',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Shown (controlled). The anatomy stays mounted but `hidden` while closed, so nothing reaches the accessibility tree.' },\n triggerLabel: { type: 'string', attribute: 'trigger-label', doc: 'Accessible name of the built-in info trigger (required when the trigger slot is empty).' },\n title: { type: 'string', attribute: 'title', doc: 'Heading at the top of the panel; also its accessible name.' },\n placement: { type: 'enum', values: ['top', 'end', 'bottom', 'start'], default: 'bottom', attribute: 'placement', doc: 'Preferred side; `start`/`end` follow the reading direction. Flips when there is no room.' },\n align: { type: 'enum', values: ['start', 'center', 'end'], default: 'center', attribute: 'align', doc: 'Alignment along the chosen side.' },\n offset: { type: 'string', default: '2', attribute: 'offset', doc: 'Gap between trigger and panel as a step of the spacing scale (0–9); the arrow\\'s inset is added to it.' },\n showArrow: { type: 'string', attribute: 'show-arrow', doc: '`true` or `false`; unset: the arrow shows.' },\n panelTestId: { type: 'string', attribute: 'panel-test-id', doc: 'Test hook on the panel (`data-testid`).' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the panel when `title` is empty.' },\n },\n events: [\n { type: 'ty-open-change', kind: 'custom', detail: { open: 'boolean' }, reactProp: 'onOpenChange', doc: 'The element asks the host to change visibility — `open: false` on Escape, an outside press or focus leaving the panel, `open: true` on a trigger activation. Controlled: the element does not toggle itself; the host flips `open`.' },\n ],\n slots: {\n trigger: { doc: 'The host\\'s own toggle — any single focusable element; wired to the panel (aria-expanded, activation). Empty: the built-in info button.' },\n default: { doc: 'The panel body.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-popover__anchor',\n attrs: {},\n children: [\n // The trigger slot projects the host\\'s control; the built-in info\n // button stands in when it is empty.\n {\n tag: 'button',\n class: 'ty-button ty-popover__trigger',\n when: ['!slot:trigger'],\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'triggerLabel' },\n 'aria-haspopup': { value: 'dialog' },\n 'data-variant': { value: 'quiet' },\n 'data-size': { value: 'compact' },\n 'data-shape': { value: 'circle' },\n 'data-icon-only': { value: '' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-button__icon',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [infoIcon],\n },\n ],\n },\n { slot: 'trigger', when: ['slot:trigger'] },\n {\n tag: 'div',\n class: 'ty-popover',\n // Always rendered (a framework's closed popover has an anatomy to\n // find); `hidden` while closed, so nothing reaches the tree.\n attrs: {\n hidden: { value: '', when: ['!open'] },\n role: { value: 'dialog' },\n 'data-placement': { prop: 'placement' },\n 'data-testid': { prop: 'panelTestId' },\n },\n children: [\n {\n tag: 'div',\n class: 'ty-popover__arrow',\n when: ['!showArrow:false'],\n attrs: { 'aria-hidden': { value: 'true' } },\n },\n {\n tag: 'div',\n class: 'ty-popover__dialog',\n children: [\n {\n tag: 'h3',\n class: 'ty-popover__title',\n when: ['title'],\n children: [{ text: { prop: 'title' } }],\n },\n {\n tag: 'div',\n class: 'ty-popover__content',\n when: ['slot:default'],\n children: [{ slot: 'default' }],\n },\n ],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'closed', props: { triggerLabel: 'Details' }, slots: {} },\n { name: 'info-open', props: { open: true, triggerLabel: 'About this', title: 'What this means' }, slots: { default: 'A short explanation.' } },\n { name: 'own-trigger', props: { open: true, placement: 'top', align: 'start' }, slots: { trigger: 'Open', default: 'Anchored above, aligned to the start.' } },\n { name: 'no-arrow', props: { open: true, triggerLabel: 'Where', title: 'Somewhere', showArrow: 'false' }, slots: { default: 'Without a pointer.' } },\n { name: 'offset-4', props: { open: true, triggerLabel: 'Gap', title: 'Further away', offset: '4' }, slots: { default: 'A wider gap.' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { popoverDefinition } from './definition.ts'\nimport { physicalSide, place, offsetPx, type Rect, type Size } from './model.ts'\n\n/**\n * `<ty-popover>`. The host framework renders the anatomy (trigger or its\n * slot, panel with arrow/title/body) from the definition; the element adds\n * the behaviour (spec: wave-1/popover.md):\n *\n * - **Trigger wiring** — the trigger slot's first element (or the built-in\n * info button) gets `aria-haspopup=\"dialog\"` and reflects `open` in\n * `aria-expanded`; activating it asks the host to toggle\n * (`ty-open-change`).\n * - **Placement** — the panel is `position: fixed` at the geometry the\n * shared placement model computes from the trigger's rectangle (side\n * preference, collision flip, viewport clamp, arrow inset), recomputed\n * on open, on resize and on scroll.\n * - **Dismissal** — Escape and a press outside ask to close; focus leaving\n * the panel (a Tab past its last control) does too. Not a focus trap:\n * content that needs one is a dialog.\n */\nexport class TyPopoverElement extends TyElement {\n static override definition = popoverDefinition\n\n /** Observed outside-press/focus listeners, for a clean disconnect. */\n #outsideController: AbortController | null = null\n /** The panel's fixed position is recomputed while open. */\n #raf = 0\n\n override connected(): void {\n super.connected?.()\n this.addEventListener('click', this.#onActivate)\n this.addEventListener('keydown', this.#onKeydown)\n if (this.props.open) this.#activate()\n }\n\n override disconnected(): void {\n super.disconnected?.()\n this.removeEventListener('click', this.#onActivate)\n this.removeEventListener('keydown', this.#onKeydown)\n this.#teardown()\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#wireTrigger()\n if (this.props.open) this.#activate()\n else this.#teardown()\n }\n\n /** The control that toggles the panel: the trigger slot's first element, else the built-in info button. */\n #trigger(): HTMLElement | null {\n const slot = this.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n const fromSlot = slot?.assignedElements({ flatten: true })[0]\n const trigger = fromSlot ?? this.querySelector('.ty-popover__trigger')\n return trigger instanceof HTMLElement ? trigger : null\n }\n\n #panel(): HTMLElement | null {\n return this.querySelector('.ty-popover')\n }\n\n /** The trigger reflects open state; the panel's name comes from title or accessibleLabel. */\n #wireTrigger(): void {\n const trigger = this.#trigger()\n const panel = this.#panel()\n if (!trigger || !panel) return\n trigger.setAttribute('aria-haspopup', 'dialog')\n trigger.setAttribute('aria-expanded', this.props.open ? 'true' : 'false')\n if (!panel.getAttribute('aria-label')) {\n const label = String(this.props.title || this.props.accessibleLabel || '')\n if (label) panel.setAttribute('aria-label', label)\n }\n // The panel is controlled by the trigger it belongs to.\n const id = panel.id || (panel.id = `ty-popover-panel-${crypto.randomUUID().slice(0, 8)}`)\n trigger.setAttribute('aria-controls', id)\n }\n\n #onActivate = (event: Event): void => {\n const trigger = this.#trigger()\n if (!trigger || !this.#contains(event.target as Node, trigger)) return\n // The host's own button already handles its activation semantics; the\n // element only asks for the toggle.\n event.preventDefault()\n this.requestOpen(!this.props.open)\n }\n\n #onKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape' || !this.props.open) return\n event.stopPropagation()\n this.requestOpen(false)\n }\n\n /** Ask the host to change visibility (controlled). */\n requestOpen(open: boolean): void {\n this.emit('ty-open-change', { open })\n }\n\n #activate(): void {\n if (this.#outsideController) return\n const controller = new AbortController()\n this.#outsideController = controller\n // A press that starts outside closes; one that starts inside (selecting\n // text) does not.\n document.addEventListener(\n 'pointerdown',\n (event) => {\n if (this.contains(event.target as Node)) return\n this.requestOpen(false)\n },\n { signal: controller.signal },\n )\n // Focus leaving the panel (and not entering the trigger) closes.\n this.addEventListener(\n 'focusout',\n (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null\n if (next && this.contains(next)) return\n this.requestOpen(false)\n },\n { signal: controller.signal },\n )\n const reposition = () => this.#place()\n window.addEventListener('resize', reposition, { signal: controller.signal })\n window.addEventListener('scroll', reposition, { capture: true, passive: true, signal: controller.signal })\n // Place after the anatomy has had its frame (a framework commits\n // children and host attributes separately).\n requestAnimationFrame(() => {\n if (!this.isConnected || !this.props.open) return\n this.#place()\n const panel = this.#panel()\n if (panel) {\n panel.setAttribute('data-entering', '')\n panel.addEventListener('animationend', () => panel.removeAttribute('data-entering'), { once: true })\n }\n })\n }\n\n #teardown(): void {\n this.#outsideController?.abort()\n this.#outsideController = null\n if (this.#raf) cancelAnimationFrame(this.#raf)\n this.#raf = 0\n const panel = this.#panel()\n if (panel) panel.style.removeProperty('inset')\n }\n\n #place(): void {\n const trigger = this.#trigger()\n const panel = this.#panel()\n if (!trigger || !panel) return\n const rect = trigger.getBoundingClientRect()\n const anchor: Rect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height }\n // The panel measures itself at its natural size before placement.\n const style = getComputedStyle(panel)\n const size: Size = {\n width: panel.offsetWidth + Number.parseFloat(style.marginLeft || '0') + Number.parseFloat(style.marginRight || '0'),\n height: panel.offsetHeight + Number.parseFloat(style.marginTop || '0') + Number.parseFloat(style.marginBottom || '0'),\n }\n const viewport: Size = { width: document.documentElement.clientWidth, height: window.innerHeight }\n const rtl = getComputedStyle(this).direction === 'rtl'\n const side = physicalSide(String(this.props.placement || 'bottom'), rtl)\n const offset = offsetPx(Number(this.props.offset ?? 2), this.getAttribute('show-arrow') !== 'false')\n const placed = place(\n anchor,\n size,\n viewport,\n side,\n String(this.props.align || 'center') as 'start' | 'center' | 'end',\n offset,\n )\n this.#raf = requestAnimationFrame(() => {\n panel.style.position = 'fixed'\n panel.style.left = `${Math.round(placed.x)}px`\n panel.style.top = `${Math.round(placed.y)}px`\n panel.style.maxWidth = `${Math.max(0, viewport.width - 32)}px`\n const arrow = panel.querySelector<HTMLElement>('.ty-popover__arrow')\n if (arrow) arrow.dataset.side = placed.side\n panel.dataset.side = placed.side\n })\n }\n\n #contains(node: Node | null, scope: HTMLElement): boolean {\n let current: Node | null = node\n while (current) {\n if (current === scope) return true\n current = current.parentElement ?? (current instanceof HTMLSlotElement ? null : null)\n if (!current && node instanceof Node) {\n // Slotted light DOM resolves through its slot's host.\n const slot = (node as Element).assignedSlot\n if (slot) current = slot\n }\n }\n return false\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-native-select>`: the NativeSelect's single source (spec: wave-1/native-select.md). */\nexport const nativeSelectDefinition = {\n tag: 'ty-native-select',\n name: 'TyNativeSelect',\n kind: 'enhancing',\n doc: 'One value from a short list with the platform select. A native <select> inside, so the picker on touch devices, keyboard, screen-reader support and form participation are the platform\\'s. The options are the host\\'s children.',\n props: {\n value: { type: 'string', attribute: 'value', doc: 'The selected value; the element mirrors it into the control (while the user chooses, the live value is the control\\'s own).' },\n placeholder: { type: 'string', attribute: 'placeholder', doc: 'Text of the empty, disabled first option, shown while nothing is selected.' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name; the selected value is sent.' },\n required: { type: 'boolean', attribute: 'required', doc: 'Native required; the form will not submit while the empty option is the selection.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n invalid: { type: 'boolean', attribute: 'invalid', doc: 'Painted and announced as invalid without an error message (a surrounding field marks it).' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n labelledBy: { type: 'string', attribute: 'labelled-by', doc: '`aria-labelledby` from a surrounding field (used when there is no visible label and no `accessibleLabel`).' },\n describedBy: { type: 'string', attribute: 'described-by', doc: '`aria-describedby` from a surrounding field, joined before the select\\'s own parts.' },\n controlId: { type: 'string', attribute: 'control-id', doc: 'Explicit id of the control (a surrounding field\\'s control id); `<instance>-control` otherwise.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the native select (`data-testid`).' },\n },\n events: [{ type: 'change', kind: 'native', detail: { value: 'string' }, reactProp: 'onChange', doc: 'The native change of the select; `value` is the new value.' }],\n slots: {\n default: { doc: 'The `<option>` and `<optgroup>` children.' },\n label: { doc: 'The visible label above the control.' },\n hint: { doc: 'Help text between the label and the control, announced as the description.' },\n error: { doc: 'The error message; marks the control invalid and is announced.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-native-select',\n attrs: {\n 'data-invalid': { value: '', when: ['invalid|slot:error'] },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n },\n children: [\n {\n tag: 'label',\n class: 'ty-native-select__label',\n when: ['slot:label'],\n attrs: { for: { idref: 'control', prop: 'controlId' } },\n children: [{ slot: 'label' }],\n },\n {\n tag: 'p',\n class: 'ty-native-select__hint',\n when: ['slot:hint'],\n attrs: { id: { idref: 'hint' } },\n children: [{ slot: 'hint' }],\n },\n {\n tag: 'div',\n class: 'ty-native-select__frame',\n children: [\n {\n tag: 'select',\n class: 'ty-native-select__control',\n attrs: {\n id: { idref: 'control', prop: 'controlId' },\n name: { prop: 'name' },\n required: { prop: 'required', kind: 'boolean-attr' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:label'] },\n 'aria-labelledby': { prop: 'labelledBy', when: ['!slot:label', '!accessibleLabel'] },\n 'aria-describedby': {\n idrefs: [\n { prop: 'describedBy' },\n { id: 'hint', when: ['slot:hint'] },\n { id: 'error', when: ['slot:error'] },\n ],\n },\n 'aria-invalid': { value: 'true', when: ['invalid|slot:error'] },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n {\n tag: 'option',\n class: 'ty-native-select__placeholder',\n when: ['placeholder'],\n attrs: {\n label: { prop: 'placeholder' },\n value: { value: '' },\n disabled: { value: 'true' },\n },\n },\n { slot: 'default' },\n ],\n },\n {\n tag: 'svg',\n class: 'ty-icon ty-native-select__chevron',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [{ tag: 'path', class: 'ty-native-select__chevron-path', attrs: { d: { value: 'm6 9 6 6 6-6' } } }],\n },\n ],\n },\n {\n tag: 'p',\n class: 'ty-native-select__error',\n when: ['slot:error'],\n attrs: { id: { idref: 'error' }, role: { value: 'alert' } },\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children: [{ tag: 'path', class: 'ty-native-select__error-glyph', attrs: { d: { value: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20ZM12 8v4M12 16h.01' } } }],\n },\n { tag: 'span', class: 'ty-native-select__error-text', children: [{ slot: 'error' }] },\n ],\n },\n ],\n },\n examples: [\n { name: 'labelled-placeholder', props: { name: 'region', placeholder: 'Choose a region…' }, slots: { label: 'Region', default: 'us-east-1' } },\n { name: 'hint-required-value', props: { name: 'region', required: true, value: 'us-east-1' }, slots: { label: 'Region', hint: 'Where the workflow runs', default: 'us-east-1' } },\n { name: 'invalid-error', props: { name: 'region' }, slots: { label: 'Region', error: 'Pick a region', default: 'us-east-1' } },\n {\n name: 'field-wired',\n props: { controlId: 'field-3-control', describedBy: 'field-3-description field-3-error', invalid: true, required: true, name: 'region', testId: 'region', accessibleLabel: 'Region' },\n slots: { error: 'Required', default: 'us-east-1' },\n },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Region' }, slots: { default: 'us-east-1' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { nativeSelectDefinition } from './definition.ts'\n\n/**\n * `<ty-native-select>`. A native `<select>` inside, so the picker (the\n * platform's own on touch devices), keyboard, screen-reader support and\n * form participation are the platform's; a form reset is native too. The\n * element only mirrors the `value` attribute into the control (a no-op\n * while it already matches, so an open picker is never disturbed); while\n * the user chooses, the live value is the control's own.\n */\nexport class TyNativeSelectElement extends TyElement {\n static override definition = nativeSelectDefinition\n\n get select(): HTMLSelectElement | null {\n return this.querySelector('select')\n }\n\n /** Controlled value in, without disturbing a matching control. */\n #applyValue = () => {\n const select = this.select\n const value = this.getAttribute('value')\n if (select && value !== null && select.value !== value) select.value = value\n }\n\n protected override connected(): void {\n this.#applyValue()\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyValue()\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-separator>`: the Separator's single source (spec: wave-1/separator.md). */\nexport const separatorDefinition = {\n tag: 'ty-separator',\n name: 'TySeparator',\n kind: 'enhancing',\n doc: 'Thin rule between groups of content, optionally with a short caption centred on it (\"or\"). Decorative by default (`aria-hidden`); `semantic` exposes the non-focusable separator role. A captioned rule keeps the caption readable as plain text and the strokes decorative, so it never carries the role.',\n props: {\n orientation: { type: 'enum', values: ['horizontal', 'vertical'], default: 'horizontal', attribute: 'orientation', doc: 'Direction of the rule; vertical takes the height of its row.' },\n emphasis: { type: 'enum', values: ['regular', 'soft'], default: 'regular', attribute: 'emphasis', doc: 'Line strength: `--ty-line` or the fainter `--ty-line-soft`.' },\n semantic: { type: 'boolean', attribute: 'semantic', doc: 'Exposes the separator role (with `aria-orientation`); decorative otherwise.' },\n spacing: { type: 'enum', values: ['none', 'regular', 'roomy'], default: 'regular', attribute: 'spacing', doc: 'Margin step from the spacing scale.' },\n },\n events: [],\n slots: {\n caption: { doc: 'Short text centred on the rule, such as \"or\"; readable plain text between the two decorative strokes.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-separator',\n attrs: {\n role: { value: 'separator', when: ['semantic', '!slot:caption'] },\n 'aria-orientation': { prop: 'orientation', when: ['semantic', '!slot:caption'] },\n 'aria-hidden': { value: 'true', when: ['!semantic', '!slot:caption'] },\n 'data-orientation': { prop: 'orientation' },\n 'data-emphasis': { prop: 'emphasis' },\n 'data-spacing': { prop: 'spacing' },\n 'data-captioned': { value: '', when: ['slot:caption'] },\n },\n children: [\n { tag: 'span', class: 'ty-separator__line', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:caption'] },\n { tag: 'span', class: 'ty-separator__caption', when: ['slot:caption'], children: [{ slot: 'caption' }] },\n { tag: 'span', class: 'ty-separator__line', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:caption'] },\n ],\n },\n examples: [\n { name: 'decorative', props: {}, slots: {} },\n { name: 'semantic', props: { semantic: true }, slots: {} },\n { name: 'semantic-vertical', props: { semantic: true, orientation: 'vertical' }, slots: {} },\n { name: 'soft-roomy', props: { emphasis: 'soft', spacing: 'roomy' }, slots: {} },\n { name: 'caption', props: {}, slots: { caption: 'or' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { separatorDefinition } from './definition.ts'\n\n/**\n * `<ty-separator>`. All presentation: the host framework renders the anatomy\n * (the rule, or two strokes around a readable caption) and the stylesheet\n * draws it, including the forced-colours fallback. Not a widget — no\n * keyboard or events; the base class builds and patches the anatomy for\n * plain-HTML use and keeps the bound attributes in step.\n */\nexport class TySeparatorElement extends TyElement {\n static override definition = separatorDefinition\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/**\n * `<ty-skeleton>`: the Skeleton's single source (spec: wave-1/skeleton.md).\n *\n * Accessibility mirrors the React Skeleton and PageLoadingState: the blocks\n * are decorative, so the anatomy hides them (`aria-hidden` on the content,\n * which the React component carries on the root — here the root also holds\n * the announcement, so the hidden subtree moves one level down). With\n * `label`, the root is `aria-busy` and the label is announced once in a\n * visually-hidden `role=\"status\"`, the PageLoadingState pattern; without it\n * the skeleton is purely decorative and the host announces the loading\n * region itself.\n *\n * The anatomy covers the block level (a single shape, and the stacked-lines\n * container with its first line). The composed `preset`s repeat per `count`\n * and `columns`, which the declarative anatomy cannot express (no dynamic\n * repetition), so the element composes them into the `ty-skeleton-preset`\n * container on upgrade — self-rendering for the preset case, as the theme\n * palette self-renders its composite. For the same reason the element (not\n * the anatomy) repeats stacked lines beyond the first and resolves a custom\n * CSS `width` to `data-width=\"custom\"` plus an inline size. Preset, repeated\n * and custom-width examples therefore stay out of `examples` (the parity\n * renderers could not produce them).\n */\nexport const skeletonDefinition = {\n tag: 'ty-skeleton',\n name: 'TySkeleton',\n kind: 'enhancing',\n doc: 'Content-shaped placeholder, hidden from assistive technology; with `label`, one polite status announces the loading and the region is marked busy. Presets (stats, cards, section-heading, filters, analysis) are composed by the element on upgrade.',\n props: {\n shape: { type: 'enum', values: ['line', 'heading', 'circle', 'rect'], default: 'line', attribute: 'shape', doc: 'Block form: a text line, a heading line, a circle (avatar) or a rectangle (media, a chart).' },\n width: { type: 'string', attribute: 'width', doc: 'Named width (`short`, `medium`, `long`, `full`) or any CSS length; full width when unset. A custom length resolves on upgrade (`data-width=\"custom\"` and an inline size).' },\n lines: { type: 'number', default: 1, attribute: 'lines', doc: 'Stacked text lines for the `line` and `heading` shapes, widths varied automatically (the last is short).' },\n preset: { type: 'enum', values: ['stats', 'cards', 'section-heading', 'filters', 'analysis'], attribute: 'preset', doc: 'A composed skeleton instead of blocks; the element composes it on upgrade.' },\n count: { type: 'number', attribute: 'count', doc: 'Repetitions of the preset (tiles, pills, items); the preset\\'s default when unset.' },\n columns: { type: 'number', attribute: 'columns', doc: 'Grid columns of a tiled preset (1 to 4); the preset\\'s default when unset.' },\n label: { type: 'string', attribute: 'label', doc: 'Announced once in a visually-hidden status while loading, the region marked `aria-busy` (the PageLoadingState pattern); unset, the skeleton is purely decorative and the host announces.' },\n },\n events: [],\n anatomy: {\n tag: 'span',\n class: 'ty-skeleton-root',\n attrs: {\n 'aria-busy': { prop: 'label', kind: 'bool' },\n },\n children: [\n {\n tag: 'span',\n class: 'ty-skeleton-content',\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [\n {\n tag: 'span',\n class: 'ty-skeleton-lines',\n when: ['!preset', 'shape:line|shape:heading'],\n children: [\n { tag: 'span', class: 'ty-skeleton', attrs: { 'data-shape': { prop: 'shape' }, 'data-width': { prop: 'width' } } },\n ],\n },\n {\n tag: 'span',\n class: 'ty-skeleton',\n when: ['!preset', 'shape:circle|shape:rect'],\n attrs: { 'data-shape': { prop: 'shape' }, 'data-width': { prop: 'width' } },\n },\n {\n tag: 'span',\n class: 'ty-skeleton-preset',\n when: ['preset'],\n attrs: { 'data-preset': { prop: 'preset' } },\n },\n ],\n },\n {\n tag: 'span',\n class: 'ty-visually-hidden',\n attrs: { role: { value: 'status' } },\n when: ['label'],\n children: [{ text: { prop: 'label' } }],\n },\n ],\n },\n examples: [\n { name: 'line', props: {}, slots: {} },\n { name: 'heading-short', props: { shape: 'heading', width: 'short' }, slots: {} },\n { name: 'circle', props: { shape: 'circle' }, slots: {} },\n { name: 'rect-medium', props: { shape: 'rect', width: 'medium' }, slots: {} },\n { name: 'announced', props: { label: 'Loading the catalogue' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { skeletonDefinition } from './definition.ts'\n\nconst NAMED_WIDTHS = new Set(['short', 'medium', 'long', 'full'])\n/** Widths of stacked lines, the React Skeleton's `lineCycle`; the last line is always short. */\nconst LINE_CYCLE = ['long', 'full', 'medium']\n\nfunction el(tag: string, className: string, attrs: Record<string, string> = {}): HTMLElement {\n const node = document.createElement(tag)\n node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\nconst repetitions = (count: number | undefined, fallback: number): number => Math.max(0, Math.floor(count ?? fallback))\n\n/**\n * `<ty-skeleton>`. All presentation: the stylesheet draws and pulses the\n * blocks (stopping under reduced motion), and the anatomy — rendered by the\n * host framework or built from plain HTML — carries the single block, the\n * first stacked line and the announcement. The element adds what the\n * declarative anatomy cannot: it repeats stacked lines beyond the first,\n * resolves a custom CSS `width` (`data-width=\"custom\"` plus an inline size)\n * and composes the `preset`s (stats, cards, section-heading, filters,\n * analysis), which repeat per `count`/`columns`.\n *\n * Composition fills containers the anatomy rendered empty or with one\n * template block; the anatomy's own nodes are reused, never moved or\n * replaced, so a framework-rendered tree keeps its nodes. Everything the\n * element composes is inside the `aria-hidden` content: the only announced\n * part is the optional visually-hidden status.\n */\nexport class TySkeletonElement extends TyElement {\n static override definition = skeletonDefinition\n\n override sync(): void {\n super.sync()\n const root = this.anatomyRoot()\n if (!root) return\n const props = this.props\n const preset = props.preset ? String(props.preset) : undefined\n if (preset) {\n const container = root.querySelector('.ty-skeleton-preset')\n // The container's children are all the element's; recompose freely.\n if (container) container.replaceChildren(...this.#preset(preset, num(props.count), num(props.columns)))\n return\n }\n const width = props.width ? String(props.width) : undefined\n const shape = String(props.shape)\n if (shape === 'line' || shape === 'heading') {\n const container = root.querySelector('.ty-skeleton-lines')\n if (!container) return\n const lines = repetitions(num(props.lines), 1) || 1\n if (lines > 1) this.#fillLines(container, lines)\n else {\n // One line: the anatomy's block stays (a framework owns it); drop\n // only the lines the element added.\n while (container.children.length > 1) container.lastElementChild!.remove()\n const block = container.firstElementChild\n if (block instanceof HTMLElement) this.#customWidth(block, width)\n }\n } else {\n const block = root.querySelector('.ty-skeleton-content > .ty-skeleton')\n if (block instanceof HTMLElement) this.#customWidth(block, width)\n }\n }\n\n /** A custom CSS width on an anatomy-rendered block; named widths stay `data-width` only. */\n #customWidth(block: HTMLElement, width: string | undefined): void {\n if (width && !NAMED_WIDTHS.has(width)) {\n block.setAttribute('data-width', 'custom')\n block.style.inlineSize = width\n } else if (block.style.inlineSize) {\n block.style.inlineSize = ''\n }\n }\n\n /** `lines` blocks in the container, reusing the anatomy's first block. */\n #fillLines(container: Element, lines: number): void {\n for (let i = 0; i < lines; i++) {\n const width = i === lines - 1 ? 'short' : LINE_CYCLE[i % LINE_CYCLE.length]!\n let block = container.children[i]\n if (!(block instanceof HTMLElement) || !block.classList.contains('ty-skeleton')) {\n block = el('span', 'ty-skeleton')\n container.append(block)\n }\n block.setAttribute('data-shape', 'line')\n block.setAttribute('data-width', width)\n if (block instanceof HTMLElement) block.style.inlineSize = ''\n }\n while (container.children.length > lines) container.lastElementChild!.remove()\n }\n\n #lines(lines: number): HTMLElement {\n const container = el('span', 'ty-skeleton-lines')\n this.#fillLines(container, lines)\n return container\n }\n\n /** A composed block (the React Skeleton's `Block`: full width when unset). */\n #block(shape: string, width = 'full'): HTMLElement {\n const block = el('span', 'ty-skeleton', { 'data-shape': shape })\n if (NAMED_WIDTHS.has(width)) block.setAttribute('data-width', width)\n else {\n block.setAttribute('data-width', 'custom')\n block.style.inlineSize = width\n }\n return block\n }\n\n #grid(kind: string, columns: number): HTMLElement {\n const grid = el('span', 'ty-skeleton-grid', { 'data-preset': kind })\n grid.style.setProperty('--ty-skeleton-columns', String(columns))\n return grid\n }\n\n /** The preset's subtree, mirroring the React Skeleton's `Preset`. */\n #preset(preset: string, count: number | undefined, columns: number | undefined): HTMLElement[] {\n switch (preset) {\n case 'stats': {\n const n = repetitions(count, 4)\n const grid = this.#grid('stats', columns ?? n)\n for (let i = 0; i < n; i++) {\n const tile = el('span', 'ty-skeleton-tile', { 'data-part': 'stat' })\n tile.append(this.#block('circle'), this.#block('heading', 'medium'), this.#block('line', 'short'))\n grid.append(tile)\n }\n return [grid]\n }\n case 'cards': {\n const n = repetitions(count, 6)\n const grid = this.#grid('cards', columns ?? 3)\n for (let i = 0; i < n; i++) {\n const tile = el('span', 'ty-skeleton-tile', { 'data-part': 'card' })\n tile.append(this.#block('heading', 'long'), this.#lines(2), this.#block('line', 'short'))\n grid.append(tile)\n }\n return [grid]\n }\n case 'section-heading': {\n const row = el('span', 'ty-skeleton-row', { 'data-preset': 'section-heading' })\n const lines = el('span', 'ty-skeleton-lines')\n lines.append(this.#block('heading', 'medium'), this.#block('line', 'long'))\n row.append(this.#block('circle'), lines)\n return [row]\n }\n case 'filters': {\n const n = repetitions(count, 5)\n const row = el('span', 'ty-skeleton-row', { 'data-preset': 'filters' })\n for (let i = 0; i < n; i++) row.append(el('span', 'ty-skeleton ty-skeleton--pill', { 'data-shape': 'pill' }))\n return [row]\n }\n case 'analysis': {\n const n = repetitions(count, 3)\n const tile = el('span', 'ty-skeleton-tile', { 'data-preset': 'analysis' })\n tile.append(this.#block('heading', 'medium'))\n for (let i = 0; i < n; i++) {\n const row = el('span', 'ty-skeleton-row', { 'data-part': 'item' })\n row.append(this.#block('circle'), this.#lines(2))\n tile.append(row)\n }\n return [tile]\n }\n default:\n console.warn(`ty-skeleton: unknown preset \"${preset}\".`)\n return []\n }\n }\n}\n\nfunction num(value: unknown): number | undefined {\n if (value === undefined || value === false || value === '') return undefined\n const n = Number(value)\n return Number.isFinite(n) ? n : undefined\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-spinner>`: the Spinner's single source (spec: wave-1/spinner.md). */\nexport const spinnerDefinition = {\n tag: 'ty-spinner',\n name: 'TySpinner',\n kind: 'enhancing',\n doc: 'Indeterminate work indicator: an indeterminate progressbar named by `label`, drawn as a CSS ring or three pulsing dots (never announced). Under reduced motion the animation stops (the stylesheet) and the element reveals the label as text.',\n props: {\n label: { type: 'string', default: 'Loading', attribute: 'label', doc: 'Accessible name; the visible caption should say the same.' },\n size: { type: 'enum', values: ['small', 'medium', 'large'], default: 'medium', attribute: 'size', doc: 'Diameter step (`small` follows the text size).' },\n shape: { type: 'enum', values: ['ring', 'dots'], default: 'ring', attribute: 'shape', doc: 'The drawing: a border-arc ring or three pulsing dots.' },\n tone: { type: 'enum', values: ['inherit', 'accent', 'on-accent', 'neutral'], default: 'inherit', attribute: 'tone', doc: 'Colour; `inherit` takes the current text colour.' },\n },\n events: [],\n slots: {\n default: { doc: 'The visible label next to the indicator (keep it the same text as `label`; it is decorative, the progressbar is named by `label`).' },\n },\n anatomy: {\n tag: 'span',\n class: 'ty-spinner',\n attrs: {\n role: { value: 'progressbar' },\n 'aria-label': { prop: 'label' },\n 'data-size': { prop: 'size' },\n 'data-shape': { prop: 'shape' },\n 'data-tone': { prop: 'tone' },\n },\n children: [\n { tag: 'span', class: 'ty-spinner__ring', attrs: { 'aria-hidden': { value: 'true' } }, when: ['shape:ring'] },\n {\n tag: 'span',\n class: 'ty-spinner__dots',\n attrs: { 'aria-hidden': { value: 'true' } },\n when: ['shape:dots'],\n children: [\n { tag: 'span', class: 'ty-spinner__dot' },\n { tag: 'span', class: 'ty-spinner__dot' },\n { tag: 'span', class: 'ty-spinner__dot' },\n ],\n },\n { tag: 'span', class: 'ty-spinner__label', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:default'], children: [{ slot: 'default' }] },\n ],\n },\n examples: [\n { name: 'ring', props: {}, slots: {} },\n { name: 'dots-labelled', props: { shape: 'dots', label: 'Saving' }, slots: { default: 'Saving' } },\n { name: 'large-accent', props: { size: 'large', tone: 'accent', label: 'Indexing' }, slots: {} },\n { name: 'small-on-accent', props: { size: 'small', tone: 'on-accent', label: 'Uploading' }, slots: {} },\n { name: 'dots-neutral', props: { shape: 'dots', tone: 'neutral' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { spinnerDefinition } from './definition.ts'\n\n/**\n * `<ty-spinner>`. All presentation: the host framework renders the anatomy\n * (an indeterminate progressbar and its glyph) and the stylesheet draws and\n * animates it. The element adds what markup cannot: it follows\n * `prefers-reduced-motion`, reflecting `data-reduced-motion` on the anatomy\n * root, and — a still indicator says nothing by itself — reveals the label\n * as text while motion is reduced. For an anatomy it built itself (plain\n * HTML) it adds the caption node; a framework-rendered one shows the label\n * through the default slot, so the element never creates a node a framework\n * owns.\n */\nexport class TySpinnerElement extends TyElement {\n static override definition = spinnerDefinition\n\n #media: MediaQueryList | null = null\n #caption: HTMLElement | null = null\n\n #onMedia = () => this.#reflectMotion()\n\n protected override connected(): void {\n this.#media = typeof matchMedia === 'undefined' ? null : matchMedia('(prefers-reduced-motion: reduce)')\n this.#media?.addEventListener('change', this.#onMedia)\n this.#reflectMotion()\n }\n\n protected override disconnected(): void {\n this.#media?.removeEventListener('change', this.#onMedia)\n this.#media = null\n }\n\n protected override changed(): void {\n this.#reflectMotion()\n }\n\n #reflectMotion(): void {\n const root = this.anatomyRoot()\n if (!root) return\n const reduced = this.#media?.matches ?? false\n root.toggleAttribute('data-reduced-motion', reduced)\n if (!this.owned) return\n const labelled = root.querySelector(':scope > .ty-spinner__label') !== null\n if (reduced && !labelled) {\n if (!this.#caption?.isConnected) {\n this.#caption = document.createElement('span')\n this.#caption.className = 'ty-spinner__label'\n this.#caption.setAttribute('aria-hidden', 'true')\n }\n this.#caption.textContent = String(this.props.label ?? '')\n root.append(this.#caption)\n } else if (!reduced && this.#caption) {\n this.#caption.remove()\n this.#caption = null\n }\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-status-pill>`: the StatusPill's single source (spec: wave-1/status-pill.md). */\nexport const statusPillDefinition = {\n tag: 'ty-status-pill',\n name: 'TyStatusPill',\n kind: 'enhancing',\n doc: 'Current state of an item as icon, word and semantic tone. Nothing interactive inside; a known `status` takes its tone and busy state from the element\\'s status map unless `tone` overrides.',\n props: {\n status: { type: 'string', attribute: 'status', doc: 'The status key (`data-status`); the built-in map colours the common ones (`pending`, `approved`, `processing`, …) while `tone` is absent.' },\n tone: { type: 'enum', values: ['neutral', 'info', 'success', 'warning', 'danger'], attribute: 'tone', doc: 'The semantic tone (`data-tone`); left out, the status map decides (server renderings pass it themselves).' },\n size: { type: 'enum', values: ['small', 'regular'], default: 'regular', attribute: 'size', doc: 'Pill size.' },\n busy: { type: 'boolean', attribute: 'busy', doc: 'In-progress: the icon spins (static under reduced motion).' },\n announce: { type: 'boolean', attribute: 'announce', doc: 'Announce changes politely (`role=\"status\"`); off by default, so tables of pills create no live regions.' },\n label: { type: 'string', attribute: 'label', doc: 'Plain-HTML label text; the default slot (what frameworks render) wins, then the status map\\'s label, then the status key.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the pill (`aria-label`), e.g. \"Status: Running\" on an announced badge.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the pill (`data-testid`).' },\n },\n events: [],\n slots: {\n default: { doc: 'The status word.' },\n icon: { doc: 'The status icon (decorative); spins while busy.' },\n },\n anatomy: {\n tag: 'span',\n class: 'ty-status',\n attrs: {\n role: { value: 'status', when: ['announce'] },\n 'aria-label': { prop: 'accessibleLabel' },\n 'data-tone': { prop: 'tone' },\n 'data-size': { prop: 'size' },\n 'data-busy': { prop: 'busy', kind: 'flag' },\n 'data-status': { prop: 'status' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n { tag: 'span', class: 'ty-status__icon', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:icon'], children: [{ slot: 'icon' }] },\n { tag: 'span', class: 'ty-status__label', children: [{ slot: 'default' }] },\n ],\n },\n examples: [\n { name: 'success', props: { status: 'active', tone: 'success' }, slots: { default: 'Active', icon: '✓' } },\n { name: 'busy-info', props: { status: 'processing', tone: 'info', busy: true }, slots: { default: 'Processing', icon: '↻' } },\n { name: 'small-warning', props: { status: 'pending', tone: 'warning', size: 'small' }, slots: { default: 'Pending' } },\n { name: 'announced-danger', props: { status: 'error', tone: 'danger', announce: true, accessibleLabel: 'Status: Error', testId: 'status-badge-error' }, slots: { default: 'Error' } },\n { name: 'unknown-neutral', props: { status: 'archived' }, slots: { default: 'archived' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { statusPillDefinition } from './definition.ts'\n\n/**\n * The tone, busy state and English default label of each common status —\n * the React StatusPill's `builtInStatusMap` (whose labels come from the\n * messages catalogue). The map is runtime behaviour: a server rendering\n * (React SSR) passes `tone` and the label itself, and the map\n * only fills in what the host left out.\n */\nconst STATUS_MAP: Record<string, { tone: string; busy?: boolean; label: string }> = {\n pending: { tone: 'warning', label: 'Pending' },\n approved: { tone: 'success', label: 'Approved' },\n rejected: { tone: 'danger', label: 'Rejected' },\n active: { tone: 'success', label: 'Active' },\n inactive: { tone: 'neutral', label: 'Inactive' },\n processing: { tone: 'info', busy: true, label: 'Processing' },\n error: { tone: 'danger', label: 'Error' },\n success: { tone: 'success', label: 'Success' },\n}\n\n/**\n * `<ty-status-pill>`. Nothing interactive: the element applies the status\n * map to what the host left out (an explicit `tone` or `busy` wins) and,\n * built from plain HTML, fills an empty label from the `label` attribute,\n * the map's label or the status key. A framework-rendered label is never\n * touched — the framework owns it.\n */\nexport class TyStatusPillElement extends TyElement {\n static override definition = statusPillDefinition\n\n override sync(): void {\n super.sync()\n const root = this.anatomyRoot()\n if (!root) return\n const status = this.getAttribute('status') ?? ''\n const entry = STATUS_MAP[status]\n if (entry && !this.hasAttribute('tone')) root.setAttribute('data-tone', entry.tone)\n if (entry?.busy) root.setAttribute('data-busy', '')\n if (!entry && status && !this.hasAttribute('label')) {\n console.warn(`ty-status-pill: unknown status \"${status}\"; showing it as a neutral pill.`)\n }\n if (this.owned) {\n const label = root.querySelector('.ty-status__label')\n if (label && !(label.textContent ?? '').trim()) {\n label.textContent = this.getAttribute('label') || entry?.label || status\n }\n }\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-surface>`: the Surface's single source (spec: wave-1/surface.md). */\nexport const surfaceDefinition = {\n tag: 'ty-surface',\n name: 'TySurface',\n kind: 'enhancing',\n doc: 'Bounded container at a chosen elevation. A titled surface is a region named by its title; a pressable one forwards presses anywhere on it to the single primary control in the title (a link with `href`, a button otherwise).',\n props: {\n elevation: { type: 'enum', values: ['sheet', 'raised', 'floating', 'flat'], default: 'sheet', attribute: 'elevation', doc: 'Level 1 (sheet glass), 2 (raised card), 3 (floating) or 0 (flat).' },\n padding: { type: 'enum', values: ['none', 'regular', 'roomy'], default: 'regular', attribute: 'padding', doc: 'Internal padding step.' },\n titleLevel: { type: 'enum', values: ['h2', 'h3', 'h4'], default: 'h3', attribute: 'title-level', doc: 'Heading level of the title.' },\n pressable: { type: 'boolean', attribute: 'pressable', doc: 'The whole surface is one press target that forwards to the title\\'s primary control; set it when `onclick` is wired. Implied by `href`.' },\n href: { type: 'string', attribute: 'href', doc: 'Makes the surface a whole-card link: the title\\'s primary control is an anchor and its hit area stretches over the card.' },\n selected: { type: 'boolean', attribute: 'selected', doc: 'A chosen card (accent-soft state).' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Pressable surfaces only: inert primary control, no forwarding.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name of the region when there is no visible title.' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onClick', doc: 'A press of the primary control (directly, or forwarded from anywhere on the surface).' }],\n slots: {\n default: { doc: 'The body.' },\n title: { doc: 'The header title (a heading). Required on a pressable surface: it holds the primary control.' },\n description: { doc: 'A secondary line under the title.' },\n footer: { doc: 'The footer region, usually actions.' },\n },\n anatomy: {\n tag: 'section',\n class: 'ty-surface',\n attrs: {\n 'aria-labelledby': { idref: 'title', when: ['slot:title'] },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:title'] },\n 'data-elevation': { prop: 'elevation' },\n 'data-padding': { prop: 'padding' },\n 'data-pressable': { value: '', when: ['pressable|href'] },\n 'data-selected': { prop: 'selected', kind: 'flag' },\n 'data-disabled': { value: '', when: ['pressable|href', 'disabled'] },\n },\n children: [\n {\n tag: 'header',\n class: 'ty-surface__header',\n when: ['slot:title|slot:description'],\n children: [\n {\n tag: 'h2',\n class: 'ty-surface__title',\n attrs: { id: { idref: 'title' } },\n when: ['slot:title', 'titleLevel:h2'],\n children: [\n { tag: 'a', class: 'ty-surface__primary', when: ['href'], attrs: { href: { prop: 'href', when: ['!disabled'] }, 'aria-disabled': { prop: 'disabled', kind: 'bool' } }, children: [{ slot: 'title' }] },\n { tag: 'button', class: 'ty-surface__primary', when: ['!href', 'pressable'], attrs: { type: { value: 'button' }, disabled: { prop: 'disabled', kind: 'boolean-attr' } }, children: [{ slot: 'title' }] },\n { slot: 'title', when: ['!href', '!pressable'] },\n ],\n },\n {\n tag: 'h3',\n class: 'ty-surface__title',\n attrs: { id: { idref: 'title' } },\n when: ['slot:title', 'titleLevel:h3'],\n children: [\n { tag: 'a', class: 'ty-surface__primary', when: ['href'], attrs: { href: { prop: 'href', when: ['!disabled'] }, 'aria-disabled': { prop: 'disabled', kind: 'bool' } }, children: [{ slot: 'title' }] },\n { tag: 'button', class: 'ty-surface__primary', when: ['!href', 'pressable'], attrs: { type: { value: 'button' }, disabled: { prop: 'disabled', kind: 'boolean-attr' } }, children: [{ slot: 'title' }] },\n { slot: 'title', when: ['!href', '!pressable'] },\n ],\n },\n {\n tag: 'h4',\n class: 'ty-surface__title',\n attrs: { id: { idref: 'title' } },\n when: ['slot:title', 'titleLevel:h4'],\n children: [\n { tag: 'a', class: 'ty-surface__primary', when: ['href'], attrs: { href: { prop: 'href', when: ['!disabled'] }, 'aria-disabled': { prop: 'disabled', kind: 'bool' } }, children: [{ slot: 'title' }] },\n { tag: 'button', class: 'ty-surface__primary', when: ['!href', 'pressable'], attrs: { type: { value: 'button' }, disabled: { prop: 'disabled', kind: 'boolean-attr' } }, children: [{ slot: 'title' }] },\n { slot: 'title', when: ['!href', '!pressable'] },\n ],\n },\n { tag: 'div', class: 'ty-surface__description', when: ['slot:description'], children: [{ slot: 'description' }] },\n ],\n },\n { tag: 'div', class: 'ty-surface__body', when: ['slot:default'], children: [{ slot: 'default' }] },\n { tag: 'footer', class: 'ty-surface__footer', when: ['slot:footer'], children: [{ slot: 'footer' }] },\n ],\n },\n examples: [\n { name: 'sheet', props: {}, slots: { title: 'Runs', description: 'Last 24 hours', default: 'Body' } },\n { name: 'raised-roomy', props: { elevation: 'raised', padding: 'roomy' }, slots: { default: 'Body' } },\n { name: 'flat-none-footer', props: { elevation: 'flat', padding: 'none' }, slots: { default: 'Body', footer: 'Actions' } },\n { name: 'pressable', props: { pressable: true }, slots: { title: 'Open workflow', default: 'Body' } },\n { name: 'link-selected', props: { href: '/runs/1', selected: true }, slots: { title: 'Nightly sync', default: 'Body' } },\n { name: 'pressable-disabled', props: { pressable: true, disabled: true }, slots: { title: 'Archived', default: 'Body' } },\n { name: 'title-level', props: { titleLevel: 'h2' }, slots: { title: 'Settings' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { surfaceDefinition } from './definition.ts'\n\nconst INTERACTIVE = 'a[href],button,input,select,textarea,summary,[role=\"button\"],[role=\"link\"],[role=\"checkbox\"],[role=\"switch\"],[tabindex]:not([tabindex=\"-1\"])'\n\n/**\n * `<ty-surface>`. The anatomy is purely presentational; the behaviour the\n * element adds is the pressable card: a press anywhere on the surface,\n * outside a nested control and outside a text selection, is forwarded to\n * the title's primary control (the link with `href`, the button otherwise),\n * so keyboard activation and context menus stay that control's own.\n */\nexport class TySurfaceElement extends TyElement {\n static override definition = surfaceDefinition\n\n get primary(): HTMLElement | null {\n return this.querySelector('.ty-surface__primary')\n }\n\n #pressable(): boolean {\n return this.hasAttribute('pressable') || this.hasAttribute('href')\n }\n\n #onClick = (event: MouseEvent) => {\n const primary = this.primary\n if (!this.#pressable() || this.hasAttribute('disabled') || !primary || !(event.target instanceof Element)) return\n if (primary.contains(event.target)) return\n const interactive = event.target.closest(INTERACTIVE)\n if (interactive && this.contains(interactive)) return\n if (typeof window !== 'undefined' && window.getSelection?.()?.toString()) return\n primary.click()\n }\n\n protected override connected(): void {\n if (this.#pressable() && !this.primary) console.warn('<ty-surface>: a pressable surface needs a title, which becomes its primary control.')\n this.addEventListener('click', this.#onClick)\n }\n\n protected override disconnected(): void {\n this.removeEventListener('click', this.#onClick)\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-switch>`: the Switch's single source (spec: wave-1/switch.md). */\nexport const switchDefinition = {\n tag: 'ty-switch',\n name: 'TySwitch',\n kind: 'enhancing',\n doc: 'On/off setting with immediate effect. A native checkbox with role=\"switch\" inside a <label>, so labelling, keyboard and form participation are the platform\\'s; Enter toggles as well as Space.',\n props: {\n checked: { type: 'boolean', attribute: 'checked', doc: 'On.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n readOnly: { type: 'boolean', attribute: 'read-only', doc: 'Shown but not changeable (`aria-readonly`).' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name; the value is sent while on.' },\n value: { type: 'string', attribute: 'value', doc: 'Form value sent while on (the browser sends \"on\" without one).' },\n size: { type: 'enum', values: ['small', 'regular', 'large'], default: 'regular', attribute: 'size', doc: 'Track size.' },\n layout: { type: 'enum', values: ['inline', 'tile'], default: 'inline', attribute: 'layout', doc: '`tile`: text at the start, control at the end, the whole row is the target.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the native checkbox (`data-testid`).' },\n },\n events: [{ type: 'change', kind: 'native', detail: { checked: 'boolean' }, reactProp: 'onChange', doc: 'The native change of the checkbox; `checked` is the new state.' }],\n slots: {\n default: { doc: 'The visible label.' },\n description: { doc: 'A secondary line, announced as the description.' },\n },\n anatomy: {\n tag: 'label',\n class: 'ty-switch',\n attrs: {\n 'data-layout': { prop: 'layout' },\n 'data-size': { prop: 'size' },\n 'data-selected': { prop: 'checked', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n 'data-readonly': { prop: 'readOnly', kind: 'flag' },\n },\n children: [\n {\n tag: 'input',\n class: 'ty-visually-hidden',\n attrs: {\n type: { value: 'checkbox' },\n role: { value: 'switch' },\n name: { prop: 'name' },\n value: { prop: 'value' },\n checked: { prop: 'checked', kind: 'boolean-attr' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n 'aria-readonly': { prop: 'readOnly', kind: 'bool' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:default'] },\n 'aria-labelledby': { idref: 'label', when: ['slot:default'] },\n 'aria-describedby': { idref: 'description', when: ['slot:description'] },\n 'data-testid': { prop: 'testId' },\n },\n },\n { tag: 'span', class: 'ty-switch__track', attrs: { 'aria-hidden': { value: 'true' } }, children: [{ tag: 'span', class: 'ty-switch__thumb' }] },\n {\n tag: 'span',\n class: 'ty-switch__text',\n when: ['slot:default|slot:description'],\n children: [\n { tag: 'span', class: 'ty-switch__label', attrs: { id: { idref: 'label' } }, when: ['slot:default'], children: [{ slot: 'default' }] },\n { tag: 'span', class: 'ty-switch__description', attrs: { id: { idref: 'description' } }, when: ['slot:description'], children: [{ slot: 'description' }] },\n ],\n },\n ],\n },\n examples: [\n { name: 'off', props: {}, slots: { default: 'Autosave' } },\n { name: 'on-with-description', props: { checked: true, name: 'autosave' }, slots: { default: 'Autosave', description: 'Save every change' } },\n { name: 'tile-large', props: { layout: 'tile', size: 'large', value: 'yes', testId: 'notifications' }, slots: { default: 'Notifications' } },\n { name: 'read-only', props: { checked: true, readOnly: true }, slots: { default: 'Managed by your organization' } },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Dark mode' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { switchDefinition } from './definition.ts'\n\n/**\n * `<ty-switch>`. A native checkbox with `role=\"switch\"` inside a `<label>`:\n * the label names it, Space toggles it and forms submit it natively. The\n * element adds Enter (parity with the React Switch), keeps it unchangeable\n * while read-only, reflects the state to the `checked` attribute (and so to\n * `data-selected`), and follows a form reset.\n */\nexport class TySwitchElement extends TyElement {\n static override definition = switchDefinition\n\n #form: HTMLFormElement | null = null\n\n get input(): HTMLInputElement | null {\n return this.querySelector('input[role=\"switch\"]')\n }\n\n #locked(): boolean {\n return this.hasAttribute('disabled') || this.hasAttribute('read-only')\n }\n\n #onKey = (event: KeyboardEvent) => {\n const input = this.input\n if (!input || event.key !== 'Enter' || event.target !== input || this.#locked()) return\n event.preventDefault()\n input.click()\n }\n\n #onClick = (event: Event) => {\n if (event.target === this.input && this.hasAttribute('read-only')) event.preventDefault()\n }\n\n #onChange = (event: Event) => {\n const input = this.input\n if (event.target !== input || !input) return\n this.toggleAttribute('checked', input.checked)\n }\n\n #onReset = () => {\n // The reset runs after the event; read the restored state then.\n setTimeout(() => {\n const input = this.input\n if (input) this.toggleAttribute('checked', input.checked)\n })\n }\n\n protected override connected(): void {\n this.addEventListener('keydown', this.#onKey)\n this.addEventListener('click', this.#onClick)\n this.addEventListener('change', this.#onChange)\n this.#form = this.input?.form ?? null\n this.#form?.addEventListener('reset', this.#onReset)\n }\n\n protected override disconnected(): void {\n this.removeEventListener('keydown', this.#onKey)\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('change', this.#onChange)\n this.#form?.removeEventListener('reset', this.#onReset)\n this.#form = null\n }\n\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-tag>`: the Tag's single source (spec: wave-1/tag.md). */\nexport const tagDefinition = {\n tag: 'ty-tag',\n name: 'TyTag',\n kind: 'enhancing',\n doc: 'Small label for static metadata (a badge or chip), optionally removable; the remove button is a native <button>. An interactive tag (pressable or a link) is a plain styled native — <button class=\"ty-tag\" data-interactive> or <a class=\"ty-tag\" href> — not this element (see docs/html-contract.md).',\n props: {\n tone: { type: 'enum', values: ['neutral', 'accent'], default: 'neutral', attribute: 'tone', doc: '`accent` fills with the theme accent.' },\n categoryIndex: { type: 'number', attribute: 'category-index', doc: 'A categorical token (1 to 8) shown as a small colour square; normalised into range on upgrade.' },\n size: { type: 'enum', values: ['small', 'regular', 'large'], default: 'regular', attribute: 'size', doc: 'Text step; `small` never goes below the meta size.' },\n removable: { type: 'boolean', attribute: 'removable', doc: 'Shows the remove button at the end.' },\n removeLabel: { type: 'string', attribute: 'remove-label', doc: 'Accessible name of the remove button; must include the tag text (defaults to \"Remove <text>\" on upgrade).' },\n live: { type: 'boolean', attribute: 'live', doc: 'A polite live region (`role=\"status\"`) for a tag whose text updates dynamically.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the tag (`data-testid`).' },\n },\n events: [{ type: 'click', kind: 'native', reactProp: 'onClick', doc: 'The remove button\\'s native click (wired on that button).' }],\n slots: {\n default: { doc: 'The text; truncates with an ellipsis.' },\n icon: { doc: 'A leading icon (decorative); wins over the category square.' },\n },\n anatomy: {\n tag: 'span',\n class: 'ty-tag',\n attrs: {\n role: { value: 'status', when: ['live'] },\n 'aria-live': { value: 'polite', when: ['live'] },\n 'data-tone': { prop: 'tone' },\n 'data-size': { prop: 'size' },\n 'data-removable': { prop: 'removable', kind: 'flag' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n { tag: 'span', class: 'ty-tag__icon', attrs: { 'aria-hidden': { value: 'true' } }, when: ['slot:icon'], children: [{ slot: 'icon' }] },\n { tag: 'span', class: 'ty-tag__swatch', attrs: { 'aria-hidden': { value: 'true' }, 'data-category': { prop: 'categoryIndex' } }, when: ['!slot:icon', 'categoryIndex'] },\n { tag: 'span', class: 'ty-tag__text', children: [{ slot: 'default' }] },\n {\n tag: 'button',\n class: 'ty-tag__remove',\n attrs: { type: { value: 'button' }, 'aria-label': { prop: 'removeLabel' } },\n when: ['removable'],\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n viewBox: { value: '0 0 12 12' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '1.5' },\n 'stroke-linecap': { value: 'round' },\n },\n children: [{ tag: 'path', attrs: { d: { value: 'M2.5 2.5l7 7M9.5 2.5l-7 7' } } }],\n },\n ],\n },\n ],\n },\n examples: [\n { name: 'neutral', props: {}, slots: { default: 'postgres' } },\n { name: 'accent-small-icon', props: { tone: 'accent', size: 'small', testId: 'env' }, slots: { default: 'production', icon: '◆' } },\n { name: 'category', props: { categoryIndex: 3 }, slots: { default: 'Stage 3' } },\n { name: 'removable', props: { removable: true, removeLabel: 'Remove São Paulo' }, slots: { default: 'São Paulo' } },\n { name: 'live-large', props: { live: true, size: 'large' }, slots: { default: 'Running' } },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { tagDefinition } from './definition.ts'\n\n/**\n * `<ty-tag>`. A static pill with a text, an optional leading icon or\n * category square, and an optional native remove button (wired by the\n * wrappers through its native click). The element adds what the markup\n * cannot: it names an unlabelled remove button \"Remove <text>\" (the host\n * passes a translated `remove-label` to override) and normalises\n * `category-index` into the 1–8 categorical tokens.\n */\nexport class TyTagElement extends TyElement {\n static override definition = tagDefinition\n\n override sync(): void {\n super.sync()\n const button = this.querySelector('.ty-tag__remove')\n if (button && !button.hasAttribute('aria-label')) {\n const text = this.querySelector('.ty-tag__text')?.textContent?.trim() ?? ''\n button.setAttribute('aria-label', `Remove ${text}`.trim())\n }\n }\n\n protected override changed(): void {\n const raw = this.getAttribute('category-index')\n if (raw === null) return\n const n = Number(raw)\n if (!Number.isFinite(n)) {\n this.removeAttribute('category-index')\n return\n }\n const normalized = String(((Math.max(1, Math.round(n)) - 1) % 8) + 1)\n if (normalized !== raw) this.setAttribute('category-index', normalized)\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\n/** `<ty-text-area>`: the TextArea's single source (spec: wave-1/text-area.md). */\nexport const textAreaDefinition = {\n tag: 'ty-text-area',\n name: 'TyTextArea',\n kind: 'enhancing',\n doc: 'Multi-line text entry. A native <textarea> inside, so input, keyboard and form participation are the platform\\'s; the element adds the character counter, the over-limit state and auto-grow.',\n props: {\n value: { type: 'string', attribute: 'value', doc: 'Controlled text; the element mirrors it into the textarea (while the user types, the live value is the textarea\\'s own).' },\n defaultValue: { type: 'string', attribute: 'default-value', doc: 'Initial text of an uncontrolled area, applied once on connect; a form reset returns to it.' },\n rows: { type: 'number', default: 3, attribute: 'rows', doc: 'Initial visible lines.' },\n autoGrow: { type: 'boolean', attribute: 'auto-grow', doc: 'Grows with the content up to `maxRows`, then scrolls.' },\n maxRows: { type: 'number', attribute: 'max-rows', doc: 'Growth limit of `autoGrow`; past it the area scrolls (`data-scrolling`).' },\n resize: { type: 'enum', values: ['vertical', 'none'], default: 'vertical', attribute: 'resize', doc: 'The native resize handle; `autoGrow` always disables it.' },\n maxLength: { type: 'number', attribute: 'max-length', doc: 'Counted for the counter and the over-limit state; typing is not cut off.' },\n showCounter: { type: 'boolean', attribute: 'show-counter', doc: 'A character counter under the area (needs `maxLength`).' },\n counterLabel: { type: 'string', default: '{count} of {max} characters', attribute: 'counter-label', doc: 'Counter template; `{count}` and `{max}` are filled in.' },\n overLimitLabel: { type: 'string', default: '{count} of {max} characters, {over} over the limit', attribute: 'over-limit-label', doc: 'Counter template past the limit; `{over}` is the excess.' },\n monospace: { type: 'boolean', attribute: 'monospace', doc: 'Mono family for code, keys or JSON.' },\n required: { type: 'boolean', attribute: 'required', doc: 'Native required.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n readOnly: { type: 'boolean', attribute: 'read-only', doc: 'Shown but not changeable.' },\n invalid: { type: 'boolean', attribute: 'invalid', doc: 'Painted and announced as invalid without an error message (a surrounding field marks it).' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name.' },\n placeholder: { type: 'string', attribute: 'placeholder', doc: 'Native placeholder.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n labelledBy: { type: 'string', attribute: 'labelled-by', doc: '`aria-labelledby` from a surrounding field (used when there is no visible label and no `accessibleLabel`).' },\n describedBy: { type: 'string', attribute: 'described-by', doc: '`aria-describedby` from a surrounding field, joined before the area\\'s own parts.' },\n controlId: { type: 'string', attribute: 'control-id', doc: 'Explicit id of the control (a surrounding field\\'s control id); `<instance>-input` otherwise.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the root (`data-testid`).' },\n },\n events: [{ type: 'input', kind: 'native', detail: { value: 'string' }, reactProp: 'onChange', doc: 'The native input of the textarea; `value` is the whole text.' }],\n slots: {\n label: { doc: 'The visible label, targeting the area.' },\n hint: { doc: 'Help text under the area, announced as the description.' },\n error: { doc: 'The error message; marks the area invalid and is announced.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-text-area',\n attrs: {\n 'data-resize': { prop: 'resize' },\n 'data-monospace': { prop: 'monospace', kind: 'flag' },\n 'data-auto-grow': { prop: 'autoGrow', kind: 'flag' },\n 'data-invalid': { value: '', when: ['invalid|slot:error'] },\n 'data-readonly': { prop: 'readOnly', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n {\n tag: 'label',\n class: 'ty-text-area__label',\n when: ['slot:label'],\n attrs: { for: { idref: 'input', prop: 'controlId' } },\n children: [{ slot: 'label' }],\n },\n {\n tag: 'p',\n class: 'ty-text-area__hint',\n when: ['slot:hint'],\n attrs: { id: { idref: 'hint' } },\n children: [{ slot: 'hint' }],\n },\n {\n tag: 'textarea',\n class: 'ty-text-area__input',\n attrs: {\n id: { idref: 'input', prop: 'controlId' },\n rows: { prop: 'rows' },\n name: { prop: 'name' },\n placeholder: { prop: 'placeholder' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n readonly: { prop: 'readOnly', kind: 'boolean-attr' },\n required: { prop: 'required', kind: 'boolean-attr' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:label'] },\n 'aria-labelledby': { prop: 'labelledBy', when: ['!slot:label', '!accessibleLabel'] },\n 'aria-describedby': {\n idrefs: [\n { prop: 'describedBy' },\n { id: 'hint', when: ['slot:hint'] },\n { id: 'error', when: ['slot:error'] },\n { id: 'counter', when: ['showCounter', 'maxLength'] },\n ],\n },\n 'aria-invalid': { value: 'true', when: ['invalid|slot:error'] },\n },\n },\n {\n tag: 'p',\n class: 'ty-text-area__error',\n when: ['slot:error'],\n attrs: { id: { idref: 'error' } },\n children: [\n {\n tag: 'svg',\n class: 'ty-icon',\n attrs: {\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n width: { value: '24' },\n height: { value: '24' },\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n },\n children: [\n { tag: 'circle', attrs: { cx: { value: '12' }, cy: { value: '12' }, r: { value: '10' } } },\n { tag: 'line', attrs: { x1: { value: '12' }, y1: { value: '8' }, x2: { value: '12' }, y2: { value: '12' } } },\n { tag: 'line', attrs: { x1: { value: '12' }, y1: { value: '16' }, x2: { value: '12.01' }, y2: { value: '16' } } },\n ],\n },\n { tag: 'span', children: [{ slot: 'error' }] },\n ],\n },\n {\n tag: 'p',\n class: 'ty-text-area__counter',\n when: ['showCounter', 'maxLength'],\n attrs: { id: { idref: 'counter' } },\n },\n ],\n },\n examples: [\n { name: 'labelled', props: {}, slots: { label: 'Notes' } },\n { name: 'hint-and-placeholder', props: { name: 'notes', placeholder: 'Write a summary' }, slots: { label: 'Notes', hint: 'Shown on the canvas' } },\n { name: 'error', props: { value: 'Draft' }, slots: { label: 'Abstract', error: 'Required' } },\n { name: 'counter', props: { value: 'Hello', maxLength: 500, showCounter: true }, slots: { label: 'Bio' } },\n { name: 'monospace-read-only', props: { monospace: true, resize: 'none', readOnly: true, value: '{ \"a\": 1 }' }, slots: { label: 'JSON' } },\n { name: 'auto-grow', props: { autoGrow: true, maxRows: 6, rows: 2 }, slots: { label: 'Log' } },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Notes', describedBy: 'external-hint', testId: 'notes' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { textAreaDefinition } from './definition.ts'\n\n/**\n * `<ty-text-area>`. A native `<textarea>` inside, so typing, keyboard and\n * form participation are the platform's. The element mirrors the `value`\n * attribute into the control (a no-op while the user types, so the cursor\n * stays put), applies `default-value` once (and makes it the value a form\n * reset returns to), keeps the character counter and the over-limit state\n * (over `max-length` the area is invalid, never cut off), and grows the\n * control with its content up to `max-rows` when `auto-grow` is set.\n */\nexport class TyTextAreaElement extends TyElement {\n static override definition = textAreaDefinition\n\n #defaultApplied = false\n\n get area(): HTMLTextAreaElement | null {\n return this.querySelector('textarea')\n }\n\n /** Controlled text in, without disturbing the caret while typing. */\n #applyValue = () => {\n const area = this.area\n if (!area) return\n const value = this.getAttribute('value')\n if (value !== null) {\n if (area.value !== value) area.value = value\n } else if (!this.#defaultApplied) {\n this.#defaultApplied = true\n const initial = this.getAttribute('default-value')\n if (initial !== null) {\n area.defaultValue = initial\n if (area.value === '') area.value = initial\n }\n }\n }\n\n /** The counter text and the over-limit state (also without a counter). */\n #updateState = () => {\n const root = this.anatomyRoot()\n const area = this.area\n if (!root || !area) return\n const maxLength = this.props.maxLength as number | undefined\n const count = area.value.length\n const over = maxLength !== undefined && count > maxLength\n const counter = root.querySelector('.ty-text-area__counter')\n if (counter && maxLength !== undefined) {\n const template = String(over ? this.props.overLimitLabel : this.props.counterLabel)\n const text = template\n .replaceAll('{count}', String(count))\n .replaceAll('{max}', String(maxLength))\n .replaceAll('{over}', String(count - maxLength))\n if (counter.textContent !== text) counter.textContent = text\n counter.toggleAttribute('data-over-limit', over)\n }\n const invalid = over || this.hasAttribute('invalid') || root.querySelector('.ty-text-area__error') !== null\n root.toggleAttribute('data-invalid', invalid)\n if (invalid) area.setAttribute('aria-invalid', 'true')\n else area.removeAttribute('aria-invalid')\n }\n\n /** Auto-grow: hard lines, plus soft-wrapped lines where they can be measured. */\n #measure = () => {\n const area = this.area\n if (!area || !this.hasAttribute('auto-grow')) return\n const rows = Number(this.props.rows ?? 3)\n const maxRows = this.props.maxRows as number | undefined\n const lines = area.value.split('\\n').length\n let measured = 0\n const lineHeight = parseFloat(getComputedStyle(area).lineHeight)\n if (lineHeight && !Number.isNaN(lineHeight)) {\n const previous = area.rows\n area.rows = 1\n measured = Math.ceil((area.scrollHeight - 0.5) / lineHeight)\n area.rows = previous\n }\n const wanted = Math.max(rows, lines, measured)\n const visible = maxRows !== undefined ? Math.min(wanted, maxRows) : wanted\n if (area.rows !== visible) area.rows = visible\n this.anatomyRoot()?.toggleAttribute('data-scrolling', maxRows !== undefined && wanted > maxRows)\n }\n\n #onInput = (event: Event) => {\n if (event.target !== this.area) return\n this.#updateState()\n this.#measure()\n }\n\n protected override connected(): void {\n this.addEventListener('input', this.#onInput)\n this.#applyValue()\n // Measure and count after the first paint (the React component measures\n // in an effect too), so the upgrade never rewrites the rendered anatomy.\n // The value is not re-applied here: by the first frame it may already\n // hold what the user typed.\n requestAnimationFrame(() => {\n this.#updateState()\n this.#measure()\n })\n }\n\n protected override disconnected(): void {\n this.removeEventListener('input', this.#onInput)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyValue()\n this.#updateState()\n this.#measure()\n }\n}\n","import type { ElementDefinition, ElementNode } from '../definition.ts'\n\n/** A lucide glyph (ISC, THIRD_PARTY_NOTICES): every child carries a class so the element's patch pass can match it. */\nconst glyph = (tag: string, attrs: Record<string, string>): ElementNode => ({\n tag,\n class: 'ty-text-field__glyph',\n attrs: Object.fromEntries(Object.entries(attrs).map(([name, value]) => [name, { value }])),\n})\n\n/** A decorative 24px icon (lucide strokes). */\nconst icon = (children: ElementNode[], className = 'ty-icon'): ElementNode => ({\n tag: 'svg',\n class: className,\n attrs: {\n viewBox: { value: '0 0 24 24' },\n fill: { value: 'none' },\n stroke: { value: 'currentColor' },\n 'stroke-width': { value: '2' },\n 'stroke-linecap': { value: 'round' },\n 'stroke-linejoin': { value: 'round' },\n 'aria-hidden': { value: 'true' },\n focusable: { value: 'false' },\n },\n children,\n})\n\n/** `<ty-text-field>`: the TextField's single source (spec: wave-1/text-field.md). */\nexport const textFieldDefinition = {\n tag: 'ty-text-field',\n name: 'TyTextField',\n kind: 'enhancing',\n doc: 'Single-line text entry: plain, search and password. A native <input> inside, so typing, keyboard, autofill and form participation are the platform\\'s; the element adds the clear action (search mode, or `clearable`), the reveal action (password mode), the character counter and the over-limit state.',\n props: {\n mode: { type: 'enum', values: ['text', 'search', 'password'], default: 'text', attribute: 'mode', doc: '`search` adds the magnifier and the clear action (Escape clears); `password` adds the reveal action.' },\n inputType: { type: 'enum', values: ['text', 'email', 'url', 'tel', 'number'], attribute: 'input-type', doc: 'Native type for `mode=\"text\"` (`text` when unset); `mode` wins when both are set.' },\n value: { type: 'string', attribute: 'value', doc: 'Controlled text; the element mirrors it into the input (while the user types, the live value is the input\\'s own).' },\n defaultValue: { type: 'string', attribute: 'default-value', doc: 'Initial text of an uncontrolled field, applied once on connect; a form reset returns to it.' },\n appearance: { type: 'enum', values: ['outlined', 'filled'], default: 'outlined', attribute: 'appearance', doc: 'Surface treatment of the group.' },\n clearable: { type: 'boolean', attribute: 'clearable', doc: 'The clear action outside search mode (search always has it); shown while the field is non-empty and editable.' },\n clearLabel: { type: 'string', default: 'Clear', attribute: 'clear-label', doc: 'Accessible name of the clear action.' },\n showPasswordLabel: { type: 'string', default: 'Show password', attribute: 'show-password-label', doc: 'Accessible name of the reveal action while the password is hidden.' },\n hidePasswordLabel: { type: 'string', default: 'Hide password', attribute: 'hide-password-label', doc: 'Accessible name of the reveal action while the password is shown.' },\n maxLength: { type: 'number', attribute: 'max-length', doc: 'Counted for the counter and the over-limit state; typing is not cut off.' },\n showCounter: { type: 'boolean', attribute: 'show-counter', doc: 'A character counter under the field (needs `maxLength`).' },\n counterLabel: { type: 'string', default: '{count} of {max} characters', attribute: 'counter-label', doc: 'Counter template; `{count}` and `{max}` are filled in.' },\n overLimitLabel: { type: 'string', default: '{count} of {max} characters, {over} over the limit', attribute: 'over-limit-label', doc: 'Counter template past the limit; `{over}` is the excess.' },\n required: { type: 'boolean', attribute: 'required', doc: 'Native required.' },\n disabled: { type: 'boolean', attribute: 'disabled', doc: 'Native disabled.' },\n readOnly: { type: 'boolean', attribute: 'read-only', doc: 'Shown but not changeable.' },\n invalid: { type: 'boolean', attribute: 'invalid', doc: 'Painted and announced as invalid without an error message (a surrounding field marks it).' },\n name: { type: 'string', attribute: 'name', doc: 'Form field name.' },\n placeholder: { type: 'string', attribute: 'placeholder', doc: 'Native placeholder.' },\n autoComplete: { type: 'string', attribute: 'autocomplete', doc: 'Native autocomplete hint.' },\n accessibleLabel: { type: 'string', attribute: 'accessible-label', doc: 'Accessible name when there is no visible label.' },\n labelledBy: { type: 'string', attribute: 'labelled-by', doc: '`aria-labelledby` from a surrounding field (used when there is no visible label and no `accessibleLabel`).' },\n describedBy: { type: 'string', attribute: 'described-by', doc: '`aria-describedby` from a surrounding field, joined before the field\\'s own parts.' },\n controlId: { type: 'string', attribute: 'control-id', doc: 'Explicit id of the control (a surrounding field\\'s control id); `<instance>-input` otherwise.' },\n testId: { type: 'string', attribute: 'test-id', doc: 'Test hook on the root (`data-testid`).' },\n },\n events: [\n { type: 'input', kind: 'native', detail: { value: 'string' }, reactProp: 'onChange', doc: 'The native input of the field; `value` is the whole text.' },\n { type: 'ty-clear', kind: 'custom', reactProp: 'onClear', doc: 'The clear action ran (its button, or Escape in search mode); the value is already empty and focus is back on the input.' },\n ],\n slots: {\n label: { doc: 'The visible label, targeting the input.' },\n hint: { doc: 'Help text above the group, announced as the description.' },\n error: { doc: 'The error message; marks the field invalid and is announced.' },\n success: { doc: 'Confirmation of a valid value; only without an error, and hidden while over the limit.' },\n leading: { doc: 'A decorative leading icon; wins over the search magnifier.' },\n },\n anatomy: {\n tag: 'div',\n class: 'ty-text-field',\n attrs: {\n 'data-appearance': { prop: 'appearance' },\n 'data-mode': { prop: 'mode' },\n 'data-invalid': { value: '', when: ['invalid|slot:error'] },\n 'data-readonly': { prop: 'readOnly', kind: 'flag' },\n 'data-disabled': { prop: 'disabled', kind: 'flag' },\n 'data-testid': { prop: 'testId' },\n },\n children: [\n {\n tag: 'label',\n class: 'ty-text-field__label',\n when: ['slot:label'],\n attrs: { for: { idref: 'input', prop: 'controlId' } },\n children: [{ slot: 'label' }],\n },\n {\n tag: 'p',\n class: 'ty-text-field__hint',\n when: ['slot:hint'],\n attrs: { id: { idref: 'hint' } },\n children: [{ slot: 'hint' }],\n },\n {\n tag: 'div',\n class: 'ty-text-field__group',\n children: [\n {\n tag: 'span',\n class: 'ty-text-field__leading',\n when: ['slot:leading'],\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [{ slot: 'leading' }],\n },\n {\n tag: 'span',\n class: 'ty-text-field__leading',\n when: ['mode:search', '!slot:leading'],\n attrs: { 'aria-hidden': { value: 'true' } },\n children: [icon([glyph('circle', { cx: '11', cy: '11', r: '8' }), glyph('path', { d: 'm21 21-4.34-4.34' })])],\n },\n {\n tag: 'input',\n class: 'ty-text-field__input',\n attrs: {\n id: { idref: 'input', prop: 'controlId' },\n // `mode` decides; `inputType` only when it is set (text mode).\n type: {\n prop: 'inputType',\n kind: 'map',\n values: { text: 'text', email: 'email', url: 'url', tel: 'tel', number: 'number' },\n fallback: { prop: 'mode', values: { text: 'text', search: 'search', password: 'password' } },\n },\n name: { prop: 'name' },\n placeholder: { prop: 'placeholder' },\n autocomplete: { prop: 'autoComplete' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n readonly: { prop: 'readOnly', kind: 'boolean-attr' },\n required: { prop: 'required', kind: 'boolean-attr' },\n 'aria-label': { prop: 'accessibleLabel', when: ['!slot:label'] },\n 'aria-labelledby': { prop: 'labelledBy', when: ['!slot:label', '!accessibleLabel'] },\n 'aria-describedby': {\n idrefs: [\n { prop: 'describedBy' },\n { id: 'hint', when: ['slot:hint'] },\n { id: 'error', when: ['slot:error'] },\n { id: 'success', when: ['slot:success', '!slot:error'] },\n { id: 'counter', when: ['showCounter', 'maxLength'] },\n ],\n },\n 'aria-invalid': { value: 'true', when: ['invalid|slot:error'] },\n },\n },\n {\n tag: 'button',\n class: 'ty-text-field__clear ty-text-field__action',\n when: ['clearable|mode:search'],\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'clearLabel' },\n },\n children: [icon([glyph('path', { d: 'M18 6 6 18' }), glyph('path', { d: 'm6 6 12 12' })])],\n },\n {\n tag: 'button',\n class: 'ty-text-field__reveal ty-text-field__action',\n when: ['mode:password'],\n attrs: {\n type: { value: 'button' },\n 'aria-label': { prop: 'showPasswordLabel' },\n 'aria-pressed': { value: 'false' },\n disabled: { prop: 'disabled', kind: 'boolean-attr' },\n },\n children: [\n icon([\n {\n tag: 'g',\n class: 'ty-text-field__eye',\n children: [\n glyph('path', { d: 'M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0' }),\n glyph('circle', { cx: '12', cy: '12', r: '3' }),\n ],\n },\n {\n tag: 'g',\n class: 'ty-text-field__eye-off',\n children: [\n glyph('path', { d: 'M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49' }),\n glyph('path', { d: 'M14.084 14.158a3 3 0 0 1-4.242-4.242' }),\n glyph('path', { d: 'M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143' }),\n glyph('path', { d: 'm2 2 20 20' }),\n ],\n },\n ]),\n ],\n },\n {\n ...icon([glyph('circle', { cx: '12', cy: '12', r: '10' }), glyph('path', { d: 'm16 9-5.5 5.5L8 12' })], 'ty-icon ty-text-field__success-mark'),\n when: ['slot:success', '!slot:error'],\n },\n ],\n },\n {\n tag: 'p',\n class: 'ty-text-field__error',\n when: ['slot:error'],\n attrs: { id: { idref: 'error' } },\n children: [\n icon([\n glyph('circle', { cx: '12', cy: '12', r: '10' }),\n glyph('line', { x1: '12', y1: '8', x2: '12', y2: '12' }),\n glyph('line', { x1: '12', y1: '16', x2: '12.01', y2: '16' }),\n ]),\n { tag: 'span', class: 'ty-text-field__error-text', children: [{ slot: 'error' }] },\n ],\n },\n {\n tag: 'p',\n class: 'ty-text-field__success',\n when: ['slot:success', '!slot:error'],\n attrs: { id: { idref: 'success' } },\n children: [{ slot: 'success' }],\n },\n {\n tag: 'p',\n class: 'ty-text-field__counter',\n when: ['showCounter', 'maxLength'],\n attrs: { id: { idref: 'counter' } },\n },\n ],\n },\n examples: [\n { name: 'labelled', props: {}, slots: { label: 'Name' } },\n { name: 'hint-and-placeholder', props: { name: 'name', placeholder: 'Ada Lovelace', autoComplete: 'name' }, slots: { label: 'Name', hint: 'As on your badge' } },\n { name: 'email-filled-leading', props: { inputType: 'email', appearance: 'filled', name: 'email', autoComplete: 'email' }, slots: { label: 'Email', leading: '✉' } },\n { name: 'search', props: { mode: 'search', name: 'q', value: 'brazil', placeholder: 'Search states' }, slots: { label: 'Search' } },\n { name: 'password', props: { mode: 'password', name: 'password', autoComplete: 'current-password', required: true }, slots: { label: 'Password', hint: 'At least 12 characters' } },\n { name: 'error', props: { value: 'ab', required: true }, slots: { label: 'Code', error: 'Too short' } },\n { name: 'counter', props: { value: 'Hello', maxLength: 20, showCounter: true }, slots: { label: 'Title' } },\n { name: 'success', props: { inputType: 'email', value: 'ada@example.org' }, slots: { label: 'Email', success: 'Looks right' } },\n { name: 'disabled-unlabelled', props: { disabled: true, accessibleLabel: 'Name', describedBy: 'external-hint', testId: 'name' }, slots: {} },\n ],\n} as const satisfies ElementDefinition\n","import { TyElement } from '../base.ts'\nimport { textFieldDefinition } from './definition.ts'\n\n/**\n * `<ty-text-field>`. A native `<input>` inside, so typing, keyboard,\n * autofill and form participation (submit, reset, validation) are the\n * platform's. The element mirrors the `value` attribute into the control\n * (a no-op while the user types, so the caret stays put), applies\n * `default-value` once (the value a form reset returns to), keeps the\n * character counter and the over-limit state (over `max-length` the field\n * is invalid, never cut off), shows the clear action only while the field\n * is non-empty and editable (clearing empties the value, fires the native\n * `input` and `ty-clear`, and returns focus; Escape clears in search\n * mode), and toggles the password reveal (the input's type, the action's\n * `aria-pressed` and its name; the two icons are both in the button and\n * CSS picks the visible one).\n */\nexport class TyTextFieldElement extends TyElement {\n static override definition = textFieldDefinition\n\n #defaultApplied = false\n #revealed = false\n\n get field(): HTMLInputElement | null {\n return this.querySelector('input')\n }\n\n /** Controlled text in, without disturbing the caret while typing. */\n #applyValue = () => {\n const field = this.field\n if (!field) return\n const value = this.getAttribute('value')\n if (value !== null) {\n if (field.value !== value) field.value = value\n } else if (!this.#defaultApplied) {\n this.#defaultApplied = true\n const initial = this.getAttribute('default-value')\n if (initial !== null) {\n field.defaultValue = initial\n if (field.value === '') field.value = initial\n }\n }\n }\n\n /** The counter, the over-limit state, the success parts and the clear action's visibility. */\n #updateState = () => {\n const root = this.anatomyRoot()\n const field = this.field\n if (!root || !field) return\n const maxLength = this.props.maxLength as number | undefined\n const count = field.value.length\n const over = maxLength !== undefined && count > maxLength\n const counter = root.querySelector('.ty-text-field__counter')\n if (counter && maxLength !== undefined) {\n const template = String(over ? this.props.overLimitLabel : this.props.counterLabel)\n const text = template\n .replaceAll('{count}', String(count))\n .replaceAll('{max}', String(maxLength))\n .replaceAll('{over}', String(count - maxLength))\n if (counter.textContent !== text) counter.textContent = text\n counter.toggleAttribute('data-over-limit', over)\n }\n const invalid = over || this.hasAttribute('invalid') || root.querySelector('.ty-text-field__error') !== null\n root.toggleAttribute('data-invalid', invalid)\n if (invalid) field.setAttribute('aria-invalid', 'true')\n else field.removeAttribute('aria-invalid')\n // An over-limit field is not a success.\n for (const part of root.querySelectorAll('.ty-text-field__success, .ty-text-field__success-mark')) part.toggleAttribute('hidden', over)\n // The clear action only while there is something to clear and the field is editable.\n const clear = root.querySelector('.ty-text-field__clear')\n if (clear) clear.toggleAttribute('hidden', count === 0 || this.hasAttribute('disabled') || this.hasAttribute('read-only'))\n }\n\n /** The reveal state: the input's type, the action's pressed state and name. */\n #applyReveal = () => {\n if (this.props.mode !== 'password') return\n const field = this.field\n const button = this.querySelector('.ty-text-field__reveal')\n const type = this.#revealed ? 'text' : 'password'\n if (field && field.getAttribute('type') !== type) field.setAttribute('type', type)\n if (button) {\n button.setAttribute('aria-pressed', this.#revealed ? 'true' : 'false')\n const label = String(this.#revealed ? this.props.hidePasswordLabel : this.props.showPasswordLabel)\n if (button.getAttribute('aria-label') !== label) button.setAttribute('aria-label', label)\n }\n }\n\n /** Clear: empty value, a native input event (the wrappers' onChange), `ty-clear`, focus back on the input. */\n #clear = () => {\n const field = this.field\n if (!field || field.disabled || field.readOnly || field.value === '') return\n // The prototype setter bypasses React's value tracker, so a controlled\n // wrapper sees the change and reports it from the input event below.\n const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set\n if (setValue) setValue.call(field, '')\n else field.value = ''\n field.dispatchEvent(new Event('input', { bubbles: true }))\n this.emit('ty-clear')\n field.focus()\n }\n\n #onInput = (event: Event) => {\n if (event.target !== this.field) return\n this.#updateState()\n }\n\n #onClick = (event: Event) => {\n const target = event.target as Element | null\n if (!target || typeof target.closest !== 'function') return\n const clear = target.closest('.ty-text-field__clear')\n if (clear && this.contains(clear)) {\n this.#clear()\n return\n }\n const reveal = target.closest('.ty-text-field__reveal')\n if (reveal && this.contains(reveal) && !(reveal as HTMLButtonElement).disabled) {\n this.#revealed = !this.#revealed\n this.#applyReveal()\n }\n }\n\n /** Escape clears in search mode (the SearchField behaviour). */\n #onKeydown = (event: Event) => {\n if ((event as KeyboardEvent).key !== 'Escape' || event.target !== this.field) return\n if (this.props.mode === 'search') this.#clear()\n }\n\n protected override connected(): void {\n this.addEventListener('input', this.#onInput)\n this.addEventListener('click', this.#onClick)\n this.addEventListener('keydown', this.#onKeydown)\n this.#applyValue()\n this.#applyReveal()\n // Count and clear-visibility after the first paint, so the upgrade never\n // rewrites the rendered anatomy (see <ty-text-area>).\n requestAnimationFrame(() => this.#updateState())\n }\n\n protected override disconnected(): void {\n this.removeEventListener('input', this.#onInput)\n this.removeEventListener('click', this.#onClick)\n this.removeEventListener('keydown', this.#onKeydown)\n }\n\n protected override changed(): void {\n if (!this.isConnected) return\n this.#applyValue()\n this.#applyReveal()\n this.#updateState()\n }\n}\n","import type { ElementDefinition } from '../definition.ts'\n\nconst text = (attribute: string, fallback: string, doc: string) => ({ type: 'string', attribute, default: fallback, doc }) as const\n\n/**\n * `<ty-theme-palette>`: a command palette over every Tympan theme, the\n * colour mode and the density. Choosing a row applies it to the document\n * (`data-ty-theme` / `data-ty-mode` / `data-ty-density` on `<html>`) and\n * stores it under `storage-key` in the format ThemeProvider and\n * `themeInitScript` read, so React and non-React hosts share one choice.\n */\nexport const themePaletteDefinition = {\n tag: 'ty-theme-palette',\n name: 'TyThemePalette',\n kind: 'self-rendering',\n doc: 'Theme, mode and density picker in the command palette\\'s look; a native <dialog> in the top layer while open.',\n props: {\n open: { type: 'boolean', attribute: 'open', doc: 'Shown (a modal dialog in the top layer).' },\n apply: { type: 'boolean', attribute: 'apply', doc: 'Apply the stored choice (or the defaults) to the document as soon as the element connects, and again when a default changes.' },\n storageKey: text('storage-key', 'ty-theme', 'localStorage key of the choice ({ theme, mode, density } JSON, as ThemeProvider stores it).'),\n defaultTheme: text('default-theme', 'tympan', 'Theme when nothing is stored (a host passes its organization default here).'),\n defaultMode: { type: 'enum', values: ['system', 'light', 'dark'], default: 'system', attribute: 'default-mode', doc: 'Mode when nothing is stored.' },\n defaultDensity: { type: 'enum', values: ['compact', 'default', 'comfortable'], default: 'default', attribute: 'default-density', doc: 'Density when nothing is stored.' },\n themes: { type: 'string', attribute: 'themes', doc: 'Comma-separated theme names to offer; all of them when empty.' },\n printStylesheet: { type: 'string', attribute: 'print-stylesheet', doc: 'URL of print-themes.css, linked while a print theme is applied.' },\n loadFonts: { type: 'boolean', attribute: 'load-fonts', doc: 'Link the font stylesheet a theme names (off: no request to a font host).' },\n themeLabels: { type: 'string', attribute: 'theme-labels', doc: 'JSON object of translated theme names, by theme name.' },\n label: text('label', 'Appearance', 'Accessible name of the dialog and the field.'),\n placeholder: text('placeholder', 'Search themes, modes and densities', 'Field placeholder.'),\n emptyLabel: text('empty-label', 'No matches', 'Shown when nothing matches.'),\n resultsLabel: text('results-label', '{count} results', 'Announced result count; {count} is replaced.'),\n groupPresets: text('group-presets', 'Themes', 'Heading of the built-in themes.'),\n groupPrint: text('group-print', 'Print styles', 'Heading of the print themes.'),\n groupMode: text('group-mode', 'Mode', 'Heading of the colour modes.'),\n groupDensity: text('group-density', 'Density', 'Heading of the densities.'),\n modeSystem: text('mode-system', 'System', 'Label of the system colour mode.'),\n modeLight: text('mode-light', 'Light', 'Label of the light mode.'),\n modeDark: text('mode-dark', 'Dark', 'Label of the dark mode.'),\n densityCompact: text('density-compact', 'Compact', 'Label of the compact density.'),\n densityDefault: text('density-default', 'Default', 'Label of the default density.'),\n densityComfortable: text('density-comfortable', 'Comfortable', 'Label of the comfortable density.'),\n currentLabel: text('current-label', 'Current', 'Marks the row in use.'),\n hintNavigate: text('hint-navigate', 'move', 'Footer hint beside ↑↓.'),\n hintSelect: text('hint-select', 'choose', 'Footer hint beside ↵.'),\n hintClose: text('hint-close', 'close', 'Footer hint beside esc.'),\n },\n events: [\n { type: 'ty-theme-change', kind: 'custom', detail: { theme: 'string', mode: 'string', density: 'string' }, reactProp: 'onThemeChange', doc: 'A row was chosen and applied; the detail is the whole appearance.' },\n { type: 'ty-close', kind: 'custom', reactProp: 'onClose', doc: 'The palette asks to close (Escape, a press outside, or after a choice). The element closes itself too.' },\n ],\n examples: [],\n} as const satisfies ElementDefinition\n","// The theme palette's logic without the DOM: the catalogue, the stored\n// choice, filtering and the rows. Shared by the element and its tests.\n\nimport catalogue from '@datatechsolutions/tympan-tokens/themes.json'\n\nexport type Mode = 'system' | 'light' | 'dark'\nexport type Density = 'compact' | 'default' | 'comfortable'\nexport const MODES: readonly Mode[] = ['system', 'light', 'dark']\nexport const DENSITIES: readonly Density[] = ['compact', 'default', 'comfortable']\n\nexport interface ThemeEntry {\n name: string\n label: string\n kind: 'preset' | 'print'\n fontsUrl: string | null\n}\n\nexport const THEMES: readonly ThemeEntry[] = catalogue as ThemeEntry[]\n\nexport interface Appearance {\n theme: string\n mode: Mode\n density: Density\n}\n\nconst isMode = (v: unknown): v is Mode => MODES.includes(v as Mode)\nconst isDensity = (v: unknown): v is Density => DENSITIES.includes(v as Density)\nexport const isTheme = (v: unknown): v is string => THEMES.some((t) => t.name === v)\n\n/** The stored choice (the ThemeProvider format); fields that are not valid are dropped. */\nexport function readStored(storage: Pick<Storage, 'getItem'> | undefined, key: string): Partial<Appearance> {\n try {\n const raw = JSON.parse(storage?.getItem(key) ?? '{}') as Record<string, unknown>\n const out: Partial<Appearance> = {}\n if (isTheme(raw.theme)) out.theme = raw.theme\n if (isMode(raw.mode)) out.mode = raw.mode\n if (isDensity(raw.density)) out.density = raw.density\n return out\n } catch {\n return {}\n }\n}\n\nexport function writeStored(storage: Pick<Storage, 'setItem'> | undefined, key: string, value: Partial<Appearance>): void {\n try {\n storage?.setItem(key, JSON.stringify(value))\n } catch {\n // Storage full or blocked: the choice still applies for this page.\n }\n}\n\nexport function resolve(stored: Partial<Appearance>, defaults: Appearance): Appearance {\n return {\n theme: stored.theme ?? (isTheme(defaults.theme) ? defaults.theme : 'tympan'),\n mode: stored.mode ?? defaults.mode,\n density: stored.density ?? defaults.density,\n }\n}\n\nexport type RowGroup = 'preset' | 'print' | 'mode' | 'density'\n\nexport interface Row {\n key: string\n group: RowGroup\n value: string\n label: string\n /** The theme's name (a code), shown beside a translated label. */\n hint?: string\n current: boolean\n /** Character positions of the query in the label. */\n marks: number[]\n}\n\nexport interface Section {\n group: RowGroup\n heading: string\n rows: Row[]\n}\n\nexport interface RowLabels {\n groups: Record<RowGroup, string>\n modes: Record<Mode, string>\n densities: Record<Density, string>\n themes: Record<string, string>\n}\n\nconst fold = (s: string) => s.toLocaleLowerCase().normalize('NFD').replace(/\\p{Diacritic}/gu, '')\n\n/** Positions of `query` in `label` (case and accent blind); `null` when it is not there. */\nexport function match(label: string, query: string, alsoIn: string[] = []): number[] | null {\n const q = fold(query.trim())\n if (!q) return []\n const at = fold(label).indexOf(q)\n if (at >= 0) return Array.from({ length: q.length }, (_, i) => at + i)\n return alsoIn.some((extra) => fold(extra).includes(q)) ? [] : null\n}\n\n/** The sections for `query`, in menu order; empty sections are left out. */\nexport function sections(query: string, current: Appearance, labels: RowLabels, offered?: ReadonlySet<string>): Section[] {\n const out: Section[] = []\n const push = (group: RowGroup, rows: Row[]) => {\n if (rows.length) out.push({ group, heading: labels.groups[group], rows })\n }\n const themeRows = (kind: 'preset' | 'print'): Row[] =>\n THEMES.filter((t) => t.kind === kind && (!offered || offered.has(t.name))).flatMap((t) => {\n const label = labels.themes[t.name] ?? t.label\n const marks = match(label, query, [t.name])\n return marks ? [{ key: `theme:${t.name}`, group: kind, value: t.name, label, hint: t.name, current: t.name === current.theme, marks }] : []\n })\n push('preset', themeRows('preset'))\n push('print', themeRows('print'))\n push(\n 'mode',\n MODES.flatMap((m) => {\n const marks = match(labels.modes[m], query, [m])\n return marks ? [{ key: `mode:${m}`, group: 'mode' as const, value: m, label: labels.modes[m], current: m === current.mode, marks }] : []\n }),\n )\n push(\n 'density',\n DENSITIES.flatMap((d) => {\n const marks = match(labels.densities[d], query, [d])\n return marks ? [{ key: `density:${d}`, group: 'density' as const, value: d, label: labels.densities[d], current: d === current.density, marks }] : []\n }),\n )\n return out\n}\n\n/** The one field choosing `row` sets. */\nexport function choose(row: Row): Partial<Appearance> {\n switch (row.group) {\n case 'preset':\n case 'print':\n return { theme: row.value }\n case 'mode':\n return { mode: row.value as Mode }\n case 'density':\n return { density: row.value as Density }\n }\n}\n","import { TyElement } from '../base.ts'\nimport { themePaletteDefinition } from './definition.ts'\nimport { choose, DENSITIES, MODES, readStored, resolve, sections, THEMES, writeStored, type Appearance, type Density, type Mode, type Row, type RowLabels } from './model.ts'\n\nconst PRINT_LINK_ID = 'ty-print-themes'\nconst FONT_LINK_ID = 'ty-theme-fonts'\nconst SVG = 'http://www.w3.org/2000/svg'\n\nfunction storage(): Storage | undefined {\n try {\n return window.localStorage\n } catch {\n return undefined\n }\n}\n\nfunction el<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string, attrs: Record<string, string> = {}): HTMLElementTagNameMap[K] {\n const node = document.createElement(tag)\n if (className) node.className = className\n for (const [name, value] of Object.entries(attrs)) node.setAttribute(name, value)\n return node\n}\n\nfunction searchIcon(): SVGSVGElement {\n const svg = document.createElementNS(SVG, 'svg')\n svg.setAttribute('class', 'ty-palette__search-icon')\n svg.setAttribute('viewBox', '0 0 24 24')\n svg.setAttribute('fill', 'none')\n svg.setAttribute('stroke', 'currentColor')\n svg.setAttribute('stroke-width', '2')\n svg.setAttribute('aria-hidden', 'true')\n const circle = document.createElementNS(SVG, 'circle')\n circle.setAttribute('cx', '11')\n circle.setAttribute('cy', '11')\n circle.setAttribute('r', '7')\n const line = document.createElementNS(SVG, 'path')\n line.setAttribute('d', 'm20 20-3.5-3.5')\n svg.append(circle, line)\n return svg\n}\n\n/**\n * `<ty-theme-palette>`. While `open`, a native `<dialog>` (top layer: no\n * ancestor can clip it, the rest of the page is inert, Escape cancels) holds\n * the palette: a combobox field over a listbox of themes, modes and\n * densities, navigated with the arrow keys, Home, End, Enter and Escape.\n * Choosing applies and stores the appearance and closes.\n */\nexport class TyThemePaletteElement extends TyElement {\n static override definition = themePaletteDefinition\n\n #dialog: HTMLDialogElement | null = null\n #input: HTMLInputElement | null = null\n #list: HTMLElement | null = null\n #status: HTMLElement | null = null\n #empty: HTMLElement | null = null\n #query = ''\n #cursor = 0\n #rows: Row[] = []\n #appliedDefaults = ''\n\n /** The appearance in use: the stored choice over the defaults. */\n get appearance(): Appearance {\n const p = this.props\n return resolve(readStored(storage(), String(p.storageKey)), {\n theme: String(p.defaultTheme),\n mode: String(p.defaultMode) as Mode,\n density: String(p.defaultDensity) as Density,\n })\n }\n\n /**\n * Store `choice` over what is stored (fields left out keep following\n * the defaults, so an organization default still reaches a person who\n * only picked a mode), apply the result and announce it.\n */\n select(choice: Partial<Appearance>): void {\n const key = String(this.props.storageKey)\n const stored = { ...readStored(storage(), key), ...choice }\n writeStored(storage(), key, stored)\n const appearance = this.appearance\n this.#applyToDocument(appearance)\n this.emit('ty-theme-change', { ...appearance })\n }\n\n protected override connected(): void {\n this.#reconcile()\n }\n\n protected override disconnected(): void {\n this.#close(false)\n }\n\n protected override changed(): void {\n if (this.isConnected) this.#reconcile()\n }\n\n #reconcile(): void {\n const p = this.props\n if (p.apply) {\n const defaults = `${p.defaultTheme}|${p.defaultMode}|${p.defaultDensity}|${p.storageKey}`\n if (defaults !== this.#appliedDefaults) {\n this.#appliedDefaults = defaults\n this.#applyToDocument(this.appearance)\n }\n }\n if (p.open && !this.#dialog) this.#open()\n else if (!p.open && this.#dialog) this.#close(false)\n else if (this.#dialog) this.#renderRows()\n }\n\n #applyToDocument(appearance: Appearance): void {\n const root = document.documentElement\n root.setAttribute('data-ty-theme', appearance.theme)\n root.setAttribute('data-ty-mode', appearance.mode)\n root.setAttribute('data-ty-density', appearance.density)\n const entry = THEMES.find((t) => t.name === appearance.theme)\n const href = this.getAttribute('print-stylesheet')\n this.#link(PRINT_LINK_ID, entry?.kind === 'print' && href ? href : null)\n this.#link(FONT_LINK_ID, this.hasAttribute('load-fonts') ? (entry?.fontsUrl ?? null) : null)\n }\n\n #link(id: string, href: string | null): void {\n const existing = document.getElementById(id) as HTMLLinkElement | null\n if (!href) {\n existing?.remove()\n return\n }\n if (existing) {\n if (existing.getAttribute('href') !== href) existing.setAttribute('href', href)\n return\n }\n const link = el('link', undefined, { id, rel: 'stylesheet', href })\n document.head.append(link)\n }\n\n #labels(): RowLabels {\n const p = this.props\n let themes: Record<string, string> = {}\n try {\n themes = JSON.parse(String(p.themeLabels ?? '{}')) as Record<string, string>\n } catch {\n themes = {}\n }\n return {\n groups: { preset: String(p.groupPresets), print: String(p.groupPrint), mode: String(p.groupMode), density: String(p.groupDensity) },\n modes: { system: String(p.modeSystem), light: String(p.modeLight), dark: String(p.modeDark) },\n densities: { compact: String(p.densityCompact), default: String(p.densityDefault), comfortable: String(p.densityComfortable) },\n themes,\n }\n }\n\n #offered(): ReadonlySet<string> | undefined {\n const list = String(this.props.themes ?? '')\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean)\n return list.length ? new Set(list) : undefined\n }\n\n #open(): void {\n const p = this.props\n const id = this.instanceId\n const dialog = el('dialog', 'ty-palette', { 'aria-label': String(p.label), 'data-ty-palette': '' })\n const body = el('div', 'ty-palette__dialog')\n const field = el('div', 'ty-palette__field')\n const input = el('input', 'ty-palette__input', {\n role: 'combobox',\n 'aria-label': String(p.label),\n 'aria-autocomplete': 'list',\n 'aria-controls': `${id}-list`,\n placeholder: String(p.placeholder),\n autocomplete: 'off',\n spellcheck: 'false',\n type: 'text',\n })\n field.append(searchIcon(), input)\n const main = el('div', 'ty-palette__main')\n const results = el('div', 'ty-palette__results')\n const list = el('div', 'ty-palette__list', { id: `${id}-list`, role: 'listbox', 'aria-label': String(p.label) })\n const empty = el('p', 'ty-palette__empty')\n empty.hidden = true\n results.append(list, empty)\n main.append(results)\n const footer = el('div', 'ty-palette__footer', { 'aria-hidden': 'true' })\n for (const [keys, hint] of [\n ['↑↓', p.hintNavigate],\n ['↵', p.hintSelect],\n ['esc', p.hintClose],\n ] as const) {\n const span = el('span')\n const kbd = el('kbd', 'ty-palette__kbd')\n kbd.textContent = keys\n span.append(kbd, ` ${String(hint)}`)\n footer.append(span)\n }\n const status = el('span', 'ty-visually-hidden', { role: 'status' })\n body.append(field, main, footer, status)\n dialog.append(body)\n\n input.addEventListener('input', () => {\n this.#query = input.value\n this.#cursor = 0\n this.#renderRows()\n })\n input.addEventListener('keydown', (event) => this.#onKey(event))\n dialog.addEventListener('cancel', (event) => {\n event.preventDefault()\n this.#close(true)\n })\n // A press on the dialog box itself (outside the palette's content) is a press outside.\n dialog.addEventListener('click', (event) => {\n if (event.target === dialog) this.#close(true)\n })\n\n this.#dialog = dialog\n this.#input = input\n this.#list = list\n this.#empty = empty\n this.#status = status\n this.#query = ''\n this.#cursor = 0\n this.replaceChildren(dialog)\n this.#renderRows()\n if (typeof dialog.showModal === 'function') dialog.showModal()\n else dialog.setAttribute('open', '')\n input.focus()\n }\n\n #close(announce: boolean): void {\n const dialog = this.#dialog\n if (!dialog) return\n this.#dialog = null\n this.#input = null\n this.#list = null\n if (dialog.open && typeof dialog.close === 'function') dialog.close()\n dialog.remove()\n if (this.hasAttribute('open')) this.removeAttribute('open')\n if (announce) this.emit('ty-close')\n }\n\n #onKey(event: KeyboardEvent): void {\n const count = this.#rows.length\n const step = (to: number) => {\n event.preventDefault()\n if (count) {\n this.#cursor = (to + count) % count\n this.#renderRows()\n }\n }\n switch (event.key) {\n case 'ArrowDown':\n return step(this.#cursor + 1)\n case 'ArrowUp':\n return step(this.#cursor - 1)\n case 'Home':\n return step(0)\n case 'End':\n return step(count - 1)\n case 'Enter': {\n event.preventDefault()\n const row = this.#rows[this.#cursor]\n if (row) this.#run(row)\n return\n }\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n if (this.#query) {\n this.#query = ''\n if (this.#input) this.#input.value = ''\n this.#cursor = 0\n this.#renderRows()\n } else this.#close(true)\n return\n }\n }\n\n #run(row: Row): void {\n this.select(choose(row))\n this.#close(true)\n }\n\n #renderRows(): void {\n const list = this.#list\n const input = this.#input\n if (!list || !input) return\n const p = this.props\n const id = this.instanceId\n const current = this.appearance\n const found = sections(this.#query, current, this.#labels(), this.#offered())\n this.#rows = found.flatMap((s) => s.rows)\n if (this.#cursor >= this.#rows.length) this.#cursor = Math.max(0, this.#rows.length - 1)\n const active = this.#rows[this.#cursor]\n\n list.replaceChildren(\n ...found.map((section) => {\n const group = el('div', 'ty-palette__group', { role: 'group', 'aria-labelledby': `${id}-${section.group}` })\n const heading = el('div', 'ty-palette__heading', { id: `${id}-${section.group}`, role: 'presentation' })\n heading.textContent = section.heading\n group.append(heading)\n for (const row of section.rows) {\n const on = row === active\n const option = el('div', 'ty-palette__option', {\n id: `${id}-${row.key.replace(':', '-')}`,\n role: 'option',\n 'aria-selected': String(on),\n 'data-kind': row.group,\n })\n if (on) option.setAttribute('data-highlighted', '')\n if (row.current) option.setAttribute('data-current', '')\n const icon = el('span', 'ty-palette__icon', { 'aria-hidden': 'true' })\n const swatch = el('span', 'ty-palette__swatch')\n if (row.group === 'preset' || row.group === 'print') swatch.setAttribute('data-ty-theme', row.value)\n if (row.group === 'mode' && row.value !== 'system') swatch.setAttribute('data-ty-mode', row.value)\n if (row.group === 'density') swatch.setAttribute('data-density-swatch', row.value)\n icon.append(swatch)\n const text = el('span', 'ty-palette__text')\n const label = el('span', 'ty-palette__label')\n appendMarked(label, row.label, row.marks)\n text.append(label)\n option.append(icon, text)\n if (row.current) {\n const hint = el('span', 'ty-palette__hint')\n hint.textContent = String(p.currentLabel)\n option.append(hint)\n } else if (row.hint && row.hint !== row.label) {\n const hint = el('span', 'ty-palette__hint')\n hint.textContent = row.hint\n option.append(hint)\n }\n option.addEventListener('pointermove', () => {\n const index = this.#rows.indexOf(row)\n if (index !== this.#cursor) {\n this.#cursor = index\n this.#renderRows()\n }\n })\n option.addEventListener('mousedown', (event) => event.preventDefault())\n option.addEventListener('click', () => this.#run(row))\n group.append(option)\n }\n return group\n }),\n )\n input.setAttribute('aria-expanded', String(this.#rows.length > 0))\n if (active) input.setAttribute('aria-activedescendant', `${id}-${active.key.replace(':', '-')}`)\n else input.removeAttribute('aria-activedescendant')\n if (this.#empty) {\n this.#empty.hidden = this.#rows.length > 0\n this.#empty.textContent = String(p.emptyLabel)\n }\n if (this.#status) this.#status.textContent = this.#query.trim() ? String(p.resultsLabel).replace('{count}', String(this.#rows.length)) : ''\n if (active) document.getElementById(`${id}-${active.key.replace(':', '-')}`)?.scrollIntoView?.({ block: 'nearest' })\n }\n}\n\nfunction appendMarked(target: HTMLElement, text: string, marks: number[]): void {\n if (!marks.length) {\n target.textContent = text\n return\n }\n const first = marks[0]!\n const last = marks[marks.length - 1]! + 1\n if (first > 0) target.append(text.slice(0, first))\n const mark = el('mark', 'ty-palette__mark')\n mark.textContent = text.slice(first, last)\n target.append(mark)\n if (last < text.length) target.append(text.slice(last))\n}\n\nexport { MODES, DENSITIES }\n","// Renders an element's anatomy to an HTML string: the reference markup the\n// React wrappers and the element's own upgrade must all produce. Pure:\n// runs in Node (fixtures, tests) and in the browser.\n\nimport { bindingValue, holds, withDefaults, type AnatomyNode, type ElementDefinition, type Props } from './definition.ts'\n\nconst VOID = new Set(['input', 'br', 'hr', 'img', 'meta', 'link'])\n\nexport function escapeHtml(text: string): string {\n return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"')\n}\n\n/**\n * The anatomy of `def` for `props`, with each slot filled by the given\n * (already escaped or trusted) HTML. Attributes keep their declared order;\n * `class` comes first.\n */\nexport function renderAnatomy(def: ElementDefinition, props: Props, slots: Record<string, string>, instanceId: string): string {\n if (!def.anatomy) return ''\n const resolved = withDefaults(def, props)\n const filled = new Set(Object.entries(slots).filter(([, html]) => html !== '').map(([name]) => name))\n const render = (node: AnatomyNode): string => {\n if (!holds(node.when, resolved, filled)) return ''\n if ('slot' in node) return slots[node.slot] ?? ''\n if ('text' in node) {\n const v = resolved[node.text.prop]\n return v === undefined || v === false || v === '' ? '' : escapeHtml(String(v))\n }\n const attrs: string[] = []\n if (node.class) attrs.push(`class=\"${escapeHtml(node.class)}\"`)\n for (const [name, binding] of Object.entries(node.attrs ?? {})) {\n const value = bindingValue(binding, resolved, filled, instanceId)\n if (value !== undefined) attrs.push(value === '' ? name : `${name}=\"${escapeHtml(value)}\"`)\n }\n const open = `<${node.tag}${attrs.length ? ` ${attrs.join(' ')}` : ''}>`\n if (VOID.has(node.tag)) return open\n return `${open}${(node.children ?? []).map(render).join('')}</${node.tag}>`\n }\n return render(def.anatomy)\n}\n\n/**\n * The host element around the anatomy: `data-ty-instance`, then every prop\n * (defaults applied) as a host attribute, the way the wrappers render it.\n */\nexport function renderElement(def: ElementDefinition, props: Props, slots: Record<string, string>, instanceId: string): string {\n const resolved = withDefaults(def, props)\n const attrs: string[] = [`data-ty-instance=\"${escapeHtml(instanceId)}\"`]\n for (const [name, prop] of Object.entries(def.props)) {\n const v = resolved[name]\n if (v === undefined || v === false || v === '') continue\n attrs.push(prop.type === 'boolean' ? prop.attribute : `${prop.attribute}=\"${escapeHtml(String(v))}\"`)\n }\n return `<${def.tag}${attrs.length ? ` ${attrs.join(' ')}` : ''}>${renderAnatomy(def, props, slots, instanceId)}</${def.tag}>`\n}\n","// Tympan custom elements: one definition per component, consumed by React\n// (generated wrappers in ./react) and by plain HTML. See docs/design/single-source-components.md.\n\nimport { defineTympanElement } from './base.ts'\nimport { TyWheelPickerElement } from './wheel-picker/element.ts'\nimport { TyToastElement } from './toast/element.ts'\nimport { TyTagFieldElement } from './tag-field/element.ts'\nimport { TyTabsElement } from './tabs/element.ts'\nimport { TySkipLinkElement } from './skip-link/element.ts'\nimport { TySegmentedControlElement } from './segmented-control/element.ts'\nimport { TySectionHeadingElement } from './section-heading/element.ts'\nimport { TyProgressBarElement } from './progress-bar/element.ts'\nimport { TyPageHeaderElement } from './page-header/element.ts'\nimport { TyNotificationCenterElement } from './notification-center/element.ts'\nimport { TyMarkdownViewElement } from './markdown-view/element.ts'\nimport { TyHeadingElement } from './heading/element.ts'\nimport { TyDataTableElement } from './data-table/element.ts'\nimport { TyCurrencyFieldElement } from './currency-field/element.ts'\nimport { TyCommandPaletteElement } from './command-palette/element.ts'\nimport { TyBreadcrumbsElement } from './breadcrumbs/element.ts'\nimport { TyBrandWordmarkElement } from './brand-wordmark/element.ts'\nimport { TyAvatarElement } from './avatar/element.ts'\nimport { TyActionMenuElement } from './action-menu/element.ts'\nimport { TyButtonElement } from './button/element.ts'\nimport { TyCheckboxElement } from './checkbox/element.ts'\nimport { TyDrawerElement } from './drawer/element.ts'\nimport { TyGradientMarkElement } from './gradient-mark/element.ts'\nimport { TyInlineNoticeElement } from './inline-notice/element.ts'\nimport { TyLinkElement } from './link/element.ts'\nimport { TyModalElement } from './modal/element.ts'\nimport { TyPopoverElement } from './popover/element.ts'\nimport { TyNativeSelectElement } from './native-select/element.ts'\nimport { TySeparatorElement } from './separator/element.ts'\nimport { TySkeletonElement } from './skeleton/element.ts'\nimport { TySpinnerElement } from './spinner/element.ts'\nimport { TyStatusPillElement } from './status-pill/element.ts'\nimport { TySurfaceElement } from './surface/element.ts'\nimport { TySwitchElement } from './switch/element.ts'\nimport { TyTagElement } from './tag/element.ts'\nimport { TyTextAreaElement } from './text-area/element.ts'\nimport { TyTextFieldElement } from './text-field/element.ts'\nimport { TyThemePaletteElement } from './theme-palette/element.ts'\n\nexport { TyElement, defineTympanElement } from './base.ts'\nexport { TyActionMenuElement } from './action-menu/element.ts'\nexport { TyAvatarElement } from './avatar/element.ts'\nexport { TyBrandWordmarkElement } from './brand-wordmark/element.ts'\nexport { TyBreadcrumbsElement } from './breadcrumbs/element.ts'\nexport { TyCommandPaletteElement } from './command-palette/element.ts'\nexport { TyCurrencyFieldElement } from './currency-field/element.ts'\nexport { TyDataTableElement } from './data-table/element.ts'\nexport { TyHeadingElement } from './heading/element.ts'\nexport { TyMarkdownViewElement } from './markdown-view/element.ts'\nexport { TyNotificationCenterElement } from './notification-center/element.ts'\nexport { TyPageHeaderElement } from './page-header/element.ts'\nexport { TyProgressBarElement } from './progress-bar/element.ts'\nexport { TySectionHeadingElement } from './section-heading/element.ts'\nexport { TySegmentedControlElement } from './segmented-control/element.ts'\nexport { TySkipLinkElement } from './skip-link/element.ts'\nexport { TyTabsElement } from './tabs/element.ts'\nexport { TyTagFieldElement } from './tag-field/element.ts'\nexport { TyToastElement } from './toast/element.ts'\nexport { TyWheelPickerElement } from './wheel-picker/element.ts'\nexport { TyButtonElement } from './button/element.ts'\nexport { TyCheckboxElement } from './checkbox/element.ts'\nexport { TyDrawerElement } from './drawer/element.ts'\nexport { TyGradientMarkElement } from './gradient-mark/element.ts'\nexport { TyInlineNoticeElement } from './inline-notice/element.ts'\nexport { TyLinkElement } from './link/element.ts'\nexport { TyModalElement } from './modal/element.ts'\nexport { TyPopoverElement } from './popover/element.ts'\nexport { TyNativeSelectElement } from './native-select/element.ts'\nexport { TySeparatorElement } from './separator/element.ts'\nexport { TySkeletonElement } from './skeleton/element.ts'\nexport { TySpinnerElement } from './spinner/element.ts'\nexport { TyStatusPillElement } from './status-pill/element.ts'\nexport { TySurfaceElement } from './surface/element.ts'\nexport { TySwitchElement } from './switch/element.ts'\nexport { TyTagElement } from './tag/element.ts'\nexport { TyTextAreaElement } from './text-area/element.ts'\nexport { TyTextFieldElement } from './text-field/element.ts'\nexport { TyThemePaletteElement } from './theme-palette/element.ts'\nexport { brandWordmarkDefinition } from './brand-wordmark/definition.ts'\nexport { buttonDefinition } from './button/definition.ts'\nexport { checkboxDefinition } from './checkbox/definition.ts'\nexport { drawerDefinition } from './drawer/definition.ts'\nexport { gradientMarkDefinition } from './gradient-mark/definition.ts'\nexport { inlineNoticeDefinition } from './inline-notice/definition.ts'\nexport { linkDefinition } from './link/definition.ts'\nexport { modalDefinition } from './modal/definition.ts'\nexport { nativeSelectDefinition } from './native-select/definition.ts'\nexport { separatorDefinition } from './separator/definition.ts'\nexport { skeletonDefinition } from './skeleton/definition.ts'\nexport { spinnerDefinition } from './spinner/definition.ts'\nexport { statusPillDefinition } from './status-pill/definition.ts'\nexport { surfaceDefinition } from './surface/definition.ts'\nexport { switchDefinition } from './switch/definition.ts'\nexport { tagDefinition } from './tag/definition.ts'\nexport { textAreaDefinition } from './text-area/definition.ts'\nexport { textFieldDefinition } from './text-field/definition.ts'\nexport { themePaletteDefinition } from './theme-palette/definition.ts'\nexport { renderAnatomy, renderElement } from './anatomy.ts'\nexport type { ElementDefinition, PropDef, EventDef, AnatomyNode, ElementNode, Example } from './definition.ts'\nexport type { Appearance, Mode as ThemeMode, Density as ThemeDensity } from './theme-palette/model.ts'\n\n/** Register every Tympan custom element (idempotent; a no-op outside a browser). */\nexport function defineTympanElements(): void {\n defineTympanElement(TyActionMenuElement)\n defineTympanElement(TyAvatarElement)\n defineTympanElement(TyBrandWordmarkElement)\n defineTympanElement(TyBreadcrumbsElement)\n defineTympanElement(TyCommandPaletteElement)\n defineTympanElement(TyCurrencyFieldElement)\n defineTympanElement(TyDataTableElement)\n defineTympanElement(TyHeadingElement)\n defineTympanElement(TyMarkdownViewElement)\n defineTympanElement(TyNotificationCenterElement)\n defineTympanElement(TyPageHeaderElement)\n defineTympanElement(TyProgressBarElement)\n defineTympanElement(TySectionHeadingElement)\n defineTympanElement(TySegmentedControlElement)\n defineTympanElement(TySkipLinkElement)\n defineTympanElement(TyTabsElement)\n defineTympanElement(TyTagFieldElement)\n defineTympanElement(TyToastElement)\n defineTympanElement(TyWheelPickerElement)\n defineTympanElement(TyButtonElement)\n defineTympanElement(TyCheckboxElement)\n defineTympanElement(TyDrawerElement)\n defineTympanElement(TyGradientMarkElement)\n defineTympanElement(TyInlineNoticeElement)\n defineTympanElement(TyLinkElement)\n defineTympanElement(TyModalElement)\n defineTympanElement(TyPopoverElement)\n defineTympanElement(TyNativeSelectElement)\n defineTympanElement(TySeparatorElement)\n defineTympanElement(TySkeletonElement)\n defineTympanElement(TySpinnerElement)\n defineTympanElement(TyStatusPillElement)\n defineTympanElement(TySurfaceElement)\n defineTympanElement(TySwitchElement)\n defineTympanElement(TyTagElement)\n defineTympanElement(TyTextAreaElement)\n defineTympanElement(TyTextFieldElement)\n defineTympanElement(TyThemePaletteElement)\n}\n"],"mappings":";;;;;AAqHA,SAAgB,aAAa,KAAwB,OAAqB;CACxE,MAAM,MAAa,EAAE,GAAG,MAAM;CAC9B,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,IAAI,KAAK,GACjD,IAAI,IAAI,UAAU,KAAA,KAAa,KAAK,YAAY,KAAA,GAAW,IAAI,QAAQ,KAAK;CAE9E,OAAO;AACT;AAEA,MAAM,UAAU,MAA0B,MAAM,KAAA,KAAa,MAAM,SAA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