@skdx/docs-kit 0.35.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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/component-aliases.json +12 -0
- package/dist/data/THIRD-PARTY-NOTICES.md +21 -0
- package/dist/data/angular-inputs.json +1 -0
- package/dist/data/api-manifest.json +1 -0
- package/dist/data/exports-by-framework.json +1 -0
- package/dist/data/honoured-slots.json +1 -0
- package/dist/data/styling-hooks-manifest.json +10331 -0
- package/dist/frameworks.mjs +64 -0
- package/dist/shared/contracts/accordion.d.ts +3 -0
- package/dist/shared/contracts/accordion.js +1 -0
- package/dist/shared/contracts/alert.d.ts +3 -0
- package/dist/shared/contracts/alert.js +1 -0
- package/dist/shared/contracts/angle-slider.d.ts +3 -0
- package/dist/shared/contracts/angle-slider.js +1 -0
- package/dist/shared/contracts/aspect-ratio.d.ts +3 -0
- package/dist/shared/contracts/aspect-ratio.js +1 -0
- package/dist/shared/contracts/autocomplete.d.ts +3 -0
- package/dist/shared/contracts/autocomplete.js +1 -0
- package/dist/shared/contracts/avatar.d.ts +3 -0
- package/dist/shared/contracts/avatar.js +1 -0
- package/dist/shared/contracts/badge.d.ts +3 -0
- package/dist/shared/contracts/badge.js +1 -0
- package/dist/shared/contracts/box.d.ts +3 -0
- package/dist/shared/contracts/box.js +1 -0
- package/dist/shared/contracts/breadcrumb.d.ts +3 -0
- package/dist/shared/contracts/breadcrumb.js +1 -0
- package/dist/shared/contracts/button.d.ts +3 -0
- package/dist/shared/contracts/button.js +1 -0
- package/dist/shared/contracts/calendar.d.ts +5 -0
- package/dist/shared/contracts/calendar.js +1 -0
- package/dist/shared/contracts/card.d.ts +3 -0
- package/dist/shared/contracts/card.js +1 -0
- package/dist/shared/contracts/carousel.d.ts +3 -0
- package/dist/shared/contracts/carousel.js +1 -0
- package/dist/shared/contracts/change-reason.d.ts +29 -0
- package/dist/shared/contracts/change-reason.js +1 -0
- package/dist/shared/contracts/chat-composer.d.ts +3 -0
- package/dist/shared/contracts/chat-composer.js +1 -0
- package/dist/shared/contracts/chat-message.d.ts +3 -0
- package/dist/shared/contracts/chat-message.js +1 -0
- package/dist/shared/contracts/checkbox-card.d.ts +3 -0
- package/dist/shared/contracts/checkbox-card.js +1 -0
- package/dist/shared/contracts/checkbox-group.d.ts +3 -0
- package/dist/shared/contracts/checkbox-group.js +1 -0
- package/dist/shared/contracts/checkbox.d.ts +3 -0
- package/dist/shared/contracts/checkbox.js +1 -0
- package/dist/shared/contracts/clipboard.d.ts +3 -0
- package/dist/shared/contracts/clipboard.js +1 -0
- package/dist/shared/contracts/collapsible.d.ts +3 -0
- package/dist/shared/contracts/collapsible.js +1 -0
- package/dist/shared/contracts/color-picker.d.ts +3 -0
- package/dist/shared/contracts/color-picker.js +1 -0
- package/dist/shared/contracts/combobox.d.ts +3 -0
- package/dist/shared/contracts/combobox.js +1 -0
- package/dist/shared/contracts/command.d.ts +3 -0
- package/dist/shared/contracts/command.js +1 -0
- package/dist/shared/contracts/comment-thread.d.ts +3 -0
- package/dist/shared/contracts/comment-thread.js +1 -0
- package/dist/shared/contracts/comment.d.ts +3 -0
- package/dist/shared/contracts/comment.js +1 -0
- package/dist/shared/contracts/confirm-dialog.d.ts +3 -0
- package/dist/shared/contracts/confirm-dialog.js +1 -0
- package/dist/shared/contracts/conversation-list.d.ts +3 -0
- package/dist/shared/contracts/conversation-list.js +1 -0
- package/dist/shared/contracts/dashboard-layout.d.ts +3 -0
- package/dist/shared/contracts/dashboard-layout.js +1 -0
- package/dist/shared/contracts/date-field.d.ts +3 -0
- package/dist/shared/contracts/date-field.js +1 -0
- package/dist/shared/contracts/date-picker.d.ts +3 -0
- package/dist/shared/contracts/date-picker.js +1 -0
- package/dist/shared/contracts/date-value.d.ts +11 -0
- package/dist/shared/contracts/date-value.js +1 -0
- package/dist/shared/contracts/dialog.d.ts +3 -0
- package/dist/shared/contracts/dialog.js +1 -0
- package/dist/shared/contracts/divider.d.ts +5 -0
- package/dist/shared/contracts/divider.js +1 -0
- package/dist/shared/contracts/drawer.d.ts +3 -0
- package/dist/shared/contracts/drawer.js +1 -0
- package/dist/shared/contracts/editable.d.ts +3 -0
- package/dist/shared/contracts/editable.js +1 -0
- package/dist/shared/contracts/empty-state.d.ts +3 -0
- package/dist/shared/contracts/empty-state.js +1 -0
- package/dist/shared/contracts/field.d.ts +3 -0
- package/dist/shared/contracts/field.js +1 -0
- package/dist/shared/contracts/file-upload.d.ts +3 -0
- package/dist/shared/contracts/file-upload.js +1 -0
- package/dist/shared/contracts/filter-bar.d.ts +3 -0
- package/dist/shared/contracts/filter-bar.js +1 -0
- package/dist/shared/contracts/floating-panel.d.ts +3 -0
- package/dist/shared/contracts/floating-panel.js +1 -0
- package/dist/shared/contracts/forgot-password-page.d.ts +3 -0
- package/dist/shared/contracts/forgot-password-page.js +1 -0
- package/dist/shared/contracts/form-property.d.ts +3 -0
- package/dist/shared/contracts/form-property.js +1 -0
- package/dist/shared/contracts/form-section.d.ts +3 -0
- package/dist/shared/contracts/form-section.js +1 -0
- package/dist/shared/contracts/form-validity.d.ts +7 -0
- package/dist/shared/contracts/form-validity.js +1 -0
- package/dist/shared/contracts/form.d.ts +3 -0
- package/dist/shared/contracts/form.js +1 -0
- package/dist/shared/contracts/heading.d.ts +3 -0
- package/dist/shared/contracts/heading.js +1 -0
- package/dist/shared/contracts/image.d.ts +3 -0
- package/dist/shared/contracts/image.js +1 -0
- package/dist/shared/contracts/index.d.ts +8 -0
- package/dist/shared/contracts/index.js +1 -0
- package/dist/shared/contracts/kbd.d.ts +3 -0
- package/dist/shared/contracts/kbd.js +1 -0
- package/dist/shared/contracts/label.d.ts +3 -0
- package/dist/shared/contracts/label.js +1 -0
- package/dist/shared/contracts/link.d.ts +3 -0
- package/dist/shared/contracts/link.js +1 -0
- package/dist/shared/contracts/list.d.ts +3 -0
- package/dist/shared/contracts/list.js +1 -0
- package/dist/shared/contracts/listbox.d.ts +3 -0
- package/dist/shared/contracts/listbox.js +1 -0
- package/dist/shared/contracts/loading-overlay.d.ts +3 -0
- package/dist/shared/contracts/loading-overlay.js +1 -0
- package/dist/shared/contracts/member-id.d.ts +18 -0
- package/dist/shared/contracts/member-id.js +1 -0
- package/dist/shared/contracts/mentions.d.ts +3 -0
- package/dist/shared/contracts/mentions.js +1 -0
- package/dist/shared/contracts/menu.d.ts +3 -0
- package/dist/shared/contracts/menu.js +1 -0
- package/dist/shared/contracts/menubar.d.ts +3 -0
- package/dist/shared/contracts/menubar.js +1 -0
- package/dist/shared/contracts/navigation-menu.d.ts +6 -0
- package/dist/shared/contracts/navigation-menu.js +1 -0
- package/dist/shared/contracts/notification-center.d.ts +3 -0
- package/dist/shared/contracts/notification-center.js +1 -0
- package/dist/shared/contracts/number-field.d.ts +5 -0
- package/dist/shared/contracts/number-field.js +1 -0
- package/dist/shared/contracts/onboarding-checklist.d.ts +3 -0
- package/dist/shared/contracts/onboarding-checklist.js +1 -0
- package/dist/shared/contracts/overlay-parts.d.ts +73 -0
- package/dist/shared/contracts/overlay-parts.js +1 -0
- package/dist/shared/contracts/page-container.d.ts +3 -0
- package/dist/shared/contracts/page-container.js +1 -0
- package/dist/shared/contracts/pagination.d.ts +5 -0
- package/dist/shared/contracts/pagination.js +1 -0
- package/dist/shared/contracts/password-input.d.ts +6 -0
- package/dist/shared/contracts/password-input.js +1 -0
- package/dist/shared/contracts/pin-input.d.ts +6 -0
- package/dist/shared/contracts/pin-input.js +1 -0
- package/dist/shared/contracts/polymorphic.d.ts +6 -0
- package/dist/shared/contracts/polymorphic.js +1 -0
- package/dist/shared/contracts/popover.d.ts +7 -0
- package/dist/shared/contracts/popover.js +1 -0
- package/dist/shared/contracts/progress.d.ts +6 -0
- package/dist/shared/contracts/progress.js +1 -0
- package/dist/shared/contracts/qr-code.d.ts +5 -0
- package/dist/shared/contracts/qr-code.js +1 -0
- package/dist/shared/contracts/radio-card.d.ts +6 -0
- package/dist/shared/contracts/radio-card.js +1 -0
- package/dist/shared/contracts/radio-group.d.ts +6 -0
- package/dist/shared/contracts/radio-group.js +1 -0
- package/dist/shared/contracts/rating.d.ts +6 -0
- package/dist/shared/contracts/rating.js +1 -0
- package/dist/shared/contracts/reset-password-page.d.ts +3 -0
- package/dist/shared/contracts/reset-password-page.js +1 -0
- package/dist/shared/contracts/resizable.d.ts +7 -0
- package/dist/shared/contracts/resizable.js +1 -0
- package/dist/shared/contracts/rules.d.ts +11 -0
- package/dist/shared/contracts/rules.js +1 -0
- package/dist/shared/contracts/scroll-area.d.ts +6 -0
- package/dist/shared/contracts/scroll-area.js +1 -0
- package/dist/shared/contracts/select.d.ts +5 -0
- package/dist/shared/contracts/select.js +1 -0
- package/dist/shared/contracts/selection-value.d.ts +20 -0
- package/dist/shared/contracts/selection-value.js +1 -0
- package/dist/shared/contracts/sign-in-page.d.ts +3 -0
- package/dist/shared/contracts/sign-in-page.js +1 -0
- package/dist/shared/contracts/sign-up-page.d.ts +3 -0
- package/dist/shared/contracts/sign-up-page.js +1 -0
- package/dist/shared/contracts/skeleton.d.ts +5 -0
- package/dist/shared/contracts/skeleton.js +1 -0
- package/dist/shared/contracts/slider.d.ts +7 -0
- package/dist/shared/contracts/slider.js +1 -0
- package/dist/shared/contracts/speed-dial.d.ts +6 -0
- package/dist/shared/contracts/speed-dial.js +1 -0
- package/dist/shared/contracts/spinner.d.ts +6 -0
- package/dist/shared/contracts/spinner.js +1 -0
- package/dist/shared/contracts/split-button.d.ts +6 -0
- package/dist/shared/contracts/split-button.js +1 -0
- package/dist/shared/contracts/stat-card.d.ts +3 -0
- package/dist/shared/contracts/stat-card.js +1 -0
- package/dist/shared/contracts/stepper.d.ts +6 -0
- package/dist/shared/contracts/stepper.js +1 -0
- package/dist/shared/contracts/styling-hooks.d.ts +8 -0
- package/dist/shared/contracts/styling-hooks.js +1 -0
- package/dist/shared/contracts/switch.d.ts +6 -0
- package/dist/shared/contracts/switch.js +1 -0
- package/dist/shared/contracts/table.d.ts +7 -0
- package/dist/shared/contracts/table.js +1 -0
- package/dist/shared/contracts/tabs.d.ts +5 -0
- package/dist/shared/contracts/tabs.js +1 -0
- package/dist/shared/contracts/tag-group.d.ts +7 -0
- package/dist/shared/contracts/tag-group.js +1 -0
- package/dist/shared/contracts/tags-input.d.ts +8 -0
- package/dist/shared/contracts/tags-input.js +1 -0
- package/dist/shared/contracts/text-field.d.ts +6 -0
- package/dist/shared/contracts/text-field.js +1 -0
- package/dist/shared/contracts/text.d.ts +6 -0
- package/dist/shared/contracts/text.js +1 -0
- package/dist/shared/contracts/textarea.d.ts +5 -0
- package/dist/shared/contracts/textarea.js +1 -0
- package/dist/shared/contracts/time-field.d.ts +5 -0
- package/dist/shared/contracts/time-field.js +1 -0
- package/dist/shared/contracts/time.d.ts +6 -0
- package/dist/shared/contracts/time.js +1 -0
- package/dist/shared/contracts/timeline.d.ts +5 -0
- package/dist/shared/contracts/timeline.js +1 -0
- package/dist/shared/contracts/toast.d.ts +6 -0
- package/dist/shared/contracts/toast.js +1 -0
- package/dist/shared/contracts/toggle-group.d.ts +6 -0
- package/dist/shared/contracts/toggle-group.js +1 -0
- package/dist/shared/contracts/toggle.d.ts +5 -0
- package/dist/shared/contracts/toggle.js +1 -0
- package/dist/shared/contracts/toolbar.d.ts +3 -0
- package/dist/shared/contracts/toolbar.js +1 -0
- package/dist/shared/contracts/tour.d.ts +5 -0
- package/dist/shared/contracts/tour.js +1 -0
- package/dist/shared/contracts/transfer.d.ts +6 -0
- package/dist/shared/contracts/transfer.js +1 -0
- package/dist/shared/contracts/tree-select.d.ts +6 -0
- package/dist/shared/contracts/tree-select.js +1 -0
- package/dist/shared/contracts/tree.d.ts +6 -0
- package/dist/shared/contracts/tree.js +1 -0
- package/dist/shared/contracts/types.d.ts +230 -0
- package/dist/shared/contracts/types.js +1 -0
- package/dist/shared/contracts/usage-card.d.ts +3 -0
- package/dist/shared/contracts/usage-card.js +1 -0
- package/dist/shared/contracts/user-menu.d.ts +3 -0
- package/dist/shared/contracts/user-menu.js +1 -0
- package/dist/shared/contracts/verification-page.d.ts +3 -0
- package/dist/shared/contracts/verification-page.js +1 -0
- package/dist/shared/contracts/workspace-switcher.d.ts +3 -0
- package/dist/shared/contracts/workspace-switcher.js +1 -0
- package/dist/shared/core/announcer.d.ts +17 -0
- package/dist/shared/core/announcer.js +1 -0
- package/dist/shared/core/appearance.d.ts +14 -0
- package/dist/shared/core/appearance.js +1 -0
- package/dist/shared/core/arrow-keys.d.ts +7 -0
- package/dist/shared/core/arrow-keys.js +1 -0
- package/dist/shared/core/calendar-locale.d.ts +35 -0
- package/dist/shared/core/calendar-locale.js +1 -0
- package/dist/shared/core/color.d.ts +80 -0
- package/dist/shared/core/color.js +1 -0
- package/dist/shared/core/controllable.d.ts +42 -0
- package/dist/shared/core/controllable.js +1 -0
- package/dist/shared/core/csv.d.ts +43 -0
- package/dist/shared/core/csv.js +2 -0
- package/dist/shared/core/date-segments.d.ts +223 -0
- package/dist/shared/core/date-segments.js +1 -0
- package/dist/shared/core/date-value.d.ts +57 -0
- package/dist/shared/core/date-value.js +1 -0
- package/dist/shared/core/dev-mode.d.ts +12 -0
- package/dist/shared/core/dev-mode.js +1 -0
- package/dist/shared/core/dialogs.d.ts +96 -0
- package/dist/shared/core/dialogs.js +1 -0
- package/dist/shared/core/dismissal.d.ts +56 -0
- package/dist/shared/core/dismissal.js +1 -0
- package/dist/shared/core/field-core.d.ts +250 -0
- package/dist/shared/core/field-core.js +1 -0
- package/dist/shared/core/focus-targets.d.ts +77 -0
- package/dist/shared/core/focus-targets.js +1 -0
- package/dist/shared/core/format-file-size.d.ts +9 -0
- package/dist/shared/core/format-file-size.js +1 -0
- package/dist/shared/core/glyph-data.d.ts +13 -0
- package/dist/shared/core/glyph-data.js +1 -0
- package/dist/shared/core/measure-auto-resize.d.ts +5 -0
- package/dist/shared/core/measure-auto-resize.js +1 -0
- package/dist/shared/core/media-query.d.ts +7 -0
- package/dist/shared/core/media-query.js +1 -0
- package/dist/shared/core/mentions.d.ts +116 -0
- package/dist/shared/core/mentions.js +2 -0
- package/dist/shared/core/pin-chars.d.ts +13 -0
- package/dist/shared/core/pin-chars.js +1 -0
- package/dist/shared/core/placement.d.ts +102 -0
- package/dist/shared/core/placement.js +1 -0
- package/dist/shared/core/qr-encoder.d.ts +33 -0
- package/dist/shared/core/qr-encoder.js +1 -0
- package/dist/shared/core/roving-tab-stop.d.ts +37 -0
- package/dist/shared/core/roving-tab-stop.js +1 -0
- package/dist/shared/core/select-keyboard.d.ts +80 -0
- package/dist/shared/core/select-keyboard.js +1 -0
- package/dist/shared/core/selection.d.ts +58 -0
- package/dist/shared/core/selection.js +1 -0
- package/dist/shared/core/tabbable.d.ts +8 -0
- package/dist/shared/core/tabbable.js +1 -0
- package/dist/shared/core/timer.d.ts +82 -0
- package/dist/shared/core/timer.js +1 -0
- package/dist/shared/core/tree-columns.d.ts +48 -0
- package/dist/shared/core/tree-columns.js +1 -0
- package/dist/shared/core/typeahead.d.ts +27 -0
- package/dist/shared/core/typeahead.js +1 -0
- package/dist/shared/index.d.ts +113 -0
- package/dist/shared/index.js +1 -0
- package/dist/skins-src/_foundation-fallback.css +124 -0
- package/dist/skins-src/base.css +328 -0
- package/dist/skins-src/components/_actuator.css +203 -0
- package/dist/skins-src/components/_arrow.css +20 -0
- package/dist/skins-src/components/_card-control.css +27 -0
- package/dist/skins-src/components/_collection.css +281 -0
- package/dist/skins-src/components/_hit-target.css +28 -0
- package/dist/skins-src/components/_overlay.css +214 -0
- package/dist/skins-src/components/_status.css +38 -0
- package/dist/skins-src/components/_trigger.css +85 -0
- package/dist/skins-src/components/accordion.css +85 -0
- package/dist/skins-src/components/alert.css +118 -0
- package/dist/skins-src/components/angle-slider.css +110 -0
- package/dist/skins-src/components/aspect-ratio.css +26 -0
- package/dist/skins-src/components/autocomplete.css +112 -0
- package/dist/skins-src/components/avatar.css +87 -0
- package/dist/skins-src/components/badge.css +164 -0
- package/dist/skins-src/components/box.css +9 -0
- package/dist/skins-src/components/breadcrumb.css +78 -0
- package/dist/skins-src/components/button.css +304 -0
- package/dist/skins-src/components/calendar.css +269 -0
- package/dist/skins-src/components/card.css +116 -0
- package/dist/skins-src/components/carousel.css +192 -0
- package/dist/skins-src/components/chat-composer.css +89 -0
- package/dist/skins-src/components/chat-message.css +98 -0
- package/dist/skins-src/components/checkbox-card.css +153 -0
- package/dist/skins-src/components/checkbox-group.css +72 -0
- package/dist/skins-src/components/checkbox.css +141 -0
- package/dist/skins-src/components/clipboard.css +126 -0
- package/dist/skins-src/components/collapsible.css +64 -0
- package/dist/skins-src/components/color-picker.css +304 -0
- package/dist/skins-src/components/combobox.css +111 -0
- package/dist/skins-src/components/command.css +73 -0
- package/dist/skins-src/components/comment-thread.css +56 -0
- package/dist/skins-src/components/comment.css +59 -0
- package/dist/skins-src/components/confirm-dialog.css +43 -0
- package/dist/skins-src/components/conversation-list.css +142 -0
- package/dist/skins-src/components/dashboard-layout.css +106 -0
- package/dist/skins-src/components/date-field.css +95 -0
- package/dist/skins-src/components/date-picker.css +79 -0
- package/dist/skins-src/components/dialog.css +161 -0
- package/dist/skins-src/components/divider.css +64 -0
- package/dist/skins-src/components/drawer.css +166 -0
- package/dist/skins-src/components/editable.css +121 -0
- package/dist/skins-src/components/empty-state.css +85 -0
- package/dist/skins-src/components/field.css +104 -0
- package/dist/skins-src/components/file-upload.css +164 -0
- package/dist/skins-src/components/filter-bar.css +48 -0
- package/dist/skins-src/components/floating-panel.css +168 -0
- package/dist/skins-src/components/forgot-password-page.css +45 -0
- package/dist/skins-src/components/form-section.css +75 -0
- package/dist/skins-src/components/form.css +115 -0
- package/dist/skins-src/components/heading.css +38 -0
- package/dist/skins-src/components/image.css +43 -0
- package/dist/skins-src/components/kbd.css +76 -0
- package/dist/skins-src/components/label.css +45 -0
- package/dist/skins-src/components/link.css +72 -0
- package/dist/skins-src/components/list.css +104 -0
- package/dist/skins-src/components/listbox.css +90 -0
- package/dist/skins-src/components/loading-overlay.css +89 -0
- package/dist/skins-src/components/mentions.css +79 -0
- package/dist/skins-src/components/menu.css +102 -0
- package/dist/skins-src/components/menubar.css +130 -0
- package/dist/skins-src/components/navigation-menu.css +145 -0
- package/dist/skins-src/components/notification-center.css +139 -0
- package/dist/skins-src/components/number-field.css +95 -0
- package/dist/skins-src/components/onboarding-checklist.css +156 -0
- package/dist/skins-src/components/page-container.css +29 -0
- package/dist/skins-src/components/pagination.css +147 -0
- package/dist/skins-src/components/password-input.css +116 -0
- package/dist/skins-src/components/pin-input.css +115 -0
- package/dist/skins-src/components/popover.css +108 -0
- package/dist/skins-src/components/progress.css +207 -0
- package/dist/skins-src/components/qr-code.css +62 -0
- package/dist/skins-src/components/radio-card.css +158 -0
- package/dist/skins-src/components/radio-group.css +148 -0
- package/dist/skins-src/components/rating.css +150 -0
- package/dist/skins-src/components/reset-password-page.css +51 -0
- package/dist/skins-src/components/resizable.css +131 -0
- package/dist/skins-src/components/scroll-area.css +101 -0
- package/dist/skins-src/components/select.css +239 -0
- package/dist/skins-src/components/sign-in-page.css +47 -0
- package/dist/skins-src/components/sign-up-page.css +55 -0
- package/dist/skins-src/components/skeleton.css +55 -0
- package/dist/skins-src/components/skip-link.css +51 -0
- package/dist/skins-src/components/slider.css +164 -0
- package/dist/skins-src/components/speed-dial.css +162 -0
- package/dist/skins-src/components/spinner.css +59 -0
- package/dist/skins-src/components/split-button.css +167 -0
- package/dist/skins-src/components/stat-card.css +117 -0
- package/dist/skins-src/components/stepper.css +153 -0
- package/dist/skins-src/components/switch.css +155 -0
- package/dist/skins-src/components/table.css +336 -0
- package/dist/skins-src/components/tabs.css +116 -0
- package/dist/skins-src/components/tag-group.css +72 -0
- package/dist/skins-src/components/tags-input.css +176 -0
- package/dist/skins-src/components/text-field.css +182 -0
- package/dist/skins-src/components/text.css +83 -0
- package/dist/skins-src/components/textarea.css +118 -0
- package/dist/skins-src/components/time-field.css +43 -0
- package/dist/skins-src/components/time.css +13 -0
- package/dist/skins-src/components/timeline.css +206 -0
- package/dist/skins-src/components/toast.css +133 -0
- package/dist/skins-src/components/toggle-group.css +185 -0
- package/dist/skins-src/components/toggle.css +89 -0
- package/dist/skins-src/components/toolbar.css +84 -0
- package/dist/skins-src/components/tour.css +67 -0
- package/dist/skins-src/components/transfer.css +112 -0
- package/dist/skins-src/components/tree-select.css +124 -0
- package/dist/skins-src/components/tree.css +110 -0
- package/dist/skins-src/components/usage-card.css +129 -0
- package/dist/skins-src/components/user-menu.css +83 -0
- package/dist/skins-src/components/verification-page.css +64 -0
- package/dist/skins-src/components/workspace-switcher.css +133 -0
- package/dist/skins-src/utilities.css +130 -0
- package/dist/skins-src/web-components.css +64 -0
- package/dist/strip-paint.d.mts +7 -0
- package/dist/strip-paint.mjs +131 -0
- package/dist/themes/AntDark.md +14 -0
- package/dist/themes/AntDark.ts +47 -0
- package/dist/themes/AntLight.md +21 -0
- package/dist/themes/AntLight.ts +95 -0
- package/dist/themes/CatppuccinLatte.md +20 -0
- package/dist/themes/CatppuccinLatte.ts +93 -0
- package/dist/themes/CatppuccinMocha.md +15 -0
- package/dist/themes/CatppuccinMocha.ts +93 -0
- package/dist/themes/ChakraDark.md +8 -0
- package/dist/themes/ChakraDark.ts +47 -0
- package/dist/themes/ChakraLight.md +14 -0
- package/dist/themes/ChakraLight.ts +93 -0
- package/dist/themes/Contrast.test.ts +80 -0
- package/dist/themes/CupcakeDark.md +8 -0
- package/dist/themes/CupcakeDark.ts +39 -0
- package/dist/themes/CupcakeLight.md +31 -0
- package/dist/themes/CupcakeLight.ts +93 -0
- package/dist/themes/DefaultTheme.md +8 -0
- package/dist/themes/DefaultTheme.test.ts +96 -0
- package/dist/themes/DefaultTheme.ts +137 -0
- package/dist/themes/DraculaDark.md +14 -0
- package/dist/themes/DraculaDark.ts +93 -0
- package/dist/themes/DraculaLight.md +8 -0
- package/dist/themes/DraculaLight.ts +55 -0
- package/dist/themes/EmeraldDark.md +8 -0
- package/dist/themes/EmeraldDark.ts +35 -0
- package/dist/themes/EmeraldLight.md +8 -0
- package/dist/themes/EmeraldLight.ts +93 -0
- package/dist/themes/EverforestDark.md +26 -0
- package/dist/themes/EverforestDark.ts +99 -0
- package/dist/themes/EverforestLight.md +31 -0
- package/dist/themes/EverforestLight.ts +51 -0
- package/dist/themes/FluentDark.md +8 -0
- package/dist/themes/FluentDark.ts +47 -0
- package/dist/themes/FluentLight.md +8 -0
- package/dist/themes/FluentLight.ts +100 -0
- package/dist/themes/GraphiteDark.md +8 -0
- package/dist/themes/GraphiteDark.ts +35 -0
- package/dist/themes/GraphiteLight.md +14 -0
- package/dist/themes/GraphiteLight.ts +93 -0
- package/dist/themes/GruvboxDark.md +14 -0
- package/dist/themes/GruvboxDark.ts +93 -0
- package/dist/themes/GruvboxLight.md +27 -0
- package/dist/themes/GruvboxLight.ts +49 -0
- package/dist/themes/MaterialDark.md +8 -0
- package/dist/themes/MaterialDark.ts +47 -0
- package/dist/themes/MaterialLight.md +8 -0
- package/dist/themes/MaterialLight.ts +104 -0
- package/dist/themes/MidnightDark.md +8 -0
- package/dist/themes/MidnightDark.ts +19 -0
- package/dist/themes/MidnightLight.md +8 -0
- package/dist/themes/MidnightLight.ts +23 -0
- package/dist/themes/NordDark.md +28 -0
- package/dist/themes/NordDark.ts +93 -0
- package/dist/themes/NordLight.md +20 -0
- package/dist/themes/NordLight.ts +50 -0
- package/dist/themes/OneDark.md +26 -0
- package/dist/themes/OneDark.ts +93 -0
- package/dist/themes/OneLight.md +20 -0
- package/dist/themes/OneLight.ts +51 -0
- package/dist/themes/PrimerDark.md +26 -0
- package/dist/themes/PrimerDark.ts +99 -0
- package/dist/themes/PrimerLight.md +14 -0
- package/dist/themes/PrimerLight.ts +93 -0
- package/dist/themes/RosePine.md +23 -0
- package/dist/themes/RosePine.ts +93 -0
- package/dist/themes/RosePineDawn.md +20 -0
- package/dist/themes/RosePineDawn.ts +51 -0
- package/dist/themes/SkandaDark.md +8 -0
- package/dist/themes/SkandaDark.ts +57 -0
- package/dist/themes/SkandaLight.md +8 -0
- package/dist/themes/SkandaLight.ts +96 -0
- package/dist/themes/SolarizedDark.md +8 -0
- package/dist/themes/SolarizedDark.ts +93 -0
- package/dist/themes/SolarizedLight.md +32 -0
- package/dist/themes/SolarizedLight.ts +93 -0
- package/dist/themes/SynthwaveDark.md +8 -0
- package/dist/themes/SynthwaveDark.ts +93 -0
- package/dist/themes/SynthwaveLight.md +20 -0
- package/dist/themes/SynthwaveLight.ts +48 -0
- package/dist/themes/Themes.test.ts +110 -0
- package/dist/themes/brands.test.ts +63 -0
- package/dist/themes/brands.ts +121 -0
- package/dist/themes/createBrandTheme.test.ts +223 -0
- package/dist/themes/createBrandTheme.ts +298 -0
- package/dist/themes/index.ts +54 -0
- package/package.json +73 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** A physical edge of the anchor. */
|
|
2
|
+
export type PhysicalSide = 'top' | 'right' | 'bottom' | 'left';
|
|
3
|
+
/** Side the floating content is placed against; `start`/`end` are logical and resolve under `dir`. */
|
|
4
|
+
export type Side = PhysicalSide | 'start' | 'end';
|
|
5
|
+
/** Alignment of the floating element along the chosen {@link Side}. */
|
|
6
|
+
export type Align = 'start' | 'center' | 'end';
|
|
7
|
+
/** Minimum distance from the collision boundary, for every side or per side. */
|
|
8
|
+
export type CollisionPadding = number | Partial<Record<PhysicalSide, number>>;
|
|
9
|
+
/** The floating-ui placement string for a resolved side and alignment. */
|
|
10
|
+
export declare function toPlacement(side: PhysicalSide, align: Align): string;
|
|
11
|
+
/** The side and alignment a floating-ui placement string resolved to. */
|
|
12
|
+
export declare function placementParts(placement: string): [PhysicalSide, Align];
|
|
13
|
+
/**
|
|
14
|
+
* Writes the four `--skdx-<component>-*` measurement properties onto the floating element after a reposition, with the transform origin derived from the resolved side/alignment so a flipped panel grows from the edge it actually sits on.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setMeasurementProperties(floating: HTMLElement, component: string, measurements: {
|
|
17
|
+
availableWidth: number;
|
|
18
|
+
availableHeight: number;
|
|
19
|
+
triggerWidth: number;
|
|
20
|
+
side: PhysicalSide;
|
|
21
|
+
align: Align;
|
|
22
|
+
}): void;
|
|
23
|
+
/** The edge an arrow sits on: opposite the side the panel was placed against. */
|
|
24
|
+
export declare const OPPOSITE_SIDE: Record<PhysicalSide, PhysicalSide>;
|
|
25
|
+
/** Inline style for an arrow element given floating-ui's arrow offsets and the resolved side. */
|
|
26
|
+
export declare function arrowStyle(offsets: {
|
|
27
|
+
x?: number | undefined;
|
|
28
|
+
y?: number | undefined;
|
|
29
|
+
} | undefined, side: PhysicalSide): {
|
|
30
|
+
position: 'absolute';
|
|
31
|
+
left: string;
|
|
32
|
+
top: string;
|
|
33
|
+
right: string;
|
|
34
|
+
bottom: string;
|
|
35
|
+
transform: string;
|
|
36
|
+
};
|
|
37
|
+
/** Applies {@link arrowStyle} to an arrow element in place. */
|
|
38
|
+
export declare function styleArrow(el: HTMLElement, offsets: {
|
|
39
|
+
x?: number | undefined;
|
|
40
|
+
y?: number | undefined;
|
|
41
|
+
} | undefined, side: PhysicalSide): void;
|
|
42
|
+
/** What the `size` middleware reports after flip/shift settled. */
|
|
43
|
+
export interface SizeState {
|
|
44
|
+
availableWidth: number;
|
|
45
|
+
availableHeight: number;
|
|
46
|
+
elements: {
|
|
47
|
+
floating: HTMLElement;
|
|
48
|
+
};
|
|
49
|
+
rects: {
|
|
50
|
+
reference: {
|
|
51
|
+
width: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
placement: string;
|
|
55
|
+
}
|
|
56
|
+
/** The floating-ui middleware factories an adapter injects — `M` is its `Middleware`, `L` its shift limiter, `E` what its `arrow` accepts as the element. */
|
|
57
|
+
export interface FloatingMiddleware<M, L, E> {
|
|
58
|
+
offset(options: {
|
|
59
|
+
mainAxis: number;
|
|
60
|
+
alignmentAxis: number;
|
|
61
|
+
}): M;
|
|
62
|
+
flip(options: {
|
|
63
|
+
padding: CollisionPadding;
|
|
64
|
+
boundary?: Element | Element[];
|
|
65
|
+
}): M;
|
|
66
|
+
shift(options: {
|
|
67
|
+
padding: CollisionPadding;
|
|
68
|
+
limiter: L;
|
|
69
|
+
boundary?: Element | Element[];
|
|
70
|
+
}): M;
|
|
71
|
+
limitShift(): L;
|
|
72
|
+
size(options: {
|
|
73
|
+
padding: CollisionPadding;
|
|
74
|
+
boundary?: Element | Element[];
|
|
75
|
+
apply(state: SizeState): void;
|
|
76
|
+
}): M;
|
|
77
|
+
arrow(options: {
|
|
78
|
+
element: E;
|
|
79
|
+
padding: number;
|
|
80
|
+
}): M;
|
|
81
|
+
hide(options: {
|
|
82
|
+
strategy: 'referenceHidden';
|
|
83
|
+
boundary?: Element | Element[];
|
|
84
|
+
}): M;
|
|
85
|
+
}
|
|
86
|
+
/** The options {@link positioningMiddleware} turns into a middleware list. */
|
|
87
|
+
export interface PositioningOptions<E> {
|
|
88
|
+
sideOffset?: number | undefined;
|
|
89
|
+
alignOffset?: number | undefined;
|
|
90
|
+
avoidCollisions?: boolean | undefined;
|
|
91
|
+
collisionPadding?: CollisionPadding | undefined;
|
|
92
|
+
collisionBoundary?: Element | Element[] | null | undefined;
|
|
93
|
+
/** Kebab-case component name the measurement properties are written under; omitted, none are written. */
|
|
94
|
+
component?: string | undefined;
|
|
95
|
+
arrow?: E | null | undefined;
|
|
96
|
+
arrowPadding?: number | undefined;
|
|
97
|
+
hideWhenDetached?: boolean | undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The one middleware order every panel uses: offset, then flip/shift when collisions are avoided, then `size` (so it measures the placement the content landed on), the arrow, and `hide` last so visibility is judged against the settled placement.
|
|
101
|
+
*/
|
|
102
|
+
export declare function positioningMiddleware<M, L, E>(fu: FloatingMiddleware<M, L, E>, options: PositioningOptions<E>): M[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function O(e,i){return i==="center"?e:`${e}-${i}`}function x(e){let[i,t="center"]=e.split("-");return[i,t]}var P={start:"0%",center:"50%",end:"100%"};function E(e,i,t){let{availableWidth:n,availableHeight:s,triggerWidth:o,side:r,align:d}=t,a=P[d],g=r==="top"||r==="bottom"?`${a} ${r==="top"?"100%":"0%"}`:`${r==="left"?"100%":"0%"} ${a}`;e.style.setProperty(`--skdx-${i}-available-width`,`${n}px`),e.style.setProperty(`--skdx-${i}-available-height`,`${s}px`),e.style.setProperty(`--skdx-${i}-trigger-width`,`${o}px`),e.style.setProperty(`--skdx-${i}-transform-origin`,g)}var S={top:"bottom",right:"left",bottom:"top",left:"right"};function M(e,i){let t=S[i],n={position:"absolute",left:e?.x!=null?`${e.x}px`:"",top:e?.y!=null?`${e.y}px`:"",right:"",bottom:"",transform:""};return t==="top"&&Object.assign(n,{top:"0px",transform:"translateY(-100%)"}),t==="bottom"&&Object.assign(n,{bottom:"0px",transform:"translateY(100%)"}),t==="left"&&Object.assign(n,{left:"0px",transform:"translateX(-100%)"}),t==="right"&&Object.assign(n,{right:"0px",transform:"translateX(100%)"}),n}function w(e,i,t){Object.assign(e.style,M(i,t))}function $(e,i){let{sideOffset:t=0,alignOffset:n=0,avoidCollisions:s=!0,collisionPadding:o=8,collisionBoundary:r,component:d,arrow:a,arrowPadding:g=0,hideWhenDetached:p=!1}=i,l=r?{boundary:r}:{};return[e.offset({mainAxis:t,alignmentAxis:n}),...s?[e.flip({padding:o,...l}),e.shift({padding:o,limiter:e.limitShift(),...l})]:[],e.size({padding:o,...l,apply({availableWidth:m,availableHeight:c,elements:f,rects:u,placement:b}){if(!d)return;let[h,y]=x(b);E(f.floating,d,{availableWidth:m,availableHeight:c,triggerWidth:u.reference.width,side:h,align:y})}}),...a?[e.arrow({element:a,padding:g})]:[],...p?[e.hide({strategy:"referenceHidden",...l})]:[]]}export{S as OPPOSITE_SIDE,M as arrowStyle,x as placementParts,$ as positioningMiddleware,E as setMeasurementProperties,w as styleArrow,O as toPlacement};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QR Code encoder from ISO/IEC 18004: byte mode only (UTF-8), versions 1–40, all four error-correction levels.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/** Error-correction level, in ascending order of redundancy: `L` ≈ 7%, `M` ≈ 15%, `Q` ≈ 25%, `H` ≈ 30%. */
|
|
7
|
+
export type ErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H';
|
|
8
|
+
export declare const MIN_VERSION = 1;
|
|
9
|
+
export declare const MAX_VERSION = 40;
|
|
10
|
+
/** Module count along one edge for `version`: `4 × version + 17`, so 21 at v1 and 177 at v40. */
|
|
11
|
+
export declare function moduleCount(version: number): number;
|
|
12
|
+
/** Total codewords (data + EC) a version holds, independent of level. */
|
|
13
|
+
export declare function totalCodewords(version: number): number;
|
|
14
|
+
/** Bits available for the data segment (mode indicator, character count, payload, padding) at this version and level. */
|
|
15
|
+
export declare function dataCapacityBits(version: number, level: ErrorCorrectionLevel): number;
|
|
16
|
+
/** Centre coordinates of alignment patterns for `version`, ascending, per ISO/IEC 18004 Table E.1. */
|
|
17
|
+
export declare function alignmentPatternPositions(version: number): number[];
|
|
18
|
+
/** Reed–Solomon generator polynomial `(x − α^0)(x − α^1)…(x − α^(degree−1))`, returned monic-implicit (leading 1 omitted). */
|
|
19
|
+
export declare function reedSolomonGeneratorPoly(degree: number): Uint8Array;
|
|
20
|
+
/** 15-bit format-information word: BCH(15, 5) over `level | mask`, XOR-masked to avoid all-zero output. */
|
|
21
|
+
export declare function formatInfoBits(level: ErrorCorrectionLevel, mask: number): number;
|
|
22
|
+
/** 18-bit version-information word: BCH(18, 6), used only for version 7 and up. */
|
|
23
|
+
export declare function versionInfoBits(version: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* Encodes `value` as a QR Code matrix.
|
|
26
|
+
*
|
|
27
|
+
* @param value - The payload, encoded as UTF-8 bytes (byte mode).
|
|
28
|
+
* @param level - Error-correction level. Use `'H'` whenever a logo covers the centre.
|
|
29
|
+
* @param version - Force a symbol version 1–40. Omit to pick the smallest that fits.
|
|
30
|
+
* @returns A square `boolean[][]` indexed `[row][column]`, `true` meaning a dark
|
|
31
|
+
* module — or `null` when the payload exceeds capacity or `version` is invalid. Never throws.
|
|
32
|
+
*/
|
|
33
|
+
export declare function encodeQr(value: string, level: ErrorCorrectionLevel, version?: number): boolean[][] | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var O={L:1,M:0,Q:3,H:2},_={L:0,M:1,Q:2,H:3},B=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],P=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],N=1,z=40,D=3,T=3,V=40,Q=10;function S(n){return n*4+17}function Y(n){let t=(16*n+128)*n+64;if(n>=2){let e=Math.floor(n/7)+2;t-=(25*e-10)*e-55,n>=7&&(t-=36)}return t}function F(n){return Math.floor(Y(n)/8)}function M(n,t){let e=_[t],r=B[e][n]*P[e][n];return(F(n)-r)*8}function j(n){if(n===1)return[];let t=Math.floor(n/7)+2,e=n===32?26:Math.ceil((n*4+4)/(t*2-2))*2,r=[6];for(let o=S(n)-7;r.length<t;o-=e)r.splice(1,0,o);return r}var h=new Uint8Array(512),A=new Uint8Array(256);{let n=1;for(let t=0;t<255;t++)h[t]=n,A[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)h[t]=h[t-255]}function E(n,t){return n===0||t===0?0:h[A[n]+A[t]]}function H(n){let t=new Uint8Array(n);t[n-1]=1;let e=1;for(let r=0;r<n;r++){for(let o=0;o<n;o++){let u=E(t[o]??0,e);t[o]=o+1<n?u^(t[o+1]??0):u}e=E(e,2)}return t}function K(n,t){let e=new Uint8Array(t.length);for(let r of n){let o=r^(e[0]??0);e.copyWithin(0,1),e[e.length-1]=0;for(let u=0;u<e.length;u++)e[u]=(e[u]??0)^E(t[u]??0,o)}return e}function R(n,t,e){let r=n;for(let o=0;o<e;o++)r=r<<1^(r>>>e-1)*t;return r}function X(n,t){let e=O[n]<<3|t;return((e<<10|R(e,1335,10))^21522)&32767}function W(n){return(n<<12|R(n,7973,12))&262143}function C(n){return n<=9?8:16}function d(n,t,e){for(let r=e-1;r>=0;r--)n.push(t>>>r&1)}function q(n,t,e){let r=M(t,e),o=[];d(o,4,4),d(o,n.length,C(t));for(let c of n)d(o,c,8);d(o,0,Math.min(4,r-o.length)),d(o,0,(8-o.length%8)%8);for(let c=236;o.length<r;c^=253)d(o,c,8);let u=new Uint8Array(o.length/8);for(let c=0;c<o.length;c++){let l=c>>>3;u[l]=(u[l]??0)|o[c]<<7-(c&7)}return u}function J(n,t,e){let r=_[e],o=P[r][t],u=B[r][t],c=F(t),l=o-c%o,f=Math.floor(c/o)-u,m=H(u),y=[];for(let i=0,b=0;i<o;i++){let U=f+(i<l?0:1),k=n.subarray(b,b+U);b+=U,y.push({data:k,ecc:K(k,m)})}let p=new Uint8Array(c),G=0;for(let i=0;i<=f;i++)for(let b of y)i<b.data.length&&(p[G++]=b.data[i]);for(let i=0;i<u;i++)for(let b of y)p[G++]=b.ecc[i];return p}var I=[(n,t)=>(n+t)%2===0,(n,t)=>t%2===0,n=>n%3===0,(n,t)=>(n+t)%3===0,(n,t)=>(Math.floor(t/2)+Math.floor(n/3))%2===0,(n,t)=>n*t%2+n*t%3===0,(n,t)=>(n*t%2+n*t%3)%2===0,(n,t)=>((n+t)%2+n*t%3)%2===0];function Z(n){let t=S(n),e=()=>Array.from({length:t},()=>new Array(t).fill(!1));return{size:t,modules:e(),isFunction:e()}}function s(n,t,e,r){n.modules[e][t]=r,n.isFunction[e][t]=!0}var a=(n,t)=>(n>>>t&1)!==0;function x(n,t,e){for(let r=-4;r<=4;r++)for(let o=-4;o<=4;o++){let u=t+o,c=e+r;if(u<0||u>=n.size||c<0||c>=n.size)continue;let l=Math.max(Math.abs(o),Math.abs(r));s(n,u,c,l!==2&&l!==4)}}function $(n,t,e){for(let r=-2;r<=2;r++)for(let o=-2;o<=2;o++)s(n,t+o,e+r,Math.max(Math.abs(o),Math.abs(r))!==1)}function L(n,t,e){let r=X(t,e),{size:o}=n;for(let u=0;u<=5;u++)s(n,8,u,a(r,u));s(n,8,7,a(r,6)),s(n,8,8,a(r,7)),s(n,7,8,a(r,8));for(let u=9;u<15;u++)s(n,14-u,8,a(r,u));for(let u=0;u<8;u++)s(n,o-1-u,8,a(r,u));for(let u=8;u<15;u++)s(n,8,o-15+u,a(r,u));s(n,8,o-8,!0)}function v(n,t){if(t<7)return;let e=W(t);for(let r=0;r<18;r++){let o=a(e,r),u=n.size-11+r%3,c=Math.floor(r/3);s(n,u,c,o),s(n,c,u,o)}}function g(n,t,e){let{size:r}=n;for(let c=0;c<r;c++)s(n,6,c,c%2===0),s(n,c,6,c%2===0);x(n,3,3),x(n,r-4,3),x(n,3,r-4);let o=j(t),u=o.length-1;for(let c=0;c<=u;c++)for(let l=0;l<=u;l++)c===0&&l===0||c===0&&l===u||c===u&&l===0||$(n,o[c],o[l]);L(n,e,0),v(n,t)}function nn(n,t){let{size:e}=n,r=0;for(let o=e-1;o>=1;o-=2){o===6&&(o=5);for(let u=0;u<e;u++)for(let c=0;c<2;c++){let l=o-c,m=(o+1&2)===0?e-1-u:u;n.isFunction[m][l]||r>=t.length*8||(n.modules[m][l]=a(t[r>>>3],7-(r&7)),r++)}}}function w(n,t){let e=I[t];for(let r=0;r<n.size;r++)for(let o=0;o<n.size;o++)!n.isFunction[r][o]&&e(o,r)&&(n.modules[r][o]=!n.modules[r][o])}function tn(n,t){let e=0,r=n(0),o=1;for(let u=1;u<t;u++)n(u)===r?(o++,o===5?e+=D:o>5&&(e+=1)):(r=n(u),o=1);return e}function on(n,t){let e=0;for(let r=0;r+10<t;r++){let o=0,u=0;for(let c=0;c<11;c++){let l=n(r+c)?1:0;o=o<<1|l,u|=l<<c}(o===1488||u===1488)&&(e+=V)}return e}function rn(n){let{size:t,modules:e}=n,r=0;for(let o=0;o+1<t;o++)for(let u=0;u+1<t;u++){let c=e[o][u];c===e[o][u+1]&&c===e[o+1][u]&&c===e[o+1][u+1]&&(r+=T)}return r}function en(n){let{size:t,modules:e}=n,r=0;for(let u of e)for(let c of u)c&&r++;let o=t*t;return Math.floor(Math.abs(r*2-o)*10/o)*Q}function un(n){let{size:t,modules:e}=n,r=0;for(let o of[!0,!1])for(let u=0;u<t;u++){let c=l=>o?e[u][l]:e[l][u];r+=tn(c,t),r+=on(c,t)}return r+rn(n)+en(n)}function cn(n,t){for(let e=N;e<=z;e++)if(4+C(e)+n*8<=M(e,t))return e;return null}function ln(n,t,e){let r=new TextEncoder().encode(n),o;if(e===void 0?o=cn(r.length,t):!Number.isInteger(e)||e<N||e>z?o=null:o=4+C(e)+r.length*8<=M(e,t)?e:null,o===null)return null;let u=Z(o);g(u,o,t),nn(u,J(q(r,o,t),o,t));let c=0,l=1/0;for(let f=0;f<I.length;f++){w(u,f),L(u,t,f);let m=un(u);m<l&&(l=m,c=f),w(u,f)}return w(u,c),L(u,t,c),u.modules}export{z as MAX_VERSION,N as MIN_VERSION,j as alignmentPatternPositions,M as dataCapacityBits,ln as encodeQr,X as formatInfoBits,S as moduleCount,H as reedSolomonGeneratorPoly,F as totalCodewords,W as versionInfoBits};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Matches an item excluded from the roving order — the contract names `data-disabled`, and native controls also carry `disabled`. */
|
|
2
|
+
export declare const DISABLED_ITEM_SELECTOR = "[disabled], [data-disabled]";
|
|
3
|
+
/** Whether an item is out of the roving order, testing both attribute spellings. */
|
|
4
|
+
export declare function isRovingItemDisabled(item: Element): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The group's items in document order, minus the disabled ones and minus any that belong to a nested group.
|
|
7
|
+
*
|
|
8
|
+
* @param root the group element owning the items, or `null` before it mounts
|
|
9
|
+
* @param itemSelector selector matching one item
|
|
10
|
+
* @param scopeSelector selector naming an item's owning group, so a nested group's items are left to it
|
|
11
|
+
* @returns the enabled items, empty when `root` is not mounted yet
|
|
12
|
+
*/
|
|
13
|
+
export declare function enabledRovingItems(root: ParentNode | null | undefined, itemSelector: string, scopeSelector?: string): HTMLElement[];
|
|
14
|
+
/**
|
|
15
|
+
* The id that should hold the tab stop after the items or the selection changed.
|
|
16
|
+
*
|
|
17
|
+
* Active items win, and the stop stays put while it is still on one of them; with
|
|
18
|
+
* nothing active it stays on whichever item still claims it, else falls to the first.
|
|
19
|
+
* An active id that is not in `ids` — disabled, or unmounted since it was selected —
|
|
20
|
+
* cannot hold the stop, so the group stays reachable by Tab.
|
|
21
|
+
*
|
|
22
|
+
* @param ids every enabled item's id, in document order
|
|
23
|
+
* @param activeIds the ids of the selected/pressed/active items, in document order
|
|
24
|
+
* @param currentId the id holding the stop now, or `null` before one is resolved
|
|
25
|
+
* @returns the id to give the stop to, or `null` when the group has no enabled item
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveTabStopId(ids: readonly string[], activeIds: readonly string[], currentId: string | null): string | null;
|
|
28
|
+
/** Every enabled item's id, skipping items that carry no id — they cannot hold a stop that survives a re-render. */
|
|
29
|
+
export declare function rovingItemIds(items: readonly Element[], idAttribute: string): string[];
|
|
30
|
+
/**
|
|
31
|
+
* The `tabindex` for one item: before the group resolves its stop — which only happens in a layout effect, so never during SSR — every enabled item is a stop rather than none.
|
|
32
|
+
*
|
|
33
|
+
* @param resolved whether the group has settled which item holds the stop
|
|
34
|
+
* @param isTabStop whether this item is that one
|
|
35
|
+
* @param disabled whether this item is disabled, in which case it never claims a stop
|
|
36
|
+
*/
|
|
37
|
+
export declare function rovingTabIndex(resolved: boolean, isTabStop: boolean, disabled?: boolean): 0 | -1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i="[disabled], [data-disabled]";function o(e){return e.matches(i)}function s(e,t,n){return Array.from(e?.querySelectorAll(t)??[]).filter(r=>!o(r)&&(!n||r.closest(n)===e))}function a(e,t,n){let l=t.filter(r=>e.includes(r));return l.length>0?n!==null&&l.includes(n)?n:l[0]:n!==null&&e.includes(n)?n:e[0]??null}function u(e,t){return e.map(n=>n.getAttribute(t)).filter(n=>n!==null&&n!=="")}function g(e,t,n=!1){return e||n?t?0:-1:0}export{i as DISABLED_ITEM_SELECTOR,s as enabledRovingItems,o as isRovingItemDisabled,a as resolveTabStopId,u as rovingItemIds,g as rovingTabIndex};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** Where the listbox should put the active option when a key opens it. */
|
|
2
|
+
export type SelectOpenIntent = 'selected' | 'first' | 'last';
|
|
3
|
+
/** Ten is the normative page jump for a listbox — a headless package has no rendered row height to divide by. */
|
|
4
|
+
export declare const SELECT_PAGE_SIZE = 10;
|
|
5
|
+
/** What a keydown on a closed trigger asks for. Every action but `'ignore'` wants `preventDefault()`. */
|
|
6
|
+
export type SelectClosedAction =
|
|
7
|
+
/** Open the listbox with the active option placed as `intent` says. */
|
|
8
|
+
{
|
|
9
|
+
kind: 'open';
|
|
10
|
+
intent: SelectOpenIntent;
|
|
11
|
+
}
|
|
12
|
+
/** A letter arrived on a multiple-select: open the listbox and search there, since a closed multi-select has no single "current" option to walk from. */
|
|
13
|
+
| {
|
|
14
|
+
kind: 'open-for-typeahead';
|
|
15
|
+
}
|
|
16
|
+
/** A letter arrived on a single-select: match it against the options and select the hit without opening, as a native `<select>` does. */
|
|
17
|
+
| {
|
|
18
|
+
kind: 'typeahead';
|
|
19
|
+
}
|
|
20
|
+
/** Not a key this trigger claims. */
|
|
21
|
+
| {
|
|
22
|
+
kind: 'ignore';
|
|
23
|
+
};
|
|
24
|
+
/** What a keydown on an open listbox asks for; `index` is already clamped into range. */
|
|
25
|
+
export type SelectOpenAction =
|
|
26
|
+
/** Move the active option to `index`. */
|
|
27
|
+
{
|
|
28
|
+
kind: 'activate';
|
|
29
|
+
index: number;
|
|
30
|
+
}
|
|
31
|
+
/** Select the active option, and close unless `closeOnSelect` is off. */
|
|
32
|
+
| {
|
|
33
|
+
kind: 'commit';
|
|
34
|
+
}
|
|
35
|
+
/** Alt+ArrowUp: select the active option and close, the keyboard equivalent of clicking it. */
|
|
36
|
+
| {
|
|
37
|
+
kind: 'commit-and-close';
|
|
38
|
+
}
|
|
39
|
+
/** Tab: add the active option to the selection without ever removing it, then close and let the browser's own Tab run. */
|
|
40
|
+
| {
|
|
41
|
+
kind: 'commit-on-exit';
|
|
42
|
+
}
|
|
43
|
+
/** A letter arrived: run the typeahead and activate its hit. */
|
|
44
|
+
| {
|
|
45
|
+
kind: 'typeahead';
|
|
46
|
+
}
|
|
47
|
+
/** Alt+ArrowDown, the open key: claimed so it cannot move focus, but nothing else happens. */
|
|
48
|
+
| {
|
|
49
|
+
kind: 'claim';
|
|
50
|
+
}
|
|
51
|
+
/** Not a key the listbox claims. */
|
|
52
|
+
| {
|
|
53
|
+
kind: 'ignore';
|
|
54
|
+
};
|
|
55
|
+
/** A keydown, reduced to what the decision needs. */
|
|
56
|
+
export interface SelectKeyEvent {
|
|
57
|
+
key: string;
|
|
58
|
+
altKey: boolean;
|
|
59
|
+
ctrlKey: boolean;
|
|
60
|
+
metaKey: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** Whether the adapter should call `preventDefault()` for this action; Tab is the exception, because focus is not trapped and the browser's own Tab has to carry focus onward. */
|
|
63
|
+
export declare function selectKeyPrevented(action: SelectClosedAction | SelectOpenAction): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The action for a keydown on a closed trigger.
|
|
66
|
+
*
|
|
67
|
+
* @param event the keydown
|
|
68
|
+
* @param multiple whether the Select holds more than one value
|
|
69
|
+
* @returns what the adapter should do; see {@link SelectClosedAction}
|
|
70
|
+
*/
|
|
71
|
+
export declare function selectClosedAction(event: SelectKeyEvent, multiple: boolean): SelectClosedAction;
|
|
72
|
+
/**
|
|
73
|
+
* The action for a keydown while the listbox is open, over virtual focus: DOM focus stays on the trigger, so these move the active option, not the focused element.
|
|
74
|
+
*
|
|
75
|
+
* @param event the keydown
|
|
76
|
+
* @param currentIndex the active option's index, or `-1` when none is active
|
|
77
|
+
* @param optionCount how many options the listbox renders
|
|
78
|
+
* @returns what the adapter should do; see {@link SelectOpenAction}
|
|
79
|
+
*/
|
|
80
|
+
export declare function selectOpenAction(event: SelectKeyEvent, currentIndex: number, optionCount: number): SelectOpenAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isTypeaheadKey as c}from"./typeahead.js";var o=10,a={ArrowDown:"first",Home:"first",ArrowUp:"last",End:"last",Enter:"selected"," ":"selected"};function k(e){return e.kind!=="ignore"&&e.kind!=="commit-on-exit"}function r(e,t,n){return Math.min(n-1,Math.max(0,e+t))}function m(e,t){if(e.altKey&&e.key==="ArrowUp")return{kind:"ignore"};let n=a[e.key];return n!==void 0?{kind:"open",intent:e.altKey&&e.key==="ArrowDown"?"selected":n}:c(e)?t?{kind:"open-for-typeahead"}:{kind:"typeahead"}:{kind:"ignore"}}function s(e,t,n){if(e.altKey&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return e.key==="ArrowUp"?{kind:"commit-and-close"}:{kind:"claim"};let i=d(e.key,t,n);return i!==null?n===0?{kind:"claim"}:{kind:"activate",index:i}:e.key==="Enter"||e.key===" "?{kind:"commit"}:e.key==="Tab"?{kind:"commit-on-exit"}:c(e)?{kind:"typeahead"}:{kind:"ignore"}}function d(e,t,n){switch(e){case"ArrowDown":return r(t,1,n);case"ArrowUp":return r(t,-1,n);case"PageDown":return r(t,o,n);case"PageUp":return r(t,-o,n);case"Home":return 0;case"End":return n-1;default:return null}}export{o as SELECT_PAGE_SIZE,m as selectClosedAction,k as selectKeyPrevented,s as selectOpenAction};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Why a selection change happened: user-driven (keyboard or pointer) or set by the application. */
|
|
2
|
+
export type SelectionChangeReason = 'keyboard' | 'pointer' | 'programmatic';
|
|
3
|
+
/** The payload every single-or-many control's change event carries — the strict-out shape. */
|
|
4
|
+
export interface SelectionChangeDetail {
|
|
5
|
+
/** The whole selection, always an array, in single and multiple mode alike. */
|
|
6
|
+
value: string[];
|
|
7
|
+
/** The first selected value, or `null` when nothing is selected. */
|
|
8
|
+
selectedValue: string | null;
|
|
9
|
+
/** The selection this change replaced, in the same array shape as `value`. */
|
|
10
|
+
previousValue?: string[];
|
|
11
|
+
/** What drove the change — see {@link SelectionChangeReason}. */
|
|
12
|
+
reason?: SelectionChangeReason;
|
|
13
|
+
}
|
|
14
|
+
/** Options {@link toSelectionValues} needs to apply the single-selection rule. */
|
|
15
|
+
export interface SelectionValueOptions {
|
|
16
|
+
/** Whether the control may hold more than one value at once — `multiple`, or `type === 'multiple'` on the families that spell it that way. */
|
|
17
|
+
multiple: boolean;
|
|
18
|
+
/** The component and member named in the development error, e.g. `Select value`, so the message says which of a page's selects is wrong. */
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
21
|
+
/** Every selected value as an array, whatever shape was passed; `''` and `undefined` mean nothing selected. */
|
|
22
|
+
export declare function toValues(value: string | string[] | undefined): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Normalizes every selection value to `string[]`, enforcing the single-selection rule; called once at the boundary, never again downstream.
|
|
25
|
+
*
|
|
26
|
+
* @param input the value the consumer supplied, in any accepted shape
|
|
27
|
+
* @param options cardinality and label for errors — see {@link SelectionValueOptions}
|
|
28
|
+
* @returns the selection as an array; at most one element unless `multiple`
|
|
29
|
+
* @throws RangeError in development when an entry is not a string or a single-select gets multiple values
|
|
30
|
+
*/
|
|
31
|
+
export declare function toSelectionValues(input: string | readonly string[] | null | undefined, { multiple, label }: SelectionValueOptions): string[];
|
|
32
|
+
/**
|
|
33
|
+
* The `selectedValue` half of the rule's output: the first selected value, or `null` (never `undefined` or `''`).
|
|
34
|
+
*
|
|
35
|
+
* @param values the normalized selection, as {@link toSelectionValues} returns it
|
|
36
|
+
* @returns the first selected value, or `null` when nothing is selected
|
|
37
|
+
*/
|
|
38
|
+
export declare function selectedValueOf(values: readonly string[]): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The selection after choosing `value`: replaces it, or toggles it within the set when `multiple`.
|
|
41
|
+
*
|
|
42
|
+
* @param selected the current selection, already normalized
|
|
43
|
+
* @param value the option value the user committed
|
|
44
|
+
* @param multiple whether choosing toggles within a set rather than replacing
|
|
45
|
+
* @param deselectable whether re-choosing the only selected value clears it (single-select only)
|
|
46
|
+
* @returns the new selection as an array in both cardinalities
|
|
47
|
+
*/
|
|
48
|
+
export declare function nextSelection(selected: readonly string[], value: string, multiple: boolean, deselectable?: boolean): string[];
|
|
49
|
+
/** Whether two selections are indistinguishable to a consumer: same values in the same order. */
|
|
50
|
+
export declare function sameSelection(a: readonly string[], b: readonly string[]): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Parses the attribute form — one comma-separated list under both cardinalities — with {@link toSelectionValues} enforcing the rule.
|
|
53
|
+
*
|
|
54
|
+
* @param attribute the raw attribute string, or `null` when absent
|
|
55
|
+
* @param options cardinality and label for errors
|
|
56
|
+
* @returns the selection as an array
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseSelectionAttribute(attribute: string | null | undefined, options: SelectionValueOptions): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isDevMode as s}from"./dev-mode.js";function g(e){return Array.isArray(e)?e:e?[e]:[]}function l(e){if(s())throw new RangeError(e);console.error(e)}function a(e,{multiple:n,label:t}){let i;Array.isArray(e)?i=e:i=e==null?[]:[e];let r=[];for(let o of i){if(typeof o!="string"){l(`[skdx] ${t}: a selection value must be a string, got ${o===null?"null":typeof o} (${JSON.stringify(o)}). If this is a change payload, read its \`value\` \u2014 the event carries { value, selectedValue } and only \`value\` goes back in.`);continue}o!==""&&r.push(o)}return n||r.length<=1?r:(l(`[skdx] ${t}: a single-selection control was given ${r.length} values (${r.join(", ")}). Only one can be held \u2014 pass a single value, or turn the control multiple. Set multiple (or type="multiple") to keep them all.`),[r[0]])}function c(e){return e.length>0?e[0]:null}function f(e,n,t,i=!1){return t?e.includes(n)?e.filter(r=>r!==n):[...e,n]:i&&e.length===1&&e[0]===n?[]:[n]}function p(e,n){return e.length===n.length&&e.every((t,i)=>t===n[i])}function d(e,n){return e==null?[]:a(e.split(",").map(t=>t.trim()),n)}export{f as nextSelection,d as parseSelectionAttribute,p as sameSelection,c as selectedValueOf,a as toSelectionValues,g as toValues};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The elements a `Tab` press can land on — this package's one definition of "tabbable", for components that have to walk the tab order by hand. */
|
|
2
|
+
export declare const TABBABLE_SELECTOR: string;
|
|
3
|
+
/**
|
|
4
|
+
* Every tabbable element inside `container`, in document order. Uses only the
|
|
5
|
+
* selector without visibility checks (unlike focus traps) because overlays are
|
|
6
|
+
* small subtrees only in the DOM while open.
|
|
7
|
+
*/
|
|
8
|
+
export declare function tabbablesWithin(container: Element): HTMLElement[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function n(t){return Array.from(t.querySelectorAll(e))}export{e as TABBABLE_SELECTOR,n as tabbablesWithin};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Where the clock stands: never started, running, held by a pause, or finished. */
|
|
2
|
+
export type TimerPhase = 'idle' | 'running' | 'paused' | 'complete';
|
|
3
|
+
/** The clock as a consumer renders it, computed fresh on every read. */
|
|
4
|
+
export interface TimerState {
|
|
5
|
+
/** Where the clock stands right now, as one of the four phases. */
|
|
6
|
+
phase: TimerPhase;
|
|
7
|
+
/** Milliseconds the clock has actually run, never counting paused time. */
|
|
8
|
+
elapsed: number;
|
|
9
|
+
/** Milliseconds left before completion, or `Infinity` when counting up. */
|
|
10
|
+
remaining: number;
|
|
11
|
+
/** The countdown length in force, `Infinity` for an open-ended count-up. */
|
|
12
|
+
duration: number;
|
|
13
|
+
}
|
|
14
|
+
/** How one clock is configured; every field has a working default. */
|
|
15
|
+
export interface TimerOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Countdown length in milliseconds; leave it out to count up with no end.
|
|
18
|
+
*
|
|
19
|
+
* @default Infinity
|
|
20
|
+
*/
|
|
21
|
+
duration?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Milliseconds between `onTick` calls while running; `0` reports no ticks.
|
|
24
|
+
*
|
|
25
|
+
* @default 0
|
|
26
|
+
*/
|
|
27
|
+
tickMs?: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a hidden or unloading page pauses the clock and a returning page resumes it.
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
pauseWhenHidden?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Called on every tick and once more at completion, for rendering the clock only.
|
|
36
|
+
*
|
|
37
|
+
* Ticks are far too frequent to announce: write them to a progress bar or a
|
|
38
|
+
* `<time>`, never to a live region.
|
|
39
|
+
*/
|
|
40
|
+
onTick?: ((state: TimerState) => void) | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the phase changes, and only on an actual change, so it is the one place announcements belong.
|
|
43
|
+
*/
|
|
44
|
+
onPhaseChange?: ((state: TimerState) => void) | undefined;
|
|
45
|
+
}
|
|
46
|
+
/** A framework-neutral countdown or count-up: `start`, `pause`, `resume`, `reset`, and a completion phase. */
|
|
47
|
+
export declare class Timer {
|
|
48
|
+
private readonly options;
|
|
49
|
+
private readonly tickMs;
|
|
50
|
+
private duration;
|
|
51
|
+
private phase;
|
|
52
|
+
private accrued;
|
|
53
|
+
private startedAt;
|
|
54
|
+
private completion;
|
|
55
|
+
private ticker;
|
|
56
|
+
private pausedByPage;
|
|
57
|
+
constructor(options?: TimerOptions);
|
|
58
|
+
/** The phase, elapsed, remaining and duration as they read at this instant. */
|
|
59
|
+
get state(): TimerState;
|
|
60
|
+
/**
|
|
61
|
+
* Runs the clock from zero, replacing whatever it was doing.
|
|
62
|
+
*
|
|
63
|
+
* @param duration a new countdown length to adopt, in milliseconds
|
|
64
|
+
*/
|
|
65
|
+
start(duration?: number): void;
|
|
66
|
+
/** Holds the clock where it stands; a second call while already paused changes nothing. */
|
|
67
|
+
pause(): void;
|
|
68
|
+
/** Runs the clock on from where a pause left it; ignored unless it is paused. */
|
|
69
|
+
resume(): void;
|
|
70
|
+
/** Stops the clock and returns it to zero, as it was before the first `start`. */
|
|
71
|
+
reset(): void;
|
|
72
|
+
/** Stops the clock and releases every listener and handle it holds. */
|
|
73
|
+
destroy(): void;
|
|
74
|
+
private measure;
|
|
75
|
+
private run;
|
|
76
|
+
private complete;
|
|
77
|
+
private setPhase;
|
|
78
|
+
private clearHandles;
|
|
79
|
+
private readonly onVisibilityChange;
|
|
80
|
+
private readonly onPageHide;
|
|
81
|
+
private pauseForPage;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=class{constructor(e={}){this.phase="idle";this.accrued=0;this.startedAt=0;this.pausedByPage=!1;this.onVisibilityChange=()=>{document.hidden?this.pauseForPage():this.pausedByPage&&this.resume()};this.onPageHide=()=>{this.pauseForPage()};this.options=e,this.duration=e.duration??Number.POSITIVE_INFINITY,this.tickMs=e.tickMs??0,!(e.pauseWhenHidden===!1||typeof document>"u")&&(document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("pagehide",this.onPageHide))}get state(){let e=this.measure();return{phase:this.phase,elapsed:e,remaining:this.duration-e,duration:this.duration}}start(e){e!==void 0&&(this.duration=e),this.clearHandles(),this.accrued=0,this.pausedByPage=!1,this.run()}pause(){this.pausedByPage=!1,this.phase==="running"&&(this.accrued=this.measure(),this.clearHandles(),this.setPhase("paused"))}resume(){this.pausedByPage=!1,this.phase==="paused"&&this.run()}reset(){this.clearHandles(),this.accrued=0,this.startedAt=0,this.pausedByPage=!1,this.setPhase("idle")}destroy(){this.clearHandles(),!(this.options.pauseWhenHidden===!1||typeof document>"u")&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("pagehide",this.onPageHide))}measure(){let e=this.phase==="running"?Date.now()-this.startedAt:0;return Math.min(this.accrued+e,this.duration)}run(){this.startedAt=Date.now();let e=this.duration-this.accrued;Number.isFinite(e)&&(this.completion=setTimeout(()=>this.complete(),Math.max(e,0))),this.tickMs>0&&(this.ticker=setInterval(()=>this.options.onTick?.(this.state),this.tickMs)),this.setPhase("running")}complete(){this.clearHandles(),this.accrued=this.duration,this.setPhase("complete"),this.tickMs>0&&this.options.onTick?.(this.state)}setPhase(e){this.phase!==e&&(this.phase=e,this.options.onPhaseChange?.(this.state))}clearHandles(){clearTimeout(this.completion),clearInterval(this.ticker),this.completion=void 0,this.ticker=void 0}pauseForPage(){this.phase==="running"&&(this.pause(),this.pausedByPage=!0)}};export{i as Timer};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** The minimal node shape the projection reads; the adapters' own node types are supersets of it. */
|
|
2
|
+
export interface TreeColumnNode {
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
/** Declares a branch whose children have not loaded yet, so its column exists while still empty. */
|
|
6
|
+
hasChildren?: boolean | undefined;
|
|
7
|
+
children?: readonly TreeColumnNode[] | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** One rendered column: the sibling set at a single depth. */
|
|
10
|
+
export interface TreeColumn {
|
|
11
|
+
/** The branch whose children this column lists, or `null` for the root column. */
|
|
12
|
+
parent: string | null;
|
|
13
|
+
/** The column's nodes in collection order; empty while a lazy branch is still loading. */
|
|
14
|
+
nodes: readonly TreeColumnNode[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The columns showing for an expanded set: the roots, then one column per expanded branch along a single open path.
|
|
18
|
+
*
|
|
19
|
+
* Columns are a chain, so at most one branch per depth can be open. An
|
|
20
|
+
* `expanded` set naming two branches at the same depth is not an error: the
|
|
21
|
+
* first in collection order wins and the rest are ignored, which keeps the
|
|
22
|
+
* projection total and lets a consumer hand the same `expanded` array to
|
|
23
|
+
* either layout.
|
|
24
|
+
*
|
|
25
|
+
* @param collection the root nodes, each carrying its own children
|
|
26
|
+
* @param expanded every expanded node's value, in any order
|
|
27
|
+
* @returns the columns left to right; always at least the root column
|
|
28
|
+
*/
|
|
29
|
+
export declare function treeColumns(collection: readonly TreeColumnNode[], expanded: Iterable<string>): TreeColumn[];
|
|
30
|
+
/**
|
|
31
|
+
* The chain of values from the root down to `value`, inclusive, or empty when the collection does not hold it.
|
|
32
|
+
*
|
|
33
|
+
* This is the expanded set that opens `value`'s own column: passing it to
|
|
34
|
+
* {@link treeColumns} shows every ancestor's column and closes every branch off
|
|
35
|
+
* the path. Dropping its last entry is the set that closes `value`'s column
|
|
36
|
+
* instead, which is what moving back a column needs.
|
|
37
|
+
*
|
|
38
|
+
* @param collection the root nodes, each carrying its own children
|
|
39
|
+
* @param value the node to reach
|
|
40
|
+
*/
|
|
41
|
+
export declare function pathTo(collection: readonly TreeColumnNode[], value: string): string[];
|
|
42
|
+
/**
|
|
43
|
+
* The index of the column holding `value`, or `-1` when no showing column does.
|
|
44
|
+
*
|
|
45
|
+
* @param columns the projection {@link treeColumns} returned
|
|
46
|
+
* @param value the node to locate
|
|
47
|
+
*/
|
|
48
|
+
export declare function columnIndexOf(columns: readonly TreeColumn[], value: string): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(o,u){let l=new Set(u),t=[{parent:null,nodes:o}],d=new Set,e=o;for(;;){let n=e.find(r=>l.has(r.value)&&!d.has(r.value)&&((r.children?.length??0)>0||r.hasChildren===!0));if(!n)return t;d.add(n.value),e=n.children??[],t.push({parent:n.value,nodes:e})}}function i(o,u){let l=(t,d)=>{for(let e of t){let n=[...d,e.value];if(e.value===u)return n;let r=e.children?l(e.children,n):null;if(r)return r}return null};return l(o,[])??[]}function s(o,u){return o.findIndex(l=>l.nodes.some(t=>t.value===u))}export{s as columnIndexOf,i as pathTo,a as treeColumns};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** How long successive keys keep merging into one search before the buffer resets. */
|
|
2
|
+
export declare const TYPEAHEAD_TIMEOUT_MS = 1000;
|
|
3
|
+
/** Plain printable character, not a shortcut or named key. */
|
|
4
|
+
export declare function isTypeaheadKey(event: {
|
|
5
|
+
key: string;
|
|
6
|
+
ctrlKey: boolean;
|
|
7
|
+
metaKey: boolean;
|
|
8
|
+
altKey: boolean;
|
|
9
|
+
}): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Text typeahead matches: explicit `data-text-value`, else rendered text, since raw `textContent` fails for items rendering beyond their label.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function itemText(el: Element): string;
|
|
15
|
+
/** Letter-key search like native `<select>` (accumulating buffer and timer), shared by every collection and menu family. */
|
|
16
|
+
export declare class Typeahead {
|
|
17
|
+
private buffer;
|
|
18
|
+
private timer?;
|
|
19
|
+
/**
|
|
20
|
+
* Matches `key` against the label collection, accumulating a 1s buffer (`"s"` + `"a"` = `"sa"`); repeating one letter cycles through matches.
|
|
21
|
+
*
|
|
22
|
+
* @returns the index to move to, or `-1` for no match.
|
|
23
|
+
*/
|
|
24
|
+
match(key: string, labels: string[], currentIndex: number): number;
|
|
25
|
+
/** Drops the pending buffer and its timer. Call when the owner unmounts or closes. */
|
|
26
|
+
clear(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=1e3;function c(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey}function l(t){return t.getAttribute("data-text-value")??t.textContent??""}var f=class{constructor(){this.buffer=""}match(o,i,n){if(o===" "&&this.buffer==="")return-1;clearTimeout(this.timer),this.buffer+=o.toLowerCase(),this.timer=setTimeout(()=>this.buffer="",1e3);let e=this.buffer,s=e.length>1&&[...e].every(r=>r===e[0]),u=s?e[0]:e,m=s||e.length===1?n+1:n;for(let r=0;r<i.length;r++){let a=(Math.max(m,0)+r)%i.length;if(i[a].trim().toLowerCase().startsWith(u))return a}return-1}clear(){clearTimeout(this.timer),this.buffer=""}};export{h as TYPEAHEAD_TIMEOUT_MS,f as Typeahead,c as isTypeaheadKey,l as itemText};
|