@esportsplus/ui 0.54.0 → 0.56.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -4
- package/build/components/accordion/index.d.ts +2157 -8
- package/build/components/accordion/index.js +25 -11
- package/build/components/accordion/more.d.ts +20 -0
- package/build/components/accordion/more.js +76 -0
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/anchor/scss/index.scss +1 -1
- package/build/components/announcement-banner/index.d.ts +33 -0
- package/build/components/announcement-banner/index.js +61 -0
- package/build/components/announcement-banner/scss/index.scss +2 -0
- package/build/components/autosave/index.d.ts +12 -0
- package/build/components/autosave/index.js +140 -0
- package/build/components/autosave/scss/index.scss +2 -0
- package/build/components/back-to-top/index.d.ts +16 -0
- package/build/components/back-to-top/index.js +182 -0
- package/build/components/back-to-top/scss/index.scss +2 -0
- package/build/components/bento-grid/index.d.ts +25 -0
- package/build/components/bento-grid/index.js +38 -0
- package/build/components/bento-grid/scss/index.scss +2 -0
- package/build/components/bento-grid-spotlight/index.d.ts +35 -0
- package/build/components/bento-grid-spotlight/index.js +108 -0
- package/build/components/bento-grid-spotlight/scss/index.scss +2 -0
- package/build/components/bookmark-button/index.d.ts +23 -0
- package/build/components/bookmark-button/index.js +120 -0
- package/build/components/bookmark-button/scss/index.scss +2 -0
- package/build/components/breadcrumb/ellipsis.d.ts +12 -0
- package/build/components/breadcrumb/ellipsis.js +11 -0
- package/build/components/breadcrumb/index.d.ts +29 -0
- package/build/components/breadcrumb/index.js +19 -0
- package/build/components/breadcrumb/item.d.ts +12 -0
- package/build/components/breadcrumb/item.js +9 -0
- package/build/components/breadcrumb/link.d.ts +15 -0
- package/build/components/breadcrumb/link.js +14 -0
- package/build/components/breadcrumb/list.d.ts +12 -0
- package/build/components/breadcrumb/list.js +9 -0
- package/build/components/breadcrumb/menu.d.ts +13 -0
- package/build/components/breadcrumb/menu.js +16 -0
- package/build/components/breadcrumb/page.d.ts +12 -0
- package/build/components/breadcrumb/page.js +9 -0
- package/build/components/breadcrumb/scss/index.scss +2 -0
- package/build/components/breadcrumb/separator.d.ts +12 -0
- package/build/components/breadcrumb/separator.js +11 -0
- package/build/components/breadcrumb/svg/caret.svg +1 -0
- package/build/components/breadcrumb/svg/chevron.svg +1 -0
- package/build/components/breadcrumb/svg/more.svg +1 -0
- package/build/components/breadcrumbs/index.d.ts +27 -0
- package/build/components/breadcrumbs/index.js +324 -0
- package/build/components/breadcrumbs/scss/index.scss +2 -0
- package/build/components/button/copy.d.ts +21 -0
- package/build/components/button/copy.js +48 -0
- package/build/components/button/faces.d.ts +10 -0
- package/build/components/button/faces.js +16 -0
- package/build/components/button/fan.d.ts +24 -0
- package/build/components/button/fan.js +117 -0
- package/build/components/button/hold.d.ts +31 -0
- package/build/components/button/hold.js +117 -0
- package/build/components/button/icons.d.ts +6 -0
- package/build/components/button/icons.js +12 -0
- package/build/components/button/index.d.ts +14 -0
- package/build/components/button/index.js +8 -0
- package/build/components/button/kbd.d.ts +15 -0
- package/build/components/button/kbd.js +106 -0
- package/build/components/button/loading.d.ts +22 -0
- package/build/components/button/loading.js +60 -0
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/svg/plus.svg +1 -0
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/card-input/index.d.ts +31 -0
- package/build/components/card-input/index.js +562 -0
- package/build/components/card-input/scss/index.scss +2 -0
- package/build/components/carousel-3d/index.d.ts +27 -0
- package/build/components/carousel-3d/index.js +248 -0
- package/build/components/carousel-3d/scss/index.scss +2 -0
- package/build/components/checkbox/index.d.ts +1447 -11
- package/build/components/checkbox/index.js +50 -66
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/checkbox-group/index.d.ts +30 -0
- package/build/components/checkbox-group/index.js +101 -0
- package/build/components/checkbox-group/scss/index.scss +2 -0
- package/build/components/clipboard/copy.d.ts +21 -5
- package/build/components/clipboard/copy.js +28 -29
- package/build/components/clipboard/index.d.ts +2165 -1435
- package/build/components/clipboard/index.js +2 -3
- package/build/components/code-morph/index.d.ts +25 -0
- package/build/components/code-morph/index.js +401 -0
- package/build/components/code-morph/scss/index.scss +2 -0
- package/build/components/collapsible-sidebar/index.d.ts +41 -0
- package/build/components/collapsible-sidebar/index.js +105 -0
- package/build/components/collapsible-sidebar/scss/index.scss +2 -0
- package/build/components/color-picker/index.d.ts +19 -0
- package/build/components/color-picker/index.js +569 -0
- package/build/components/color-picker/scss/index.scss +2 -0
- package/build/components/command/constants.d.ts +3 -0
- package/build/components/command/constants.js +3 -0
- package/build/components/command/index.d.ts +30 -0
- package/build/components/command/index.js +188 -0
- package/build/components/command/scss/index.scss +2 -0
- package/build/components/command-palette/index.d.ts +51 -0
- package/build/components/command-palette/index.js +319 -0
- package/build/components/command-palette/scss/index.scss +2 -0
- package/build/components/composer/index.d.ts +29 -0
- package/build/components/composer/index.js +79 -0
- package/build/components/composer/scss/index.scss +2 -0
- package/build/components/composer/svg/arrow-up.svg +1 -0
- package/build/components/container/scss/index.scss +1 -1
- package/build/components/contribution-heatmap/index.d.ts +30 -0
- package/build/components/contribution-heatmap/index.js +236 -0
- package/build/components/contribution-heatmap/scss/index.scss +2 -0
- package/build/components/counter/index.d.ts +3 -1
- package/build/components/counter/index.js +54 -31
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/datalist/index.d.ts +37 -0
- package/build/components/datalist/index.js +159 -0
- package/build/components/datalist/scss/index.scss +2 -0
- package/build/components/date-range-picker/index.d.ts +28 -0
- package/build/components/date-range-picker/index.js +443 -0
- package/build/components/date-range-picker/scss/index.scss +2 -0
- package/build/components/dock/index.d.ts +24 -0
- package/build/components/dock/index.js +200 -0
- package/build/components/dock/scss/index.scss +2 -0
- package/build/components/dynamic-island/index.d.ts +23 -0
- package/build/components/dynamic-island/index.js +179 -0
- package/build/components/dynamic-island/scss/index.scss +2 -0
- package/build/components/email-typo-fix/index.d.ts +28 -0
- package/build/components/email-typo-fix/index.js +416 -0
- package/build/components/email-typo-fix/scss/index.scss +2 -0
- package/build/components/expanding-card/index.d.ts +26 -0
- package/build/components/expanding-card/index.js +265 -0
- package/build/components/expanding-card/scss/index.scss +2 -0
- package/build/components/feature-spotlight/index.d.ts +37 -0
- package/build/components/feature-spotlight/index.js +248 -0
- package/build/components/feature-spotlight/scss/index.scss +2 -0
- package/build/components/file-tree/index.d.ts +31 -0
- package/build/components/file-tree/index.js +208 -0
- package/build/components/file-tree/scss/index.scss +2 -0
- package/build/components/filter-grid/index.d.ts +23 -0
- package/build/components/filter-grid/index.js +240 -0
- package/build/components/filter-grid/scss/index.scss +2 -0
- package/build/components/form/action.d.ts +1 -1
- package/build/components/form/action.js +9 -12
- package/build/components/form/index.d.ts +1 -1
- package/build/components/form/scss/index.scss +1 -1
- package/build/components/gradient-text/index.d.ts +19 -0
- package/build/components/gradient-text/index.js +14 -0
- package/build/components/gradient-text/scss/index.scss +2 -0
- package/build/components/grid/scss/index.scss +1 -1
- package/build/components/header/index.d.ts +41 -0
- package/build/components/header/index.js +281 -0
- package/build/components/header/scss/index.scss +2 -0
- package/build/components/highlight/index.d.ts +25 -0
- package/build/components/highlight/index.js +218 -0
- package/build/components/highlight/scss/index.scss +2 -0
- package/build/components/hover-card/index.d.ts +47 -0
- package/build/components/hover-card/index.js +197 -0
- package/build/components/hover-card/scss/index.scss +2 -0
- package/build/components/icon/index.d.ts +11 -2
- package/build/components/icon/index.js +6 -6
- package/build/components/image/index.d.ts +14 -0
- package/build/components/image/index.js +62 -0
- package/build/components/image/scss/index.scss +2 -0
- package/build/components/index.d.ts +96 -1
- package/build/components/index.js +96 -1
- package/build/components/inline-edit/index.d.ts +30 -0
- package/build/components/inline-edit/index.js +108 -0
- package/build/components/inline-edit/scss/index.scss +2 -0
- package/build/components/input/index.d.ts +8 -2
- package/build/components/input/index.js +12 -13
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/kanban-board/index.d.ts +23 -0
- package/build/components/kanban-board/index.js +235 -0
- package/build/components/kanban-board/scss/index.scss +2 -0
- package/build/components/lightbox/index.d.ts +32 -0
- package/build/components/lightbox/index.js +396 -0
- package/build/components/lightbox/scss/index.scss +2 -0
- package/build/components/lightbox/spring.d.ts +16 -0
- package/build/components/lightbox/spring.js +71 -0
- package/build/components/line-shadow-text/index.d.ts +17 -0
- package/build/components/line-shadow-text/index.js +15 -0
- package/build/components/line-shadow-text/scss/index.scss +2 -0
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/index.js +5 -7
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/log/index.d.ts +20 -0
- package/build/components/log/index.js +125 -0
- package/build/components/log/scss/index.scss +2 -0
- package/build/components/long-press/bind.d.ts +21 -0
- package/build/components/long-press/bind.js +136 -0
- package/build/components/long-press/button.d.ts +21 -0
- package/build/components/long-press/button.js +25 -0
- package/build/components/long-press/index.d.ts +2181 -0
- package/build/components/long-press/index.js +4 -0
- package/build/components/long-press/scss/index.scss +2 -0
- package/build/components/marquee/index.d.ts +20 -0
- package/build/components/marquee/index.js +236 -0
- package/build/components/marquee/scss/index.scss +2 -0
- package/build/components/modal/index.d.ts +24 -0
- package/build/components/modal/index.js +75 -0
- package/build/components/modal/scss/index.scss +1 -1
- package/build/components/morphing-button/index.d.ts +24 -0
- package/build/components/morphing-button/index.js +127 -0
- package/build/components/morphing-button/scss/index.scss +2 -0
- package/build/components/morphing-nav/index.d.ts +38 -0
- package/build/components/morphing-nav/index.js +342 -0
- package/build/components/morphing-nav/scss/index.scss +2 -0
- package/build/components/multi-step-form/index.d.ts +32 -0
- package/build/components/multi-step-form/index.js +305 -0
- package/build/components/multi-step-form/scss/index.scss +2 -0
- package/build/components/nested-menu/index.d.ts +27 -0
- package/build/components/nested-menu/index.js +374 -0
- package/build/components/nested-menu/scss/index.scss +2 -0
- package/build/components/notification-bell/index.d.ts +13 -0
- package/build/components/notification-bell/index.js +87 -0
- package/build/components/notification-bell/scss/index.scss +2 -0
- package/build/components/notification-bell/svg/bell.svg +1 -0
- package/build/components/onboarding-checklist/index.d.ts +29 -0
- package/build/components/onboarding-checklist/index.js +196 -0
- package/build/components/onboarding-checklist/scss/index.scss +2 -0
- package/build/components/overlay/index.d.ts +11 -2
- package/build/components/overlay/index.js +7 -7
- package/build/components/page-dots/index.d.ts +24 -0
- package/build/components/page-dots/index.js +116 -0
- package/build/components/page-dots/scss/index.scss +2 -0
- package/build/components/pagination/index.d.ts +11 -0
- package/build/components/pagination/index.js +109 -0
- package/build/components/pagination/scss/index.scss +2 -0
- package/build/components/pagination/svg/arrow-left.svg +1 -0
- package/build/components/pagination/svg/arrow-right.svg +1 -0
- package/build/components/password/constants.d.ts +2 -0
- package/build/components/password/constants.js +2 -0
- package/build/components/password/index.d.ts +22 -0
- package/build/components/password/index.js +74 -0
- package/build/components/password/scss/index.scss +2 -0
- package/build/components/progress/index.d.ts +15 -0
- package/build/components/progress/index.js +37 -0
- package/build/components/progress/scss/index.scss +2 -0
- package/build/components/pull-to-refresh/index.d.ts +26 -0
- package/build/components/pull-to-refresh/index.js +260 -0
- package/build/components/pull-to-refresh/scss/index.scss +2 -0
- package/build/components/radio/index.d.ts +3 -1442
- package/build/components/radio/index.js +2 -1
- package/build/components/radio-cards/index.d.ts +36 -0
- package/build/components/radio-cards/index.js +106 -0
- package/build/components/radio-cards/scss/index.scss +2 -0
- package/build/components/range/index.js +13 -13
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/range-filter/index.d.ts +20 -0
- package/build/components/range-filter/index.js +216 -0
- package/build/components/range-filter/scss/index.scss +2 -0
- package/build/components/range-slider/index.d.ts +30 -0
- package/build/components/range-slider/index.js +287 -0
- package/build/components/range-slider/scss/index.scss +2 -0
- package/build/components/reading-progress/index.d.ts +13 -0
- package/build/components/reading-progress/index.js +106 -0
- package/build/components/reading-progress/scss/index.scss +2 -0
- package/build/components/relative-time/index.d.ts +25 -0
- package/build/components/relative-time/index.js +283 -0
- package/build/components/relative-time/scss/index.scss +2 -0
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/scroll-fade/index.d.ts +39 -0
- package/build/components/scroll-fade/index.js +104 -0
- package/build/components/scroll-fade/scss/index.scss +2 -0
- package/build/components/scroll-spine/index.d.ts +26 -0
- package/build/components/scroll-spine/index.js +204 -0
- package/build/components/scroll-spine/scss/index.scss +2 -0
- package/build/components/scroll-velocity/index.d.ts +22 -0
- package/build/components/scroll-velocity/index.js +160 -0
- package/build/components/scroll-velocity/scss/index.scss +2 -0
- package/build/components/scrub-input/index.d.ts +39 -0
- package/build/components/scrub-input/index.js +221 -0
- package/build/components/scrub-input/scss/index.scss +2 -0
- package/build/components/select/index.d.ts +16 -8
- package/build/components/select/index.js +66 -81
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/select-menu/index.d.ts +34 -0
- package/build/components/select-menu/index.js +329 -0
- package/build/components/select-menu/scss/index.scss +2 -0
- package/build/components/selection-toolbar/index.d.ts +36 -0
- package/build/components/selection-toolbar/index.js +442 -0
- package/build/components/selection-toolbar/scss/index.scss +2 -0
- package/build/components/settings/index.d.ts +43 -0
- package/build/components/settings/index.js +147 -0
- package/build/components/settings/scss/index.scss +2 -0
- package/build/components/settings/svg/close.svg +1 -0
- package/build/components/settings/svg/saved.svg +1 -0
- package/build/components/share-button/index.d.ts +29 -0
- package/build/components/share-button/index.js +191 -0
- package/build/components/share-button/scss/index.scss +2 -0
- package/build/components/sheet/index.d.ts +33 -0
- package/build/components/sheet/index.js +110 -0
- package/build/components/sheet/scss/index.scss +2 -0
- package/build/components/shiny-text/index.d.ts +17 -0
- package/build/components/shiny-text/index.js +14 -0
- package/build/components/shiny-text/scss/index.scss +2 -0
- package/build/components/shortcut-recorder/index.d.ts +12 -0
- package/build/components/shortcut-recorder/index.js +230 -0
- package/build/components/shortcut-recorder/scss/index.scss +2 -0
- package/build/components/shortcut-sheet/index.d.ts +48 -0
- package/build/components/shortcut-sheet/index.js +304 -0
- package/build/components/shortcut-sheet/scss/index.scss +2 -0
- package/build/components/sidebar/index.d.ts +11 -2
- package/build/components/sidebar/index.js +7 -7
- package/build/components/sidebar/scss/index.scss +1 -1
- package/build/components/slider/index.d.ts +25 -0
- package/build/components/slider/index.js +188 -0
- package/build/components/slider/scss/index.scss +2 -0
- package/build/components/sliding-tabs/index.d.ts +28 -0
- package/build/components/sliding-tabs/index.js +188 -0
- package/build/components/sliding-tabs/scss/index.scss +2 -0
- package/build/components/snap-carousel/index.d.ts +30 -0
- package/build/components/snap-carousel/index.js +233 -0
- package/build/components/snap-carousel/scss/index.scss +2 -0
- package/build/components/sortable/index.d.ts +9 -0
- package/build/components/sortable/index.js +302 -0
- package/build/components/sortable/scss/index.scss +2 -0
- package/build/components/sparkline/index.d.ts +26 -0
- package/build/components/sparkline/index.js +173 -0
- package/build/components/sparkline/scss/index.scss +2 -0
- package/build/components/stacked-drawer/index.d.ts +24 -0
- package/build/components/stacked-drawer/index.js +211 -0
- package/build/components/stacked-drawer/scss/index.scss +2 -0
- package/build/components/stat-counter/index.d.ts +32 -0
- package/build/components/stat-counter/index.js +216 -0
- package/build/components/stat-counter/scss/index.scss +2 -0
- package/build/components/status-picker/index.d.ts +32 -0
- package/build/components/status-picker/index.js +198 -0
- package/build/components/status-picker/scss/index.scss +2 -0
- package/build/components/sticky-header/index.d.ts +2159 -0
- package/build/components/sticky-header/index.js +98 -0
- package/build/components/sticky-header/scss/index.scss +2 -0
- package/build/components/sticky-stack/index.d.ts +33 -0
- package/build/components/sticky-stack/index.js +184 -0
- package/build/components/sticky-stack/scss/index.scss +2 -0
- package/build/components/story-progress/index.d.ts +26 -0
- package/build/components/story-progress/index.js +196 -0
- package/build/components/story-progress/scss/index.scss +2 -0
- package/build/components/swipe-deck/index.d.ts +19 -0
- package/build/components/swipe-deck/index.js +300 -0
- package/build/components/swipe-deck/scss/index.scss +2 -0
- package/build/components/switch/index.d.ts +3 -1442
- package/build/components/switch/index.js +2 -1
- package/build/components/tabs/scss/index.scss +1 -1
- package/build/components/tag-input/index.d.ts +27 -0
- package/build/components/tag-input/index.js +309 -0
- package/build/components/tag-input/scss/index.scss +2 -0
- package/build/components/task-list/index.d.ts +28 -0
- package/build/components/task-list/index.js +107 -0
- package/build/components/task-list/scss/index.scss +2 -0
- package/build/components/tasklist/constants.d.ts +2 -0
- package/build/components/tasklist/constants.js +2 -0
- package/build/components/tasklist/index.d.ts +730 -0
- package/build/components/tasklist/index.js +116 -0
- package/build/components/tasklist/scss/index.scss +2 -0
- package/build/components/text-animate/index.d.ts +30 -0
- package/build/components/text-animate/index.js +97 -0
- package/build/components/text-animate/scss/index.scss +2 -0
- package/build/components/text-progress/index.d.ts +13 -0
- package/build/components/text-progress/index.js +114 -0
- package/build/components/text-progress/scss/index.scss +2 -0
- package/build/components/textarea/index.d.ts +2159 -715
- package/build/components/textarea/index.js +16 -18
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/thumbnail/scss/index.scss +1 -1
- package/build/components/toast/index.js +53 -43
- package/build/components/toast/manager.d.ts +4 -0
- package/build/components/toast/manager.js +19 -1
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/context.d.ts +22 -0
- package/build/components/tooltip/context.js +66 -0
- package/build/components/tooltip/group.d.ts +29 -0
- package/build/components/tooltip/group.js +128 -0
- package/build/components/tooltip/index.d.ts +12 -2153
- package/build/components/tooltip/index.js +4 -1
- package/build/components/tooltip/menu.d.ts +23 -10
- package/build/components/tooltip/menu.js +16 -36
- package/build/components/tooltip/onclick.d.ts +22 -713
- package/build/components/tooltip/onclick.js +32 -18
- package/build/components/tooltip/onhover.d.ts +24 -711
- package/build/components/tooltip/onhover.js +85 -14
- package/build/components/tooltip/options.d.ts +7 -0
- package/build/components/tooltip/options.js +21 -0
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/utilities.d.ts +4 -0
- package/build/components/tooltip/utilities.js +58 -0
- package/build/components/tree/index.d.ts +28 -0
- package/build/components/tree/index.js +182 -0
- package/build/components/tree/scss/index.scss +2 -0
- package/build/components/tree-view/index.d.ts +25 -0
- package/build/components/tree-view/index.js +205 -0
- package/build/components/tree-view/scss/index.scss +2 -0
- package/build/components/typewriter/index.d.ts +11 -2
- package/build/components/typewriter/index.js +16 -12
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/typewriter-retype/index.d.ts +8 -0
- package/build/components/typewriter-retype/index.js +122 -0
- package/build/components/typewriter-retype/scss/index.scss +2 -0
- package/build/components/undo-toast/index.d.ts +30 -0
- package/build/components/undo-toast/index.js +262 -0
- package/build/components/undo-toast/scss/index.scss +2 -0
- package/build/components/uptime/index.d.ts +21 -0
- package/build/components/uptime/index.js +210 -0
- package/build/components/uptime/scss/index.scss +2 -0
- package/build/components/usage-meter/index.d.ts +2159 -0
- package/build/components/usage-meter/index.js +30 -0
- package/build/components/usage-meter/scss/index.scss +2 -0
- package/build/components/value-flash/index.d.ts +12 -0
- package/build/components/value-flash/index.js +106 -0
- package/build/components/value-flash/scss/index.scss +2 -0
- package/build/components/waitlist-join/index.d.ts +34 -0
- package/build/components/waitlist-join/index.js +402 -0
- package/build/components/waitlist-join/scss/index.scss +2 -0
- package/build/components/web-search/brands.d.ts +121 -0
- package/build/components/web-search/brands.js +138 -0
- package/build/components/web-search/index.d.ts +31 -0
- package/build/components/web-search/index.js +245 -0
- package/build/components/web-search/scss/index.scss +2 -0
- package/build/components/word-rotator/index.d.ts +14 -0
- package/build/components/word-rotator/index.js +196 -0
- package/build/components/word-rotator/scss/index.scss +2 -0
- package/build/css-utilities/absolute/scss/index.scss +1 -1
- package/build/css-utilities/index.scss +1 -1
- package/build/css-utilities/scrollbar/scss/index.scss +1 -1
- package/build/themes/dark/input.d.ts +496 -492
- package/build/themes/dark/select.d.ts +3 -735
- package/build/themes/dark/select.js +4 -3
- package/build/themes/dark/textarea.d.ts +2172 -718
- package/package.json +6 -6
- package/pnpm-workspace.yaml +5 -5
- package/src/components/accordion/index.ts +13 -14
- package/src/components/accordion/more.ts +97 -0
- package/src/components/accordion/scss/index.scss +144 -1
- package/src/components/anchor/scss/index.scss +2 -2
- package/src/components/announcement-banner/index.ts +81 -0
- package/src/components/announcement-banner/scss/index.scss +183 -0
- package/src/components/announcement-banner/scss/variables.scss +18 -0
- package/src/components/autosave/index.ts +113 -0
- package/src/components/autosave/scss/index.scss +155 -0
- package/src/components/autosave/scss/variables.scss +22 -0
- package/src/components/back-to-top/index.ts +293 -0
- package/src/components/back-to-top/scss/index.scss +111 -0
- package/src/components/back-to-top/scss/variables.scss +30 -0
- package/src/components/banner/scss/variables.scss +1 -1
- package/src/components/bento-grid/index.ts +63 -0
- package/src/components/bento-grid/scss/index.scss +174 -0
- package/src/components/bento-grid/scss/variables.scss +19 -0
- package/src/components/bento-grid-spotlight/index.ts +133 -0
- package/src/components/bento-grid-spotlight/scss/index.scss +226 -0
- package/src/components/bento-grid-spotlight/scss/variables.scss +36 -0
- package/src/components/bookmark-button/index.ts +174 -0
- package/src/components/bookmark-button/scss/index.scss +162 -0
- package/src/components/bookmark-button/scss/variables.scss +28 -0
- package/src/components/breadcrumb/ellipsis.ts +17 -0
- package/src/components/breadcrumb/index.ts +32 -0
- package/src/components/breadcrumb/item.ts +10 -0
- package/src/components/breadcrumb/link.ts +21 -0
- package/src/components/breadcrumb/list.ts +10 -0
- package/src/components/breadcrumb/menu.ts +20 -0
- package/src/components/breadcrumb/page.ts +16 -0
- package/src/components/breadcrumb/scss/index.scss +74 -0
- package/src/components/breadcrumb/scss/variables.scss +17 -0
- package/src/components/breadcrumb/separator.ts +17 -0
- package/src/components/breadcrumb/svg/caret.svg +1 -0
- package/src/components/breadcrumb/svg/chevron.svg +1 -0
- package/src/components/breadcrumb/svg/more.svg +1 -0
- package/src/components/breadcrumbs/index.ts +479 -0
- package/src/components/breadcrumbs/scss/index.scss +235 -0
- package/src/components/breadcrumbs/scss/variables.scss +30 -0
- package/src/components/button/copy.ts +59 -0
- package/src/components/button/faces.ts +29 -0
- package/src/components/button/fan.ts +173 -0
- package/src/components/button/hold.ts +154 -0
- package/src/components/button/icons.ts +38 -0
- package/src/components/button/index.ts +12 -0
- package/src/components/button/kbd.ts +156 -0
- package/src/components/button/loading.ts +77 -0
- package/src/components/button/scss/_fan.scss +125 -0
- package/src/components/button/scss/_kbd.scss +10 -0
- package/src/components/button/scss/index.scss +117 -5
- package/src/components/button/scss/variables.scss +81 -0
- package/src/components/button/svg/plus.svg +1 -0
- package/src/components/card/scss/index.scss +2 -3
- package/src/components/card-input/index.ts +594 -0
- package/src/components/card-input/scss/index.scss +512 -0
- package/src/components/card-input/scss/variables.scss +29 -0
- package/src/components/carousel-3d/index.ts +405 -0
- package/src/components/carousel-3d/scss/index.scss +155 -0
- package/src/components/carousel-3d/scss/variables.scss +25 -0
- package/src/components/checkbox/index.ts +17 -25
- package/src/components/checkbox/scss/index.scss +6 -3
- package/src/components/checkbox-group/index.ts +171 -0
- package/src/components/checkbox-group/scss/index.scss +229 -0
- package/src/components/checkbox-group/scss/variables.scss +28 -0
- package/src/components/clipboard/copy.ts +24 -35
- package/src/components/clipboard/index.ts +2 -3
- package/src/components/code-morph/index.ts +459 -0
- package/src/components/code-morph/scss/index.scss +384 -0
- package/src/components/code-morph/scss/variables.scss +33 -0
- package/src/components/collapsible-sidebar/index.ts +193 -0
- package/src/components/collapsible-sidebar/scss/index.scss +220 -0
- package/src/components/collapsible-sidebar/scss/variables.scss +42 -0
- package/src/components/color-picker/index.ts +650 -0
- package/src/components/color-picker/scss/index.scss +345 -0
- package/src/components/color-picker/scss/variables.scss +33 -0
- package/src/components/command/constants.ts +6 -0
- package/src/components/command/index.ts +282 -0
- package/src/components/command/scss/index.scss +213 -0
- package/src/components/command/scss/variables.scss +35 -0
- package/src/components/command-palette/index.ts +456 -0
- package/src/components/command-palette/scss/index.scss +235 -0
- package/src/components/command-palette/scss/variables.scss +42 -0
- package/src/components/composer/index.ts +117 -0
- package/src/components/composer/scss/index.scss +105 -0
- package/src/components/composer/scss/variables.scss +82 -0
- package/src/components/composer/svg/arrow-up.svg +1 -0
- package/src/components/container/scss/index.scss +2 -1
- package/src/components/contribution-heatmap/index.ts +348 -0
- package/src/components/contribution-heatmap/scss/index.scss +151 -0
- package/src/components/contribution-heatmap/scss/variables.scss +39 -0
- package/src/components/counter/index.ts +58 -20
- package/src/components/counter/scss/index.scss +56 -2
- package/src/components/counter/scss/variables.scss +38 -2
- package/src/components/datalist/index.ts +236 -0
- package/src/components/datalist/scss/index.scss +84 -0
- package/src/components/datalist/scss/variables.scss +26 -0
- package/src/components/date-range-picker/index.ts +641 -0
- package/src/components/date-range-picker/scss/index.scss +380 -0
- package/src/components/date-range-picker/scss/variables.scss +22 -0
- package/src/components/dock/index.ts +265 -0
- package/src/components/dock/scss/index.scss +102 -0
- package/src/components/dock/scss/variables.scss +30 -0
- package/src/components/dynamic-island/index.ts +161 -0
- package/src/components/dynamic-island/scss/index.scss +278 -0
- package/src/components/dynamic-island/scss/variables.scss +39 -0
- package/src/components/email-typo-fix/index.ts +615 -0
- package/src/components/email-typo-fix/scss/index.scss +213 -0
- package/src/components/email-typo-fix/scss/variables.scss +18 -0
- package/src/components/expanding-card/index.ts +377 -0
- package/src/components/expanding-card/scss/index.scss +232 -0
- package/src/components/expanding-card/scss/variables.scss +22 -0
- package/src/components/feature-spotlight/index.ts +437 -0
- package/src/components/feature-spotlight/scss/index.scss +254 -0
- package/src/components/feature-spotlight/scss/variables.scss +36 -0
- package/src/components/file-tree/index.ts +319 -0
- package/src/components/file-tree/scss/index.scss +138 -0
- package/src/components/file-tree/scss/variables.scss +18 -0
- package/src/components/filter-grid/index.ts +344 -0
- package/src/components/filter-grid/scss/index.scss +142 -0
- package/src/components/filter-grid/scss/variables.scss +41 -0
- package/src/components/form/action.ts +2 -8
- package/src/components/form/scss/index.scss +2 -1
- package/src/components/gradient-text/index.ts +26 -0
- package/src/components/gradient-text/scss/index.scss +20 -0
- package/src/components/gradient-text/scss/variables.scss +6 -0
- package/src/components/grid/scss/index.scss +1 -1
- package/src/components/header/index.ts +318 -0
- package/src/components/header/scss/index.scss +508 -0
- package/src/components/header/scss/variables.scss +21 -0
- package/src/components/highlight/index.ts +239 -0
- package/src/components/highlight/scss/index.scss +48 -0
- package/src/components/highlight/scss/variables.scss +26 -0
- package/src/components/hover-card/index.ts +319 -0
- package/src/components/hover-card/scss/index.scss +117 -0
- package/src/components/hover-card/scss/variables.scss +25 -0
- package/src/components/image/index.ts +79 -0
- package/src/components/image/scss/index.scss +82 -0
- package/src/components/image/scss/variables.scss +15 -0
- package/src/components/index.ts +96 -1
- package/src/components/inline-edit/index.ts +177 -0
- package/src/components/inline-edit/scss/index.scss +152 -0
- package/src/components/inline-edit/scss/variables.scss +17 -0
- package/src/components/input/index.ts +15 -6
- package/src/components/input/scss/index.scss +2 -3
- package/src/components/kanban-board/index.ts +326 -0
- package/src/components/kanban-board/scss/index.scss +126 -0
- package/src/components/kanban-board/scss/variables.scss +39 -0
- package/src/components/lightbox/index.ts +594 -0
- package/src/components/lightbox/scss/index.scss +194 -0
- package/src/components/lightbox/scss/variables.scss +24 -0
- package/src/components/lightbox/spring.ts +118 -0
- package/src/components/line-shadow-text/index.ts +24 -0
- package/src/components/line-shadow-text/scss/index.scss +45 -0
- package/src/components/line-shadow-text/scss/variables.scss +6 -0
- package/src/components/link/scss/index.scss +2 -3
- package/src/components/loading/index.ts +3 -10
- package/src/components/loading/scss/index.scss +55 -4
- package/src/components/loading/scss/variables.scss +15 -1
- package/src/components/log/index.ts +156 -0
- package/src/components/log/scss/index.scss +269 -0
- package/src/components/log/scss/variables.scss +19 -0
- package/src/components/long-press/bind.ts +159 -0
- package/src/components/long-press/button.ts +46 -0
- package/src/components/long-press/index.ts +6 -0
- package/src/components/long-press/scss/index.scss +60 -0
- package/src/components/long-press/scss/variables.scss +9 -0
- package/src/components/marquee/index.ts +300 -0
- package/src/components/marquee/scss/index.scss +109 -0
- package/src/components/marquee/scss/variables.scss +18 -0
- package/src/components/modal/index.ts +91 -0
- package/src/components/modal/scss/index.scss +51 -4
- package/src/components/modal/scss/variables.scss +36 -0
- package/src/components/morphing-button/index.ts +188 -0
- package/src/components/morphing-button/scss/index.scss +154 -0
- package/src/components/morphing-button/scss/variables.scss +21 -0
- package/src/components/morphing-nav/index.ts +496 -0
- package/src/components/morphing-nav/scss/index.scss +284 -0
- package/src/components/morphing-nav/scss/variables.scss +36 -0
- package/src/components/multi-step-form/index.ts +368 -0
- package/src/components/multi-step-form/scss/index.scss +397 -0
- package/src/components/multi-step-form/scss/variables.scss +22 -0
- package/src/components/nested-menu/index.ts +446 -0
- package/src/components/nested-menu/scss/index.scss +219 -0
- package/src/components/nested-menu/scss/variables.scss +26 -0
- package/src/components/notification-bell/index.ts +102 -0
- package/src/components/notification-bell/scss/index.scss +132 -0
- package/src/components/notification-bell/scss/variables.scss +41 -0
- package/src/components/notification-bell/svg/bell.svg +1 -0
- package/src/components/onboarding-checklist/index.ts +252 -0
- package/src/components/onboarding-checklist/scss/index.scss +414 -0
- package/src/components/onboarding-checklist/scss/variables.scss +17 -0
- package/src/components/page-dots/index.ts +137 -0
- package/src/components/page-dots/scss/index.scss +95 -0
- package/src/components/page-dots/scss/variables.scss +26 -0
- package/src/components/pagination/index.ts +129 -0
- package/src/components/pagination/scss/index.scss +46 -0
- package/src/components/pagination/scss/variables.scss +40 -0
- package/src/components/pagination/svg/arrow-left.svg +1 -0
- package/src/components/pagination/svg/arrow-right.svg +1 -0
- package/src/components/password/constants.ts +4 -0
- package/src/components/password/index.ts +97 -0
- package/src/components/password/scss/index.scss +188 -0
- package/src/components/password/scss/variables.scss +50 -0
- package/src/components/progress/index.ts +57 -0
- package/src/components/progress/scss/index.scss +49 -0
- package/src/components/progress/scss/variables.scss +11 -0
- package/src/components/pull-to-refresh/index.ts +438 -0
- package/src/components/pull-to-refresh/scss/index.scss +91 -0
- package/src/components/pull-to-refresh/scss/variables.scss +10 -0
- package/src/components/radio/index.ts +5 -2
- package/src/components/radio-cards/index.ts +145 -0
- package/src/components/radio-cards/scss/index.scss +232 -0
- package/src/components/radio-cards/scss/variables.scss +32 -0
- package/src/components/range/scss/index.scss +2 -1
- package/src/components/range-filter/index.ts +295 -0
- package/src/components/range-filter/scss/index.scss +257 -0
- package/src/components/range-filter/scss/variables.scss +20 -0
- package/src/components/range-slider/index.ts +277 -0
- package/src/components/range-slider/scss/index.scss +234 -0
- package/src/components/range-slider/scss/variables.scss +26 -0
- package/src/components/reading-progress/index.ts +160 -0
- package/src/components/reading-progress/scss/index.scss +115 -0
- package/src/components/reading-progress/scss/variables.scss +31 -0
- package/src/components/relative-time/index.ts +410 -0
- package/src/components/relative-time/scss/index.scss +88 -0
- package/src/components/relative-time/scss/variables.scss +19 -0
- package/src/components/root/scss/index.scss +2 -2
- package/src/components/scroll-fade/index.ts +131 -0
- package/src/components/scroll-fade/scss/index.scss +104 -0
- package/src/components/scroll-fade/scss/variables.scss +10 -0
- package/src/components/scroll-spine/index.ts +355 -0
- package/src/components/scroll-spine/scss/index.scss +209 -0
- package/src/components/scroll-spine/scss/variables.scss +22 -0
- package/src/components/scroll-velocity/index.ts +269 -0
- package/src/components/scroll-velocity/scss/index.scss +29 -0
- package/src/components/scroll-velocity/scss/variables.scss +3 -0
- package/src/components/scrub-input/index.ts +339 -0
- package/src/components/scrub-input/scss/index.scss +105 -0
- package/src/components/scrub-input/scss/variables.scss +23 -0
- package/src/components/select/index.ts +54 -51
- package/src/components/select/scss/index.scss +15 -10
- package/src/components/select-menu/index.ts +499 -0
- package/src/components/select-menu/scss/index.scss +192 -0
- package/src/components/select-menu/scss/variables.scss +41 -0
- package/src/components/selection-toolbar/index.ts +510 -0
- package/src/components/selection-toolbar/scss/index.scss +221 -0
- package/src/components/selection-toolbar/scss/variables.scss +24 -0
- package/src/components/settings/index.ts +184 -0
- package/src/components/settings/scss/index.scss +327 -0
- package/src/components/settings/scss/variables.scss +50 -0
- package/src/components/settings/svg/close.svg +1 -0
- package/src/components/settings/svg/saved.svg +1 -0
- package/src/components/share-button/index.ts +328 -0
- package/src/components/share-button/scss/index.scss +191 -0
- package/src/components/share-button/scss/variables.scss +24 -0
- package/src/components/sheet/index.ts +170 -0
- package/src/components/sheet/scss/index.scss +65 -0
- package/src/components/sheet/scss/variables.scss +27 -0
- package/src/components/shiny-text/index.ts +19 -0
- package/src/components/shiny-text/scss/index.scss +32 -0
- package/src/components/shiny-text/scss/variables.scss +7 -0
- package/src/components/shortcut-recorder/index.ts +284 -0
- package/src/components/shortcut-recorder/scss/index.scss +198 -0
- package/src/components/shortcut-recorder/scss/variables.scss +54 -0
- package/src/components/shortcut-sheet/index.ts +454 -0
- package/src/components/shortcut-sheet/scss/index.scss +306 -0
- package/src/components/shortcut-sheet/scss/variables.scss +36 -0
- package/src/components/sidebar/scss/index.scss +3 -3
- package/src/components/slider/index.ts +232 -0
- package/src/components/slider/scss/index.scss +182 -0
- package/src/components/slider/scss/variables.scss +15 -0
- package/src/components/sliding-tabs/index.ts +291 -0
- package/src/components/sliding-tabs/scss/index.scss +174 -0
- package/src/components/sliding-tabs/scss/variables.scss +34 -0
- package/src/components/snap-carousel/index.ts +324 -0
- package/src/components/snap-carousel/scss/index.scss +174 -0
- package/src/components/snap-carousel/scss/variables.scss +31 -0
- package/src/components/sortable/index.ts +483 -0
- package/src/components/sortable/scss/index.scss +282 -0
- package/src/components/sortable/scss/variables.scss +59 -0
- package/src/components/sparkline/index.ts +234 -0
- package/src/components/sparkline/scss/index.scss +169 -0
- package/src/components/sparkline/scss/variables.scss +30 -0
- package/src/components/stacked-drawer/index.ts +272 -0
- package/src/components/stacked-drawer/scss/index.scss +122 -0
- package/src/components/stacked-drawer/scss/variables.scss +20 -0
- package/src/components/stat-counter/index.ts +337 -0
- package/src/components/stat-counter/scss/index.scss +246 -0
- package/src/components/stat-counter/scss/variables.scss +24 -0
- package/src/components/status-picker/index.ts +323 -0
- package/src/components/status-picker/scss/index.scss +290 -0
- package/src/components/status-picker/scss/variables.scss +29 -0
- package/src/components/sticky-header/index.ts +127 -0
- package/src/components/sticky-header/scss/index.scss +149 -0
- package/src/components/sticky-header/scss/variables.scss +22 -0
- package/src/components/sticky-stack/index.ts +313 -0
- package/src/components/sticky-stack/scss/index.scss +167 -0
- package/src/components/sticky-stack/scss/variables.scss +50 -0
- package/src/components/story-progress/index.ts +247 -0
- package/src/components/story-progress/scss/index.scss +205 -0
- package/src/components/story-progress/scss/variables.scss +21 -0
- package/src/components/swipe-deck/index.ts +438 -0
- package/src/components/swipe-deck/scss/index.scss +275 -0
- package/src/components/swipe-deck/scss/variables.scss +24 -0
- package/src/components/switch/index.ts +5 -2
- package/src/components/tabs/scss/index.scss +3 -3
- package/src/components/tag-input/index.ts +415 -0
- package/src/components/tag-input/scss/index.scss +186 -0
- package/src/components/tag-input/scss/variables.scss +30 -0
- package/src/components/task-list/index.ts +137 -0
- package/src/components/task-list/scss/index.scss +171 -0
- package/src/components/task-list/scss/variables.scss +8 -0
- package/src/components/tasklist/constants.ts +4 -0
- package/src/components/tasklist/index.ts +174 -0
- package/src/components/tasklist/scss/index.scss +184 -0
- package/src/components/tasklist/scss/variables.scss +83 -0
- package/src/components/text-animate/index.ts +142 -0
- package/src/components/text-animate/scss/index.scss +106 -0
- package/src/components/text-animate/scss/variables.scss +17 -0
- package/src/components/text-progress/index.ts +170 -0
- package/src/components/text-progress/scss/index.scss +148 -0
- package/src/components/text-progress/scss/variables.scss +26 -0
- package/src/components/textarea/index.ts +18 -16
- package/src/components/textarea/scss/index.scss +2 -3
- package/src/components/thumbnail/scss/index.scss +51 -0
- package/src/components/thumbnail/scss/variables.scss +12 -0
- package/src/components/toast/index.ts +11 -1
- package/src/components/toast/manager.ts +31 -1
- package/src/components/toast/scss/index.scss +66 -18
- package/src/components/toast/scss/variables.scss +2 -0
- package/src/components/tooltip/context.ts +96 -0
- package/src/components/tooltip/group.ts +162 -0
- package/src/components/tooltip/index.ts +6 -1
- package/src/components/tooltip/menu.ts +31 -48
- package/src/components/tooltip/onclick.ts +42 -15
- package/src/components/tooltip/onhover.ts +130 -11
- package/src/components/tooltip/options.ts +33 -0
- package/src/components/tooltip/scss/_center.scss +1 -5
- package/src/components/tooltip/scss/_east.scss +5 -5
- package/src/components/tooltip/scss/_group.scss +164 -0
- package/src/components/tooltip/scss/_north.scss +5 -5
- package/src/components/tooltip/scss/_south.scss +5 -5
- package/src/components/tooltip/scss/_west.scss +5 -5
- package/src/components/tooltip/scss/index.scss +230 -17
- package/src/components/tooltip/scss/variables.scss +105 -0
- package/src/components/tooltip/utilities.ts +103 -0
- package/src/components/tree/index.ts +259 -0
- package/src/components/tree/scss/index.scss +105 -0
- package/src/components/tree/scss/variables.scss +48 -0
- package/src/components/tree-view/index.ts +285 -0
- package/src/components/tree-view/scss/index.scss +169 -0
- package/src/components/tree-view/scss/variables.scss +18 -0
- package/src/components/typewriter/index.ts +10 -6
- package/src/components/typewriter/scss/index.scss +30 -11
- package/src/components/typewriter/scss/variables.scss +24 -0
- package/src/components/typewriter-retype/index.ts +164 -0
- package/src/components/typewriter-retype/scss/index.scss +142 -0
- package/src/components/typewriter-retype/scss/variables.scss +46 -0
- package/src/components/undo-toast/index.ts +359 -0
- package/src/components/undo-toast/scss/index.scss +216 -0
- package/src/components/undo-toast/scss/variables.scss +20 -0
- package/src/components/uptime/index.ts +271 -0
- package/src/components/uptime/scss/index.scss +163 -0
- package/src/components/uptime/scss/variables.scss +56 -0
- package/src/components/usage-meter/index.ts +63 -0
- package/src/components/usage-meter/scss/index.scss +94 -0
- package/src/components/usage-meter/scss/variables.scss +43 -0
- package/src/components/value-flash/index.ts +121 -0
- package/src/components/value-flash/scss/index.scss +193 -0
- package/src/components/value-flash/scss/variables.scss +47 -0
- package/src/components/waitlist-join/index.ts +545 -0
- package/src/components/waitlist-join/scss/index.scss +401 -0
- package/src/components/waitlist-join/scss/variables.scss +23 -0
- package/src/components/web-search/brands.ts +155 -0
- package/src/components/web-search/index.ts +316 -0
- package/src/components/web-search/scss/index.scss +270 -0
- package/src/components/web-search/scss/variables.scss +8 -0
- package/src/components/word-rotator/index.ts +296 -0
- package/src/components/word-rotator/scss/index.scss +33 -0
- package/src/components/word-rotator/scss/variables.scss +7 -0
- package/src/css-utilities/scrollbar/scss/index.scss +6 -1
- package/src/lib/scss/position.scss +3 -3
- package/src/themes/dark/select.ts +7 -4
- package/storage/svg/settings/add-line.svg +1 -0
- package/storage/svg/settings/arrow-down-s-line.svg +1 -0
- package/storage/svg/settings/arrow-left-s-line.svg +1 -0
- package/storage/svg/settings/arrow-right-s-line.svg +1 -0
- package/storage/svg/settings/bank-card-line.svg +1 -0
- package/storage/svg/settings/book-open-line.svg +1 -0
- package/storage/svg/settings/calendar-line.svg +1 -0
- package/storage/svg/settings/code-block.svg +1 -0
- package/storage/svg/settings/database-2-line.svg +1 -0
- package/storage/svg/settings/delete-bin-6-line.svg +1 -0
- package/storage/svg/settings/download-2-line.svg +1 -0
- package/storage/svg/settings/edit-line.svg +1 -0
- package/storage/svg/settings/expand-up-down-line.svg +1 -0
- package/storage/svg/settings/external-link-line.svg +1 -0
- package/storage/svg/settings/file-copy-line.svg +1 -0
- package/storage/svg/settings/file-excel-2-fill.svg +1 -0
- package/storage/svg/settings/file-text-fill.svg +1 -0
- package/storage/svg/settings/film-fill.svg +1 -0
- package/storage/svg/settings/git-merge-line.svg +1 -0
- package/storage/svg/settings/logout-circle-line.svg +1 -0
- package/storage/svg/settings/mail-line.svg +1 -0
- package/storage/svg/settings/more-2-fill.svg +1 -0
- package/storage/svg/settings/more-fill.svg +1 -0
- package/storage/svg/settings/organization-chart.svg +1 -0
- package/storage/svg/settings/palette-line.svg +1 -0
- package/storage/svg/settings/plug-line.svg +1 -0
- package/storage/svg/settings/school-line.svg +1 -0
- package/storage/svg/settings/search-line.svg +1 -0
- package/storage/svg/settings/settings-6-line.svg +1 -0
- package/storage/svg/settings/settings-line.svg +1 -0
- package/storage/svg/settings/tools-fill.svg +1 -0
- package/storage/svg/settings/upload-cloud-2-line.svg +1 -0
- package/build/components/border/scss/index.scss +0 -2
- package/build/components/clipboard/onclick.d.ts +0 -10
- package/build/components/clipboard/onclick.js +0 -38
- package/src/components/border/scss/index.scss +0 -17
- package/src/components/border/scss/variables.scss +0 -6
- package/src/components/clipboard/onclick.ts +0 -40
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { html, type Attributes } from '@esportsplus/template';
|
|
2
|
+
import { effect, onCleanup, reactive } from '@esportsplus/reactivity';
|
|
3
|
+
import './scss/index.scss';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
type A = Attributes & {
|
|
7
|
+
prefix?: string;
|
|
8
|
+
words: string[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// Long enough to read the finished sentence once.
|
|
13
|
+
const HOLD = 1800;
|
|
14
|
+
|
|
15
|
+
const REDUCED = '(prefers-reduced-motion: reduce)';
|
|
16
|
+
|
|
17
|
+
// How long the word sits selected before the first key replaces it: the beat where a person decides on the new
|
|
18
|
+
// word. Includes the selection sweep.
|
|
19
|
+
const SELECTED_FOR = 620;
|
|
20
|
+
|
|
21
|
+
// Reduced motion swaps whole words on this interval instead of typing.
|
|
22
|
+
const SWAP_EVERY = 2800;
|
|
23
|
+
|
|
24
|
+
// Per-character typing delay: a base plus up to this much jitter, which lands around 8 to 14 keys a second, the pace
|
|
25
|
+
// of someone who knows the word.
|
|
26
|
+
const TYPE_BASE = 62;
|
|
27
|
+
|
|
28
|
+
const TYPE_JITTER = 64;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Deterministic, and smooth from key to key: a slow wave carries a rhythm through the word and a small hash roughens
|
|
32
|
+
// it, so delays vary the way a hand does instead of jumping between extremes.
|
|
33
|
+
function jitter(word: number, char: number) {
|
|
34
|
+
let n = Math.sin(char * 12.9898 + word * 78.233) * 43758.5453,
|
|
35
|
+
wave = Math.sin(char * 1.9 + word * 2.7) * 0.5 + 0.5;
|
|
36
|
+
|
|
37
|
+
return wave * 0.7 + (n - Math.floor(n)) * 0.3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function type(root: HTMLElement, text: HTMLElement, words: string[]) {
|
|
41
|
+
let length = words[0].length,
|
|
42
|
+
timer: ReturnType<typeof setTimeout> | undefined,
|
|
43
|
+
word = 0;
|
|
44
|
+
|
|
45
|
+
function key() {
|
|
46
|
+
let target = words[word];
|
|
47
|
+
|
|
48
|
+
if (length < target.length) {
|
|
49
|
+
strike(target[length++]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let finished = length === target.length;
|
|
53
|
+
|
|
54
|
+
// Solid while keys are moving, blinking while it waits.
|
|
55
|
+
root.classList.toggle('--typing', !finished);
|
|
56
|
+
timer = finished
|
|
57
|
+
? setTimeout(select, HOLD)
|
|
58
|
+
: setTimeout(key, TYPE_BASE + jitter(word, length) * TYPE_JITTER);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Rewrites the way people do: select the word, then type over it. The first key replaces the whole selection
|
|
62
|
+
// at once.
|
|
63
|
+
function select() {
|
|
64
|
+
if (words.length < 2) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
root.classList.add('--selecting');
|
|
69
|
+
timer = setTimeout(() => {
|
|
70
|
+
length = 0;
|
|
71
|
+
text.textContent = '';
|
|
72
|
+
word = (word + 1) % words.length;
|
|
73
|
+
root.classList.remove('--selecting');
|
|
74
|
+
key();
|
|
75
|
+
}, SELECTED_FOR);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function strike(char: string) {
|
|
79
|
+
let letter = document.createElement('span');
|
|
80
|
+
|
|
81
|
+
letter.className = 'typewriter-retype-letter';
|
|
82
|
+
letter.textContent = char;
|
|
83
|
+
text.append(letter);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
timer = setTimeout(select, HOLD);
|
|
87
|
+
|
|
88
|
+
return () => {
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
root.classList.remove('--selecting', '--typing');
|
|
91
|
+
// Leaves the DOM as rendered, so a remount or motion change starts clean instead of from a half typed,
|
|
92
|
+
// selected word.
|
|
93
|
+
text.textContent = words[0];
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
export default ({ prefix = '', words, ...attributes }: A) => {
|
|
99
|
+
let lead = prefix ? `${prefix} ` : '',
|
|
100
|
+
longest = words.reduce((a, b) => b.length > a.length ? b : a, ''),
|
|
101
|
+
media: MediaQueryList | undefined,
|
|
102
|
+
stop: VoidFunction | undefined,
|
|
103
|
+
view = reactive({ index: 0, reduced: false });
|
|
104
|
+
|
|
105
|
+
function change() {
|
|
106
|
+
view.reduced = media?.matches ?? false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return html`
|
|
110
|
+
<span
|
|
111
|
+
class='typewriter-retype ${() => view.reduced && '--reduced'}'
|
|
112
|
+
${attributes}
|
|
113
|
+
${{
|
|
114
|
+
onconnect: (element: HTMLElement) => {
|
|
115
|
+
let text = element.querySelector<HTMLElement>('.typewriter-retype-text');
|
|
116
|
+
|
|
117
|
+
media = matchMedia(REDUCED);
|
|
118
|
+
media.addEventListener('change', change);
|
|
119
|
+
change();
|
|
120
|
+
|
|
121
|
+
if (!text || words.length === 0) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
stop = effect(() => {
|
|
126
|
+
if (!view.reduced) {
|
|
127
|
+
onCleanup(type(element, text, words));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (words.length < 2) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let interval = setInterval(() => {
|
|
136
|
+
view.index = (view.index + 1) % words.length;
|
|
137
|
+
}, SWAP_EVERY);
|
|
138
|
+
|
|
139
|
+
onCleanup(() => clearInterval(interval));
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
ondisconnect: () => {
|
|
143
|
+
media?.removeEventListener('change', change);
|
|
144
|
+
stop?.();
|
|
145
|
+
}
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<span class='typewriter-retype-sr'>${`${lead}${new Intl.ListFormat('en', { type: 'disjunction' }).format(words)}.`}</span>
|
|
149
|
+
<span aria-hidden='true' class='typewriter-retype-sizer'>${`${lead}${longest}`}</span>
|
|
150
|
+
<span aria-hidden='true' class='typewriter-retype-line'>
|
|
151
|
+
<span class='typewriter-retype-prefix'>${lead}</span>
|
|
152
|
+
<span class='typewriter-retype-swap'>
|
|
153
|
+
${words.map((word, i) => html`
|
|
154
|
+
<span class='typewriter-retype-option ${() => view.index === i && '--active'}'>${word}</span>
|
|
155
|
+
`)}
|
|
156
|
+
</span>
|
|
157
|
+
<span class='typewriter-retype-word'>
|
|
158
|
+
<span class='typewriter-retype-selection'></span>
|
|
159
|
+
<span class='typewriter-retype-text'>${words[0] ?? ''}</span>
|
|
160
|
+
</span>
|
|
161
|
+
</span>
|
|
162
|
+
</span>
|
|
163
|
+
`;
|
|
164
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@use 'variables';
|
|
2
|
+
|
|
3
|
+
.typewriter-retype {
|
|
4
|
+
display: inline-grid;
|
|
5
|
+
text-shadow: var(--glow);
|
|
6
|
+
white-space: pre;
|
|
7
|
+
|
|
8
|
+
// A macOS-length blink with short fades rather than a hard flash; solid while keys move and hidden while a
|
|
9
|
+
// selection is up, as in a real text field.
|
|
10
|
+
&-line::after,
|
|
11
|
+
&-sizer::after {
|
|
12
|
+
background: var(--caret-background);
|
|
13
|
+
border-radius: var(--caret-radius);
|
|
14
|
+
box-shadow: var(--glow);
|
|
15
|
+
color: var(--caret-color);
|
|
16
|
+
content: var(--caret);
|
|
17
|
+
display: inline-block;
|
|
18
|
+
height: var(--caret-height);
|
|
19
|
+
margin-inline-start: var(--caret-offset);
|
|
20
|
+
vertical-align: var(--caret-align);
|
|
21
|
+
width: var(--caret-width);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&-letter {
|
|
25
|
+
animation: typewriter-retype--ink var(--ink-duration) var(--ease-out);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-line {
|
|
29
|
+
grid-area: 1 / 1;
|
|
30
|
+
text-align: left;
|
|
31
|
+
|
|
32
|
+
&::after {
|
|
33
|
+
animation: typewriter-retype--blink var(--caret-duration) var(--caret-timing-function) infinite;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-option {
|
|
38
|
+
grid-area: 1 / 1;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transition: opacity var(--swap-duration) ease-in-out;
|
|
41
|
+
|
|
42
|
+
&.--active {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// The ink stays and a tinted block sits behind it, slightly taller than the glyphs like the line box a browser
|
|
48
|
+
// paints. It sweeps in from the word's end but vanishes the instant a key replaces it.
|
|
49
|
+
&-selection {
|
|
50
|
+
background: var(--selection-color);
|
|
51
|
+
border-radius: var(--selection-radius);
|
|
52
|
+
inset: -0.06em -1px;
|
|
53
|
+
position: absolute;
|
|
54
|
+
scale: 0 1;
|
|
55
|
+
transform-origin: right;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&-sizer {
|
|
59
|
+
grid-area: 1 / 1;
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-sr {
|
|
64
|
+
clip-path: inset(50%);
|
|
65
|
+
height: 1px;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
position: absolute;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
width: 1px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-swap {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&-text {
|
|
77
|
+
position: relative;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-word {
|
|
81
|
+
display: inline-block;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.--reduced {
|
|
86
|
+
.typewriter-retype-line::after,
|
|
87
|
+
.typewriter-retype-word {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.typewriter-retype-swap {
|
|
92
|
+
display: inline-grid;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.--selecting {
|
|
97
|
+
.typewriter-retype-line::after {
|
|
98
|
+
visibility: hidden;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.typewriter-retype-selection {
|
|
102
|
+
scale: 1 1;
|
|
103
|
+
transition: scale var(--select-duration) var(--ease-out);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.--typing .typewriter-retype-line::after {
|
|
108
|
+
animation: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (prefers-reduced-motion: reduce) {
|
|
112
|
+
&-letter,
|
|
113
|
+
&-line::after {
|
|
114
|
+
animation: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.--selecting .typewriter-retype-selection {
|
|
118
|
+
transition: none;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes typewriter-retype--blink {
|
|
124
|
+
0%, 45% {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
55%, 95% {
|
|
129
|
+
opacity: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
100% {
|
|
133
|
+
opacity: 1;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes typewriter-retype--ink {
|
|
138
|
+
from {
|
|
139
|
+
filter: blur(2px);
|
|
140
|
+
opacity: 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.typewriter-retype {
|
|
2
|
+
--caret: '';
|
|
3
|
+
--caret-align: -0.18em;
|
|
4
|
+
--caret-background: var(--caret-color);
|
|
5
|
+
--caret-color: currentColor;
|
|
6
|
+
--caret-duration: 1.06s;
|
|
7
|
+
--caret-height: 1.1em;
|
|
8
|
+
--caret-offset: 2px;
|
|
9
|
+
--caret-radius: 999px;
|
|
10
|
+
--caret-timing-function: linear;
|
|
11
|
+
--caret-width: 2px;
|
|
12
|
+
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
13
|
+
--glow: 0 0 0 transparent;
|
|
14
|
+
--ink-duration: 140ms;
|
|
15
|
+
--select-duration: 220ms;
|
|
16
|
+
--selection-color: oklch(from var(--color-text-500) l c h / 0.15);
|
|
17
|
+
--selection-radius: 3px;
|
|
18
|
+
--swap-duration: 500ms;
|
|
19
|
+
|
|
20
|
+
&--block {
|
|
21
|
+
--caret-align: bottom;
|
|
22
|
+
--caret-height: 1lh;
|
|
23
|
+
--caret-offset: 0.08em;
|
|
24
|
+
--caret-radius: 0;
|
|
25
|
+
--caret-width: 0.56em;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--glow {
|
|
29
|
+
--glow: 0 0 0.4em var(--caret-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--hard {
|
|
33
|
+
--caret-duration: 1s;
|
|
34
|
+
--caret-timing-function: steps(1, end);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--underscore {
|
|
38
|
+
--caret: '_';
|
|
39
|
+
--caret-align: baseline;
|
|
40
|
+
--caret-background: transparent;
|
|
41
|
+
--caret-height: auto;
|
|
42
|
+
--caret-offset: 0.04em;
|
|
43
|
+
--caret-radius: 0;
|
|
44
|
+
--caret-width: auto;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { html, type Attributes } from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
+
import { toast } from '~/components/toast';
|
|
4
|
+
import './scss/index.scss';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
type A = Attributes & {
|
|
8
|
+
[UNDO_TOAST_ROW]?: Attributes;
|
|
9
|
+
duration?: number;
|
|
10
|
+
emptyLabel?: string;
|
|
11
|
+
items: Item[];
|
|
12
|
+
label?: string;
|
|
13
|
+
onconnect?: never;
|
|
14
|
+
ondelete?: (items: Item[]) => void;
|
|
15
|
+
ondocumentkeydown?: never;
|
|
16
|
+
restoreLabel?: string;
|
|
17
|
+
state?: State;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Item = { id: string, meta: string, name: string };
|
|
21
|
+
|
|
22
|
+
type State = { empty: boolean, pending: number };
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const EASE_OUT = 'cubic-bezier(0.23, 1, 0.32, 1)';
|
|
26
|
+
|
|
27
|
+
const UNDO_TOAST_ROW = Symbol.for('@esportsplus/ui/undo-toast.row');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
function editable(target: EventTarget | null) {
|
|
31
|
+
return target instanceof HTMLElement && (target.isContentEditable || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function enter(row: HTMLElement) {
|
|
35
|
+
let reduce = reduced();
|
|
36
|
+
|
|
37
|
+
row.hidden = false;
|
|
38
|
+
row.animate(
|
|
39
|
+
[
|
|
40
|
+
reduce ? { opacity: 0 } : { filter: 'blur(4px)', opacity: 0, scale: 0.98 },
|
|
41
|
+
reduce ? { opacity: 1 } : { filter: 'blur(0px)', opacity: 1, scale: 1 }
|
|
42
|
+
],
|
|
43
|
+
// Waits 50ms for its neighbours to open the gap first.
|
|
44
|
+
{ delay: 50, duration: 250, easing: EASE_OUT, fill: 'backwards' }
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function leave(row: HTMLElement) {
|
|
49
|
+
let { offsetLeft, offsetTop, offsetWidth } = row;
|
|
50
|
+
|
|
51
|
+
// Popped out of flow so survivors slide into its place while it fades.
|
|
52
|
+
row.classList.add('undo-toast-row--leaving');
|
|
53
|
+
row.style.left = `${offsetLeft}px`;
|
|
54
|
+
row.style.top = `${offsetTop}px`;
|
|
55
|
+
row.style.width = `${offsetWidth}px`;
|
|
56
|
+
|
|
57
|
+
row.animate(
|
|
58
|
+
[{}, reduced() ? { opacity: 0 } : { opacity: 0, scale: 0.98 }],
|
|
59
|
+
{ duration: 150, easing: EASE_OUT, fill: 'forwards' }
|
|
60
|
+
).finished.then((animation) => {
|
|
61
|
+
row.classList.remove('undo-toast-row--leaving');
|
|
62
|
+
row.hidden = true;
|
|
63
|
+
row.style.left = '';
|
|
64
|
+
row.style.top = '';
|
|
65
|
+
row.style.width = '';
|
|
66
|
+
animation.cancel();
|
|
67
|
+
}, () => {});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function measure(rows: HTMLElement[]) {
|
|
71
|
+
let rects = new Map<HTMLElement, DOMRect>();
|
|
72
|
+
|
|
73
|
+
for (let row of rows) {
|
|
74
|
+
if (!row.hidden) {
|
|
75
|
+
rects.set(row, row.getBoundingClientRect());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return rects;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function reduced() {
|
|
83
|
+
return matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function shortcut() {
|
|
87
|
+
return /Mac|iPhone|iPad/.test(navigator.platform) ? 'Command Z' : 'Control Z';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export default Object.assign(
|
|
92
|
+
function(this: { attributes?: Partial<A> } | void, { duration = 5000, emptyLabel = 'No files left', items, label = 'Files', ondelete, restoreLabel, state = reactive({ empty: false, pending: 0 }), ...attributes }: A) {
|
|
93
|
+
let gone = new Set<string>(),
|
|
94
|
+
live = reactive({ text: '' }),
|
|
95
|
+
message: HTMLElement | undefined,
|
|
96
|
+
pending: string[] = [],
|
|
97
|
+
root: HTMLElement | undefined,
|
|
98
|
+
rows = new Map<string, HTMLElement>(),
|
|
99
|
+
slides = new WeakMap<HTMLElement, Animation>(),
|
|
100
|
+
toastId: string | undefined;
|
|
101
|
+
|
|
102
|
+
function commit() {
|
|
103
|
+
toastId = undefined;
|
|
104
|
+
message = undefined;
|
|
105
|
+
|
|
106
|
+
if (pending.length === 0) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let committed = items.filter((item) => pending.includes(item.id)),
|
|
111
|
+
target = inside() ? visible()[0] : undefined;
|
|
112
|
+
|
|
113
|
+
for (let id of pending) {
|
|
114
|
+
gone.add(id);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
pending = [];
|
|
118
|
+
state.pending = 0;
|
|
119
|
+
state.empty = visible().length === 0;
|
|
120
|
+
ondelete?.(committed);
|
|
121
|
+
focus(target ? target.id : 'list');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function focus(target: string | undefined) {
|
|
125
|
+
if (!target || !root) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (target === 'list') {
|
|
130
|
+
root.querySelector<HTMLElement>('.undo-toast-list')?.focus();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
rows.get(target)?.querySelector<HTMLElement>('.undo-toast-delete')?.focus();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function inside() {
|
|
138
|
+
return !!root?.contains(document.activeElement);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function notify(text: string) {
|
|
142
|
+
if (!message) {
|
|
143
|
+
message = document.createElement('span');
|
|
144
|
+
message.className = 'undo-toast-message';
|
|
145
|
+
toastId = toast.message(message, {
|
|
146
|
+
action: { label: 'Undo', onclick: undo },
|
|
147
|
+
countdown: true,
|
|
148
|
+
dismissible: false,
|
|
149
|
+
duration,
|
|
150
|
+
ondismiss: commit
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
else if (toastId) {
|
|
154
|
+
// A second delete stacks into this batch and restarts its timer instead of
|
|
155
|
+
// replacing it, which would make the first delete permanent unseen.
|
|
156
|
+
toast.update(toastId, { duration });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
let next = document.createElement('span');
|
|
160
|
+
|
|
161
|
+
next.className = 'undo-toast-message-text';
|
|
162
|
+
next.textContent = text;
|
|
163
|
+
|
|
164
|
+
for (let old of [...message.children] as HTMLElement[]) {
|
|
165
|
+
old.classList.add('undo-toast-message-text--leaving');
|
|
166
|
+
old.animate([{}, { opacity: 0 }], { duration: 120, fill: 'forwards' })
|
|
167
|
+
.finished.then(() => old.remove(), () => old.remove());
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
message.append(next);
|
|
171
|
+
|
|
172
|
+
if (message.children.length > 1) {
|
|
173
|
+
next.animate(
|
|
174
|
+
[
|
|
175
|
+
reduced() ? { opacity: 0 } : { filter: 'blur(4px)', opacity: 0, translate: '0 4px' },
|
|
176
|
+
{ filter: 'blur(0px)', opacity: 1, translate: '0 0' }
|
|
177
|
+
],
|
|
178
|
+
{ duration: 200, easing: EASE_OUT }
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function remove(item: Item) {
|
|
184
|
+
let list = visible(),
|
|
185
|
+
index = list.findIndex((i) => i.id === item.id),
|
|
186
|
+
row = rows.get(item.id);
|
|
187
|
+
|
|
188
|
+
if (!row || index === -1) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let before = measure([...rows.values()].filter((r) => r !== row)),
|
|
193
|
+
neighbour = list[index + 1] ?? list[index - 1],
|
|
194
|
+
refocus = inside();
|
|
195
|
+
|
|
196
|
+
leave(row);
|
|
197
|
+
slide(before);
|
|
198
|
+
pending.push(item.id);
|
|
199
|
+
state.pending = pending.length;
|
|
200
|
+
notify(pending.length === 1 ? `Deleted ‘${item.name}’` : `${pending.length} items deleted`);
|
|
201
|
+
live.text = `Deleted ${item.name}. Press Undo or ${shortcut()} to restore.`;
|
|
202
|
+
|
|
203
|
+
// Hands focus to a neighbour so it isn't dropped on the body.
|
|
204
|
+
if (refocus) {
|
|
205
|
+
focus(neighbour ? neighbour.id : 'list');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function restore(ids: string[]) {
|
|
210
|
+
let before = measure([...rows.values()]);
|
|
211
|
+
|
|
212
|
+
for (let id of ids) {
|
|
213
|
+
let row = rows.get(id);
|
|
214
|
+
|
|
215
|
+
if (row) {
|
|
216
|
+
row.getAnimations().forEach((animation) => animation.cancel());
|
|
217
|
+
row.classList.remove('undo-toast-row--leaving');
|
|
218
|
+
row.style.left = '';
|
|
219
|
+
row.style.top = '';
|
|
220
|
+
row.style.width = '';
|
|
221
|
+
enter(row);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
slide(before);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function slide(before: Map<HTMLElement, DOMRect>) {
|
|
229
|
+
for (let [row, rect] of before) {
|
|
230
|
+
if (row.hidden || row.classList.contains('undo-toast-row--leaving')) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let delta = rect.top - row.getBoundingClientRect().top;
|
|
235
|
+
|
|
236
|
+
slides.get(row)?.cancel();
|
|
237
|
+
|
|
238
|
+
if (delta === 0 || reduced()) {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
slides.set(row, row.animate(
|
|
243
|
+
[{ translate: `0 ${delta}px` }, { translate: '0 0' }],
|
|
244
|
+
{ duration: 250, easing: EASE_OUT }
|
|
245
|
+
));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function undo() {
|
|
250
|
+
if (pending.length === 0) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
let restored = pending,
|
|
255
|
+
refocus = inside();
|
|
256
|
+
|
|
257
|
+
pending = [];
|
|
258
|
+
state.pending = 0;
|
|
259
|
+
restore(restored);
|
|
260
|
+
live.text = restored.length === 1 ? 'Restored' : `Restored ${restored.length} items`;
|
|
261
|
+
|
|
262
|
+
if (refocus) {
|
|
263
|
+
focus(restored[0]);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function visible() {
|
|
268
|
+
return items.filter((item) => !gone.has(item.id) && !pending.includes(item.id));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return html`
|
|
272
|
+
<div
|
|
273
|
+
class='undo-toast'
|
|
274
|
+
${this?.attributes}
|
|
275
|
+
${attributes}
|
|
276
|
+
${{
|
|
277
|
+
onconnect: (element: HTMLElement) => {
|
|
278
|
+
root = element;
|
|
279
|
+
|
|
280
|
+
for (let row of element.querySelectorAll<HTMLElement>('.undo-toast-row')) {
|
|
281
|
+
rows.set(row.dataset.id ?? '', row);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
ondisconnect: () => {
|
|
285
|
+
if (toastId) {
|
|
286
|
+
toast.dismiss(toastId);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
// Ctrl/Cmd+Z undoes while the toast shows, unless a text field wants it.
|
|
290
|
+
ondocumentkeydown: (e: KeyboardEvent) => {
|
|
291
|
+
if (pending.length === 0 || e.key.toLowerCase() !== 'z' || !(e.metaKey || e.ctrlKey)) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (e.shiftKey || e.altKey || editable(e.target) || root?.closest('[inert]')) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
e.preventDefault();
|
|
300
|
+
undo();
|
|
301
|
+
|
|
302
|
+
if (toastId) {
|
|
303
|
+
toast.dismiss(toastId);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}}
|
|
307
|
+
>
|
|
308
|
+
<ul aria-label='${label}' class='undo-toast-list' tabindex='-1'>
|
|
309
|
+
${items.map((item) => html`
|
|
310
|
+
<li
|
|
311
|
+
class='undo-toast-row'
|
|
312
|
+
data-id='${item.id}'
|
|
313
|
+
${this?.attributes?.[UNDO_TOAST_ROW]}
|
|
314
|
+
${attributes[UNDO_TOAST_ROW]}
|
|
315
|
+
>
|
|
316
|
+
<div class='undo-toast-row-text'>
|
|
317
|
+
<span class='undo-toast-row-name'>${item.name}</span>
|
|
318
|
+
<span class='undo-toast-row-meta'>${item.meta}</span>
|
|
319
|
+
</div>
|
|
320
|
+
<button
|
|
321
|
+
aria-label='Delete ${item.name}'
|
|
322
|
+
class='button undo-toast-delete'
|
|
323
|
+
type='button'
|
|
324
|
+
onclick=${() => remove(item)}
|
|
325
|
+
>
|
|
326
|
+
<svg aria-hidden='true' viewBox='0 0 16 16'>
|
|
327
|
+
<path d='M2.75 4.25h10.5M6.25 4.25v-1.5h3.5v1.5M4 4.25l.6 8.1a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.1M6.75 7v3.75M9.25 7v3.75' />
|
|
328
|
+
</svg>
|
|
329
|
+
</button>
|
|
330
|
+
</li>
|
|
331
|
+
`)}
|
|
332
|
+
</ul>
|
|
333
|
+
|
|
334
|
+
<div class='undo-toast-empty ${() => state.empty && '--active'}' ${{ inert: () => !state.empty }}>
|
|
335
|
+
<span class='undo-toast-empty-label'>${emptyLabel}</span>
|
|
336
|
+
${restoreLabel && html`
|
|
337
|
+
<button
|
|
338
|
+
class='button undo-toast-restore'
|
|
339
|
+
type='button'
|
|
340
|
+
onclick=${() => {
|
|
341
|
+
let ids = [...gone];
|
|
342
|
+
|
|
343
|
+
gone.clear();
|
|
344
|
+
state.empty = false;
|
|
345
|
+
restore(ids);
|
|
346
|
+
focus(ids[0]);
|
|
347
|
+
}}
|
|
348
|
+
>
|
|
349
|
+
${restoreLabel}
|
|
350
|
+
</button>
|
|
351
|
+
`}
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<span aria-live='polite' class='undo-toast-live'>${() => live.text}</span>
|
|
355
|
+
</div>
|
|
356
|
+
`;
|
|
357
|
+
},
|
|
358
|
+
{ row: UNDO_TOAST_ROW } as const
|
|
359
|
+
);
|