@0001-labs/design-system-1 0.0.0-stage → 0.3.0-alpha.13
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/control.ts +99 -0
- package/DS1/0-face/define.ts +5 -0
- package/DS1/0-face/device.ts +414 -0
- package/DS1/0-face/grid-fit.ts +63 -0
- package/DS1/0-face/grid.ts +144 -0
- package/DS1/0-face/i18n.ts +1023 -0
- package/DS1/0-face/language-routing.ts +135 -0
- package/DS1/0-face/language-validator.ts +46 -0
- package/DS1/0-face/languages.ts +242 -0
- package/DS1/0-face/layout-inspector.ts +184 -0
- package/DS1/0-face/preferences.ts +39 -0
- package/DS1/0-face/pricing.ts +57 -0
- package/DS1/0-face/scaling.ts +25 -0
- package/DS1/0-face/shared-words.ts +45 -0
- package/DS1/0-face/theme.ts +58 -0
- package/DS1/0-face/tooltips.ts +82 -0
- package/DS1/0-face/translations/da.json +63 -0
- package/DS1/0-face/translations/de.json +63 -0
- package/DS1/0-face/translations/en.json +63 -0
- package/DS1/0-face/translations/es.json +63 -0
- package/DS1/0-face/translations/fi.json +63 -0
- package/DS1/0-face/translations/fr.json +63 -0
- package/DS1/0-face/translations/is.json +56 -0
- package/DS1/0-face/translations/it.json +63 -0
- package/DS1/0-face/translations/ja.json +63 -0
- package/DS1/0-face/translations/ko.json +63 -0
- package/DS1/0-face/translations/nb.json +63 -0
- package/DS1/0-face/translations/pt-BR.json +63 -0
- package/DS1/0-face/translations/pt.json +63 -0
- package/DS1/0-face/translations/sv.json +63 -0
- package/DS1/0-face/translations/zh.json +63 -0
- package/DS1/0-face/translations-format.ts +216 -0
- package/DS1/1-root/component-appearance.css +32 -0
- package/DS1/1-root/component-metrics.css +21 -0
- package/DS1/1-root/component-tokens.css +90 -0
- package/DS1/1-root/controls.css +261 -0
- package/DS1/1-root/fonts/GT-America-Compressed-Regular.woff2 +0 -0
- package/DS1/1-root/fonts/GT-America-Standard-Medium.woff2 +0 -0
- package/DS1/1-root/fonts/GT-America-Standard-Regular.woff2 +0 -0
- package/DS1/1-root/fonts/GT-Canon-M-Standard-Medium-Trial.woff2 +0 -0
- package/DS1/1-root/fonts/Inter-Arrows.woff2 +0 -0
- package/DS1/1-root/fonts/Inter-LICENSE.md +7 -0
- package/DS1/1-root/fonts/Iosevka-LICENSE.md +7 -0
- package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
- package/DS1/1-root/grid.css +31 -0
- package/DS1/1-root/one.css +602 -0
- package/DS1/1-root/one.semantic.css +683 -0
- package/DS1/1-root/palette.ts +91 -0
- package/DS1/2-core/ds-avatar.ts +130 -0
- package/DS1/2-core/ds-badge.ts +77 -0
- package/DS1/2-core/ds-banner.ts +122 -0
- package/DS1/2-core/ds-button.ts +163 -0
- package/DS1/2-core/ds-card.ts +137 -0
- package/DS1/2-core/ds-checkbox.ts +14 -0
- package/DS1/2-core/ds-color.ts +32 -0
- package/DS1/2-core/ds-composer.ts +182 -0
- package/DS1/2-core/ds-cycle.ts +628 -0
- package/DS1/2-core/ds-date.ts +24 -0
- package/DS1/2-core/ds-file-picker.ts +83 -0
- package/DS1/2-core/ds-gap.ts +34 -0
- package/DS1/2-core/ds-icon.ts +161 -0
- package/DS1/2-core/ds-input.ts +518 -0
- package/DS1/2-core/ds-language.ts +94 -0
- package/DS1/2-core/ds-pagedots.ts +52 -0
- package/DS1/2-core/ds-radio.ts +25 -0
- package/DS1/2-core/ds-select.ts +44 -0
- package/DS1/2-core/ds-split.ts +122 -0
- package/DS1/2-core/ds-swatch.ts +20 -0
- package/DS1/2-core/ds-switch.ts +13 -0
- package/DS1/2-core/ds-text.ts +190 -0
- package/DS1/2-core/ds-textarea.ts +136 -0
- package/DS1/2-core/ds-token.ts +40 -0
- package/DS1/2-core/ds-tooltip.ts +115 -0
- package/DS1/2-core/generated/ds-icon-map.ts +583 -0
- package/DS1/2-core/generated/icons-extra.ts +243 -0
- package/DS1/2-core/generated/icons-immediate.ts +49 -0
- package/DS1/2-core/styles/ds-avatar.css +125 -0
- package/DS1/2-core/styles/ds-badge.css +26 -0
- package/DS1/2-core/styles/ds-banner.css +77 -0
- package/DS1/2-core/styles/ds-button-host.css +214 -0
- package/DS1/2-core/styles/ds-button.css +131 -0
- package/DS1/2-core/styles/ds-checkbox.css +48 -0
- package/DS1/2-core/styles/ds-color.css +24 -0
- package/DS1/2-core/styles/ds-composer-frame.css +11 -0
- package/DS1/2-core/styles/ds-composer.css +55 -0
- package/DS1/2-core/styles/ds-cycle.css +18 -0
- package/DS1/2-core/styles/ds-date.css +9 -0
- package/DS1/2-core/styles/ds-file-picker.css +66 -0
- package/DS1/2-core/styles/ds-gap.css +71 -0
- package/DS1/2-core/styles/ds-icon.css +44 -0
- package/DS1/2-core/styles/ds-input.css +233 -0
- package/DS1/2-core/styles/ds-language.css +78 -0
- package/DS1/2-core/styles/ds-pagedots.css +31 -0
- package/DS1/2-core/styles/ds-radio.css +83 -0
- package/DS1/2-core/styles/ds-select.css +95 -0
- package/DS1/2-core/styles/ds-split.css +62 -0
- package/DS1/2-core/styles/ds-switch.css +50 -0
- package/DS1/2-core/styles/ds-text.css +87 -0
- package/DS1/2-core/styles/ds-textarea.css +27 -0
- package/DS1/2-core/styles/ds-token.css +9 -0
- package/DS1/2-core/styles/ds-tooltip.css +37 -0
- package/DS1/3-unit/context-trigger.ts +104 -0
- package/DS1/3-unit/ds-accordion.ts +120 -0
- package/DS1/3-unit/ds-avatar-group.ts +99 -0
- package/DS1/3-unit/ds-form.ts +304 -0
- package/DS1/3-unit/ds-list.ts +36 -0
- package/DS1/3-unit/ds-menu.ts +482 -0
- package/DS1/3-unit/ds-row.ts +48 -0
- package/DS1/3-unit/ds-table.ts +68 -0
- package/DS1/3-unit/ds-tabs.ts +77 -0
- package/DS1/3-unit/ds-token-field.ts +127 -0
- package/DS1/3-unit/styles/context-trigger.css +6 -0
- package/DS1/3-unit/styles/ds-accordion.css +64 -0
- package/DS1/3-unit/styles/ds-avatar-group.css +51 -0
- package/DS1/3-unit/styles/ds-list.css +26 -0
- package/DS1/3-unit/styles/ds-menu.css +97 -0
- package/DS1/3-unit/styles/ds-row.css +37 -0
- package/DS1/3-unit/styles/ds-table.css +80 -0
- package/DS1/3-unit/styles/ds-tabs.css +44 -0
- package/DS1/3-unit/styles/ds-token-field.css +11 -0
- package/DS1/4-page/ds-container.ts +28 -0
- package/DS1/4-page/ds-dialog.ts +331 -0
- package/DS1/4-page/ds-grid.ts +74 -0
- package/DS1/4-page/ds-layout.ts +949 -0
- package/DS1/4-page/ds-panel.ts +38 -0
- package/DS1/4-page/email.ts +170 -0
- package/DS1/4-page/styles/ds-container.css +35 -0
- package/DS1/4-page/styles/ds-dialog.css +94 -0
- package/DS1/4-page/styles/ds-grid.css +95 -0
- package/DS1/4-page/styles/ds-layout.css +246 -0
- package/DS1/4-page/styles/ds-panel.css +31 -0
- package/DS1/components.ts +13 -0
- package/DS1/index.ts +86 -0
- package/DS1/react/accordion.ts +33 -0
- package/DS1/react/avatar-group.ts +11 -0
- package/DS1/react/avatar.ts +42 -0
- package/DS1/react/badge.ts +7 -0
- package/DS1/react/button.ts +63 -0
- package/DS1/react/choice.ts +64 -0
- package/DS1/react/composer.ts +18 -0
- package/DS1/react/context-menu.ts +167 -0
- package/DS1/react/dialog.ts +102 -0
- package/DS1/react/file-picker.ts +34 -0
- package/DS1/react/input.ts +184 -0
- package/DS1/react/menu.ts +28 -0
- package/DS1/react/split.ts +42 -0
- package/DS1/react/token-field.ts +32 -0
- package/DS1/vite-env.d.ts +13 -0
- package/DS1/x-icon/1x.svg +4 -0
- package/DS1/x-icon/1xdots.svg +11 -0
- package/DS1/x-icon/1xgrid.svg +8 -0
- package/DS1/x-icon/1xlines.svg +5 -0
- package/DS1/x-icon/2x.svg +4 -0
- package/DS1/x-icon/2xdots.svg +18 -0
- package/DS1/x-icon/2xgrid-alt-2.svg +9 -0
- package/DS1/x-icon/2xgrid-alt-3.svg +8 -0
- package/DS1/x-icon/2xgrid-alt.svg +15 -0
- package/DS1/x-icon/2xgrid.svg +6 -0
- package/DS1/x-icon/2xlines.svg +6 -0
- package/DS1/x-icon/4x4.svg +18 -0
- package/DS1/x-icon/app.svg +4 -0
- package/DS1/x-icon/apple.svg +3 -0
- package/DS1/x-icon/archive-alt.svg +4 -0
- package/DS1/x-icon/archive.svg +4 -0
- package/DS1/x-icon/arrange-archive.svg +1 -0
- package/DS1/x-icon/arrange-check.svg +1 -0
- package/DS1/x-icon/arrange-chevron.svg +1 -0
- package/DS1/x-icon/arrange-connect.svg +1 -0
- package/DS1/x-icon/arrange-draft.svg +1 -0
- package/DS1/x-icon/arrange-dropdown.svg +1 -0
- package/DS1/x-icon/arrange-home.svg +1 -0
- package/DS1/x-icon/arrange-link.svg +1 -0
- package/DS1/x-icon/arrange-menu.svg +1 -0
- package/DS1/x-icon/arrange-more.svg +1 -0
- package/DS1/x-icon/arrange-page.svg +1 -0
- package/DS1/x-icon/arrange-plus.svg +1 -0
- package/DS1/x-icon/arrange-site.svg +1 -0
- package/DS1/x-icon/avatar.svg +4 -0
- package/DS1/x-icon/badge-bands-3d.svg +1 -0
- package/DS1/x-icon/badge-bands.svg +1 -0
- package/DS1/x-icon/badge-blue-fan-3d.svg +1 -0
- package/DS1/x-icon/badge-blue-fan.svg +1 -0
- package/DS1/x-icon/badge-bricks-3d.svg +1 -0
- package/DS1/x-icon/badge-bricks.svg +1 -0
- package/DS1/x-icon/badge-broken-stripes-3d.svg +1 -0
- package/DS1/x-icon/badge-broken-stripes.svg +1 -0
- package/DS1/x-icon/badge-checker-3d.svg +1 -0
- package/DS1/x-icon/badge-checker.svg +1 -0
- package/DS1/x-icon/badge-diamond-3d.svg +1 -0
- package/DS1/x-icon/badge-diamond.svg +1 -0
- package/DS1/x-icon/badge-fan-3d.svg +1 -0
- package/DS1/x-icon/badge-fan-dark-3d.svg +1 -0
- package/DS1/x-icon/badge-fan-dark.svg +1 -0
- package/DS1/x-icon/badge-fan.svg +1 -0
- package/DS1/x-icon/badge-halves-3d.svg +1 -0
- package/DS1/x-icon/badge-halves-green-3d.svg +1 -0
- package/DS1/x-icon/badge-halves-green.svg +1 -0
- package/DS1/x-icon/badge-halves.svg +1 -0
- package/DS1/x-icon/badge-red-3d.svg +1 -0
- package/DS1/x-icon/badge-red-blue-bricks-3d.svg +1 -0
- package/DS1/x-icon/badge-red-blue-bricks.svg +1 -0
- package/DS1/x-icon/badge-red.svg +1 -0
- package/DS1/x-icon/badge-round-fan-3d.svg +1 -0
- package/DS1/x-icon/badge-round-fan.svg +1 -0
- package/DS1/x-icon/badge-shard-3d.svg +1 -0
- package/DS1/x-icon/badge-shard.svg +1 -0
- package/DS1/x-icon/badge-split-circle-3d.svg +1 -0
- package/DS1/x-icon/badge-split-circle.svg +1 -0
- package/DS1/x-icon/badge-tall-bricks-3d.svg +1 -0
- package/DS1/x-icon/badge-tall-bricks.svg +1 -0
- package/DS1/x-icon/badge-weave-3d.svg +1 -0
- package/DS1/x-icon/badge-weave.svg +1 -0
- package/DS1/x-icon/bag.svg +4 -0
- package/DS1/x-icon/block-accordion.svg +1 -0
- package/DS1/x-icon/block-banner.svg +1 -0
- package/DS1/x-icon/block-breadcrumbs.svg +1 -0
- package/DS1/x-icon/block-button.svg +1 -0
- package/DS1/x-icon/block-divider.svg +1 -0
- package/DS1/x-icon/block-forms.svg +1 -0
- package/DS1/x-icon/block-group.svg +1 -0
- package/DS1/x-icon/block-heading.svg +1 -0
- package/DS1/x-icon/block-image.svg +1 -0
- package/DS1/x-icon/block-logo-marquee.svg +1 -0
- package/DS1/x-icon/block-page-progress.svg +1 -0
- package/DS1/x-icon/block-section.svg +1 -0
- package/DS1/x-icon/block-table.svg +1 -0
- package/DS1/x-icon/block-tabs.svg +1 -0
- package/DS1/x-icon/block-text.svg +1 -0
- package/DS1/x-icon/bold.svg +3 -0
- package/DS1/x-icon/bullet.svg +5 -0
- package/DS1/x-icon/calendar.svg +6 -0
- package/DS1/x-icon/callout.svg +5 -0
- package/DS1/x-icon/camera.svg +5 -0
- package/DS1/x-icon/categories.svg +12 -0
- package/DS1/x-icon/check-alt.svg +3 -0
- package/DS1/x-icon/check.svg +3 -0
- package/DS1/x-icon/close.svg +3 -0
- package/DS1/x-icon/code-block.svg +4 -0
- package/DS1/x-icon/code.svg +3 -0
- package/DS1/x-icon/collapse.svg +3 -0
- package/DS1/x-icon/color.svg +4 -0
- package/DS1/x-icon/column.svg +3 -0
- package/DS1/x-icon/comment.svg +3 -0
- package/DS1/x-icon/compose.svg +4 -0
- package/DS1/x-icon/connect.svg +5 -0
- package/DS1/x-icon/content.svg +6 -0
- package/DS1/x-icon/default.svg +4 -0
- package/DS1/x-icon/delete.svg +5 -0
- package/DS1/x-icon/dictate.svg +6 -0
- package/DS1/x-icon/divider.svg +3 -0
- package/DS1/x-icon/down.svg +3 -0
- package/DS1/x-icon/duplicate.svg +8 -0
- package/DS1/x-icon/email.svg +3 -0
- package/DS1/x-icon/equation.svg +3 -0
- package/DS1/x-icon/exercise.svg +3 -0
- package/DS1/x-icon/expand.svg +3 -0
- package/DS1/x-icon/ezo-accordion-chevron.svg +11 -0
- package/DS1/x-icon/ezo-account-close.svg +1 -0
- package/DS1/x-icon/ezo-android-screen-archive.svg +4 -0
- package/DS1/x-icon/ezo-android-screen-calendar.svg +6 -0
- package/DS1/x-icon/ezo-android-screen-camera.svg +5 -0
- package/DS1/x-icon/ezo-android-screen-check.svg +3 -0
- package/DS1/x-icon/ezo-android-screen-compose.svg +4 -0
- package/DS1/x-icon/ezo-android-screen-globe.svg +1 -0
- package/DS1/x-icon/ezo-android-screen-lists.svg +3 -0
- package/DS1/x-icon/ezo-android-screen-shared.svg +5 -0
- package/DS1/x-icon/ezo-android-screen-stats.svg +3 -0
- package/DS1/x-icon/ezo-android-screen-store.svg +4 -0
- package/DS1/x-icon/ezo-android-screen-views.svg +4 -0
- package/DS1/x-icon/ezo-android-screen-work.svg +3 -0
- package/DS1/x-icon/ezo-arrow-cursor.svg +8 -0
- package/DS1/x-icon/ezo-block-accordion.svg +1 -0
- package/DS1/x-icon/ezo-block-divider.svg +1 -0
- package/DS1/x-icon/ezo-block-group.svg +1 -0
- package/DS1/x-icon/ezo-block-image.svg +1 -0
- package/DS1/x-icon/ezo-block-section.svg +1 -0
- package/DS1/x-icon/ezo-block-table.svg +1 -0
- package/DS1/x-icon/ezo-code.svg +14 -0
- package/DS1/x-icon/ezo-down.svg +3 -0
- package/DS1/x-icon/ezo-figma-premium-star.svg +5 -0
- package/DS1/x-icon/ezo-item-button-complete.svg +4 -0
- package/DS1/x-icon/ezo-item-button-header.svg +3 -0
- package/DS1/x-icon/ezo-item-button-open.svg +3 -0
- package/DS1/x-icon/ezo-item-button-reopen.svg +3 -0
- package/DS1/x-icon/ezo-item-button-star.svg +3 -0
- package/DS1/x-icon/ezo-item-button-start.svg +3 -0
- package/DS1/x-icon/ezo-item-button-unheader.svg +7 -0
- package/DS1/x-icon/ezo-item-button-unstar.svg +5 -0
- package/DS1/x-icon/ezo-item-star.svg +5 -0
- package/DS1/x-icon/ezo-left.svg +3 -0
- package/DS1/x-icon/ezo-logo.svg +1 -0
- package/DS1/x-icon/ezo-mic.svg +8 -0
- package/DS1/x-icon/ezo-move-column.svg +14 -0
- package/DS1/x-icon/ezo-move-row.svg +18 -0
- package/DS1/x-icon/ezo-navigation-check.svg +1 -0
- package/DS1/x-icon/ezo-note-back.svg +5 -0
- package/DS1/x-icon/ezo-note-menu-complete.svg +11 -0
- package/DS1/x-icon/ezo-note-menu-delete.svg +4 -0
- package/DS1/x-icon/ezo-note-menu-duplicate.svg +8 -0
- package/DS1/x-icon/ezo-note-menu-note.svg +5 -0
- package/DS1/x-icon/ezo-note-menu-page.svg +3 -0
- package/DS1/x-icon/ezo-note-menu-star.svg +5 -0
- package/DS1/x-icon/ezo-note-menu-start.svg +6 -0
- package/DS1/x-icon/ezo-note-menu-stop.svg +6 -0
- package/DS1/x-icon/ezo-note-more.svg +7 -0
- package/DS1/x-icon/ezo-note-star.svg +5 -0
- package/DS1/x-icon/ezo-password-visibility-see.svg +6 -0
- package/DS1/x-icon/ezo-password-visibility-unsee.svg +9 -0
- package/DS1/x-icon/ezo-pattern-call-to-action.svg +1 -0
- package/DS1/x-icon/ezo-play.svg +5 -0
- package/DS1/x-icon/ezo-premium-star.svg +5 -0
- package/DS1/x-icon/ezo-setting-1xdots.svg +13 -0
- package/DS1/x-icon/ezo-setting-1xgrid.svg +10 -0
- package/DS1/x-icon/ezo-setting-1xlines.svg +7 -0
- package/DS1/x-icon/ezo-setting-2xdots.svg +8 -0
- package/DS1/x-icon/ezo-setting-2xgrid.svg +8 -0
- package/DS1/x-icon/ezo-setting-2xlines.svg +6 -0
- package/DS1/x-icon/ezo-setting-blank.svg +5 -0
- package/DS1/x-icon/ezo-store-chevron.svg +1 -0
- package/DS1/x-icon/ezo-upgrade-close.svg +5 -0
- package/DS1/x-icon/folder.svg +3 -0
- package/DS1/x-icon/form.svg +5 -0
- package/DS1/x-icon/gallery.svg +3 -0
- package/DS1/x-icon/globe.svg +1 -0
- package/DS1/x-icon/google.svg +6 -0
- package/DS1/x-icon/group-alt-2.svg +3 -0
- package/DS1/x-icon/group-alt.svg +7 -0
- package/DS1/x-icon/group.svg +3 -0
- package/DS1/x-icon/h1.svg +3 -0
- package/DS1/x-icon/h2.svg +3 -0
- package/DS1/x-icon/h3.svg +3 -0
- package/DS1/x-icon/handle.svg +8 -0
- package/DS1/x-icon/head.svg +3 -0
- package/DS1/x-icon/help-alt.svg +3 -0
- package/DS1/x-icon/help.svg +5 -0
- package/DS1/x-icon/home.svg +3 -0
- package/DS1/x-icon/icon.svg +4 -0
- package/DS1/x-icon/image.svg +5 -0
- package/DS1/x-icon/in.svg +4 -0
- package/DS1/x-icon/indent.svg +4 -0
- package/DS1/x-icon/italic.svg +3 -0
- package/DS1/x-icon/item.svg +3 -0
- package/DS1/x-icon/left.svg +4 -0
- package/DS1/x-icon/life.svg +8 -0
- package/DS1/x-icon/link.svg +3 -0
- package/DS1/x-icon/list-line.svg +3 -0
- package/DS1/x-icon/lists.svg +3 -0
- package/DS1/x-icon/lock-filled.svg +3 -0
- package/DS1/x-icon/lock.svg +3 -0
- package/DS1/x-icon/logo-marquee.svg +5 -0
- package/DS1/x-icon/loop.svg +6 -0
- package/DS1/x-icon/mention.svg +4 -0
- package/DS1/x-icon/menu.svg +3 -0
- package/DS1/x-icon/mic.svg +5 -0
- package/DS1/x-icon/minimize-alt.svg +4 -0
- package/DS1/x-icon/minimize.svg +4 -0
- package/DS1/x-icon/money.svg +6 -0
- package/DS1/x-icon/more.svg +5 -0
- package/DS1/x-icon/navigation-check.svg +1 -0
- package/DS1/x-icon/note-alt-2.svg +6 -0
- package/DS1/x-icon/note-alt.svg +4 -0
- package/DS1/x-icon/note-lines.svg +6 -0
- package/DS1/x-icon/note.svg +4 -0
- package/DS1/x-icon/notifications.svg +3 -0
- package/DS1/x-icon/numbered.svg +4 -0
- package/DS1/x-icon/open-alt.svg +3 -0
- package/DS1/x-icon/open-source.svg +3 -0
- package/DS1/x-icon/open.svg +3 -0
- package/DS1/x-icon/outdent.svg +4 -0
- package/DS1/x-icon/pad.svg +8 -0
- package/DS1/x-icon/page-18.svg +3 -0
- package/DS1/x-icon/page-alt.svg +3 -0
- package/DS1/x-icon/page-note.svg +1 -0
- package/DS1/x-icon/page.svg +3 -0
- package/DS1/x-icon/panel.svg +4 -0
- package/DS1/x-icon/pattern-call-to-action.svg +1 -0
- package/DS1/x-icon/pattern-card.svg +1 -0
- package/DS1/x-icon/pattern-feature.svg +1 -0
- package/DS1/x-icon/pattern-hero.svg +1 -0
- package/DS1/x-icon/pen.svg +4 -0
- package/DS1/x-icon/play-alt.svg +3 -0
- package/DS1/x-icon/plus.svg +3 -0
- package/DS1/x-icon/product-sources.json +2557 -0
- package/DS1/x-icon/quote.svg +3 -0
- package/DS1/x-icon/redo.svg +3 -0
- package/DS1/x-icon/relationships.svg +3 -0
- package/DS1/x-icon/rewind-30-alt.svg +4 -0
- package/DS1/x-icon/rewind-30.svg +5 -0
- package/DS1/x-icon/rewind.svg +5 -0
- package/DS1/x-icon/right.svg +3 -0
- package/DS1/x-icon/row.svg +3 -0
- package/DS1/x-icon/school.svg +4 -0
- package/DS1/x-icon/sdown.svg +3 -0
- package/DS1/x-icon/search-30.svg +4 -0
- package/DS1/x-icon/search.svg +3 -0
- package/DS1/x-icon/see-30.svg +4 -0
- package/DS1/x-icon/see.svg +4 -0
- package/DS1/x-icon/settings.svg +8 -0
- package/DS1/x-icon/shared.svg +5 -0
- package/DS1/x-icon/slash.svg +3 -0
- package/DS1/x-icon/star-alt-2.svg +3 -0
- package/DS1/x-icon/star-alt.svg +3 -0
- package/DS1/x-icon/star.svg +3 -0
- package/DS1/x-icon/stats.svg +3 -0
- package/DS1/x-icon/status-alt.svg +11 -0
- package/DS1/x-icon/status-filled.svg +26 -0
- package/DS1/x-icon/status.svg +10 -0
- package/DS1/x-icon/store.svg +4 -0
- package/DS1/x-icon/strike.svg +3 -0
- package/DS1/x-icon/sup.svg +3 -0
- package/DS1/x-icon/table.svg +4 -0
- package/DS1/x-icon/template.svg +4 -0
- package/DS1/x-icon/templates.svg +4 -0
- package/DS1/x-icon/text.svg +3 -0
- package/DS1/x-icon/title.svg +3 -0
- package/DS1/x-icon/titlestyle.svg +11 -0
- package/DS1/x-icon/todo.svg +5 -0
- package/DS1/x-icon/toggle.svg +4 -0
- package/DS1/x-icon/triangle.svg +3 -0
- package/DS1/x-icon/underline.svg +3 -0
- package/DS1/x-icon/undo.svg +3 -0
- package/DS1/x-icon/ungroup.svg +4 -0
- package/DS1/x-icon/unhead.svg +7 -0
- package/DS1/x-icon/unicon.svg +6 -0
- package/DS1/x-icon/unlock.svg +3 -0
- package/DS1/x-icon/unmic.svg +6 -0
- package/DS1/x-icon/unsee.svg +5 -0
- package/DS1/x-icon/unstar.svg +5 -0
- package/DS1/x-icon/untitle.svg +7 -0
- package/DS1/x-icon/up-right.svg +3 -0
- package/DS1/x-icon/up.svg +3 -0
- package/DS1/x-icon/views.svg +4 -0
- package/DS1/x-icon/warning.svg +3 -0
- package/DS1/x-icon/work.svg +3 -0
- package/LICENSE +21 -0
- package/README.md +240 -2
- package/dist/0-face/control.d.ts +24 -0
- package/dist/0-face/control.d.ts.map +1 -0
- package/dist/0-face/control.js +117 -0
- package/dist/0-face/define.d.ts +3 -0
- package/dist/0-face/define.d.ts.map +1 -0
- package/dist/0-face/define.js +7 -0
- package/dist/0-face/device.d.ts +71 -0
- package/dist/0-face/device.d.ts.map +1 -0
- package/dist/0-face/device.js +318 -0
- package/dist/0-face/grid-fit.d.ts +3 -0
- package/dist/0-face/grid-fit.d.ts.map +1 -0
- package/dist/0-face/grid-fit.js +73 -0
- package/dist/0-face/grid.d.ts +3 -0
- package/dist/0-face/grid.d.ts.map +1 -0
- package/dist/0-face/grid.js +144 -0
- package/dist/0-face/i18n.d.ts +138 -0
- package/dist/0-face/i18n.d.ts.map +1 -0
- package/dist/0-face/i18n.js +725 -0
- package/dist/0-face/language-routing.d.ts +47 -0
- package/dist/0-face/language-routing.d.ts.map +1 -0
- package/dist/0-face/language-routing.js +91 -0
- package/dist/0-face/language-validator.d.ts +11 -0
- package/dist/0-face/language-validator.d.ts.map +1 -0
- package/dist/0-face/language-validator.js +31 -0
- package/dist/0-face/languages.d.ts +53 -0
- package/dist/0-face/languages.d.ts.map +1 -0
- package/dist/0-face/languages.js +192 -0
- package/dist/0-face/layout-inspector.d.ts +6 -0
- package/dist/0-face/layout-inspector.d.ts.map +1 -0
- package/dist/0-face/layout-inspector.js +197 -0
- package/dist/0-face/preferences.d.ts +20 -0
- package/dist/0-face/preferences.d.ts.map +1 -0
- package/dist/0-face/preferences.js +19 -0
- package/dist/0-face/pricing.d.ts +15 -0
- package/dist/0-face/pricing.d.ts.map +1 -0
- package/dist/0-face/pricing.js +46 -0
- package/dist/0-face/scaling.d.ts +10 -0
- package/dist/0-face/scaling.d.ts.map +1 -0
- package/dist/0-face/scaling.js +14 -0
- package/dist/0-face/shared-words.d.ts +14 -0
- package/dist/0-face/shared-words.d.ts.map +1 -0
- package/dist/0-face/shared-words.js +32 -0
- package/dist/0-face/theme.d.ts +4 -0
- package/dist/0-face/theme.d.ts.map +1 -0
- package/dist/0-face/theme.js +48 -0
- package/dist/0-face/tooltips.d.ts +8 -0
- package/dist/0-face/tooltips.d.ts.map +1 -0
- package/dist/0-face/tooltips.js +90 -0
- package/dist/0-face/translations/da.json +63 -0
- package/dist/0-face/translations/de.json +63 -0
- package/dist/0-face/translations/en.json +63 -0
- package/dist/0-face/translations/es.json +63 -0
- package/dist/0-face/translations/fi.json +63 -0
- package/dist/0-face/translations/fr.json +63 -0
- package/dist/0-face/translations/is.json +56 -0
- package/dist/0-face/translations/it.json +63 -0
- package/dist/0-face/translations/ja.json +63 -0
- package/dist/0-face/translations/ko.json +63 -0
- package/dist/0-face/translations/nb.json +63 -0
- package/dist/0-face/translations/pt-BR.json +63 -0
- package/dist/0-face/translations/pt.json +63 -0
- package/dist/0-face/translations/sv.json +63 -0
- package/dist/0-face/translations/zh.json +63 -0
- package/dist/0-face/translations-format.d.ts +62 -0
- package/dist/0-face/translations-format.d.ts.map +1 -0
- package/dist/0-face/translations-format.js +159 -0
- package/dist/1-root/palette.d.ts +31 -0
- package/dist/1-root/palette.d.ts.map +1 -0
- package/dist/1-root/palette.js +83 -0
- package/dist/2-core/ds-avatar.d.ts +82 -0
- package/dist/2-core/ds-avatar.d.ts.map +1 -0
- package/dist/2-core/ds-avatar.js +102 -0
- package/dist/2-core/ds-badge.d.ts +33 -0
- package/dist/2-core/ds-badge.d.ts.map +1 -0
- package/dist/2-core/ds-badge.js +77 -0
- package/dist/2-core/ds-banner.d.ts +68 -0
- package/dist/2-core/ds-banner.d.ts.map +1 -0
- package/dist/2-core/ds-banner.js +98 -0
- package/dist/2-core/ds-button.d.ts +102 -0
- package/dist/2-core/ds-button.d.ts.map +1 -0
- package/dist/2-core/ds-button.js +133 -0
- package/dist/2-core/ds-card.d.ts +39 -0
- package/dist/2-core/ds-card.d.ts.map +1 -0
- package/dist/2-core/ds-card.js +119 -0
- package/dist/2-core/ds-checkbox.d.ts +13 -0
- package/dist/2-core/ds-checkbox.d.ts.map +1 -0
- package/dist/2-core/ds-checkbox.js +11 -0
- package/dist/2-core/ds-color.d.ts +15 -0
- package/dist/2-core/ds-color.d.ts.map +1 -0
- package/dist/2-core/ds-color.js +30 -0
- package/dist/2-core/ds-composer.d.ts +69 -0
- package/dist/2-core/ds-composer.d.ts.map +1 -0
- package/dist/2-core/ds-composer.js +183 -0
- package/dist/2-core/ds-cycle.d.ts +85 -0
- package/dist/2-core/ds-cycle.d.ts.map +1 -0
- package/dist/2-core/ds-cycle.js +497 -0
- package/dist/2-core/ds-date.d.ts +16 -0
- package/dist/2-core/ds-date.d.ts.map +1 -0
- package/dist/2-core/ds-date.js +15 -0
- package/dist/2-core/ds-file-picker.d.ts +65 -0
- package/dist/2-core/ds-file-picker.d.ts.map +1 -0
- package/dist/2-core/ds-file-picker.js +80 -0
- package/dist/2-core/ds-gap.d.ts +27 -0
- package/dist/2-core/ds-gap.d.ts.map +1 -0
- package/dist/2-core/ds-gap.js +22 -0
- package/dist/2-core/ds-icon.d.ts +58 -0
- package/dist/2-core/ds-icon.d.ts.map +1 -0
- package/dist/2-core/ds-icon.js +128 -0
- package/dist/2-core/ds-input.d.ts +97 -0
- package/dist/2-core/ds-input.d.ts.map +1 -0
- package/dist/2-core/ds-input.js +429 -0
- package/dist/2-core/ds-language.d.ts +75 -0
- package/dist/2-core/ds-language.d.ts.map +1 -0
- package/dist/2-core/ds-language.js +74 -0
- package/dist/2-core/ds-pagedots.d.ts +32 -0
- package/dist/2-core/ds-pagedots.d.ts.map +1 -0
- package/dist/2-core/ds-pagedots.js +36 -0
- package/dist/2-core/ds-radio.d.ts +35 -0
- package/dist/2-core/ds-radio.d.ts.map +1 -0
- package/dist/2-core/ds-radio.js +19 -0
- package/dist/2-core/ds-select.d.ts +30 -0
- package/dist/2-core/ds-select.d.ts.map +1 -0
- package/dist/2-core/ds-select.js +45 -0
- package/dist/2-core/ds-split.d.ts +75 -0
- package/dist/2-core/ds-split.d.ts.map +1 -0
- package/dist/2-core/ds-split.js +101 -0
- package/dist/2-core/ds-swatch.d.ts +24 -0
- package/dist/2-core/ds-swatch.d.ts.map +1 -0
- package/dist/2-core/ds-swatch.js +16 -0
- package/dist/2-core/ds-switch.d.ts +13 -0
- package/dist/2-core/ds-switch.d.ts.map +1 -0
- package/dist/2-core/ds-switch.js +10 -0
- package/dist/2-core/ds-text.d.ts +75 -0
- package/dist/2-core/ds-text.d.ts.map +1 -0
- package/dist/2-core/ds-text.js +142 -0
- package/dist/2-core/ds-textarea.d.ts +46 -0
- package/dist/2-core/ds-textarea.d.ts.map +1 -0
- package/dist/2-core/ds-textarea.js +121 -0
- package/dist/2-core/ds-token.d.ts +48 -0
- package/dist/2-core/ds-token.d.ts.map +1 -0
- package/dist/2-core/ds-token.js +44 -0
- package/dist/2-core/ds-tooltip.d.ts +48 -0
- package/dist/2-core/ds-tooltip.d.ts.map +1 -0
- package/dist/2-core/ds-tooltip.js +99 -0
- package/dist/2-core/generated/ds-icon-map.d.ts +295 -0
- package/dist/2-core/generated/ds-icon-map.d.ts.map +1 -0
- package/dist/2-core/generated/ds-icon-map.js +579 -0
- package/dist/2-core/generated/icons-extra.d.ts +2 -0
- package/dist/2-core/generated/icons-extra.d.ts.map +1 -0
- package/dist/2-core/generated/icons-extra.js +243 -0
- package/dist/2-core/generated/icons-immediate.d.ts +3 -0
- package/dist/2-core/generated/icons-immediate.d.ts.map +1 -0
- package/dist/2-core/generated/icons-immediate.js +49 -0
- package/dist/3-unit/context-trigger.d.ts +22 -0
- package/dist/3-unit/context-trigger.d.ts.map +1 -0
- package/dist/3-unit/context-trigger.js +130 -0
- package/dist/3-unit/ds-accordion.d.ts +55 -0
- package/dist/3-unit/ds-accordion.d.ts.map +1 -0
- package/dist/3-unit/ds-accordion.js +105 -0
- package/dist/3-unit/ds-avatar-group.d.ts +40 -0
- package/dist/3-unit/ds-avatar-group.d.ts.map +1 -0
- package/dist/3-unit/ds-avatar-group.js +84 -0
- package/dist/3-unit/ds-form.d.ts +70 -0
- package/dist/3-unit/ds-form.d.ts.map +1 -0
- package/dist/3-unit/ds-form.js +232 -0
- package/dist/3-unit/ds-list.d.ts +25 -0
- package/dist/3-unit/ds-list.d.ts.map +1 -0
- package/dist/3-unit/ds-list.js +25 -0
- package/dist/3-unit/ds-menu.d.ts +162 -0
- package/dist/3-unit/ds-menu.d.ts.map +1 -0
- package/dist/3-unit/ds-menu.js +607 -0
- package/dist/3-unit/ds-row.d.ts +43 -0
- package/dist/3-unit/ds-row.d.ts.map +1 -0
- package/dist/3-unit/ds-row.js +32 -0
- package/dist/3-unit/ds-table.d.ts +33 -0
- package/dist/3-unit/ds-table.d.ts.map +1 -0
- package/dist/3-unit/ds-table.js +43 -0
- package/dist/3-unit/ds-tabs.d.ts +50 -0
- package/dist/3-unit/ds-tabs.d.ts.map +1 -0
- package/dist/3-unit/ds-tabs.js +64 -0
- package/dist/3-unit/ds-token-field.d.ts +64 -0
- package/dist/3-unit/ds-token-field.d.ts.map +1 -0
- package/dist/3-unit/ds-token-field.js +184 -0
- package/dist/4-page/ds-container.d.ts +17 -0
- package/dist/4-page/ds-container.d.ts.map +1 -0
- package/dist/4-page/ds-container.js +11 -0
- package/dist/4-page/ds-dialog.d.ts +105 -0
- package/dist/4-page/ds-dialog.d.ts.map +1 -0
- package/dist/4-page/ds-dialog.js +358 -0
- package/dist/4-page/ds-grid.d.ts +28 -0
- package/dist/4-page/ds-grid.d.ts.map +1 -0
- package/dist/4-page/ds-grid.js +49 -0
- package/dist/4-page/ds-layout.d.ts +31 -0
- package/dist/4-page/ds-layout.d.ts.map +1 -0
- package/dist/4-page/ds-layout.js +930 -0
- package/dist/4-page/ds-panel.d.ts +26 -0
- package/dist/4-page/ds-panel.d.ts.map +1 -0
- package/dist/4-page/ds-panel.js +29 -0
- package/dist/4-page/email.d.ts +49 -0
- package/dist/4-page/email.d.ts.map +1 -0
- package/dist/4-page/email.js +134 -0
- package/dist/components.d.ts +14 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +13 -0
- package/dist/design-system-1.bundle.js +9115 -0
- package/dist/design-system-1.bundle.js.map +1 -0
- package/dist/design-system-1.bundle.min.js +6879 -0
- package/dist/design-system-1.bundle.min.js.map +1 -0
- package/dist/design-system-1.css +2 -0
- package/dist/icons-extra-BoAACA4X.js +944 -0
- package/dist/icons-extra-BoAACA4X.js.map +1 -0
- package/dist/icons-extra-DlxTo_Y4.js +247 -0
- package/dist/icons-extra-DlxTo_Y4.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/react/accordion.d.ts +21 -0
- package/dist/react/accordion.d.ts.map +1 -0
- package/dist/react/accordion.js +30 -0
- package/dist/react/avatar-group.d.ts +6 -0
- package/dist/react/avatar-group.d.ts.map +1 -0
- package/dist/react/avatar-group.js +5 -0
- package/dist/react/avatar.d.ts +13 -0
- package/dist/react/avatar.d.ts.map +1 -0
- package/dist/react/avatar.js +18 -0
- package/dist/react/badge.d.ts +11 -0
- package/dist/react/badge.d.ts.map +1 -0
- package/dist/react/badge.js +4 -0
- package/dist/react/button.d.ts +13 -0
- package/dist/react/button.d.ts.map +1 -0
- package/dist/react/button.js +37 -0
- package/dist/react/choice.d.ts +43 -0
- package/dist/react/choice.d.ts.map +1 -0
- package/dist/react/choice.js +32 -0
- package/dist/react/composer.d.ts +17 -0
- package/dist/react/composer.d.ts.map +1 -0
- package/dist/react/composer.js +8 -0
- package/dist/react/context-menu.d.ts +657 -0
- package/dist/react/context-menu.d.ts.map +1 -0
- package/dist/react/context-menu.js +133 -0
- package/dist/react/dialog.d.ts +1173 -0
- package/dist/react/dialog.d.ts.map +1 -0
- package/dist/react/dialog.js +79 -0
- package/dist/react/file-picker.d.ts +29 -0
- package/dist/react/file-picker.d.ts.map +1 -0
- package/dist/react/file-picker.js +17 -0
- package/dist/react/input.d.ts +35 -0
- package/dist/react/input.d.ts.map +1 -0
- package/dist/react/input.js +128 -0
- package/dist/react/menu.d.ts +37 -0
- package/dist/react/menu.d.ts.map +1 -0
- package/dist/react/menu.js +31 -0
- package/dist/react/split.d.ts +15 -0
- package/dist/react/split.d.ts.map +1 -0
- package/dist/react/split.js +32 -0
- package/dist/react/token-field.d.ts +36 -0
- package/dist/react/token-field.d.ts.map +1 -0
- package/dist/react/token-field.js +33 -0
- package/dist/shared-words-Cg6Phtx0.js +915 -0
- package/dist/shared-words-Cg6Phtx0.js.map +1 -0
- package/dist/shared-words-Ddz0yUEF.js +933 -0
- package/dist/shared-words-Ddz0yUEF.js.map +1 -0
- package/package.json +149 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { LitElement, type PropertyDeclarations } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The element is the control.
|
|
5
|
+
*
|
|
6
|
+
* A host control carries the role,
|
|
7
|
+
* takes focus, answers Enter and Space, and reports itself disabled. React's
|
|
8
|
+
* handlers, the accessibility tree and Testing Library then all meet one node
|
|
9
|
+
* in the light DOM, and there is no second interactive element nested inside
|
|
10
|
+
* the first.
|
|
11
|
+
*
|
|
12
|
+
* The role defaults to `button`; an element that is a tab, an option or a menu
|
|
13
|
+
* item says so with its own `role` attribute, which is left as written.
|
|
14
|
+
*/
|
|
15
|
+
export abstract class Control extends LitElement {
|
|
16
|
+
static properties: PropertyDeclarations = {
|
|
17
|
+
// The accessor is our own: disabled changes what the element does and
|
|
18
|
+
// what assistive technology hears, so it reaches the DOM at once rather
|
|
19
|
+
// than on Lit's next update.
|
|
20
|
+
disabled: { type: Boolean, reflect: true, noAccessor: true },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
#disabled = false;
|
|
24
|
+
#enabledTabIndex: string | null | undefined;
|
|
25
|
+
protected get hostControl(): boolean { return true; }
|
|
26
|
+
protected syncControl(): void { if (this.isConnected) this.#syncDisabled(); }
|
|
27
|
+
|
|
28
|
+
get disabled(): boolean {
|
|
29
|
+
return this.#disabled;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
set disabled(value: boolean) {
|
|
33
|
+
const old = this.#disabled;
|
|
34
|
+
this.#disabled = Boolean(value);
|
|
35
|
+
// An element may not gain attributes before it is in a document; React
|
|
36
|
+
// sets properties first, and connectedCallback catches up.
|
|
37
|
+
if (this.isConnected) this.#syncDisabled();
|
|
38
|
+
this.requestUpdate("disabled", old);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this.addEventListener("keydown", this.#onKeyDown);
|
|
44
|
+
this.addEventListener("keyup", this.#onKeyUp);
|
|
45
|
+
// Registered on the element itself so it runs before the click reaches
|
|
46
|
+
// React's root listener.
|
|
47
|
+
this.addEventListener("click", this.#onClick, { capture: true });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
connectedCallback(): void {
|
|
51
|
+
super.connectedCallback();
|
|
52
|
+
if (this.hostControl && !this.hasAttribute("role")) this.setAttribute("role", "button");
|
|
53
|
+
this.#syncDisabled();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#syncDisabled(): void {
|
|
57
|
+
this.toggleAttribute("disabled", this.#disabled);
|
|
58
|
+
if (!this.hostControl) return;
|
|
59
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "button");
|
|
60
|
+
if (this.#disabled) {
|
|
61
|
+
if (this.#enabledTabIndex === undefined) this.#enabledTabIndex = this.getAttribute("tabindex");
|
|
62
|
+
this.setAttribute("aria-disabled", "true");
|
|
63
|
+
this.setAttribute("tabindex", "-1");
|
|
64
|
+
} else {
|
|
65
|
+
this.removeAttribute("aria-disabled");
|
|
66
|
+
if (this.#enabledTabIndex !== undefined) {
|
|
67
|
+
if (this.#enabledTabIndex === null) this.setAttribute("tabindex", "0");
|
|
68
|
+
else this.setAttribute("tabindex", this.#enabledTabIndex);
|
|
69
|
+
this.#enabledTabIndex = undefined;
|
|
70
|
+
} else if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#onClick = (event: Event): void => {
|
|
75
|
+
if (!this.disabled) return;
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
event.stopImmediatePropagation();
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
#onKeyDown = (event: KeyboardEvent): void => {
|
|
81
|
+
if (!this.hostControl || this.disabled || event.target !== this) return;
|
|
82
|
+
if (event.key === "Enter") {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
this.click();
|
|
85
|
+
} else if (event.key === " ") {
|
|
86
|
+
// Space clicks on release, as a native button does; stop the page from
|
|
87
|
+
// scrolling in the meantime.
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
#onKeyUp = (event: KeyboardEvent): void => {
|
|
93
|
+
if (!this.hostControl || this.disabled || event.target !== this) return;
|
|
94
|
+
if (event.key === " ") {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
this.click();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Register a shared element once; a fresh page picks up changes during HMR. */
|
|
2
|
+
export function define(name: string, element: CustomElementConstructor): void {
|
|
3
|
+
if (typeof customElements === "undefined") return;
|
|
4
|
+
if (!customElements.get(name)) customElements.define(name, element);
|
|
5
|
+
}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
// device.ts
|
|
2
|
+
// Device detection, context utilities, and responsive scaling
|
|
3
|
+
|
|
4
|
+
import { signal } from "@lit-labs/signals";
|
|
5
|
+
import { calculateScalingFactor as calculateScale, defaultScalingConfig, type ScalingConfig } from "./scaling";
|
|
6
|
+
export type { ScalingConfig, ScalingMode } from "./scaling";
|
|
7
|
+
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Types
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
export type DeviceType = "mobile" | "tablet" | "desktop";
|
|
13
|
+
|
|
14
|
+
export interface DeviceInfo {
|
|
15
|
+
isMobile: boolean;
|
|
16
|
+
isTablet: boolean;
|
|
17
|
+
isDesktop: boolean;
|
|
18
|
+
isTouchCapable: boolean;
|
|
19
|
+
deviceType: DeviceType;
|
|
20
|
+
userAgent: string;
|
|
21
|
+
screenWidth: number;
|
|
22
|
+
screenHeight: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Reactive scaling factor signal */
|
|
26
|
+
export const scalingFactor = signal<number>(1);
|
|
27
|
+
|
|
28
|
+
/** Current scaling configuration */
|
|
29
|
+
export const scalingConfig = signal<ScalingConfig>(defaultScalingConfig);
|
|
30
|
+
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Device Detection
|
|
33
|
+
// ============================================================================
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Comprehensive mobile device detection
|
|
37
|
+
* Combines user agent detection, touch capability, and viewport size
|
|
38
|
+
*/
|
|
39
|
+
export function detectMobileDevice(): boolean {
|
|
40
|
+
if (typeof navigator === "undefined" || typeof window === "undefined") {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const nav = navigator as any;
|
|
45
|
+
const win = window as any;
|
|
46
|
+
const ua: string =
|
|
47
|
+
(nav && (nav.userAgent || nav.vendor)) || (win && win.opera) || "";
|
|
48
|
+
|
|
49
|
+
// User agent based detection
|
|
50
|
+
const uaMatchesMobile =
|
|
51
|
+
/Mobile|Android|iP(ad|hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)|Windows Phone|Phone|Tablet/i.test(
|
|
52
|
+
ua
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// Touch capability detection
|
|
56
|
+
const touchPoints = (nav && nav.maxTouchPoints) || 0;
|
|
57
|
+
const isTouchCapable = touchPoints > 1;
|
|
58
|
+
|
|
59
|
+
// Viewport detection
|
|
60
|
+
const narrowViewport = win
|
|
61
|
+
? Math.min(win.innerWidth || 0, win.innerHeight || 0) <= 820
|
|
62
|
+
: false;
|
|
63
|
+
|
|
64
|
+
return uaMatchesMobile || (isTouchCapable && narrowViewport);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get detailed device information
|
|
69
|
+
*/
|
|
70
|
+
export function getDeviceInfo(): DeviceInfo {
|
|
71
|
+
const isMobile = detectMobileDevice();
|
|
72
|
+
const nav = navigator as any;
|
|
73
|
+
const win = window as any;
|
|
74
|
+
|
|
75
|
+
const touchPoints = (nav && nav.maxTouchPoints) || 0;
|
|
76
|
+
const isTouchCapable = touchPoints > 1;
|
|
77
|
+
|
|
78
|
+
// Use clientWidth instead of innerWidth to exclude scrollbars
|
|
79
|
+
const screenWidth =
|
|
80
|
+
typeof document !== "undefined"
|
|
81
|
+
? document.documentElement.clientWidth
|
|
82
|
+
: win?.innerWidth || 0;
|
|
83
|
+
const screenHeight =
|
|
84
|
+
typeof document !== "undefined"
|
|
85
|
+
? document.documentElement.clientHeight
|
|
86
|
+
: win?.innerHeight || 0;
|
|
87
|
+
const isTablet = isMobile && Math.min(screenWidth, screenHeight) >= 600;
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
isMobile,
|
|
91
|
+
isTablet,
|
|
92
|
+
isDesktop: !isMobile,
|
|
93
|
+
isTouchCapable,
|
|
94
|
+
deviceType: isMobile ? (isTablet ? "tablet" : "mobile") : "desktop",
|
|
95
|
+
userAgent: (nav && (nav.userAgent || nav.vendor)) || "",
|
|
96
|
+
screenWidth,
|
|
97
|
+
screenHeight,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ============================================================================
|
|
102
|
+
// Scaling
|
|
103
|
+
// ============================================================================
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Calculate the scaling factor based on viewport width
|
|
107
|
+
* @param viewportWidth - Current viewport width in pixels
|
|
108
|
+
* @param config - Scaling configuration
|
|
109
|
+
* @returns The calculated scaling factor
|
|
110
|
+
*/
|
|
111
|
+
export function calculateScalingFactor(
|
|
112
|
+
viewportWidth: number,
|
|
113
|
+
config: ScalingConfig = scalingConfig.get()
|
|
114
|
+
): number {
|
|
115
|
+
return calculateScale(viewportWidth, config);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Set the scaling configuration
|
|
120
|
+
* @param config - Partial scaling configuration to apply
|
|
121
|
+
*/
|
|
122
|
+
export function setScalingConfig(config: Partial<ScalingConfig>): void {
|
|
123
|
+
const currentConfig = scalingConfig.get();
|
|
124
|
+
const newConfig = { ...currentConfig, ...config };
|
|
125
|
+
scalingConfig.set(newConfig);
|
|
126
|
+
|
|
127
|
+
// Recalculate scaling factor if in browser
|
|
128
|
+
if (typeof window !== "undefined") {
|
|
129
|
+
updateScalingFactor();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Update the scaling factor based on current viewport
|
|
135
|
+
* Desktop always uses factor 1; mobile uses computed factor
|
|
136
|
+
*/
|
|
137
|
+
export function updateScalingFactor(): void {
|
|
138
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const isMobile = detectMobileDevice();
|
|
143
|
+
|
|
144
|
+
// Desktop: always use factor 1
|
|
145
|
+
if (!isMobile) {
|
|
146
|
+
const factor = 1;
|
|
147
|
+
scalingFactor.set(factor);
|
|
148
|
+
document.documentElement.style.setProperty("--sf", factor.toString());
|
|
149
|
+
window.dispatchEvent(
|
|
150
|
+
new CustomEvent("scaling-changed", {
|
|
151
|
+
detail: { scalingFactor: factor, config: scalingConfig.get() },
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Mobile: compute scaling based on viewport
|
|
158
|
+
const viewportWidth = document.documentElement.clientWidth;
|
|
159
|
+
const config = scalingConfig.get();
|
|
160
|
+
const newFactor = calculateScalingFactor(viewportWidth, config);
|
|
161
|
+
|
|
162
|
+
scalingFactor.set(newFactor);
|
|
163
|
+
document.documentElement.style.setProperty("--sf", newFactor.toString());
|
|
164
|
+
|
|
165
|
+
window.dispatchEvent(
|
|
166
|
+
new CustomEvent("scaling-changed", {
|
|
167
|
+
detail: { scalingFactor: newFactor, config },
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get the current scaling factor
|
|
174
|
+
* @returns The current scaling factor
|
|
175
|
+
*/
|
|
176
|
+
export function getScalingFactor(): number {
|
|
177
|
+
return scalingFactor.get();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Convert a design pixel value to scaled pixels
|
|
182
|
+
* @param designPx - The design pixel value (based on 280px width)
|
|
183
|
+
* @returns The scaled pixel value
|
|
184
|
+
*/
|
|
185
|
+
export function scale(designPx: number): number {
|
|
186
|
+
return designPx * scalingFactor.get();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Convert a scaled pixel value back to design pixels
|
|
191
|
+
* @param scaledPx - The scaled pixel value
|
|
192
|
+
* @returns The design pixel value
|
|
193
|
+
*/
|
|
194
|
+
export function unscale(scaledPx: number): number {
|
|
195
|
+
const factor = scalingFactor.get();
|
|
196
|
+
return factor === 0 ? scaledPx : scaledPx / factor;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// ============================================================================
|
|
200
|
+
// Unified Initialization
|
|
201
|
+
// ============================================================================
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Initialize device detection and scaling
|
|
205
|
+
* Sets CSS classes (.mobile/.desktop) and --sf custom property
|
|
206
|
+
*/
|
|
207
|
+
export function initDeviceDetection(): DeviceInfo {
|
|
208
|
+
const deviceInfo = getDeviceInfo();
|
|
209
|
+
|
|
210
|
+
if (typeof document === "undefined") {
|
|
211
|
+
return deviceInfo;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Set device class on html element
|
|
215
|
+
if (deviceInfo.isMobile) {
|
|
216
|
+
document.documentElement.classList.add("mobile");
|
|
217
|
+
document.documentElement.classList.remove("desktop");
|
|
218
|
+
} else {
|
|
219
|
+
document.documentElement.classList.add("desktop");
|
|
220
|
+
document.documentElement.classList.remove("mobile");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Update scaling factor (handles --sf CSS property)
|
|
224
|
+
updateScalingFactor();
|
|
225
|
+
|
|
226
|
+
// Log device info
|
|
227
|
+
const factor = scalingFactor.get();
|
|
228
|
+
if (deviceInfo.isMobile) {
|
|
229
|
+
console.log(
|
|
230
|
+
`[Design system 1] Mobile device detected - ${deviceInfo.deviceType} (${deviceInfo.screenWidth}x${deviceInfo.screenHeight}), scaling factor: ${factor.toFixed(2)}`
|
|
231
|
+
);
|
|
232
|
+
} else {
|
|
233
|
+
console.log(
|
|
234
|
+
`[Design system 1] Desktop device detected (${deviceInfo.screenWidth}x${deviceInfo.screenHeight})`
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Log additional details in development mode
|
|
239
|
+
if (typeof window !== "undefined" && (window as any).DS_ONE_DEBUG) {
|
|
240
|
+
console.log("[Design system 1] Device Info:", {
|
|
241
|
+
type: deviceInfo.deviceType,
|
|
242
|
+
isMobile: deviceInfo.isMobile,
|
|
243
|
+
isTablet: deviceInfo.isTablet,
|
|
244
|
+
isDesktop: deviceInfo.isDesktop,
|
|
245
|
+
isTouchCapable: deviceInfo.isTouchCapable,
|
|
246
|
+
viewport: `${deviceInfo.screenWidth}x${deviceInfo.screenHeight}`,
|
|
247
|
+
scalingFactor: factor,
|
|
248
|
+
userAgent: deviceInfo.userAgent,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return deviceInfo;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Auto-initialize when module loads
|
|
256
|
+
if (typeof window !== "undefined") {
|
|
257
|
+
// Wait for DOM to be ready
|
|
258
|
+
if (document.readyState === "loading") {
|
|
259
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
260
|
+
initDeviceDetection();
|
|
261
|
+
});
|
|
262
|
+
} else {
|
|
263
|
+
// DOM is already ready
|
|
264
|
+
initDeviceDetection();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Single debounced resize handler for both device detection + scaling
|
|
268
|
+
let resizeTimeout: ReturnType<typeof setTimeout>;
|
|
269
|
+
window.addEventListener("resize", () => {
|
|
270
|
+
clearTimeout(resizeTimeout);
|
|
271
|
+
resizeTimeout = setTimeout(() => {
|
|
272
|
+
initDeviceDetection();
|
|
273
|
+
}, 100);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// Also handle orientation change
|
|
277
|
+
window.addEventListener("orientationchange", () => {
|
|
278
|
+
setTimeout(initDeviceDetection, 100);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// ============================================================================
|
|
283
|
+
// App-like Behavior
|
|
284
|
+
// ============================================================================
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Disable double-tap to zoom in the browser (app-like behavior)
|
|
288
|
+
* Prevents all zoom gestures including double-tap and pinch-to-zoom
|
|
289
|
+
*/
|
|
290
|
+
export function applike(): void {
|
|
291
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Set viewport meta tag to prevent zoom - this is the most important step
|
|
296
|
+
let viewport = document.querySelector('meta[name="viewport"]');
|
|
297
|
+
if (!viewport) {
|
|
298
|
+
viewport = document.createElement("meta");
|
|
299
|
+
viewport.setAttribute("name", "viewport");
|
|
300
|
+
document.head.appendChild(viewport);
|
|
301
|
+
}
|
|
302
|
+
viewport.setAttribute(
|
|
303
|
+
"content",
|
|
304
|
+
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
// Apply touch-action: pan-x pan-y globally to prevent zoom but allow panning
|
|
308
|
+
const style = document.createElement("style");
|
|
309
|
+
style.id = "ds-one-applike-style";
|
|
310
|
+
style.textContent = `
|
|
311
|
+
* {
|
|
312
|
+
touch-action: pan-x pan-y !important;
|
|
313
|
+
-ms-touch-action: pan-x pan-y !important;
|
|
314
|
+
}
|
|
315
|
+
html, body {
|
|
316
|
+
touch-action: pan-x pan-y !important;
|
|
317
|
+
-ms-touch-action: pan-x pan-y !important;
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
320
|
+
// Remove existing style if present
|
|
321
|
+
const existingStyle = document.getElementById("ds-one-applike-style");
|
|
322
|
+
if (existingStyle) {
|
|
323
|
+
existingStyle.remove();
|
|
324
|
+
}
|
|
325
|
+
document.head.appendChild(style);
|
|
326
|
+
|
|
327
|
+
// Track touch events to prevent double-tap zoom
|
|
328
|
+
let lastTouchEnd = 0;
|
|
329
|
+
let touchStartTime = 0;
|
|
330
|
+
|
|
331
|
+
const preventZoom = (event: TouchEvent | WheelEvent | Event) => {
|
|
332
|
+
// Prevent pinch zoom (two fingers)
|
|
333
|
+
if (event instanceof TouchEvent) {
|
|
334
|
+
if (event.touches.length > 1) {
|
|
335
|
+
event.preventDefault();
|
|
336
|
+
event.stopPropagation();
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const now = Date.now();
|
|
341
|
+
|
|
342
|
+
if (event.type === "touchstart") {
|
|
343
|
+
// If touchstart happens within 300ms of last touchend, it's likely a double-tap
|
|
344
|
+
if (now - lastTouchEnd < 300) {
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
event.stopPropagation();
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
touchStartTime = now;
|
|
350
|
+
} else if (event.type === "touchend") {
|
|
351
|
+
const touchDuration = now - touchStartTime;
|
|
352
|
+
// If this is a quick tap (< 300ms) and happened soon after previous touchend, prevent it
|
|
353
|
+
if (touchDuration < 300 && now - lastTouchEnd < 300) {
|
|
354
|
+
event.preventDefault();
|
|
355
|
+
event.stopPropagation();
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
lastTouchEnd = now;
|
|
359
|
+
} else if (event.type === "touchmove") {
|
|
360
|
+
// Prevent any touchmove that might trigger zoom
|
|
361
|
+
if (event.touches.length > 1) {
|
|
362
|
+
event.preventDefault();
|
|
363
|
+
event.stopPropagation();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Prevent wheel zoom with ctrl/cmd key (common on trackpads)
|
|
370
|
+
if (event instanceof WheelEvent && (event.ctrlKey || event.metaKey)) {
|
|
371
|
+
event.preventDefault();
|
|
372
|
+
event.stopPropagation();
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
// Use capture phase to catch events earlier
|
|
378
|
+
const options = { passive: false, capture: true };
|
|
379
|
+
|
|
380
|
+
// Prevent all zoom gestures - use capture phase
|
|
381
|
+
document.addEventListener("touchstart", preventZoom, options);
|
|
382
|
+
document.addEventListener("touchmove", preventZoom, options);
|
|
383
|
+
document.addEventListener("touchend", preventZoom, options);
|
|
384
|
+
document.addEventListener("touchcancel", preventZoom, options);
|
|
385
|
+
|
|
386
|
+
// Prevent wheel zoom
|
|
387
|
+
document.addEventListener("wheel", preventZoom, options);
|
|
388
|
+
|
|
389
|
+
// Prevent gesture events (iOS Safari) - use capture phase
|
|
390
|
+
document.addEventListener(
|
|
391
|
+
"gesturestart",
|
|
392
|
+
(e) => {
|
|
393
|
+
e.preventDefault();
|
|
394
|
+
e.stopPropagation();
|
|
395
|
+
},
|
|
396
|
+
options
|
|
397
|
+
);
|
|
398
|
+
document.addEventListener(
|
|
399
|
+
"gesturechange",
|
|
400
|
+
(e) => {
|
|
401
|
+
e.preventDefault();
|
|
402
|
+
e.stopPropagation();
|
|
403
|
+
},
|
|
404
|
+
options
|
|
405
|
+
);
|
|
406
|
+
document.addEventListener(
|
|
407
|
+
"gestureend",
|
|
408
|
+
(e) => {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
e.stopPropagation();
|
|
411
|
+
},
|
|
412
|
+
options
|
|
413
|
+
);
|
|
414
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Round named area heights up to the shared unit without clipping their content. */
|
|
2
|
+
export function initGridFit(): void {
|
|
3
|
+
const scopes = Array.from(document.querySelectorAll<HTMLElement>('[data-ds-grid-fit]'));
|
|
4
|
+
if (!scopes.length || document.documentElement.hasAttribute('data-ds-grid-fit-ready')) return;
|
|
5
|
+
document.documentElement.setAttribute('data-ds-grid-fit-ready', '');
|
|
6
|
+
|
|
7
|
+
const measure = document.createElement('div');
|
|
8
|
+
measure.setAttribute('aria-hidden', 'true');
|
|
9
|
+
measure.style.cssText = 'position:fixed;left:0;top:0;width:0;height:var(--ds-grid-unit,20px);visibility:hidden;pointer-events:none;contain:strict';
|
|
10
|
+
document.body.append(measure);
|
|
11
|
+
const originalMinimums = new Map<HTMLElement, string>();
|
|
12
|
+
const observed = new Set<HTMLElement>();
|
|
13
|
+
let frame = 0;
|
|
14
|
+
|
|
15
|
+
const fit = () => {
|
|
16
|
+
frame = 0;
|
|
17
|
+
const unit = measure.getBoundingClientRect().height;
|
|
18
|
+
if (unit <= 0) return;
|
|
19
|
+
const elements = scopes.flatMap((scope) => Array.from(scope.querySelectorAll<HTMLElement>('[data-ds-area]')));
|
|
20
|
+
const current = new Set(elements);
|
|
21
|
+
for (const [element, minimum] of originalMinimums) {
|
|
22
|
+
if (!current.has(element)) {
|
|
23
|
+
element.style.minHeight = minimum;
|
|
24
|
+
originalMinimums.delete(element);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Restore natural heights first, allowing containers to shrink after a
|
|
28
|
+
// translation, font, or viewport change as well as grow.
|
|
29
|
+
elements.forEach((element) => {
|
|
30
|
+
if (!originalMinimums.has(element)) originalMinimums.set(element, element.style.minHeight);
|
|
31
|
+
element.style.minHeight = originalMinimums.get(element)!;
|
|
32
|
+
});
|
|
33
|
+
// Fit children before their containing areas so nested measurements agree.
|
|
34
|
+
[...elements].reverse().forEach((element) => {
|
|
35
|
+
const height = element.getBoundingClientRect().height;
|
|
36
|
+
if (!height || getComputedStyle(element).display === 'none') return;
|
|
37
|
+
const rounded = Math.max(1, Math.ceil((height - 0.02) / unit)) * unit;
|
|
38
|
+
element.style.minHeight = `${rounded}px`;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const targets = new Set<HTMLElement>([measure, ...scopes, ...elements]);
|
|
42
|
+
elements.forEach((element) => {
|
|
43
|
+
for (const child of element.children) if (child instanceof HTMLElement) targets.add(child);
|
|
44
|
+
});
|
|
45
|
+
for (const element of observed) {
|
|
46
|
+
if (!targets.has(element)) { resize.unobserve(element); observed.delete(element); }
|
|
47
|
+
}
|
|
48
|
+
for (const element of targets) {
|
|
49
|
+
if (!observed.has(element)) { resize.observe(element); observed.add(element); }
|
|
50
|
+
}
|
|
51
|
+
window.dispatchEvent(new CustomEvent('design-system-layout-sized'));
|
|
52
|
+
};
|
|
53
|
+
const schedule = () => { if (!frame) frame = requestAnimationFrame(fit); };
|
|
54
|
+
const resize = new ResizeObserver(schedule);
|
|
55
|
+
const changes = new MutationObserver(schedule);
|
|
56
|
+
scopes.forEach((scope) => changes.observe(scope, { subtree: true, childList: true, characterData: true }));
|
|
57
|
+
window.addEventListener('resize', schedule);
|
|
58
|
+
window.addEventListener('scaling-changed', schedule);
|
|
59
|
+
window.addEventListener('language-changed', schedule);
|
|
60
|
+
document.fonts.addEventListener('loadingdone', schedule);
|
|
61
|
+
void document.fonts.ready.then(schedule);
|
|
62
|
+
fit();
|
|
63
|
+
}
|