@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,250 @@
|
|
|
1
|
+
/** When a Field first runs its validator. See {@link FieldControllerProps.mode}. */
|
|
2
|
+
export type FieldMode = 'change' | 'blur' | 'submit';
|
|
3
|
+
/** What a validator may return: one message, several, or nothing when the value is acceptable. */
|
|
4
|
+
export type FieldValidationResult = string | string[] | null | undefined | void;
|
|
5
|
+
/** A Field's validator, sync or async. */
|
|
6
|
+
export type FieldValidator = (value: unknown) => FieldValidationResult | Promise<FieldValidationResult>;
|
|
7
|
+
/** The bubbling DOM event a Field fires whenever its snapshot changes; a Form's ErrorSummary listens for it. */
|
|
8
|
+
export declare const FIELD_VALIDITY_CHANGE_EVENT = "validity-change";
|
|
9
|
+
/** Marks a Field root, so the error summary can find failing fields without a registry. */
|
|
10
|
+
export declare const FIELD_ROOT_ATTRIBUTE = "data-skdx-field";
|
|
11
|
+
/** Marks a Field's name, used as the error-summary link text when nothing else supplies one. */
|
|
12
|
+
export declare const FIELD_NAME_ATTRIBUTE = "data-skdx-field-name";
|
|
13
|
+
/** The Field's current messages, written to the root on validity changes. */
|
|
14
|
+
export declare const FIELD_MESSAGE_ATTRIBUTE = "data-skdx-field-message";
|
|
15
|
+
/** Marks a Field's description element, so its id can be added to the control's `aria-describedby`. */
|
|
16
|
+
export declare const FIELD_DESCRIPTION_ATTRIBUTE = "data-skdx-field-description";
|
|
17
|
+
/** Marks a Field's error element, so its id can be added to `aria-describedby` and its text read by the summary. */
|
|
18
|
+
export declare const FIELD_ERROR_ATTRIBUTE = "data-skdx-field-error";
|
|
19
|
+
/** Marks a Field's character-count element, so it can be styled and found without a framework ref. */
|
|
20
|
+
export declare const FIELD_CHARACTER_COUNT_ATTRIBUTE = "data-skdx-field-character-count";
|
|
21
|
+
/** Marks a Field whose async validator is still running. */
|
|
22
|
+
export declare const FIELD_PENDING_ATTRIBUTE = "data-skdx-field-pending";
|
|
23
|
+
/** Marks the re-dispatched submit after async validators have settled. */
|
|
24
|
+
export declare const FIELD_RESUBMIT_ATTRIBUTE = "data-skdx-field-resubmit";
|
|
25
|
+
/** Marks a FormField root, allowing error summary to list both Field and FormField failures. */
|
|
26
|
+
export declare const FORM_FIELD_ATTRIBUTE = "data-skdx-form-field";
|
|
27
|
+
/** Marks a rendered FormMessage so the error summary shows the user's displayed message. */
|
|
28
|
+
export declare const FORM_MESSAGE_ATTRIBUTE = "data-skdx-form-message";
|
|
29
|
+
/** Events a Form ErrorSummary should re-scan on. */
|
|
30
|
+
export declare const ERROR_SUMMARY_RESCAN_EVENTS: readonly ["validity-change", "invalid", "change", "blur"];
|
|
31
|
+
/** Marks a Form's ErrorSummary so the engine knows whether to suppress the Field's own announcement. */
|
|
32
|
+
export declare const FIELD_ERROR_SUMMARY_ATTRIBUTE = "data-skdx-error-summary";
|
|
33
|
+
/** Delay in milliseconds before character count announces remaining count. */
|
|
34
|
+
export declare const CHARACTER_COUNT_ANNOUNCE_DELAY_MS = 1000;
|
|
35
|
+
/** What a Field's character count is configured with. */
|
|
36
|
+
export interface FieldCharacterCountOptions {
|
|
37
|
+
/** The soft limit, not the native `maxlength` which truncates silently. */
|
|
38
|
+
maxLength: number;
|
|
39
|
+
/**
|
|
40
|
+
* Percentage of `maxLength` before the count appears; `0` shows it immediately.
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
threshold?: number | undefined;
|
|
44
|
+
}
|
|
45
|
+
/** Default count message; negative means over-limit. */
|
|
46
|
+
export declare function characterCountMessage(remaining: number): string;
|
|
47
|
+
/** Whether a count has passed its threshold and should be rendered/announced. */
|
|
48
|
+
export declare function characterCountVisible(count: number, maxLength: number, threshold?: number): boolean;
|
|
49
|
+
/** Joins a Field's messages into one string, separated by a period unless a message already ends in sentence punctuation. */
|
|
50
|
+
export declare function joinFieldMessages(messages: string[]): string;
|
|
51
|
+
/** Fallback message when native constraint validation has no `validationMessage`. */
|
|
52
|
+
export declare const NATIVE_INVALID_FALLBACK_MESSAGE = "This field is invalid.";
|
|
53
|
+
/** Marks an element as this Field's control, an escape hatch for composites in shadow DOM. */
|
|
54
|
+
export declare const FIELD_CONTROL_ATTRIBUTE = "data-skdx-field-control";
|
|
55
|
+
/** Selector to find a Field's control, matching first in document order. */
|
|
56
|
+
export declare const FIELD_CONTROL_SELECTOR: string;
|
|
57
|
+
/** Marks a Field's required indicator for styling and assertion verification. */
|
|
58
|
+
export declare const FIELD_REQUIRED_INDICATOR_ATTRIBUTE = "data-skdx-field-required-indicator";
|
|
59
|
+
/** The public state of one Field, handed to the framework layer and to `validity-change` listeners. */
|
|
60
|
+
export interface FieldSnapshot {
|
|
61
|
+
/** The id of the discovered control — the Label's `for`, and the error summary's link target. */
|
|
62
|
+
controlId: string;
|
|
63
|
+
/** Every current message, server-injected first. Empty means valid. */
|
|
64
|
+
errors: string[];
|
|
65
|
+
/** `errors.length === 0`. */
|
|
66
|
+
valid: boolean;
|
|
67
|
+
/** The control has been blurred at least once. */
|
|
68
|
+
touched: boolean;
|
|
69
|
+
/** The value has been edited at least once. */
|
|
70
|
+
dirty: boolean;
|
|
71
|
+
/** The control currently holds a value. */
|
|
72
|
+
filled: boolean;
|
|
73
|
+
/** Length of the control's value, tracked only while a character count is configured. */
|
|
74
|
+
count: number;
|
|
75
|
+
/** The discovered control's live `ValidityState`, or `null` when none; compared by identity to detect swaps. */
|
|
76
|
+
validity: ValidityState | null;
|
|
77
|
+
}
|
|
78
|
+
/** The props the framework layer forwards into the controller on every render. */
|
|
79
|
+
export interface FieldControllerProps {
|
|
80
|
+
/** See {@link FieldValidator}. */
|
|
81
|
+
validate?: FieldValidator | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* When validation first runs; re-validates on input after any failure.
|
|
84
|
+
* @default 'blur'
|
|
85
|
+
*/
|
|
86
|
+
mode?: FieldMode | undefined;
|
|
87
|
+
/** Server-injected errors, always shown, listed before anything `validate` produces. */
|
|
88
|
+
errors?: string | string[] | undefined;
|
|
89
|
+
/** Value handed to `validate`; `undefined` reads it off the control instead. */
|
|
90
|
+
value?: unknown;
|
|
91
|
+
/** Field name, used as the error-summary link text when no error element is rendered. */
|
|
92
|
+
name?: string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Whether an answer is mandatory, reflected as native `required` or `aria-required="true"`.
|
|
95
|
+
* @default undefined — not required.
|
|
96
|
+
*/
|
|
97
|
+
required?: boolean | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the field is unavailable, applied as native `disabled` or `aria-disabled="true"`.
|
|
100
|
+
* @default undefined — not disabled.
|
|
101
|
+
*/
|
|
102
|
+
disabled?: boolean | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Formats the character-count message; negative `remaining` means over-limit.
|
|
105
|
+
* @default undefined — {@link characterCountMessage}'s English wording.
|
|
106
|
+
*/
|
|
107
|
+
getCharacterCountMessage?: ((remaining: number) => string) | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Fallback message when native constraint validation fails without a message.
|
|
110
|
+
* @default undefined — 'This field is invalid.'
|
|
111
|
+
*/
|
|
112
|
+
invalidMessage?: string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Delay in milliseconds before `change` mode validates; `0` validates every keystroke.
|
|
115
|
+
* @default 0 — no debounce.
|
|
116
|
+
*/
|
|
117
|
+
validationDebounceTime?: number | undefined;
|
|
118
|
+
}
|
|
119
|
+
/** Everything the controller needs that the framework layer owns. */
|
|
120
|
+
export interface FieldControllerOptions {
|
|
121
|
+
/** Id of the Label element, used for a group's `aria-labelledby`. */
|
|
122
|
+
labelId: string;
|
|
123
|
+
/** Id of the Description element. */
|
|
124
|
+
descriptionId: string;
|
|
125
|
+
/** Id of the Error element. */
|
|
126
|
+
errorId: string;
|
|
127
|
+
/** Fallback id assigned to a control that has none of its own. */
|
|
128
|
+
controlId: string;
|
|
129
|
+
/** True for fieldsets where Label is legend and control uses aria-labelledby. */
|
|
130
|
+
grouped: boolean;
|
|
131
|
+
/** Called whenever the snapshot changes, so the framework layer can re-render. */
|
|
132
|
+
onSnapshotChange: (snapshot: FieldSnapshot) => void;
|
|
133
|
+
/** Announces messages to the live region with politeness picked per message. */
|
|
134
|
+
announce: (message: string, politeness: 'polite' | 'assertive') => void;
|
|
135
|
+
}
|
|
136
|
+
/** Coerces whatever a validator (or the `errors` prop) returned into a message list. */
|
|
137
|
+
export declare function normalizeMessages(result: FieldValidationResult | string | string[]): string[];
|
|
138
|
+
/** The first control inside `root` that belongs to *this* Field rather than to a nested one. */
|
|
139
|
+
export declare function findFieldControl(root: Element): HTMLElement | null;
|
|
140
|
+
/** Reads the current value from a control, checking checked state, value property, or hidden input. */
|
|
141
|
+
export declare function readControlValue(control: HTMLElement | null): unknown;
|
|
142
|
+
/** Whether a value counts as entered, for `data-filled`. */
|
|
143
|
+
export declare function isFilled(value: unknown): boolean;
|
|
144
|
+
/** One failing field, as listed by a Form's ErrorSummary. */
|
|
145
|
+
export interface FieldErrorEntry {
|
|
146
|
+
/** The control's id — the link's `href` target. */
|
|
147
|
+
id: string;
|
|
148
|
+
/** The message shown as the link text. */
|
|
149
|
+
message: string;
|
|
150
|
+
}
|
|
151
|
+
/** Returns the form or skdx-form a summary should scan, falling back to its parent. */
|
|
152
|
+
export declare function errorSummaryScope(root: Element): Element;
|
|
153
|
+
/** Returns all currently-failing fields in scope, in document order. */
|
|
154
|
+
export declare function collectFieldErrors(scope: ParentNode): FieldErrorEntry[];
|
|
155
|
+
/** Runs all Fields in scope without short-circuiting, so all errors appear in ErrorSummary. */
|
|
156
|
+
export declare function validateFields(scope: ParentNode): Promise<boolean>;
|
|
157
|
+
/** Resets every Field's state when the form is reset, clearing messages and interaction flags. */
|
|
158
|
+
export declare function resetFields(scope: ParentNode): void;
|
|
159
|
+
/** Sends focus to a failing field, or to the first control inside a group. */
|
|
160
|
+
export declare function focusFieldTarget(id: string, doc?: Document): void;
|
|
161
|
+
/** Owns one Field's state machine, connected to its root element and re-synced on every render. */
|
|
162
|
+
export declare class FieldController {
|
|
163
|
+
private readonly options;
|
|
164
|
+
private props;
|
|
165
|
+
private root;
|
|
166
|
+
private form;
|
|
167
|
+
private control;
|
|
168
|
+
/** The `aria-describedby` the consumer put on the control themselves, preserved across rewrites. */
|
|
169
|
+
private baseDescribedBy;
|
|
170
|
+
/** The `aria-labelledby` the consumer put on the control themselves, preserved across rewrites. */
|
|
171
|
+
private baseLabelledBy;
|
|
172
|
+
/** Whether this controller wrote aria-labelledby; only we may withdraw it. */
|
|
173
|
+
private wroteLabelledBy;
|
|
174
|
+
/** Whether this controller wrote required/disabled; only we may withdraw them. */
|
|
175
|
+
private wroteRequired;
|
|
176
|
+
private wroteDisabled;
|
|
177
|
+
private wroteGroupDisabled;
|
|
178
|
+
/** Bumped on every validation run; a resolution from a superseded run is discarded. */
|
|
179
|
+
private runToken;
|
|
180
|
+
private pending;
|
|
181
|
+
/** Messages from the `errors` prop, always listed first. */
|
|
182
|
+
private injected;
|
|
183
|
+
/** Messages from the last `validate` run, or the native constraint-validation fallback. */
|
|
184
|
+
private custom;
|
|
185
|
+
/** Set by a mounted character-count part; `null` while the Field has none. */
|
|
186
|
+
private characterCount;
|
|
187
|
+
private announceTimer;
|
|
188
|
+
/** Pending {@link FieldControllerProps.validationDebounceTime} run, cancelled by the next keystroke or a blur. */
|
|
189
|
+
private validationTimer;
|
|
190
|
+
/** Whether a submit is waiting on this Field's async validator to settle. */
|
|
191
|
+
private awaitingSubmit;
|
|
192
|
+
private snapshot;
|
|
193
|
+
constructor(options: FieldControllerOptions);
|
|
194
|
+
/** The current state. Read by the framework layer to render the parts. */
|
|
195
|
+
get state(): FieldSnapshot;
|
|
196
|
+
/** Replaces the forwarded props; safe to call on every render. */
|
|
197
|
+
setProps(props: FieldControllerProps): void;
|
|
198
|
+
/** Registers or clears the character count configuration. */
|
|
199
|
+
setCharacterCount(options: FieldCharacterCountOptions | null): void;
|
|
200
|
+
/** Length of the control's current value; `0` when it holds something that is not text. */
|
|
201
|
+
private readCount;
|
|
202
|
+
/** The count copy, in the consumer's wording when they supplied one. */
|
|
203
|
+
private countMessage;
|
|
204
|
+
/** True once the value is longer than the configured soft limit. */
|
|
205
|
+
private isOverLimit;
|
|
206
|
+
/** Composes errors: server errors, validation results, then over-limit message. */
|
|
207
|
+
private composeErrors;
|
|
208
|
+
/** Announces the count politely one pause after the last keystroke, or assertively on over-limit. */
|
|
209
|
+
private scheduleCountAnnouncement;
|
|
210
|
+
/** Attaches the controller to its rendered root element. */
|
|
211
|
+
connect(root: HTMLElement): void;
|
|
212
|
+
/** Detaches every listener. */
|
|
213
|
+
disconnect(): void;
|
|
214
|
+
/** Re-discovers the control and re-applies injected attributes. */
|
|
215
|
+
sync(): void;
|
|
216
|
+
private applyDescribedBy;
|
|
217
|
+
private applyLabelledBy;
|
|
218
|
+
/** Sets required and disabled on control using native attributes or ARIA as appropriate. */
|
|
219
|
+
private applyConstraintState;
|
|
220
|
+
/** A group container needs its radios disabled individually; only undo what this controller set. */
|
|
221
|
+
private applyGroupDisabled;
|
|
222
|
+
/** Runs validation now, resolving to whether the field is valid. */
|
|
223
|
+
validate(): Promise<boolean>;
|
|
224
|
+
/** Resets the field to mount state and bumps the token to cancel any async validation run. */
|
|
225
|
+
reset(): void;
|
|
226
|
+
/** Marks the field touched without validating (used by a submit pass before it validates). */
|
|
227
|
+
private markTouched;
|
|
228
|
+
private applyStateAttributes;
|
|
229
|
+
private resolveValue;
|
|
230
|
+
/** The discovered control's live `ValidityState`, when it has one. */
|
|
231
|
+
private readValidity;
|
|
232
|
+
/** Publishes (or withdraws) the "a validator is still running here" marker. */
|
|
233
|
+
private markPending;
|
|
234
|
+
private nativeMessage;
|
|
235
|
+
/** Runs validation, returning messages synchronously for sync validators. */
|
|
236
|
+
private runValidation;
|
|
237
|
+
private commit;
|
|
238
|
+
private update;
|
|
239
|
+
private readonly handleInput;
|
|
240
|
+
/** Runs validator with debounce in change mode, immediately in blur/submit mode. */
|
|
241
|
+
private scheduleValidation;
|
|
242
|
+
/** Whether this Field's form has an ErrorSummary; queried per submit since it renders conditionally. */
|
|
243
|
+
private hasErrorSummary;
|
|
244
|
+
private readonly handleFocusOut;
|
|
245
|
+
/** Whether this submit is the re-dispatch from {@link resubmitIfSettled}, which must not re-run validators. */
|
|
246
|
+
private isEngineResubmit;
|
|
247
|
+
private readonly handleSubmit;
|
|
248
|
+
/** Re-dispatches submit once all async validators have settled, avoiding loops via FIELD_RESUBMIT_ATTRIBUTE. */
|
|
249
|
+
private resubmitIfSettled;
|
|
250
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var C="validity-change",a="data-skdx-field",u="data-skdx-field-name",p="data-skdx-field-message",F="data-skdx-field-description",x="data-skdx-field-error",$="data-skdx-field-character-count",E="data-skdx-field-pending",c="data-skdx-field-resubmit",f="data-skdx-form-field",_="data-skdx-form-message",G=["validity-change","invalid","change","blur"],D="data-skdx-error-summary",j=1e3;function M(i){let e=Math.abs(i),t=e===1?"character":"characters";return i<0?`You have ${e} ${t} too many`:`You have ${e} ${t} remaining`}function V(i,e,t=0){return t<=0?!0:i>=e*t/100}function Y(i){return i.map((e,t)=>t===i.length-1||/[.!?]$/.test(e)?e:`${e}.`).join(" ")}var O="This field is invalid.",w="data-skdx-field-control",I=[`[${w}]`,'input:not([type="hidden"])',"select","textarea",'[role="textbox"]','[role="searchbox"]','[role="combobox"]','[role="listbox"]','[role="radiogroup"]','[role="group"]','[role="slider"]','[role="spinbutton"]','[role="checkbox"]','[role="radio"]','[role="switch"]'].join(", "),z="data-skdx-field-required-indicator",k=new Set(["INPUT","SELECT","TEXTAREA"]),R=new Set(["radiogroup","group"]),B=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function T(i){return i==null?[]:(Array.isArray(i)?i:[i]).filter(t=>typeof t=="string"&&t.trim()!=="")}function S(i){for(let e of Array.from(i.querySelectorAll(I)))if(e.getAttribute("aria-hidden")!=="true"&&e.closest(`[${a}]`)===i)return e;return null}function m(i,e){return v(i,a,e)}function v(i,e,t){for(let r of Array.from(i.querySelectorAll(t)))if(r.closest(`[${e}]`)===i)return r;return null}function P(i){if(!i)return;let e=i;return e.type==="checkbox"||e.type==="radio"?e.checked:"value"in i?e.value:i.querySelector('input[aria-hidden="true"]')?.value}function d(i){return i==null||i===!1||i===""?!1:!(Array.isArray(i)&&i.length===0)}function o(i,e,t){t?i.setAttribute(e,""):i.removeAttribute(e)}function y(i,...e){let t=i.split(/\s+/).filter(Boolean);for(let r of e)r&&!t.includes(r)&&t.push(r);return t.join(" ")}function K(i){return i.closest("form, skdx-form")??i.parentElement??i}function N(i){let e=S(i),r=m(i,`[${x}]`)?.textContent?.trim()||i.getAttribute(p)||i.getAttribute(u)||"";return!e?.id||!r?[]:[{id:e.id,message:r}]}function H(i){let e=v(i,f,I);if(!e?.id||e.getAttribute("aria-invalid")!=="true")return[];let r=v(i,f,`[${_}]:not([hidden])`)?.textContent?.trim()||i.getAttribute(u)||"";return r?[{id:e.id,message:r}]:[]}function Q(i){return Array.from(i.querySelectorAll(`[${a}][data-invalid], [${f}]`)).flatMap(t=>(t.hasAttribute(a)?N:H)(t))}var b="__skdxFieldCheckValidity",g="__skdxFieldReset";async function X(i){let e=Array.from(i.querySelectorAll(`[${a}]`));return(await Promise.all(e.map(r=>r[b]?.()??Promise.resolve(!0)))).every(Boolean)}function J(i){for(let e of Array.from(i.querySelectorAll(`[${a}]`)))e[g]?.()}function W(i,e=document){let t=e.getElementById(i);if(!t)return;let r=t.getAttribute("role"),s=(t.tagName==="FIELDSET"||r!==null&&R.has(r)?t.querySelector(B):null)??t;s.focus(),s.scrollIntoView?.({block:"center"})}var A=class{constructor(e){this.options=e;this.props={};this.root=null;this.form=null;this.control=null;this.baseDescribedBy="";this.baseLabelledBy="";this.wroteLabelledBy=!1;this.wroteRequired=!1;this.wroteDisabled=!1;this.wroteGroupDisabled=!1;this.runToken=0;this.pending=!1;this.injected=[];this.custom=[];this.characterCount=null;this.awaitingSubmit=!1;this.handleInput=()=>{let e=this.isOverLimit(this.snapshot.count),t=this.readCount();this.update({dirty:!0,filled:d(this.resolveValue()),count:t,errors:this.composeErrors(t)}),this.scheduleCountAnnouncement(t,e),(this.props.mode==="change"||this.snapshot.errors.length>0)&&this.scheduleValidation()};this.handleFocusOut=()=>{let e=this.readCount();this.update({touched:!0,filled:d(this.resolveValue()),count:e,errors:this.composeErrors(e)});let t=this.validationTimer!==void 0;clearTimeout(this.validationTimer),this.validationTimer=void 0;let r=this.props.mode??"blur";(t||r==="blur"||this.snapshot.errors.length>0)&&this.runValidation()};this.handleSubmit=e=>{if(!this.form)return;let t=e.target;if(t!==this.form&&t?.closest?.("form")!==this.form||this.isEngineResubmit(e))return;this.markTouched();let r=this.runValidation({silent:this.hasErrorSummary()});if(L(r)){e.preventDefault(),this.awaitingSubmit=!0,Promise.resolve(r).then(()=>{this.awaitingSubmit&&(this.awaitingSubmit=!1,this.resubmitIfSettled())});return}(r.length>0||this.pending)&&e.preventDefault()};this.snapshot={controlId:"",errors:[],valid:!0,touched:!1,dirty:!1,filled:!1,count:0,validity:null}}get state(){return this.snapshot}setProps(e){let t=this.props.value;this.props=e;let r=T(e.errors??null),n=!q(this.injected,r);n&&(this.injected=r);let s=e.value!==t;if(!n&&!s)return;let l=this.readCount();this.update({count:l,filled:d(this.resolveValue()),errors:this.composeErrors(l)})}setCharacterCount(e){if((this.characterCount?.maxLength??null)===(e?.maxLength??null)&&(this.characterCount?.threshold??0)===(e?.threshold??0))return;this.characterCount=e;let r=this.readCount();this.update({count:r,errors:this.composeErrors(r)})}readCount(){let e=this.resolveValue();return typeof e=="string"?e.length:0}countMessage(e){return(this.props.getCharacterCountMessage??M)(e)}isOverLimit(e){return this.characterCount!==null&&e>this.characterCount.maxLength}composeErrors(e=this.snapshot.count){let t=[...this.injected,...this.custom];return this.characterCount&&this.isOverLimit(e)&&t.push(this.countMessage(this.characterCount.maxLength-e)),t}scheduleCountAnnouncement(e,t){let r=this.characterCount;if(!r)return;if(clearTimeout(this.announceTimer),this.isOverLimit(e)){t||this.options.announce(this.countMessage(r.maxLength-e),"assertive");return}if(!V(e,r.maxLength,r.threshold))return;let n=r.maxLength-e;this.announceTimer=setTimeout(()=>{this.options.announce(this.countMessage(n),"polite")},1e3)}connect(e){this.root=e,e.setAttribute(a,""),Object.defineProperty(e,b,{value:()=>this.validate(),configurable:!0,enumerable:!1,writable:!0}),Object.defineProperty(e,g,{value:()=>this.reset(),configurable:!0,enumerable:!1,writable:!0}),e.addEventListener("input",this.handleInput,!0),e.addEventListener("change",this.handleInput,!0),e.addEventListener("focusout",this.handleFocusOut,!0),this.form=e.closest("form"),this.form&&e.ownerDocument.addEventListener("submit",this.handleSubmit,!0),this.sync();let t=this.readCount();this.update({filled:d(this.resolveValue()),count:t,errors:this.composeErrors(t)})}disconnect(){clearTimeout(this.announceTimer),clearTimeout(this.validationTimer),this.validationTimer=void 0,this.awaitingSubmit=!1;let e=this.root;e&&(e.removeEventListener("input",this.handleInput,!0),e.removeEventListener("change",this.handleInput,!0),e.removeEventListener("focusout",this.handleFocusOut,!0),this.form&&e.ownerDocument.removeEventListener("submit",this.handleSubmit,!0),delete e[b],delete e[g],this.root=null,this.form=null,this.control=null)}sync(){let e=this.root;if(!e)return;let t=S(e);t!==this.control&&(this.control=t,this.baseDescribedBy=t?.getAttribute("aria-describedby")??"",this.baseLabelledBy=t?.getAttribute("aria-labelledby")??"",this.wroteLabelledBy=!1,this.wroteRequired=!1,this.wroteDisabled=!1,this.wroteGroupDisabled=!1);let{name:r}=this.props;r?e.setAttribute(u,r):e.removeAttribute(u);let n=this.snapshot.errors.join(" ");n?e.setAttribute(p,n):e.removeAttribute(p),this.applyStateAttributes(e),t&&(t.id||(t.id=this.options.controlId),t.id!==this.snapshot.controlId&&(this.snapshot={...this.snapshot,controlId:t.id,validity:this.readValidity()},this.options.onSnapshotChange(this.snapshot)),this.applyDescribedBy(e,t),this.snapshot.errors.length>0?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid"),this.applyLabelledBy(e,t),this.applyConstraintState(t),this.applyStateAttributes(t))}applyDescribedBy(e,t){let r=m(e,`[${F}]`)!==null,n=m(e,`[${x}]`)!==null,s=y(this.baseDescribedBy,r?this.options.descriptionId:void 0,n?this.options.errorId:void 0);s?t.setAttribute("aria-describedby",s):t.removeAttribute("aria-describedby")}applyLabelledBy(e,t){let r=e.ownerDocument.getElementById(this.options.labelId)!==null;this.options.grouped&&r?(t.setAttribute("aria-labelledby",y(this.baseLabelledBy,this.options.labelId)),this.wroteLabelledBy=!0):this.wroteLabelledBy&&(this.baseLabelledBy?t.setAttribute("aria-labelledby",this.baseLabelledBy):t.removeAttribute("aria-labelledby"),this.wroteLabelledBy=!1)}applyConstraintState(e){let t=k.has(e.tagName),r=this.props.required===!0,n=this.props.disabled===!0;r?(t?e.setAttribute("required",""):e.setAttribute("aria-required","true"),this.wroteRequired=!0):this.wroteRequired&&(e.removeAttribute(t?"required":"aria-required"),this.wroteRequired=!1),n?(t?e.setAttribute("disabled",""):e.setAttribute("aria-disabled","true"),this.wroteDisabled=!0):this.wroteDisabled&&(e.removeAttribute(t?"disabled":"aria-disabled"),this.wroteDisabled=!1),t||this.applyGroupDisabled(e,n)}applyGroupDisabled(e,t){let r=e.getAttribute("role");if(!(!(e.tagName==="FIELDSET"||r!==null&&R.has(r))||!t&&!this.wroteGroupDisabled)){for(let s of e.querySelectorAll("input, select, textarea, button"))t?s.setAttribute("disabled",""):s.removeAttribute("disabled");this.wroteGroupDisabled=t}}validate(){return Promise.resolve(this.runValidation()).then(e=>e.length===0)}reset(){this.injected=[],this.custom=[],this.pending=!1,this.awaitingSubmit=!1,this.runToken++,clearTimeout(this.announceTimer),clearTimeout(this.validationTimer),this.validationTimer=void 0,this.markPending(!1);let e=this.readCount();this.update({touched:!1,dirty:!1,count:e,filled:d(this.resolveValue()),errors:this.composeErrors(e)}),this.sync()}markTouched(){this.snapshot.touched||this.update({touched:!0})}applyStateAttributes(e){let{errors:t,touched:r,dirty:n,filled:s,count:l}=this.snapshot;o(e,"data-invalid",t.length>0),o(e,"data-valid",t.length===0),o(e,"data-touched",r),o(e,"data-dirty",n),o(e,"data-filled",s),o(e,"data-over-limit",this.isOverLimit(l)),o(e,"data-disabled",this.props.disabled===!0)}resolveValue(){return this.props.value!==void 0?this.props.value:P(this.control)}readValidity(){return this.control?.validity??null}markPending(e){this.root&&o(this.root,E,e)}nativeMessage(){let e=this.control;return!e?.validity||e.validity.valid?null:e.validationMessage||this.props.invalidMessage||O}runValidation(e={}){let t=++this.runToken,r=this.props.validate?.(this.resolveValue());return L(r)?(this.pending=!0,this.markPending(!0),Promise.resolve(r).then(n=>t!==this.runToken?this.snapshot.errors:(this.pending=!1,this.markPending(!1),this.commit(n,e)))):this.commit(r,e)}commit(e,t){if(this.custom=T(e),this.custom.length===0){let h=this.nativeMessage();h&&!this.injected.includes(h)&&(this.custom=[h])}let r=this.readCount(),n=this.composeErrors(r),s=this.snapshot.errors.length===0;this.update({errors:n,count:r,filled:d(this.resolveValue())});let l=n[0];return l&&s&&!t.silent&&this.options.announce(l,"assertive"),n}update(e){let t={...this.snapshot,...e,valid:!0,validity:this.readValidity()};t.valid=t.errors.length===0,!U(this.snapshot,t)&&(this.snapshot=t,this.sync(),this.options.onSnapshotChange(t),this.root?.dispatchEvent(new CustomEvent(C,{bubbles:!0,composed:!0,detail:{valid:t.valid,errors:t.errors,touched:t.touched,dirty:t.dirty,filled:t.filled,count:t.count,validity:t.validity}})))}scheduleValidation(){clearTimeout(this.validationTimer),this.validationTimer=void 0;let e=this.props.mode==="change"?this.props.validationDebounceTime??0:0;if(e<=0){this.runValidation();return}this.validationTimer=setTimeout(()=>{this.validationTimer=void 0,this.runValidation()},e)}hasErrorSummary(){return this.form?.querySelector(`[${D}]`)!=null}isEngineResubmit(e){return this.form?.hasAttribute(c)?(this.snapshot.errors.length>0&&e.preventDefault(),!0):!1}resubmitIfSettled(){let e=this.form;if(!(!e||typeof e.requestSubmit!="function")&&!e.querySelector(`[${E}]`)&&!e.querySelector(`[${a}][data-invalid]`)){e.setAttribute(c,"");try{e.requestSubmit()}finally{e.removeAttribute(c)}}}};function L(i){return typeof i?.then=="function"}function q(i,e){return i.length===e.length&&i.every((t,r)=>t===e[r])}function U(i,e){return i.controlId===e.controlId&&i.valid===e.valid&&i.touched===e.touched&&i.dirty===e.dirty&&i.filled===e.filled&&i.count===e.count&&i.validity===e.validity&&i.errors.length===e.errors.length&&i.errors.every((t,r)=>t===e.errors[r])}export{j as CHARACTER_COUNT_ANNOUNCE_DELAY_MS,G as ERROR_SUMMARY_RESCAN_EVENTS,$ as FIELD_CHARACTER_COUNT_ATTRIBUTE,w as FIELD_CONTROL_ATTRIBUTE,I as FIELD_CONTROL_SELECTOR,F as FIELD_DESCRIPTION_ATTRIBUTE,x as FIELD_ERROR_ATTRIBUTE,D as FIELD_ERROR_SUMMARY_ATTRIBUTE,p as FIELD_MESSAGE_ATTRIBUTE,u as FIELD_NAME_ATTRIBUTE,E as FIELD_PENDING_ATTRIBUTE,z as FIELD_REQUIRED_INDICATOR_ATTRIBUTE,c as FIELD_RESUBMIT_ATTRIBUTE,a as FIELD_ROOT_ATTRIBUTE,C as FIELD_VALIDITY_CHANGE_EVENT,f as FORM_FIELD_ATTRIBUTE,_ as FORM_MESSAGE_ATTRIBUTE,A as FieldController,O as NATIVE_INVALID_FALLBACK_MESSAGE,M as characterCountMessage,V as characterCountVisible,Q as collectFieldErrors,K as errorSummaryScope,S as findFieldControl,W as focusFieldTarget,d as isFilled,Y as joinFieldMessages,T as normalizeMessages,P as readControlValue,J as resetFields,X as validateFields};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type AutoFocusEvent } from './dismissal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolution of initialFocus/finalFocus selectors for overlay families
|
|
4
|
+
* (Dialog, Drawer, Popover). Uses CSS selector strings (not
|
|
5
|
+
* element handles) so members survive as attributes on `<skdx-*-content>` —
|
|
6
|
+
* a DOM node cannot cross HTML attribute boundaries.
|
|
7
|
+
*
|
|
8
|
+
* A miss falls back to the overlay's automatic target (the whole point).
|
|
9
|
+
* Wrong selectors warn on console even in production (a selector pointing at
|
|
10
|
+
* nothing is a defect regardless).
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export type FocusTargetFamily = 'Dialog' | 'Drawer' | 'Popover';
|
|
14
|
+
/**
|
|
15
|
+
* Resolves one focus-target selector against `root`, or returns `null` and
|
|
16
|
+
* warns when it names nothing.
|
|
17
|
+
*
|
|
18
|
+
* @param root Content for `initialFocus` (the target is part of the panel by
|
|
19
|
+
* definition, and a loose selector must not reach into the page behind it), the
|
|
20
|
+
* document for `finalFocus` (whose target is outside Content by definition).
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveFocusSelector(root: ParentNode, selector: string | undefined, prop: 'initialFocus' | 'finalFocus', family: FocusTargetFamily): HTMLElement | null;
|
|
24
|
+
/**
|
|
25
|
+
* Element initial focus should land on inside content: the selector's match or
|
|
26
|
+
* the default (a Cancel part when present, then first tabbable, then panel).
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function initialFocusTarget(content: HTMLElement, selector: string | undefined, family: FocusTargetFamily): HTMLElement;
|
|
30
|
+
/**
|
|
31
|
+
* Places initial focus for a native `<dialog>` after `showModal()`: the selector's match, then the family's own
|
|
32
|
+
* default target, else — unless the platform already focused inside the panel — the first tabbable, then the panel itself.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyInitialFocus(content: HTMLElement, selector: string | undefined, family: FocusTargetFamily): void;
|
|
36
|
+
/**
|
|
37
|
+
* Sends focus where finalFocus names, resolved at document level (panel is
|
|
38
|
+
* closing and the opening element may be gone). Returns whether focus was placed.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function applyFinalFocus(selector: string | undefined, family: FocusTargetFamily): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The open-time focus move under its veto: `open-auto-focus` fires *before*
|
|
44
|
+
* anything moves, so a consumer preventing it keeps focus where the user left
|
|
45
|
+
* it. A native `<dialog>` is the exception — `showModal()` has already moved
|
|
46
|
+
* focus into the panel by the time any handler can run, so a veto has to put it
|
|
47
|
+
* back rather than merely decline to move it. A veto that places focus itself is the
|
|
48
|
+
* documented way to take initial focus over, so that undo only runs when the handler
|
|
49
|
+
* left focus where the platform put it.
|
|
50
|
+
*
|
|
51
|
+
* @param content the overlay panel
|
|
52
|
+
* @param selector the `initialFocus` selector, or `undefined` for the default chain
|
|
53
|
+
* @param family which overlay family, for the console warning a missed selector prints
|
|
54
|
+
* @param handler the consumer's `open-auto-focus` handler
|
|
55
|
+
* @param previouslyFocused what had focus before the platform moved it, for the undo
|
|
56
|
+
* @returns whether focus was placed inside the panel
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export declare function applyOpenAutoFocus(content: HTMLElement, selector: string | undefined, family: FocusTargetFamily, handler?: (event: AutoFocusEvent) => void, previouslyFocused?: HTMLElement | null): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The close-time focus return, run on every close route (Escape, outside press,
|
|
62
|
+
* the close button, a controlled `open` flipping) so focus never strands on a
|
|
63
|
+
* panel that is going away. `close-auto-focus` fires *before* the move, and a
|
|
64
|
+
* veto leaves focus alone; otherwise `finalFocus` wins, and the element that
|
|
65
|
+
* opened the overlay is the fallback — skipped when it has left the document,
|
|
66
|
+
* since focusing a detached node silently drops focus onto `<body>`, and skipped
|
|
67
|
+
* when it *is* `<body>` or `<html>`, which means nothing was focused when the
|
|
68
|
+
* overlay opened rather than that the page root should take focus.
|
|
69
|
+
*
|
|
70
|
+
* @param selector the `finalFocus` selector, or `undefined` to go straight to the opener
|
|
71
|
+
* @param family which overlay family, for the console warning a missed selector prints
|
|
72
|
+
* @param opener the element focused before the overlay opened
|
|
73
|
+
* @param handler the consumer's `close-auto-focus` handler
|
|
74
|
+
* @returns whether focus was placed
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export declare function returnFocus(selector: string | undefined, family: FocusTargetFamily, opener: HTMLElement | null | undefined, handler?: (event: AutoFocusEvent) => void): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{autoFocusEvent as u}from"./dismissal.js";import{TABBABLE_SELECTOR as i}from"./tabbable.js";var s={Dialog:"the Cancel button when present, then the first tabbable element, then the panel itself",Drawer:"the first tabbable element, then the panel itself",Popover:"the first tabbable element, then the panel itself"},f={Dialog:"[data-skdx-dialog-cancel]"},d={Dialog:"the dialog panel",Drawer:"the drawer panel",Popover:"the popover panel"};function a(e,n,t,o){if(!n)return null;let r;try{r=e.querySelector(n)}catch{return console.warn(`[skdx] ${o}: ${t}="${n}" is not a valid CSS selector. Falling back to the default focus target.`),null}return r||console.warn(t==="initialFocus"?`[skdx] ${o}: initialFocus="${n}" matched no element inside ${d[o]}. Falling back to ${s[o]}.`:`[skdx] ${o}: finalFocus="${n}" matched no element in the document. Falling back to the element that was focused before it opened.`),r}function c(e,n){let t=f[n];return t?e.querySelector(t):null}function T(e,n,t){return a(e,n,"initialFocus",t)??c(e,t)??e.querySelector(i)??e}function m(e,n,t){let o=a(e,n,"initialFocus",t)??c(e,t);if(o){o.focus({preventScroll:!0});return}if(e.contains(document.activeElement))return;let l=e.querySelector(i)??e;l===e&&e.tabIndex<0&&(e.tabIndex=-1),l.focus?.({preventScroll:!0})}function F(e,n){let t=a(document,e,"finalFocus",n);return t?(t.focus({preventScroll:!0}),!0):!1}function h(e,n,t,o,r){let l=document.activeElement;return u("open-auto-focus",o)?(m(e,n,t),!0):(document.activeElement===l&&r?.isConnected&&e.contains(l)&&r.focus({preventScroll:!0}),!1)}function E(e,n,t,o){return u("close-auto-focus",o)?F(e,n)?!0:!t?.isConnected||t===document.body||t===document.documentElement?!1:(t.focus({preventScroll:!0}),!0):!1}export{F as applyFinalFocus,m as applyInitialFocus,h as applyOpenAutoFocus,T as initialFocusTarget,a as resolveFocusSelector,E as returnFocus};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a byte count as short, localised, readable text — `999B`, `1.5kB`,
|
|
3
|
+
* `1.2MB` — for a FileUpload file row.
|
|
4
|
+
*
|
|
5
|
+
* @param bytes - A `File.size`, in bytes.
|
|
6
|
+
* @param locale - BCP 47 tag, or omitted for the runtime's own locale.
|
|
7
|
+
* @returns The formatted size, e.g. `'1.5kB'`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatFileSize(bytes: number, locale?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=["byte","kilobyte","megabyte","gigabyte","terabyte"];function a(n,r){let t=n,e=0;for(;t>=1e3&&e<i.length-1;)t/=1e3,e+=1;return new Intl.NumberFormat(r,{style:"unit",unit:i[e],unitDisplay:"narrow",maximumFractionDigits:1}).format(t)}export{a as formatFileSize};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A built-in glyph name. */
|
|
2
|
+
export type GlyphName = 'check' | 'dash' | 'close' | 'dot' | 'star' | 'chevron-down' | 'chevron-right' | 'chevron-left' | 'arrow-right' | 'arrow-left' | 'chevrons-right' | 'chevrons-left' | 'play' | 'pause';
|
|
3
|
+
/** The shape behind a {@link GlyphName}. */
|
|
4
|
+
export interface Glyph {
|
|
5
|
+
viewBox: string;
|
|
6
|
+
d: string;
|
|
7
|
+
/** Filled with currentColor rather than stroked. */
|
|
8
|
+
fill: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Stroke width every stroked glyph is drawn at. */
|
|
11
|
+
export declare const GLYPH_STROKE_WIDTH = 1.5;
|
|
12
|
+
/** Every built-in glyph, keyed by name. */
|
|
13
|
+
export declare const GLYPHS: Record<GlyphName, Glyph>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=1.5,l=(e,o="0 0 16 16")=>({viewBox:o,d:e,fill:!1}),r=(e,o="0 0 16 16")=>({viewBox:o,d:e,fill:!0}),h={check:l("M3 8.5l3 3 7-7"),dash:l("M4 8h8"),close:l("M4 4l8 8M12 4l-8 8"),dot:r("M8 5a3 3 0 1 0 0 6 3 3 0 1 0 0-6z"),star:r("M10 1.5l2.6 5.6 6.1.7-4.5 4.2 1.2 6-5.4-3-5.4 3 1.2-6-4.5-4.2 6.1-.7z","0 0 20 20"),"chevron-down":l("M4 6l4 4 4-4"),"chevron-right":l("M6 4l4 4-4 4"),"chevron-left":l("M10 4l-4 4 4 4"),"arrow-right":l("M3 8h10M9 4l4 4-4 4"),"arrow-left":l("M13 8H3M7 4L3 8l4 4"),"chevrons-right":l("M3 4l4 4-4 4M9 4l4 4-4 4"),"chevrons-left":l("M13 4L9 8l4 4M7 4L3 8l4 4"),play:r("M5 3.5l7 4.5-7 4.5z"),pause:r("M4.5 3h2.5v10H4.5zM9 3h2.5v10H9z")};export{h as GLYPHS,t as GLYPH_STROKE_WIDTH};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the pixel height an auto-resizing `<textarea>` should be given so it
|
|
3
|
+
* shows all of its content, floored at `minRows` and capped to `maxRows`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function measureAutoResizeHeight(node: HTMLTextAreaElement, maxRows?: number, minRows?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(n,s,d){let t=getComputedStyle(n),e=i=>parseFloat(i)||0,g=e(t.borderTopWidth)+e(t.borderBottomWidth),l=e(t.paddingTop)+e(t.paddingBottom),u=t.boxSizing==="border-box",r=e(t.lineHeight),h=i=>i*r+(u?l+g:0);n.style.height="auto";let o=n.scrollHeight+(u?g:-l);return d!=null&&r>0&&(o=Math.max(o,h(d))),s!=null&&r>0&&(o=Math.min(o,h(s))),o}export{b as measureAutoResizeHeight};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Whether `query` currently matches; `false` wherever `matchMedia` is missing (SSR, some test runners). */
|
|
2
|
+
export declare function matchesMediaQuery(query: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Calls `onChange` with the new match state whenever `query` flips, and returns the unsubscribe.
|
|
5
|
+
* A no-op returning a no-op wherever `matchMedia` is missing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function subscribeMediaQuery(query: string, onChange: (matches: boolean) => void): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(e){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(e).matches}function d(e,i){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let n=window.matchMedia(e),t=o=>i(o.matches);return n.addEventListener("change",t),()=>n.removeEventListener("change",t)}export{a as matchesMediaQuery,d as subscribeMediaQuery};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** The trigger character a Mentions field uses when it configures none. */
|
|
2
|
+
export declare const DEFAULT_MENTION_TRIGGER = "@";
|
|
3
|
+
/** The mention being typed: its trigger character, the text after it, and the range the pair occupies. */
|
|
4
|
+
export interface MentionToken {
|
|
5
|
+
/** The trigger character that opened the token. */
|
|
6
|
+
trigger: string;
|
|
7
|
+
/** Text between the trigger character and the caret — what the item list is filtered by. */
|
|
8
|
+
query: string;
|
|
9
|
+
/** Offset of the trigger character in the field value. */
|
|
10
|
+
start: number;
|
|
11
|
+
/** Offset just past the query; always the caret offset the token was found at. */
|
|
12
|
+
end: number;
|
|
13
|
+
}
|
|
14
|
+
/** Where a trigger character is allowed to open a token, and what abandons one. */
|
|
15
|
+
export interface MentionTokenOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Trigger characters, either as an array or as one string read a character at a time.
|
|
18
|
+
* @defaultValue `'@'`
|
|
19
|
+
*/
|
|
20
|
+
triggers?: string | readonly string[] | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* How many spaces a query may contain before the token is abandoned.
|
|
23
|
+
* @defaultValue 0
|
|
24
|
+
*/
|
|
25
|
+
allowedSpaces?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Whether a trigger opens a token only at the start of the value or after a non-word character, so `user@example` is left alone.
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
requireWordBoundary?: boolean | undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The mention token the caret sits in, found by scanning backwards from the
|
|
34
|
+
* caret to the nearest trigger character.
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` for every condition that ends a mention: no trigger before
|
|
37
|
+
* the caret, a line break between them, more spaces than `allowedSpaces`, a
|
|
38
|
+
* trigger that fails the word-boundary rule, or a caret that has moved out of
|
|
39
|
+
* the token. There is no token to cancel — call this again after every value,
|
|
40
|
+
* caret or selection change and the answer is the whole state.
|
|
41
|
+
*
|
|
42
|
+
* @param value the field's full text
|
|
43
|
+
* @param caret the caret offset, clamped into the value
|
|
44
|
+
* @param options the trigger and boundary rules
|
|
45
|
+
*/
|
|
46
|
+
export declare function findMentionToken(value: string, caret: number, options?: MentionTokenOptions): MentionToken | null;
|
|
47
|
+
/**
|
|
48
|
+
* Whether an Escape recorded at `dismissedAt` still suppresses this token.
|
|
49
|
+
*
|
|
50
|
+
* Escape closes the popup while the token is still syntactically alive, so the
|
|
51
|
+
* offset of the dismissed trigger is held until {@link findMentionToken}
|
|
52
|
+
* returns `null` — which is the adapter's cue to forget it.
|
|
53
|
+
*
|
|
54
|
+
* @param token the token found for the current caret, or `null`
|
|
55
|
+
* @param dismissedAt the `start` of the token Escape closed, or `null`
|
|
56
|
+
*/
|
|
57
|
+
export declare function isMentionDismissed(token: MentionToken | null, dismissedAt: number | null): boolean;
|
|
58
|
+
/** The field value and caret offset an insertion produces. */
|
|
59
|
+
export interface MentionInsertion {
|
|
60
|
+
/** The whole field value with the token's range replaced. */
|
|
61
|
+
value: string;
|
|
62
|
+
/** Caret offset just past the inserted text, and past the appended space when one was added. */
|
|
63
|
+
caret: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Replaces a token's range with the serialized mention text.
|
|
67
|
+
*
|
|
68
|
+
* @param value the field value the token was found in
|
|
69
|
+
* @param token the token being replaced, from {@link findMentionToken}
|
|
70
|
+
* @param text the full replacement including the trigger character
|
|
71
|
+
* @param appendSpace whether a single space follows the mention, skipped when the value already continues with whitespace
|
|
72
|
+
*/
|
|
73
|
+
export declare function insertMention(value: string, token: MentionToken, text: string, appendSpace?: boolean): MentionInsertion;
|
|
74
|
+
/** The caret's position in viewport coordinates, as an adapter measured it. */
|
|
75
|
+
export interface CaretRect {
|
|
76
|
+
/** Distance in pixels from the viewport's top edge to the caret's top. */
|
|
77
|
+
top: number;
|
|
78
|
+
/** Distance in pixels from the viewport's left edge to the caret. */
|
|
79
|
+
left: number;
|
|
80
|
+
/** The caret's height in pixels, normally the field's computed line height. */
|
|
81
|
+
height: number;
|
|
82
|
+
}
|
|
83
|
+
/** The rectangle floating-ui reads off a positioning reference. */
|
|
84
|
+
export interface AnchorRect {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
top: number;
|
|
88
|
+
left: number;
|
|
89
|
+
bottom: number;
|
|
90
|
+
right: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
}
|
|
94
|
+
/** A positioning reference that is a rectangle rather than an element. */
|
|
95
|
+
export interface VirtualAnchor {
|
|
96
|
+
getBoundingClientRect(): AnchorRect;
|
|
97
|
+
/** The element the rect lives inside, so floating-ui can observe ancestor scroll and resize. */
|
|
98
|
+
contextElement: Element;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Wraps a caret measurement as the zero-width virtual anchor the popup is
|
|
102
|
+
* positioned against.
|
|
103
|
+
*
|
|
104
|
+
* The measurement is re-read on every call, so one anchor survives a moved
|
|
105
|
+
* caret without being rebuilt, and `contextElement` is what lets floating-ui
|
|
106
|
+
* observe the ancestor scroll and resize that make it re-read.
|
|
107
|
+
*
|
|
108
|
+
* @param measure re-reads the caret rectangle, normally closing over a {@link MeasureCaretRect}, its field and the offset
|
|
109
|
+
* @param contextElement the field the caret sits in
|
|
110
|
+
*/
|
|
111
|
+
export declare function caretAnchor(measure: () => CaretRect, contextElement: Element): VirtualAnchor;
|
|
112
|
+
/**
|
|
113
|
+
* The caret measurement each adapter implements with its own DOM work: the
|
|
114
|
+
* viewport rectangle of the caret at `offset` inside `field`.
|
|
115
|
+
*/
|
|
116
|
+
export type MeasureCaretRect = (field: HTMLTextAreaElement | HTMLInputElement, offset: number) => CaretRect;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d="@",f=/[\p{L}\p{N}_]/u;function g(e){return e===void 0?["@"]:typeof e=="string"?[...e]:e}function m(e,n,o={}){let{allowedSpaces:t=0,requireWordBoundary:u=!0}=o,s=g(o.triggers),c=Math.max(0,Math.min(n,e.length)),a=0;for(let r=c-1;r>=0;r--){let i=e[r];if(i===`
|
|
2
|
+
`||i==="\r")return null;if(s.includes(i)){let l=r>0?e[r-1]:"";return u&&l!==""&&f.test(l)?null:{trigger:i,query:e.slice(r+1,c),start:r,end:c}}if(/\s/.test(i)&&++a>t)return null}return null}function p(e,n){return e!==null&&e.start===n}function h(e,n,o,t=!0){let u=e.slice(n.end),s=t&&!/^\s/.test(u)?" ":"";return{value:e.slice(0,n.start)+o+s+u,caret:n.start+o.length+s.length}}function b(e,n){return{getBoundingClientRect:()=>{let t=e();return{x:t.left,y:t.top,top:t.top,left:t.left,bottom:t.top+t.height,right:t.left,width:0,height:t.height}},contextElement:n}}export{d as DEFAULT_MENTION_TRIGGER,b as caretAnchor,m as findMentionToken,h as insertMention,p as isMentionDismissed};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The character sets `type` names, in the spelling the contract declares. */
|
|
2
|
+
export type PinInputType = 'text' | 'numeric' | 'alphanumeric' | 'alphabetic';
|
|
3
|
+
/** Builds the per-character predicate used to accept or reject each keystroke. */
|
|
4
|
+
export declare function pinCharAcceptor(type: PinInputType, pattern?: string): (char: string) => boolean;
|
|
5
|
+
/** Returns the pattern source {@link pinCharAcceptor} applies, defaulting to `'.'` for `'text'`. */
|
|
6
|
+
export declare function pinCharPattern(type: PinInputType, pattern?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The default accessible name for a pin box. `index` is 1-based (read aloud).
|
|
9
|
+
*
|
|
10
|
+
* @param index the box's position, counting from 1
|
|
11
|
+
* @param length how many boxes the code has
|
|
12
|
+
*/
|
|
13
|
+
export declare function pinInputDigitLabel(index: number, length: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={text:null,numeric:/^[0-9]$/,alphanumeric:/^[a-zA-Z0-9]$/,alphabetic:/^[a-zA-Z]$/};function u(t,n){if(n){let e=new RegExp(n);return p=>e.test(p)}let r=i[t]??null;return r?e=>r.test(e):()=>!0}function c(t,n){return n??i[t]?.source??"."}function o(t,n){return`Digit ${t} of ${n}`}export{u as pinCharAcceptor,c as pinCharPattern,o as pinInputDigitLabel};
|