@0001-labs/design-system-1 0.3.0-alpha.13 → 0.3.0-alpha.14
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/DS1/0-face/calendar.ts +194 -0
- package/DS1/0-face/carousel.ts +623 -0
- package/DS1/0-face/component-visibility.ts +13 -0
- package/DS1/0-face/copy-text.ts +96 -0
- package/DS1/0-face/device.ts +8 -58
- package/DS1/0-face/dialog-swipe.ts +249 -0
- package/DS1/0-face/dialogs.ts +208 -0
- package/DS1/0-face/drawer.ts +258 -0
- package/DS1/0-face/feedback-words.ts +36 -0
- package/DS1/0-face/feedback.ts +40 -0
- package/DS1/0-face/format.ts +700 -0
- package/DS1/0-face/generated/toast-assets.ts +18 -0
- package/DS1/0-face/grid-fit.ts +1 -1
- package/DS1/0-face/grid.ts +3 -2
- package/DS1/0-face/header.ts +78 -0
- package/DS1/0-face/i18n.ts +93 -18
- package/DS1/0-face/keys.ts +276 -0
- package/DS1/0-face/languages.ts +4 -4
- package/DS1/0-face/layout-inspector.ts +6 -6
- package/DS1/0-face/library-styles.ts +33 -0
- package/DS1/0-face/load-toaster.ts +7 -0
- package/DS1/0-face/preference-options.ts +29 -0
- package/DS1/0-face/preferences.ts +3 -11
- package/DS1/0-face/pricing.ts +98 -43
- package/DS1/0-face/scaling.ts +160 -4
- package/DS1/0-face/shared-words.ts +9 -4
- package/DS1/0-face/sidebar.ts +201 -0
- package/DS1/0-face/theme-bootstrap.js +184 -0
- package/DS1/0-face/theme.ts +89 -47
- package/DS1/0-face/toast-queue.ts +157 -0
- package/DS1/0-face/toaster.ts +384 -0
- package/DS1/0-face/tooltips.ts +157 -15
- package/DS1/0-face/translations/da.json +60 -1
- package/DS1/0-face/translations/de.json +60 -1
- package/DS1/0-face/translations/en.json +60 -1
- package/DS1/0-face/translations/es.json +60 -1
- package/DS1/0-face/translations/fi.json +60 -1
- package/DS1/0-face/translations/fr.json +60 -1
- package/DS1/0-face/translations/is.json +60 -1
- package/DS1/0-face/translations/it.json +60 -1
- package/DS1/0-face/translations/ja.json +60 -1
- package/DS1/0-face/translations/ko.json +60 -1
- package/DS1/0-face/translations/nb.json +60 -1
- package/DS1/0-face/translations/pt-BR.json +60 -1
- package/DS1/0-face/translations/pt.json +60 -1
- package/DS1/0-face/translations/sv.json +60 -1
- package/DS1/0-face/translations/zh.json +60 -1
- package/DS1/0-face/translations-format.ts +3 -4
- package/DS1/1-root/card.css +192 -0
- package/DS1/1-root/carousel.css +136 -0
- package/DS1/1-root/cjk.css +23 -0
- package/DS1/1-root/component-metrics.css +1 -0
- package/DS1/1-root/component-tokens.css +51 -8
- package/DS1/1-root/controls.css +887 -14
- package/DS1/1-root/dialog-placement.css +191 -0
- package/DS1/1-root/document.css +183 -0
- package/DS1/1-root/drawer.css +83 -0
- package/DS1/1-root/empty.css +83 -0
- package/DS1/1-root/figures.css +141 -0
- package/DS1/1-root/fonts/Iosevka-LICENSE.md +3 -1
- package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
- package/DS1/1-root/fonts.css +69 -0
- package/DS1/1-root/footer.css +186 -0
- package/DS1/1-root/header.css +165 -0
- package/DS1/1-root/kbd.css +46 -0
- package/DS1/1-root/library-tokens.ts +91 -0
- package/DS1/1-root/measures.ts +53 -0
- package/DS1/1-root/notice.css +165 -0
- package/DS1/1-root/one.css +14 -84
- package/DS1/1-root/one.semantic.css +200 -148
- package/DS1/1-root/palette.css +58 -0
- package/DS1/1-root/palette.ts +19 -0
- package/DS1/1-root/progress.css +356 -0
- package/DS1/1-root/prose.css +202 -0
- package/DS1/1-root/row.css +297 -0
- package/DS1/1-root/table.css +111 -0
- package/DS1/1-root/text.css +70 -0
- package/DS1/2-core/button-split.ts +55 -0
- package/DS1/2-core/chart/chart.css +169 -0
- package/DS1/2-core/chart/grid-chart.ts +554 -0
- package/DS1/2-core/ds-avatar.ts +25 -6
- package/DS1/2-core/ds-badge.ts +10 -10
- package/DS1/2-core/ds-button.ts +111 -26
- package/DS1/2-core/ds-card.ts +135 -105
- package/DS1/2-core/ds-chart.ts +327 -0
- package/DS1/2-core/ds-composer.ts +8 -2
- package/DS1/2-core/ds-cycle.ts +97 -21
- package/DS1/2-core/ds-empty.ts +120 -0
- package/DS1/2-core/ds-icon.ts +11 -2
- package/DS1/2-core/ds-input.ts +165 -6
- package/DS1/2-core/ds-kbd.ts +78 -0
- package/DS1/2-core/ds-loading.ts +72 -0
- package/DS1/2-core/ds-notice.ts +180 -0
- package/DS1/2-core/ds-progress.ts +380 -0
- package/DS1/2-core/ds-spacing-handle.ts +22 -0
- package/DS1/2-core/ds-stat.ts +174 -0
- package/DS1/2-core/ds-switch.ts +1 -0
- package/DS1/2-core/ds-text.ts +15 -2
- package/DS1/2-core/ds-toast.ts +354 -0
- package/DS1/2-core/figures.ts +105 -0
- package/DS1/2-core/generated/ds-icon-map.ts +234 -128
- package/DS1/2-core/generated/icon-avatar.ts +2 -0
- package/DS1/2-core/generated/icons-extra.ts +118 -65
- package/DS1/2-core/generated/icons-immediate.ts +1 -1
- package/DS1/2-core/spacing-handle.ts +95 -0
- package/DS1/2-core/styles/ds-avatar.css +9 -8
- package/DS1/2-core/styles/ds-button-host.css +26 -3
- package/DS1/2-core/styles/ds-button-split.css +67 -0
- package/DS1/2-core/styles/ds-button.css +49 -15
- package/DS1/2-core/styles/ds-card.css +34 -0
- package/DS1/2-core/styles/ds-composer.css +13 -0
- package/DS1/2-core/styles/ds-cycle.css +69 -0
- package/DS1/2-core/styles/ds-empty.css +18 -0
- package/DS1/2-core/styles/ds-gap.css +1 -0
- package/DS1/2-core/styles/ds-icon.css +1 -0
- package/DS1/2-core/styles/ds-input.css +59 -6
- package/DS1/2-core/styles/ds-kbd.css +12 -0
- package/DS1/2-core/styles/ds-loading.css +13 -0
- package/DS1/2-core/styles/ds-notice.css +30 -0
- package/DS1/2-core/styles/ds-progress.css +25 -0
- package/DS1/2-core/styles/ds-select.css +2 -2
- package/DS1/2-core/styles/ds-spacing-handle.css +8 -0
- package/DS1/2-core/styles/ds-split.css +2 -62
- package/DS1/2-core/styles/ds-stat.css +34 -0
- package/DS1/2-core/styles/ds-switch.css +16 -1
- package/DS1/2-core/styles/ds-text.css +43 -12
- package/DS1/2-core/styles/ds-toast.css +182 -0
- package/DS1/2-core/styles/ds-tooltip.css +1 -0
- package/DS1/3-unit/calendar-base.ts +263 -0
- package/DS1/3-unit/ds-accordion.ts +9 -1
- package/DS1/3-unit/ds-avatar-group.ts +1 -0
- package/DS1/3-unit/ds-calendar-large.ts +349 -0
- package/DS1/3-unit/ds-calendar.ts +344 -0
- package/DS1/3-unit/ds-carousel.ts +368 -0
- package/DS1/3-unit/ds-date-picker.ts +540 -0
- package/DS1/3-unit/ds-form.ts +45 -37
- package/DS1/3-unit/ds-list.ts +48 -1
- package/DS1/3-unit/ds-matrix.ts +318 -0
- package/DS1/3-unit/ds-menu.ts +8 -4
- package/DS1/3-unit/ds-row.ts +84 -1
- package/DS1/3-unit/ds-sidebar.ts +280 -0
- package/DS1/3-unit/ds-table.ts +75 -34
- package/DS1/3-unit/styles/ds-accordion.css +1 -0
- package/DS1/3-unit/styles/ds-avatar-group.css +2 -4
- package/DS1/3-unit/styles/ds-calendar-large.css +165 -0
- package/DS1/3-unit/styles/ds-calendar.css +238 -0
- package/DS1/3-unit/styles/ds-carousel.css +30 -0
- package/DS1/3-unit/styles/ds-date-picker.css +124 -0
- package/DS1/3-unit/styles/ds-list.css +1 -0
- package/DS1/3-unit/styles/ds-matrix.css +203 -0
- package/DS1/3-unit/styles/ds-menu.css +31 -6
- package/DS1/3-unit/styles/ds-row.css +84 -2
- package/DS1/3-unit/styles/ds-sidebar.css +117 -0
- package/DS1/3-unit/styles/ds-table.css +3 -74
- package/DS1/4-page/ds-dialog.ts +40 -4
- package/DS1/4-page/ds-document.ts +240 -0
- package/DS1/4-page/ds-footer.ts +165 -0
- package/DS1/4-page/ds-grid.ts +39 -59
- package/DS1/4-page/ds-header.ts +171 -0
- package/DS1/4-page/ds-page.ts +184 -0
- package/DS1/4-page/email.ts +2 -3
- package/DS1/4-page/styles/ds-container.css +1 -0
- package/DS1/4-page/styles/ds-document.css +18 -0
- package/DS1/4-page/styles/ds-footer.css +29 -0
- package/DS1/4-page/styles/ds-grid.css +31 -85
- package/DS1/4-page/styles/ds-header.css +57 -0
- package/DS1/4-page/styles/ds-page.css +214 -0
- package/DS1/components.ts +7 -1
- package/DS1/index.ts +26 -6
- package/DS1/react/avatar.ts +4 -5
- package/DS1/react/button-split.ts +29 -0
- package/DS1/react/button.ts +32 -13
- package/DS1/react/carousel.ts +76 -0
- package/DS1/react/dialog.ts +36 -5
- package/DS1/react/document.ts +14 -0
- package/DS1/react/empty.ts +32 -0
- package/DS1/react/footer.ts +17 -0
- package/DS1/react/header.ts +15 -0
- package/DS1/react/input.ts +28 -17
- package/DS1/react/kbd.ts +21 -0
- package/DS1/react/loading.ts +18 -0
- package/DS1/react/notice.ts +59 -0
- package/DS1/react/page.ts +13 -0
- package/DS1/react/progress.ts +99 -0
- package/DS1/react/sidebar.ts +60 -0
- package/DS1/react/spacing-handle.ts +21 -0
- package/DS1/react/stat.ts +73 -0
- package/DS1/react/toast.ts +82 -0
- package/DS1/x-icon/Tabler-LICENSE.md +27 -0
- package/DS1/x-icon/airtable.svg +5 -0
- package/DS1/x-icon/attach.svg +3 -0
- package/DS1/x-icon/audio.svg +3 -0
- package/DS1/x-icon/bag-alt.svg +3 -0
- package/DS1/x-icon/bank.svg +3 -0
- package/DS1/x-icon/banknote.svg +3 -0
- package/DS1/x-icon/bolt.svg +3 -0
- package/DS1/x-icon/book-alt.svg +3 -0
- package/DS1/x-icon/book.svg +4 -0
- package/DS1/x-icon/box.svg +3 -0
- package/DS1/x-icon/briefcase.svg +3 -0
- package/DS1/x-icon/building.svg +4 -0
- package/DS1/x-icon/car.svg +3 -0
- package/DS1/x-icon/card.svg +3 -0
- package/DS1/x-icon/cart.svg +3 -0
- package/DS1/x-icon/{ezo-item-button-start.svg → chevron-left.svg} +1 -1
- package/DS1/x-icon/{ezo-android-screen-stats.svg → chevron-right.svg} +1 -1
- package/DS1/x-icon/cloud.svg +3 -0
- package/DS1/x-icon/coffee.svg +3 -0
- package/DS1/x-icon/coins.svg +3 -0
- package/DS1/x-icon/cursor.svg +3 -0
- package/DS1/x-icon/curve.svg +7 -0
- package/DS1/x-icon/dislike.svg +4 -0
- package/DS1/x-icon/dot-bank.svg +3 -0
- package/DS1/x-icon/dot-banknote.svg +3 -0
- package/DS1/x-icon/dot-banknotes.svg +3 -0
- package/DS1/x-icon/dot-card.svg +3 -0
- package/DS1/x-icon/dot-coin.svg +3 -0
- package/DS1/x-icon/dot-coins.svg +3 -0
- package/DS1/x-icon/dot-receipt.svg +3 -0
- package/DS1/x-icon/dot-safe.svg +3 -0
- package/DS1/x-icon/dot-transfer.svg +3 -0
- package/DS1/x-icon/dot-wallet.svg +3 -0
- package/DS1/x-icon/download.svg +4 -0
- package/DS1/x-icon/drive.svg +5 -0
- package/DS1/x-icon/drop.svg +3 -0
- package/DS1/x-icon/dropbox.svg +3 -0
- package/DS1/x-icon/dumbbell.svg +3 -0
- package/DS1/x-icon/eye-off.svg +3 -0
- package/DS1/x-icon/eye.svg +3 -0
- package/DS1/x-icon/facebook.svg +3 -0
- package/DS1/x-icon/figma.svg +5 -0
- package/DS1/x-icon/flame.svg +3 -0
- package/DS1/x-icon/flip.svg +5 -0
- package/DS1/x-icon/food.svg +3 -0
- package/DS1/x-icon/fuel.svg +3 -0
- package/DS1/x-icon/game.svg +3 -0
- package/DS1/x-icon/gift.svg +3 -0
- package/DS1/x-icon/github.svg +3 -0
- package/DS1/x-icon/heart.svg +3 -0
- package/DS1/x-icon/history.svg +3 -0
- package/DS1/x-icon/home-alt.svg +3 -0
- package/DS1/x-icon/income.svg +3 -0
- package/DS1/x-icon/info.svg +5 -0
- package/DS1/x-icon/instagram.svg +5 -0
- package/DS1/x-icon/jpbank.svg +3 -0
- package/DS1/x-icon/key.svg +4 -0
- package/DS1/x-icon/keyboard.svg +3 -0
- package/DS1/x-icon/like.svg +4 -0
- package/DS1/x-icon/linkedin.svg +7 -0
- package/DS1/x-icon/loom.svg +6 -0
- package/DS1/x-icon/map.svg +4 -0
- package/DS1/x-icon/medical.svg +3 -0
- package/DS1/x-icon/{ezo-android-screen-lists.svg → minus.svg} +1 -1
- package/DS1/x-icon/moon.svg +3 -0
- package/DS1/x-icon/move.svg +3 -0
- package/DS1/x-icon/music-alt.svg +3 -0
- package/DS1/x-icon/music.svg +5 -0
- package/DS1/x-icon/notion.svg +6 -0
- package/DS1/x-icon/offline.svg +3 -0
- package/DS1/x-icon/pause.svg +4 -0
- package/DS1/x-icon/paw.svg +3 -0
- package/DS1/x-icon/pdf.svg +3 -0
- package/DS1/x-icon/people.svg +5 -0
- package/DS1/x-icon/percent.svg +3 -0
- package/DS1/x-icon/phone.svg +3 -0
- package/DS1/x-icon/pill.svg +3 -0
- package/DS1/x-icon/plane.svg +3 -0
- package/DS1/x-icon/postal.svg +3 -0
- package/DS1/x-icon/present.svg +4 -0
- package/DS1/x-icon/reaction.svg +5 -0
- package/DS1/x-icon/receipt.svg +3 -0
- package/DS1/x-icon/refresh.svg +3 -0
- package/DS1/x-icon/refund.svg +3 -0
- package/DS1/x-icon/repeat.svg +3 -0
- package/DS1/x-icon/rotate.svg +4 -0
- package/DS1/x-icon/safe.svg +3 -0
- package/DS1/x-icon/school-alt.svg +3 -0
- package/DS1/x-icon/shield-alt.svg +3 -0
- package/DS1/x-icon/shield.svg +4 -0
- package/DS1/x-icon/shirt.svg +3 -0
- package/DS1/x-icon/shop.svg +3 -0
- package/DS1/x-icon/sign-in.svg +3 -0
- package/DS1/x-icon/sign-out.svg +3 -0
- package/DS1/x-icon/slack.svg +6 -0
- package/DS1/x-icon/sparkle.svg +3 -0
- package/DS1/x-icon/start.svg +4 -0
- package/DS1/x-icon/{ezo-item-button-reopen.svg → stop.svg} +1 -1
- package/DS1/x-icon/sun.svg +3 -0
- package/DS1/x-icon/system.svg +4 -0
- package/DS1/x-icon/tag.svg +3 -0
- package/DS1/x-icon/ticket.svg +3 -0
- package/DS1/x-icon/title-struck.svg +4 -0
- package/DS1/x-icon/train.svg +3 -0
- package/DS1/x-icon/transfer.svg +3 -0
- package/DS1/x-icon/tv.svg +3 -0
- package/DS1/x-icon/upload.svg +4 -0
- package/DS1/x-icon/video.svg +4 -0
- package/DS1/x-icon/vimeo.svg +3 -0
- package/DS1/x-icon/wallet.svg +3 -0
- package/DS1/x-icon/wifi.svg +3 -0
- package/DS1/x-icon/window.svg +4 -0
- package/DS1/x-icon/wrench.svg +3 -0
- package/DS1/x-icon/x-brand.svg +4 -0
- package/DS1/x-icon/youtube.svg +4 -0
- package/README.md +3 -3
- package/dist/0-face/calendar.d.ts +75 -0
- package/dist/0-face/calendar.d.ts.map +1 -0
- package/dist/0-face/calendar.js +149 -0
- package/dist/0-face/carousel.d.ts +174 -0
- package/dist/0-face/carousel.d.ts.map +1 -0
- package/dist/0-face/carousel.js +583 -0
- package/dist/0-face/component-visibility.d.ts +7 -0
- package/dist/0-face/component-visibility.d.ts.map +1 -0
- package/dist/0-face/component-visibility.js +10 -0
- package/dist/0-face/copy-text.d.ts +11 -0
- package/dist/0-face/copy-text.d.ts.map +1 -0
- package/dist/0-face/copy-text.js +97 -0
- package/dist/0-face/device.d.ts +3 -7
- package/dist/0-face/device.d.ts.map +1 -1
- package/dist/0-face/device.js +7 -41
- package/dist/0-face/dialog-swipe.d.ts +49 -0
- package/dist/0-face/dialog-swipe.d.ts.map +1 -0
- package/dist/0-face/dialog-swipe.js +239 -0
- package/dist/0-face/dialogs.d.ts +33 -0
- package/dist/0-face/dialogs.d.ts.map +1 -0
- package/dist/0-face/dialogs.js +173 -0
- package/dist/0-face/drawer.d.ts +64 -0
- package/dist/0-face/drawer.d.ts.map +1 -0
- package/dist/0-face/drawer.js +256 -0
- package/dist/0-face/feedback-words.d.ts +21 -0
- package/dist/0-face/feedback-words.d.ts.map +1 -0
- package/dist/0-face/feedback-words.js +30 -0
- package/dist/0-face/feedback.d.ts +41 -0
- package/dist/0-face/feedback.d.ts.map +1 -0
- package/dist/0-face/feedback.js +35 -0
- package/dist/0-face/format.d.ts +166 -0
- package/dist/0-face/format.d.ts.map +1 -0
- package/dist/0-face/format.js +445 -0
- package/dist/0-face/generated/toast-assets.d.ts +11 -0
- package/dist/0-face/generated/toast-assets.d.ts.map +1 -0
- package/dist/0-face/generated/toast-assets.js +14 -0
- package/dist/0-face/grid-fit.js +1 -1
- package/dist/0-face/grid.d.ts.map +1 -1
- package/dist/0-face/grid.js +2 -1
- package/dist/0-face/header.d.ts +38 -0
- package/dist/0-face/header.d.ts.map +1 -0
- package/dist/0-face/header.js +80 -0
- package/dist/0-face/i18n.d.ts +32 -2
- package/dist/0-face/i18n.d.ts.map +1 -1
- package/dist/0-face/i18n.js +65 -19
- package/dist/0-face/keys.d.ts +104 -0
- package/dist/0-face/keys.d.ts.map +1 -0
- package/dist/0-face/keys.js +253 -0
- package/dist/0-face/languages.d.ts +2 -2
- package/dist/0-face/languages.js +3 -3
- package/dist/0-face/layout-inspector.js +6 -6
- package/dist/0-face/library-styles.d.ts +7 -0
- package/dist/0-face/library-styles.d.ts.map +1 -0
- package/dist/0-face/library-styles.js +29 -0
- package/dist/0-face/load-toaster.d.ts +8 -0
- package/dist/0-face/load-toaster.d.ts.map +1 -0
- package/dist/0-face/load-toaster.js +7 -0
- package/dist/0-face/preference-options.d.ts +34 -0
- package/dist/0-face/preference-options.d.ts.map +1 -0
- package/dist/0-face/preference-options.js +1 -0
- package/dist/0-face/preferences.d.ts +3 -12
- package/dist/0-face/preferences.d.ts.map +1 -1
- package/dist/0-face/pricing.d.ts +19 -9
- package/dist/0-face/pricing.d.ts.map +1 -1
- package/dist/0-face/pricing.js +81 -40
- package/dist/0-face/scaling.d.ts +71 -1
- package/dist/0-face/scaling.d.ts.map +1 -1
- package/dist/0-face/scaling.js +108 -3
- package/dist/0-face/shared-words.d.ts +9 -4
- package/dist/0-face/shared-words.d.ts.map +1 -1
- package/dist/0-face/sidebar.d.ts +69 -0
- package/dist/0-face/sidebar.d.ts.map +1 -0
- package/dist/0-face/sidebar.js +191 -0
- package/dist/0-face/theme-bootstrap.d.ts +1 -0
- package/dist/0-face/theme-bootstrap.d.ts.map +1 -0
- package/dist/0-face/theme-bootstrap.js +214 -0
- package/dist/0-face/theme.d.ts +32 -0
- package/dist/0-face/theme.d.ts.map +1 -1
- package/dist/0-face/theme.js +69 -43
- package/dist/0-face/toast-queue.d.ts +110 -0
- package/dist/0-face/toast-queue.d.ts.map +1 -0
- package/dist/0-face/toast-queue.js +98 -0
- package/dist/0-face/toaster.d.ts +27 -0
- package/dist/0-face/toaster.d.ts.map +1 -0
- package/dist/0-face/toaster.js +373 -0
- package/dist/0-face/tooltips.d.ts +24 -1
- package/dist/0-face/tooltips.d.ts.map +1 -1
- package/dist/0-face/tooltips.js +155 -16
- package/dist/0-face/translations/da.json +60 -1
- package/dist/0-face/translations/de.json +60 -1
- package/dist/0-face/translations/en.json +60 -1
- package/dist/0-face/translations/es.json +60 -1
- package/dist/0-face/translations/fi.json +60 -1
- package/dist/0-face/translations/fr.json +60 -1
- package/dist/0-face/translations/is.json +60 -1
- package/dist/0-face/translations/it.json +60 -1
- package/dist/0-face/translations/ja.json +60 -1
- package/dist/0-face/translations/ko.json +60 -1
- package/dist/0-face/translations/nb.json +60 -1
- package/dist/0-face/translations/pt-BR.json +60 -1
- package/dist/0-face/translations/pt.json +60 -1
- package/dist/0-face/translations/sv.json +60 -1
- package/dist/0-face/translations/zh.json +60 -1
- package/dist/0-face/translations-format.d.ts.map +1 -1
- package/dist/0-face/translations-format.js +3 -4
- package/dist/0-face/tree.d.ts +69 -0
- package/dist/0-face/tree.d.ts.map +1 -0
- package/dist/0-face/tree.js +191 -0
- package/dist/1-root/library-tokens.d.ts +31 -0
- package/dist/1-root/library-tokens.d.ts.map +1 -0
- package/dist/1-root/library-tokens.js +84 -0
- package/dist/1-root/measures.d.ts +52 -0
- package/dist/1-root/measures.d.ts.map +1 -0
- package/dist/1-root/measures.js +49 -0
- package/dist/1-root/palette.d.ts +5 -0
- package/dist/1-root/palette.d.ts.map +1 -1
- package/dist/1-root/palette.js +18 -0
- package/dist/2-core/button-split.d.ts +21 -0
- package/dist/2-core/button-split.d.ts.map +1 -0
- package/dist/2-core/button-split.js +48 -0
- package/dist/2-core/chart/grid-chart.d.ts +113 -0
- package/dist/2-core/chart/grid-chart.d.ts.map +1 -0
- package/dist/2-core/chart/grid-chart.js +466 -0
- package/dist/2-core/ds-avatar.d.ts +20 -3
- package/dist/2-core/ds-avatar.d.ts.map +1 -1
- package/dist/2-core/ds-avatar.js +19 -5
- package/dist/2-core/ds-badge.js +10 -13
- package/dist/2-core/ds-banner.d.ts +23 -7
- package/dist/2-core/ds-banner.d.ts.map +1 -1
- package/dist/2-core/ds-banner.js +48 -12
- package/dist/2-core/ds-button.d.ts +76 -0
- package/dist/2-core/ds-button.d.ts.map +1 -1
- package/dist/2-core/ds-button.js +101 -26
- package/dist/2-core/ds-card.d.ts +76 -11
- package/dist/2-core/ds-card.d.ts.map +1 -1
- package/dist/2-core/ds-card.js +129 -105
- package/dist/2-core/ds-chart.d.ts +105 -0
- package/dist/2-core/ds-chart.d.ts.map +1 -0
- package/dist/2-core/ds-chart.js +390 -0
- package/dist/2-core/ds-composer.d.ts +7 -0
- package/dist/2-core/ds-composer.d.ts.map +1 -1
- package/dist/2-core/ds-composer.js +1 -1
- package/dist/2-core/ds-cycle.d.ts +36 -2
- package/dist/2-core/ds-cycle.d.ts.map +1 -1
- package/dist/2-core/ds-cycle.js +95 -18
- package/dist/2-core/ds-empty.d.ts +74 -0
- package/dist/2-core/ds-empty.d.ts.map +1 -0
- package/dist/2-core/ds-empty.js +96 -0
- package/dist/2-core/ds-icon.d.ts +6 -0
- package/dist/2-core/ds-icon.d.ts.map +1 -1
- package/dist/2-core/ds-icon.js +12 -2
- package/dist/2-core/ds-input.d.ts +39 -1
- package/dist/2-core/ds-input.d.ts.map +1 -1
- package/dist/2-core/ds-input.js +150 -6
- package/dist/2-core/ds-kbd.d.ts +48 -0
- package/dist/2-core/ds-kbd.d.ts.map +1 -0
- package/dist/2-core/ds-kbd.js +65 -0
- package/dist/2-core/ds-language.d.ts +8 -1
- package/dist/2-core/ds-language.d.ts.map +1 -1
- package/dist/2-core/ds-language.js +2 -2
- package/dist/2-core/ds-loading.d.ts +40 -0
- package/dist/2-core/ds-loading.d.ts.map +1 -0
- package/dist/2-core/ds-loading.js +63 -0
- package/dist/2-core/ds-meter.d.ts +103 -0
- package/dist/2-core/ds-meter.d.ts.map +1 -0
- package/dist/2-core/ds-meter.js +124 -0
- package/dist/2-core/ds-notice.d.ts +103 -0
- package/dist/2-core/ds-notice.d.ts.map +1 -0
- package/dist/2-core/ds-notice.js +152 -0
- package/dist/2-core/ds-pagedots.d.ts +64 -7
- package/dist/2-core/ds-pagedots.d.ts.map +1 -1
- package/dist/2-core/ds-pagedots.js +124 -18
- package/dist/2-core/ds-progress.d.ts +200 -0
- package/dist/2-core/ds-progress.d.ts.map +1 -0
- package/dist/2-core/ds-progress.js +319 -0
- package/dist/2-core/ds-spacing-handle.d.ts +25 -0
- package/dist/2-core/ds-spacing-handle.d.ts.map +1 -0
- package/dist/2-core/ds-spacing-handle.js +25 -0
- package/dist/2-core/ds-split.d.ts +4 -67
- package/dist/2-core/ds-split.d.ts.map +1 -1
- package/dist/2-core/ds-split.js +4 -98
- package/dist/2-core/ds-stat.d.ts +126 -0
- package/dist/2-core/ds-stat.d.ts.map +1 -0
- package/dist/2-core/ds-stat.js +137 -0
- package/dist/2-core/ds-steps.d.ts +72 -0
- package/dist/2-core/ds-steps.d.ts.map +1 -0
- package/dist/2-core/ds-steps.js +114 -0
- package/dist/2-core/ds-switch.d.ts +1 -0
- package/dist/2-core/ds-switch.d.ts.map +1 -1
- package/dist/2-core/ds-switch.js +1 -0
- package/dist/2-core/ds-text.d.ts +15 -2
- package/dist/2-core/ds-text.d.ts.map +1 -1
- package/dist/2-core/ds-text.js +13 -0
- package/dist/2-core/ds-textarea.d.ts.map +1 -1
- package/dist/2-core/ds-textarea.js +1 -0
- package/dist/2-core/ds-toast.d.ts +139 -0
- package/dist/2-core/ds-toast.d.ts.map +1 -0
- package/dist/2-core/ds-toast.js +329 -0
- package/dist/2-core/ds-toggle.d.ts +11 -0
- package/dist/2-core/ds-toggle.d.ts.map +1 -0
- package/dist/2-core/ds-toggle.js +10 -0
- package/dist/2-core/figures.d.ts +56 -0
- package/dist/2-core/figures.d.ts.map +1 -0
- package/dist/2-core/figures.js +70 -0
- package/dist/2-core/generated/ds-icon-map.d.ts +118 -65
- package/dist/2-core/generated/ds-icon-map.d.ts.map +1 -1
- package/dist/2-core/generated/ds-icon-map.js +234 -128
- package/dist/2-core/generated/icon-avatar.d.ts +2 -0
- package/dist/2-core/generated/icon-avatar.d.ts.map +1 -0
- package/dist/2-core/generated/icon-avatar.js +2 -0
- package/dist/2-core/generated/icons-extra.d.ts.map +1 -1
- package/dist/2-core/generated/icons-extra.js +118 -65
- package/dist/2-core/generated/icons-immediate.d.ts +1 -1
- package/dist/2-core/generated/icons-immediate.d.ts.map +1 -1
- package/dist/2-core/generated/icons-immediate.js +1 -1
- package/dist/2-core/spacing-handle.d.ts +28 -0
- package/dist/2-core/spacing-handle.d.ts.map +1 -0
- package/dist/2-core/spacing-handle.js +146 -0
- package/dist/3-unit/calendar-base.d.ts +149 -0
- package/dist/3-unit/calendar-base.d.ts.map +1 -0
- package/dist/3-unit/calendar-base.js +172 -0
- package/dist/3-unit/ds-accordion.d.ts +9 -0
- package/dist/3-unit/ds-accordion.d.ts.map +1 -1
- package/dist/3-unit/ds-accordion.js +7 -1
- package/dist/3-unit/ds-avatar-group.d.ts +1 -0
- package/dist/3-unit/ds-avatar-group.d.ts.map +1 -1
- package/dist/3-unit/ds-calendar-large.d.ts +138 -0
- package/dist/3-unit/ds-calendar-large.d.ts.map +1 -0
- package/dist/3-unit/ds-calendar-large.js +305 -0
- package/dist/3-unit/ds-calendar.d.ts +175 -0
- package/dist/3-unit/ds-calendar.d.ts.map +1 -0
- package/dist/3-unit/ds-calendar.js +303 -0
- package/dist/3-unit/ds-carousel.d.ts +182 -0
- package/dist/3-unit/ds-carousel.d.ts.map +1 -0
- package/dist/3-unit/ds-carousel.js +327 -0
- package/dist/3-unit/ds-date-picker.d.ts +203 -0
- package/dist/3-unit/ds-date-picker.d.ts.map +1 -0
- package/dist/3-unit/ds-date-picker.js +499 -0
- package/dist/3-unit/ds-form.d.ts.map +1 -1
- package/dist/3-unit/ds-form.js +38 -28
- package/dist/3-unit/ds-list.d.ts +12 -0
- package/dist/3-unit/ds-list.d.ts.map +1 -1
- package/dist/3-unit/ds-list.js +52 -1
- package/dist/3-unit/ds-matrix.d.ts +146 -0
- package/dist/3-unit/ds-matrix.d.ts.map +1 -0
- package/dist/3-unit/ds-matrix.js +248 -0
- package/dist/3-unit/ds-menu.d.ts +1 -1
- package/dist/3-unit/ds-menu.d.ts.map +1 -1
- package/dist/3-unit/ds-menu.js +7 -4
- package/dist/3-unit/ds-row.d.ts +66 -0
- package/dist/3-unit/ds-row.d.ts.map +1 -1
- package/dist/3-unit/ds-row.js +80 -1
- package/dist/3-unit/ds-sidebar.d.ts +108 -0
- package/dist/3-unit/ds-sidebar.d.ts.map +1 -0
- package/dist/3-unit/ds-sidebar.js +268 -0
- package/dist/3-unit/ds-table.d.ts +28 -10
- package/dist/3-unit/ds-table.d.ts.map +1 -1
- package/dist/3-unit/ds-table.js +53 -25
- package/dist/3-unit/ds-tree.d.ts +69 -0
- package/dist/3-unit/ds-tree.d.ts.map +1 -0
- package/dist/3-unit/ds-tree.js +136 -0
- package/dist/4-page/ds-dialog.d.ts +16 -1
- package/dist/4-page/ds-dialog.d.ts.map +1 -1
- package/dist/4-page/ds-dialog.js +39 -3
- package/dist/4-page/ds-document.d.ts +98 -0
- package/dist/4-page/ds-document.d.ts.map +1 -0
- package/dist/4-page/ds-document.js +213 -0
- package/dist/4-page/ds-footer.d.ts +100 -0
- package/dist/4-page/ds-footer.d.ts.map +1 -0
- package/dist/4-page/ds-footer.js +119 -0
- package/dist/4-page/ds-grid.d.ts +32 -12
- package/dist/4-page/ds-grid.d.ts.map +1 -1
- package/dist/4-page/ds-grid.js +30 -39
- package/dist/4-page/ds-header.d.ts +84 -0
- package/dist/4-page/ds-header.d.ts.map +1 -0
- package/dist/4-page/ds-header.js +143 -0
- package/dist/4-page/ds-layout.d.ts +1 -0
- package/dist/4-page/ds-layout.d.ts.map +1 -1
- package/dist/4-page/ds-layout.js +1 -1
- package/dist/4-page/ds-page.d.ts +110 -0
- package/dist/4-page/ds-page.d.ts.map +1 -0
- package/dist/4-page/ds-page.js +155 -0
- package/dist/4-page/email.d.ts +2 -3
- package/dist/4-page/email.d.ts.map +1 -1
- package/dist/4-page/email.js +2 -3
- package/dist/components.d.ts +4 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -1
- package/dist/design-system-1.bundle.js +11304 -4322
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +8867 -4132
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/design-system-1.css +1 -1
- package/dist/feedback.js +541 -0
- package/dist/feedback.js.map +1 -0
- package/dist/icons-extra-B4Iotc7s.js +298 -0
- package/dist/icons-extra-B4Iotc7s.js.map +1 -0
- package/dist/icons-extra-C4sCgoUj.js +185 -0
- package/dist/icons-extra-C4sCgoUj.js.map +1 -0
- package/dist/icons-extra-DSav6uTU.js +300 -0
- package/dist/icons-extra-DSav6uTU.js.map +1 -0
- package/dist/icons-extra-Dc_yVWIz.js +1024 -0
- package/dist/icons-extra-Dc_yVWIz.js.map +1 -0
- package/dist/icons-extra-cfzoudMf.js +1030 -0
- package/dist/icons-extra-cfzoudMf.js.map +1 -0
- package/dist/icons-extra-g_xpwZhZ.js +631 -0
- package/dist/icons-extra-g_xpwZhZ.js.map +1 -0
- package/dist/index.d.ts +23 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -6
- package/dist/react/avatar.d.ts +5 -9
- package/dist/react/avatar.d.ts.map +1 -1
- package/dist/react/avatar.js +2 -2
- package/dist/react/button-split.d.ts +19 -0
- package/dist/react/button-split.d.ts.map +1 -0
- package/dist/react/button-split.js +35 -0
- package/dist/react/button.d.ts +18 -7
- package/dist/react/button.d.ts.map +1 -1
- package/dist/react/button.js +13 -4
- package/dist/react/carousel.d.ts +63 -0
- package/dist/react/carousel.d.ts.map +1 -0
- package/dist/react/carousel.js +47 -0
- package/dist/react/choice.d.ts +1 -1
- package/dist/react/context-menu.d.ts +337 -337
- package/dist/react/dialog.d.ts +684 -678
- package/dist/react/dialog.d.ts.map +1 -1
- package/dist/react/dialog.js +29 -3
- package/dist/react/document.d.ts +11 -0
- package/dist/react/document.d.ts.map +1 -0
- package/dist/react/document.js +10 -0
- package/dist/react/empty.d.ts +34 -0
- package/dist/react/empty.d.ts.map +1 -0
- package/dist/react/empty.js +8 -0
- package/dist/react/file-picker.d.ts +1 -1
- package/dist/react/footer.d.ts +13 -0
- package/dist/react/footer.d.ts.map +1 -0
- package/dist/react/footer.js +12 -0
- package/dist/react/header.d.ts +12 -0
- package/dist/react/header.d.ts.map +1 -0
- package/dist/react/header.js +11 -0
- package/dist/react/input.d.ts +31 -9
- package/dist/react/input.d.ts.map +1 -1
- package/dist/react/input.js +94 -94
- package/dist/react/kbd.d.ts +26 -0
- package/dist/react/kbd.d.ts.map +1 -0
- package/dist/react/kbd.js +8 -0
- package/dist/react/loading.d.ts +14 -0
- package/dist/react/loading.d.ts.map +1 -0
- package/dist/react/loading.js +14 -0
- package/dist/react/meter.d.ts +64 -0
- package/dist/react/meter.d.ts.map +1 -0
- package/dist/react/meter.js +15 -0
- package/dist/react/notice.d.ts +45 -0
- package/dist/react/notice.d.ts.map +1 -0
- package/dist/react/notice.js +34 -0
- package/dist/react/page.d.ts +10 -0
- package/dist/react/page.d.ts.map +1 -0
- package/dist/react/page.js +9 -0
- package/dist/react/progress.d.ts +107 -0
- package/dist/react/progress.d.ts.map +1 -0
- package/dist/react/progress.js +47 -0
- package/dist/react/sidebar.d.ts +44 -0
- package/dist/react/sidebar.d.ts.map +1 -0
- package/dist/react/sidebar.js +41 -0
- package/dist/react/spacing-handle.d.ts +13 -0
- package/dist/react/spacing-handle.d.ts.map +1 -0
- package/dist/react/spacing-handle.js +18 -0
- package/dist/react/split.d.ts +6 -14
- package/dist/react/split.d.ts.map +1 -1
- package/dist/react/split.js +5 -31
- package/dist/react/stat.d.ts +78 -0
- package/dist/react/stat.d.ts.map +1 -0
- package/dist/react/stat.js +25 -0
- package/dist/react/steps.d.ts +36 -0
- package/dist/react/steps.d.ts.map +1 -0
- package/dist/react/steps.js +10 -0
- package/dist/react/toast.d.ts +37 -0
- package/dist/react/toast.d.ts.map +1 -0
- package/dist/react/toast.js +55 -0
- package/dist/react/tree.d.ts +31 -0
- package/dist/react/tree.d.ts.map +1 -0
- package/dist/react/tree.js +37 -0
- package/dist/shared-words-BfnT24Fe.js +1635 -0
- package/dist/shared-words-BfnT24Fe.js.map +1 -0
- package/dist/shared-words-CyZYc_De.js +1818 -0
- package/dist/shared-words-CyZYc_De.js.map +1 -0
- package/dist/shared-words-DAVSET4Z.js +1800 -0
- package/dist/shared-words-DAVSET4Z.js.map +1 -0
- package/dist/shared-words-UCvnkctb.js +1653 -0
- package/dist/shared-words-UCvnkctb.js.map +1 -0
- package/package.json +16 -5
- package/DS1/2-core/ds-banner.ts +0 -122
- package/DS1/2-core/ds-date.ts +0 -24
- package/DS1/2-core/ds-language.ts +0 -94
- package/DS1/2-core/ds-pagedots.ts +0 -52
- package/DS1/2-core/ds-split.ts +0 -122
- package/DS1/2-core/ds-textarea.ts +0 -136
- package/DS1/2-core/styles/ds-banner.css +0 -77
- package/DS1/2-core/styles/ds-date.css +0 -9
- package/DS1/2-core/styles/ds-language.css +0 -78
- package/DS1/2-core/styles/ds-pagedots.css +0 -31
- package/DS1/2-core/styles/ds-textarea.css +0 -27
- package/DS1/4-page/ds-layout.ts +0 -949
- package/DS1/4-page/styles/ds-layout.css +0 -246
- package/DS1/react/split.ts +0 -42
- package/DS1/x-icon/ezo-accordion-chevron.svg +0 -11
- package/DS1/x-icon/ezo-account-close.svg +0 -1
- package/DS1/x-icon/ezo-android-screen-archive.svg +0 -4
- package/DS1/x-icon/ezo-android-screen-calendar.svg +0 -6
- package/DS1/x-icon/ezo-android-screen-camera.svg +0 -5
- package/DS1/x-icon/ezo-android-screen-check.svg +0 -3
- package/DS1/x-icon/ezo-android-screen-compose.svg +0 -4
- package/DS1/x-icon/ezo-android-screen-globe.svg +0 -1
- package/DS1/x-icon/ezo-android-screen-shared.svg +0 -5
- package/DS1/x-icon/ezo-android-screen-store.svg +0 -4
- package/DS1/x-icon/ezo-android-screen-views.svg +0 -4
- package/DS1/x-icon/ezo-android-screen-work.svg +0 -3
- package/DS1/x-icon/ezo-arrow-cursor.svg +0 -8
- package/DS1/x-icon/ezo-block-accordion.svg +0 -1
- package/DS1/x-icon/ezo-block-divider.svg +0 -1
- package/DS1/x-icon/ezo-block-group.svg +0 -1
- package/DS1/x-icon/ezo-block-image.svg +0 -1
- package/DS1/x-icon/ezo-block-section.svg +0 -1
- package/DS1/x-icon/ezo-block-table.svg +0 -1
- package/DS1/x-icon/ezo-code.svg +0 -14
- package/DS1/x-icon/ezo-down.svg +0 -3
- package/DS1/x-icon/ezo-figma-premium-star.svg +0 -5
- package/DS1/x-icon/ezo-item-button-complete.svg +0 -4
- package/DS1/x-icon/ezo-item-button-header.svg +0 -3
- package/DS1/x-icon/ezo-item-button-open.svg +0 -3
- package/DS1/x-icon/ezo-item-button-star.svg +0 -3
- package/DS1/x-icon/ezo-item-button-unheader.svg +0 -7
- package/DS1/x-icon/ezo-item-button-unstar.svg +0 -5
- package/DS1/x-icon/ezo-item-star.svg +0 -5
- package/DS1/x-icon/ezo-left.svg +0 -3
- package/DS1/x-icon/ezo-logo.svg +0 -1
- package/DS1/x-icon/ezo-mic.svg +0 -8
- package/DS1/x-icon/ezo-move-column.svg +0 -14
- package/DS1/x-icon/ezo-move-row.svg +0 -18
- package/DS1/x-icon/ezo-navigation-check.svg +0 -1
- package/DS1/x-icon/ezo-note-back.svg +0 -5
- package/DS1/x-icon/ezo-note-menu-complete.svg +0 -11
- package/DS1/x-icon/ezo-note-menu-delete.svg +0 -4
- package/DS1/x-icon/ezo-note-menu-duplicate.svg +0 -8
- package/DS1/x-icon/ezo-note-menu-note.svg +0 -5
- package/DS1/x-icon/ezo-note-menu-page.svg +0 -3
- package/DS1/x-icon/ezo-note-menu-star.svg +0 -5
- package/DS1/x-icon/ezo-note-menu-start.svg +0 -6
- package/DS1/x-icon/ezo-note-menu-stop.svg +0 -6
- package/DS1/x-icon/ezo-note-more.svg +0 -7
- package/DS1/x-icon/ezo-note-star.svg +0 -5
- package/DS1/x-icon/ezo-pattern-call-to-action.svg +0 -1
- package/DS1/x-icon/ezo-play.svg +0 -5
- package/DS1/x-icon/ezo-premium-star.svg +0 -5
- package/DS1/x-icon/ezo-setting-1xdots.svg +0 -13
- package/DS1/x-icon/ezo-setting-1xgrid.svg +0 -10
- package/DS1/x-icon/ezo-setting-1xlines.svg +0 -7
- package/DS1/x-icon/ezo-setting-2xdots.svg +0 -8
- package/DS1/x-icon/ezo-setting-2xgrid.svg +0 -8
- package/DS1/x-icon/ezo-setting-2xlines.svg +0 -6
- package/DS1/x-icon/ezo-setting-blank.svg +0 -5
- package/DS1/x-icon/ezo-store-chevron.svg +0 -1
- package/DS1/x-icon/ezo-upgrade-close.svg +0 -5
- package/DS1/x-icon/product-sources.json +0 -2557
- /package/DS1/x-icon/{ezo-password-visibility-see.svg → password-see.svg} +0 -0
- /package/DS1/x-icon/{ezo-password-visibility-unsee.svg → password-unsee.svg} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "../2-core/ds-icon";
|
|
3
|
+
/** A visible row of the tree. The application owns the hierarchy, expansion and selection. */
|
|
4
|
+
export interface TreeItem {
|
|
5
|
+
id: string;
|
|
6
|
+
/** Words a person reads; shown as written, never translated. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** 0 for a row at the root; each level stands one square further in. */
|
|
9
|
+
depth?: number;
|
|
10
|
+
/** `true` open, `false` closed; leave it out for a leaf. */
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** An icon from the library on its own square before the label. */
|
|
15
|
+
icon?: string;
|
|
16
|
+
/** Small muted words at the row's end: a count, a size. */
|
|
17
|
+
meta?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A tree: rows one square high, each level one square further in, a
|
|
21
|
+
* disclosure arrow on its own square before each label. `role="tree"` with
|
|
22
|
+
* one `role="treeitem"` per row, `aria-level`, `aria-expanded` and
|
|
23
|
+
* `aria-selected`; one Tab stop, the keyboard of the tree pattern (see
|
|
24
|
+
* `0-face/tree.ts`). The application keeps the rows: it passes the visible
|
|
25
|
+
* ones in `items`, in order, and answers the events.
|
|
26
|
+
*
|
|
27
|
+
* @element ds-tree
|
|
28
|
+
* @attr label - The tree's accessible name.
|
|
29
|
+
* @fires ds-tree-toggle - `{ id, expanded }`: a row asks to open or close.
|
|
30
|
+
* @fires ds-tree-select - `{ id }`: a click, Space or Enter chose a row.
|
|
31
|
+
* @fires ds-tree-activate - `{ id }`: Enter or a double click opens a row.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Tree extends LitElement {
|
|
34
|
+
static properties: {
|
|
35
|
+
items: {
|
|
36
|
+
attribute: boolean;
|
|
37
|
+
};
|
|
38
|
+
label: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
items: TreeItem[];
|
|
43
|
+
label: string;
|
|
44
|
+
static styles: import("lit").CSSResult;
|
|
45
|
+
/** The row that holds the Tab stop. */
|
|
46
|
+
private focusId?;
|
|
47
|
+
constructor();
|
|
48
|
+
private request;
|
|
49
|
+
/** The row a pointer or keyboard event happened on, for a context menu or a drag of the application's own. */
|
|
50
|
+
itemFromEvent(event: Event): TreeItem | undefined;
|
|
51
|
+
/** Moves the focus to a row after `updateComplete`. */
|
|
52
|
+
focusItem(id: string): void;
|
|
53
|
+
/** Scrolls the selected row into view. */
|
|
54
|
+
scrollToSelected(): void;
|
|
55
|
+
private row;
|
|
56
|
+
/** The Tab stop: the row last focused while it is still shown, else the selected row, else the first available. */
|
|
57
|
+
private stop;
|
|
58
|
+
private toggle;
|
|
59
|
+
private press;
|
|
60
|
+
private open;
|
|
61
|
+
private keydown;
|
|
62
|
+
render(): import("lit").TemplateResult<1>;
|
|
63
|
+
}
|
|
64
|
+
declare global {
|
|
65
|
+
interface HTMLElementTagNameMap {
|
|
66
|
+
"ds-tree": Tree;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=ds-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-tree.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;AAK3D,OAAO,mBAAmB,CAAC;AAG3B,8FAA8F;AAC9F,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;;;MAGf;IAEM,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IAEtB,MAAM,CAAC,MAAM,0BAAqB;IAElC,uCAAuC;IACvC,OAAO,CAAC,OAAO,CAAC,CAAS;;IAQzB,OAAO,CAAC,OAAO;IAIf,8GAA8G;IAC9G,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS;IAKjD,uDAAuD;IACvD,SAAS,CAAC,EAAE,EAAE,MAAM;IASpB,0CAA0C;IAC1C,gBAAgB;IAIhB,OAAO,CAAC,GAAG;IAIX,mHAAmH;IACnH,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,OAAO;IAaf,MAAM;CAmCP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
2
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
3
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
4
|
+
import { define } from "../0-face/define";
|
|
5
|
+
import { treeStep } from "../0-face/tree";
|
|
6
|
+
import "../2-core/ds-icon";
|
|
7
|
+
import styles from "./styles/ds-tree.css?inline";
|
|
8
|
+
/**
|
|
9
|
+
* A tree: rows one square high, each level one square further in, a
|
|
10
|
+
* disclosure arrow on its own square before each label. `role="tree"` with
|
|
11
|
+
* one `role="treeitem"` per row, `aria-level`, `aria-expanded` and
|
|
12
|
+
* `aria-selected`; one Tab stop, the keyboard of the tree pattern (see
|
|
13
|
+
* `0-face/tree.ts`). The application keeps the rows: it passes the visible
|
|
14
|
+
* ones in `items`, in order, and answers the events.
|
|
15
|
+
*
|
|
16
|
+
* @element ds-tree
|
|
17
|
+
* @attr label - The tree's accessible name.
|
|
18
|
+
* @fires ds-tree-toggle - `{ id, expanded }`: a row asks to open or close.
|
|
19
|
+
* @fires ds-tree-select - `{ id }`: a click, Space or Enter chose a row.
|
|
20
|
+
* @fires ds-tree-activate - `{ id }`: Enter or a double click opens a row.
|
|
21
|
+
*/
|
|
22
|
+
export class Tree extends LitElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.items = [];
|
|
26
|
+
this.label = "";
|
|
27
|
+
}
|
|
28
|
+
request(name, detail) {
|
|
29
|
+
return this.dispatchEvent(new CustomEvent(`ds-tree-${name}`, { detail, bubbles: true, composed: true, cancelable: true }));
|
|
30
|
+
}
|
|
31
|
+
/** The row a pointer or keyboard event happened on, for a context menu or a drag of the application's own. */
|
|
32
|
+
itemFromEvent(event) {
|
|
33
|
+
const row = event.composedPath().find((node) => node instanceof HTMLElement && node.dataset.item !== undefined && this.renderRoot.contains(node));
|
|
34
|
+
return row ? this.items.find(item => item.id === row.dataset.item) : undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Moves the focus to a row after `updateComplete`. */
|
|
37
|
+
focusItem(id) {
|
|
38
|
+
const row = this.row(id);
|
|
39
|
+
if (!row)
|
|
40
|
+
return;
|
|
41
|
+
this.focusId = id;
|
|
42
|
+
this.requestUpdate();
|
|
43
|
+
row.tabIndex = 0;
|
|
44
|
+
row.focus();
|
|
45
|
+
}
|
|
46
|
+
/** Scrolls the selected row into view. */
|
|
47
|
+
scrollToSelected() {
|
|
48
|
+
this.renderRoot.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
49
|
+
}
|
|
50
|
+
row(id) {
|
|
51
|
+
return [...this.renderRoot.querySelectorAll("[data-item]")].find(row => row.dataset.item === id);
|
|
52
|
+
}
|
|
53
|
+
/** The Tab stop: the row last focused while it is still shown, else the selected row, else the first available. */
|
|
54
|
+
stop() {
|
|
55
|
+
const usable = this.items.filter(item => !item.disabled);
|
|
56
|
+
return usable.find(item => item.id === this.focusId)?.id ?? usable.find(item => item.selected)?.id ?? usable[0]?.id;
|
|
57
|
+
}
|
|
58
|
+
toggle(item, expanded) {
|
|
59
|
+
this.request("toggle", { id: item.id, expanded });
|
|
60
|
+
}
|
|
61
|
+
press(event, item) {
|
|
62
|
+
if (item.disabled)
|
|
63
|
+
return;
|
|
64
|
+
this.focusItem(item.id);
|
|
65
|
+
const disclosure = event.composedPath().some(node => node instanceof HTMLElement && node.classList.contains("disclosure"));
|
|
66
|
+
if (disclosure && item.expanded !== undefined)
|
|
67
|
+
this.toggle(item, !item.expanded);
|
|
68
|
+
else
|
|
69
|
+
this.request("select", { id: item.id });
|
|
70
|
+
}
|
|
71
|
+
open(event, item) {
|
|
72
|
+
if (item.disabled || event.composedPath().some(node => node instanceof HTMLElement && node.classList.contains("disclosure")))
|
|
73
|
+
return;
|
|
74
|
+
this.request("activate", { id: item.id });
|
|
75
|
+
}
|
|
76
|
+
keydown(event, item) {
|
|
77
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
78
|
+
return;
|
|
79
|
+
const index = this.items.indexOf(item);
|
|
80
|
+
const step = treeStep(this.items.map(row => ({ level: Math.max(0, row.depth ?? 0) + 1, expanded: row.expanded, disabled: row.disabled, label: row.label })), index, event.key);
|
|
81
|
+
if (!step)
|
|
82
|
+
return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
if (step.toggle !== undefined)
|
|
85
|
+
this.toggle(item, step.toggle);
|
|
86
|
+
if (step.select)
|
|
87
|
+
this.request("select", { id: item.id });
|
|
88
|
+
if (step.activate)
|
|
89
|
+
this.request("activate", { id: item.id });
|
|
90
|
+
const target = step.focus === undefined ? undefined : this.items[step.focus];
|
|
91
|
+
if (target)
|
|
92
|
+
this.focusItem(target.id);
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
const stop = this.stop();
|
|
96
|
+
// Each row's place among its siblings, for aria-setsize and aria-posinset.
|
|
97
|
+
const places = new Map();
|
|
98
|
+
const open = [];
|
|
99
|
+
for (const item of this.items) {
|
|
100
|
+
const depth = Math.max(0, item.depth ?? 0);
|
|
101
|
+
open.length = depth + 1;
|
|
102
|
+
const siblings = (open[depth] ?? (open[depth] = []));
|
|
103
|
+
siblings.push(item);
|
|
104
|
+
for (const [index, sibling] of siblings.entries())
|
|
105
|
+
places.set(sibling.id, [index + 1, siblings.length]);
|
|
106
|
+
}
|
|
107
|
+
return html `<div class="tree" role="tree" aria-label=${ifDefined(this.label || undefined)} part="tree">
|
|
108
|
+
${repeat(this.items, item => item.id, item => {
|
|
109
|
+
const depth = Math.max(0, item.depth ?? 0);
|
|
110
|
+
const [position, size] = places.get(item.id) ?? [1, 1];
|
|
111
|
+
return html `<div class="item" role="treeitem" data-item=${item.id}
|
|
112
|
+
aria-level=${depth + 1} aria-setsize=${size} aria-posinset=${position}
|
|
113
|
+
aria-expanded=${ifDefined(item.expanded === undefined ? undefined : String(item.expanded))}
|
|
114
|
+
aria-selected=${String(Boolean(item.selected))}
|
|
115
|
+
aria-disabled=${ifDefined(item.disabled ? "true" : undefined)}
|
|
116
|
+
tabindex=${item.id === stop ? 0 : -1}
|
|
117
|
+
style=${`--depth:${depth}`}
|
|
118
|
+
@click=${(event) => this.press(event, item)}
|
|
119
|
+
@dblclick=${(event) => this.open(event, item)}
|
|
120
|
+
@keydown=${(event) => this.keydown(event, item)}
|
|
121
|
+
@focus=${() => { this.focusId = item.id; }}>
|
|
122
|
+
<span class="disclosure" aria-hidden="true">${item.expanded === undefined ? nothing : html `<ds-icon type="right" ?data-open=${item.expanded}></ds-icon>`}</span>
|
|
123
|
+
${item.icon ? html `<span class="icon" aria-hidden="true"><ds-icon type=${item.icon}></ds-icon></span>` : nothing}
|
|
124
|
+
<span class="label">${item.label}</span>
|
|
125
|
+
${item.meta ? html `<span class="meta">${item.meta}</span>` : nothing}
|
|
126
|
+
</div>`;
|
|
127
|
+
})}
|
|
128
|
+
</div>`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
Tree.properties = {
|
|
132
|
+
items: { attribute: false },
|
|
133
|
+
label: { type: String },
|
|
134
|
+
};
|
|
135
|
+
Tree.styles = unsafeCSS(styles);
|
|
136
|
+
define("ds-tree", Tree);
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "../2-core/ds-button";
|
|
3
3
|
import "../2-core/ds-icon";
|
|
4
|
+
import { type DialogPlacement } from "../0-face/dialog-swipe";
|
|
4
5
|
import "./styles/ds-dialog.css";
|
|
5
|
-
|
|
6
|
+
import "../1-root/dialog-placement.css";
|
|
7
|
+
export type { DialogPlacement } from "../0-face/dialog-swipe";
|
|
8
|
+
export type DialogCloseReason = "escape" | "backdrop" | "outside" | "button" | "native" | "swipe";
|
|
6
9
|
/** A native light-DOM dialog keeps forms and accessible ID references together.
|
|
7
10
|
* The browser owns the top layer, inert background and modal focus navigation.
|
|
8
11
|
* Listen to ds-close-request and preventDefault to control whether it closes.
|
|
12
|
+
* `placement` stands it in the centre (the default), as a sheet from the
|
|
13
|
+
* bottom (`"sheet"`) or as a drawer at the end or start (`"end"`, `"start"`),
|
|
14
|
+
* which slide in and out and a finger swipes away (reason `"swipe"`).
|
|
9
15
|
*/
|
|
10
16
|
export declare class Dialog extends LitElement {
|
|
11
17
|
static properties: {
|
|
@@ -38,6 +44,10 @@ export declare class Dialog extends LitElement {
|
|
|
38
44
|
type: BooleanConstructor;
|
|
39
45
|
attribute: string;
|
|
40
46
|
};
|
|
47
|
+
placement: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
reflect: boolean;
|
|
50
|
+
};
|
|
41
51
|
anchor: {
|
|
42
52
|
attribute: boolean;
|
|
43
53
|
};
|
|
@@ -53,6 +63,8 @@ export declare class Dialog extends LitElement {
|
|
|
53
63
|
holdScroll: boolean;
|
|
54
64
|
closeOnEscape: boolean;
|
|
55
65
|
closeOnBackdrop: boolean;
|
|
66
|
+
/** Where it stands: `"center"`, a `"sheet"` from the bottom, or a drawer at the `"end"` or `"start"`. An anchored panel ignores it. */
|
|
67
|
+
placement: DialogPlacement;
|
|
56
68
|
/** A viewport point for a floating panel; null uses ordinary dialog layout. */
|
|
57
69
|
anchor: {
|
|
58
70
|
x: number;
|
|
@@ -67,10 +79,13 @@ export declare class Dialog extends LitElement {
|
|
|
67
79
|
private outsidePress;
|
|
68
80
|
private observer;
|
|
69
81
|
private sizeObserver;
|
|
82
|
+
private unbindSwipe;
|
|
70
83
|
constructor();
|
|
71
84
|
connectedCallback(): void;
|
|
72
85
|
disconnectedCallback(): void;
|
|
73
86
|
protected updated(): void;
|
|
87
|
+
/** Mark the native frame with its placement before it opens, so it slides in from its edge, and let a finger swipe it away. */
|
|
88
|
+
private syncPlacement;
|
|
74
89
|
/** Keep an anchored panel inside the visible viewport as its content or keyboard changes. */
|
|
75
90
|
place: () => void;
|
|
76
91
|
private bindDialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-dialog.d.ts","sourceRoot":"","sources":["../../DS1/4-page/ds-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAEvD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-dialog.d.ts","sourceRoot":"","sources":["../../DS1/4-page/ds-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAEvD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,wBAAwB,CAAC;AAChC,OAAO,gCAAgC,CAAC;AAKxC,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAqDlG;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWf;IACF,MAAM,CAAC,MAAM,4BAAyG;IAC9G,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACjC,uIAAuI;IAC/H,SAAS,EAAE,eAAe,CAAC;IACnC,+EAA+E;IACvE,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChD,oFAAoF;IAC5E,WAAW,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACvD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,QAAQ,CAAiD;IACjE,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,WAAW,CAA6B;;IAgBhD,iBAAiB;IAOjB,oBAAoB;IAMpB,SAAS,CAAC,OAAO;IAEjB,+HAA+H;IAC/H,OAAO,CAAC,aAAa;IAiBrB,6FAA6F;IAC7F,KAAK,aAcH;IAEF,OAAO,CAAC,UAAU,CAWhB;IAEF,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,QAAQ;IAmBhB;6EACyE;IACnE,IAAI,CAAC,EAAE,SAAiB,EAAE,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO;IAiB9D,KAAK;IAEL,OAAO,CAAC,UAAU;IA2BlB,OAAO,CAAC,OAAO;IAoCf,YAAY,CAAC,MAAM,GAAE,iBAA4B;IAMjD,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,aAAa,CAKnB;IACF,OAAO,CAAC,eAAe,CAErB;IACF,OAAO,CAAC,cAAc,CAIpB;IACF,OAAO,CAAC,cAAc,CAKpB;IAEF,OAAO,CAAC,QAAQ,CAGd;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,aAAa,CAEnB;IACF,OAAO,CAAC,OAAO,CAMb;IAEF,MAAM;CACP;AAGD,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,WAAW,EAAE,MAAM,CAAA;KAAE;CAAE"}
|
package/dist/4-page/ds-dialog.js
CHANGED
|
@@ -2,9 +2,14 @@ import { LitElement, css, html, unsafeCSS } from "lit";
|
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
3
|
import "../2-core/ds-button";
|
|
4
4
|
import "../2-core/ds-icon";
|
|
5
|
+
import { bindDialogSwipe } from "../0-face/dialog-swipe";
|
|
5
6
|
import "./styles/ds-dialog.css";
|
|
6
|
-
import
|
|
7
|
+
import "../1-root/dialog-placement.css";
|
|
8
|
+
import frameStyles from "./styles/ds-dialog.css?inline";
|
|
9
|
+
import placementStyles from "../1-root/dialog-placement.css?inline";
|
|
7
10
|
import metrics from "../1-root/component-metrics.css?inline";
|
|
11
|
+
const dialogStyles = `${frameStyles}\n${placementStyles}`;
|
|
12
|
+
const PLACEMENTS = new Set(["sheet", "end", "start"]);
|
|
8
13
|
const openDialogs = new WeakMap();
|
|
9
14
|
const scrollStyles = new WeakMap();
|
|
10
15
|
/** One owner per declaration, including mixed modal and stationary panels. */
|
|
@@ -62,6 +67,9 @@ function styleRoot(root) {
|
|
|
62
67
|
/** A native light-DOM dialog keeps forms and accessible ID references together.
|
|
63
68
|
* The browser owns the top layer, inert background and modal focus navigation.
|
|
64
69
|
* Listen to ds-close-request and preventDefault to control whether it closes.
|
|
70
|
+
* `placement` stands it in the centre (the default), as a sheet from the
|
|
71
|
+
* bottom (`"sheet"`) or as a drawer at the end or start (`"end"`, `"start"`),
|
|
72
|
+
* which slide in and out and a finger swipes away (reason `"swipe"`).
|
|
65
73
|
*/
|
|
66
74
|
export class Dialog extends LitElement {
|
|
67
75
|
constructor() {
|
|
@@ -73,6 +81,7 @@ export class Dialog extends LitElement {
|
|
|
73
81
|
this.outsidePress = null;
|
|
74
82
|
this.observer = new MutationObserver(() => this.bindDialog());
|
|
75
83
|
this.sizeObserver = null;
|
|
84
|
+
this.unbindSwipe = null;
|
|
76
85
|
/** Keep an anchored panel inside the visible viewport as its content or keyboard changes. */
|
|
77
86
|
this.place = () => {
|
|
78
87
|
const dialog = this.dialog, view = this.ownerDocument.defaultView;
|
|
@@ -103,6 +112,7 @@ export class Dialog extends LitElement {
|
|
|
103
112
|
dialog?.addEventListener("close", this.onNativeClose);
|
|
104
113
|
dialog?.addEventListener("pointerdown", this.onPointerDown);
|
|
105
114
|
dialog?.addEventListener("click", this.onClick);
|
|
115
|
+
this.syncPlacement();
|
|
106
116
|
this.syncOpen();
|
|
107
117
|
};
|
|
108
118
|
this.onDocumentKey = (event) => {
|
|
@@ -173,6 +183,7 @@ export class Dialog extends LitElement {
|
|
|
173
183
|
this.holdScroll = false;
|
|
174
184
|
this.closeOnEscape = true;
|
|
175
185
|
this.closeOnBackdrop = true;
|
|
186
|
+
this.placement = "center";
|
|
176
187
|
this.anchor = null;
|
|
177
188
|
this.returnFocus = null;
|
|
178
189
|
}
|
|
@@ -187,13 +198,37 @@ export class Dialog extends LitElement {
|
|
|
187
198
|
this.detachDialog();
|
|
188
199
|
super.disconnectedCallback();
|
|
189
200
|
}
|
|
190
|
-
updated() { this.syncOpen(); this.place(); }
|
|
201
|
+
updated() { this.syncPlacement(); this.syncOpen(); this.place(); }
|
|
202
|
+
/** Mark the native frame with its placement before it opens, so it slides in from its edge, and let a finger swipe it away. */
|
|
203
|
+
syncPlacement() {
|
|
204
|
+
const dialog = this.dialog;
|
|
205
|
+
if (!dialog)
|
|
206
|
+
return;
|
|
207
|
+
const placement = !this.anchor && PLACEMENTS.has(this.placement) ? this.placement : null;
|
|
208
|
+
if (placement)
|
|
209
|
+
dialog.setAttribute("data-ds-placement", placement);
|
|
210
|
+
else
|
|
211
|
+
dialog.removeAttribute("data-ds-placement");
|
|
212
|
+
if (placement && !this.unbindSwipe) {
|
|
213
|
+
this.unbindSwipe = bindDialogSwipe(dialog, {
|
|
214
|
+
placement: () => (!this.anchor && PLACEMENTS.has(this.placement) ? this.placement : "center"),
|
|
215
|
+
onDismiss: () => this.requestClose("swipe"),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
else if (!placement && this.unbindSwipe) {
|
|
219
|
+
this.unbindSwipe();
|
|
220
|
+
this.unbindSwipe = null;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
191
223
|
detachDialog() {
|
|
192
224
|
const dialog = this.dialog;
|
|
193
225
|
dialog?.removeEventListener("cancel", this.onCancel);
|
|
194
226
|
dialog?.removeEventListener("close", this.onNativeClose);
|
|
195
227
|
dialog?.removeEventListener("pointerdown", this.onPointerDown);
|
|
196
228
|
dialog?.removeEventListener("click", this.onClick);
|
|
229
|
+
this.unbindSwipe?.();
|
|
230
|
+
this.unbindSwipe = null;
|
|
231
|
+
dialog?.removeAttribute("data-ds-placement");
|
|
197
232
|
if (dialog?.open)
|
|
198
233
|
dialog.close();
|
|
199
234
|
this.release();
|
|
@@ -351,8 +386,9 @@ Dialog.properties = {
|
|
|
351
386
|
holdScroll: { type: Boolean, attribute: "hold-scroll" },
|
|
352
387
|
closeOnEscape: { type: Boolean, attribute: "close-on-escape" },
|
|
353
388
|
closeOnBackdrop: { type: Boolean, attribute: "close-on-backdrop" },
|
|
389
|
+
placement: { type: String, reflect: true },
|
|
354
390
|
anchor: { attribute: false },
|
|
355
391
|
returnFocus: { attribute: false },
|
|
356
392
|
};
|
|
357
|
-
Dialog.styles = [unsafeCSS(metrics), css `:host { display: contents; }`];
|
|
393
|
+
Dialog.styles = [unsafeCSS(metrics), css `:host { display: contents; } :host([hidden]) { display: none !important; }`];
|
|
358
394
|
define("ds-dialog", Dialog);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/** The shared word over the contents. */
|
|
3
|
+
export declare const CONTENTS_LABEL = "Contents";
|
|
4
|
+
/** One entry in the contents: a heading in the writing. */
|
|
5
|
+
export interface DocumentEntry {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
level: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* An id for a heading from its words: letters and digits in any script,
|
|
12
|
+
* joined by hyphens, unique among `taken`. Words with none of either get
|
|
13
|
+
* `section-<n>`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function headingId(text: string, taken: Set<string>, index: number): string;
|
|
16
|
+
/** The heading levels an attribute names, between 2 and 6: `2` by default, `2 3` for two levels. */
|
|
17
|
+
export declare function documentLevels(value: string | null | undefined): number[];
|
|
18
|
+
/**
|
|
19
|
+
* @element ds-document
|
|
20
|
+
* @prop {string} levels - The heading levels the contents list: `2` by default, `2 3` for two.
|
|
21
|
+
* @prop {string} label - The contents' title: a translation key, the shared word "Contents" by default.
|
|
22
|
+
* @prop {boolean} literal - Show `label` as written, never looked up.
|
|
23
|
+
* @prop {boolean} hideContents - Leave the contents out (`hide-contents`).
|
|
24
|
+
*
|
|
25
|
+
* @slot - The writing: native headings, paragraphs, lists, tables and a
|
|
26
|
+
* definition table (`<dl class="ds-definitions">`), as prose. The element
|
|
27
|
+
* marks itself `data-ds-prose` and brings the prose sheet.
|
|
28
|
+
* @slot contents - Contents of the page's own, in place of the built ones.
|
|
29
|
+
*
|
|
30
|
+
* The contents list the writing's headings at `levels`, giving a heading an
|
|
31
|
+
* id from its words when it has none. A link scrolls to its heading, and the
|
|
32
|
+
* section in view is marked `aria-current="location"`. With fewer than two
|
|
33
|
+
* headings there are no contents.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <ds-document>
|
|
37
|
+
* <h1>Terms</h1>
|
|
38
|
+
* <h2>Using the service</h2><p>…</p>
|
|
39
|
+
* <h2>Payments</h2><p>…</p>
|
|
40
|
+
* </ds-document>
|
|
41
|
+
*/
|
|
42
|
+
export declare class DocumentPage extends LitElement {
|
|
43
|
+
static properties: {
|
|
44
|
+
levels: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
50
|
+
literal: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
reflect: boolean;
|
|
53
|
+
};
|
|
54
|
+
hideContents: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
attribute: string;
|
|
57
|
+
reflect: boolean;
|
|
58
|
+
};
|
|
59
|
+
entries: {
|
|
60
|
+
state: boolean;
|
|
61
|
+
};
|
|
62
|
+
current: {
|
|
63
|
+
state: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
static styles: import("lit").CSSResult[];
|
|
67
|
+
levels: string;
|
|
68
|
+
label: string | undefined;
|
|
69
|
+
literal: boolean;
|
|
70
|
+
hideContents: boolean;
|
|
71
|
+
entries: DocumentEntry[];
|
|
72
|
+
current: string | null;
|
|
73
|
+
private readonly relabel;
|
|
74
|
+
private observer;
|
|
75
|
+
private frame;
|
|
76
|
+
constructor();
|
|
77
|
+
connectedCallback(): void;
|
|
78
|
+
disconnectedCallback(): void;
|
|
79
|
+
protected willUpdate(changed: Map<PropertyKey, unknown>): void;
|
|
80
|
+
/** The headings the contents list, in the order they stand. */
|
|
81
|
+
get headings(): HTMLElement[];
|
|
82
|
+
/** Reads the headings again: their words, levels and ids. */
|
|
83
|
+
collect(): void;
|
|
84
|
+
/**
|
|
85
|
+
* The section in view: the last heading at or above a fifth of the way down
|
|
86
|
+
* the view, or, scrolled to the foot of the page, the last heading in view.
|
|
87
|
+
*/
|
|
88
|
+
private onScroll;
|
|
89
|
+
private heading;
|
|
90
|
+
private follow;
|
|
91
|
+
render(): import("lit").TemplateResult<1>;
|
|
92
|
+
}
|
|
93
|
+
declare global {
|
|
94
|
+
interface HTMLElementTagNameMap {
|
|
95
|
+
"ds-document": DocumentPage;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=ds-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-document.d.ts","sourceRoot":"","sources":["../../DS1/4-page/ds-document.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;AAS3D,yCAAyC;AACzC,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjF;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAGzE;AAsBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;MAOf;IAEF,MAAM,CAAC,MAAM,4BAAqE;IAE1E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,KAAK,CAAK;;IAWlB,iBAAiB;IAajB,oBAAoB;IAWpB,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAIvD,+DAA+D;IAC/D,IAAI,QAAQ,IAAI,WAAW,EAAE,CAI5B;IAED,6DAA6D;IAC7D,OAAO,IAAI,IAAI;IAef;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAgBd;IAEF,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,MAAM;IAad,MAAM;CAqBP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,YAAY,CAAC;KAC7B;CACF"}
|