@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,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one translations file format every 0001 product writes its words in.
|
|
3
|
+
*
|
|
4
|
+
* { "<language>": { "<key>": "<text>" } }
|
|
5
|
+
*
|
|
6
|
+
* - `<language>` is a code from the language list (`da`, `pt-BR`).
|
|
7
|
+
* - `<key>` is any string. Ezo, the 0001 site and Peer key by the English
|
|
8
|
+
* sentence (`"Send": "Send"`); Link and Consistency key by a dotted id
|
|
9
|
+
* (`"settings.language": "Language"`). Both are the same format.
|
|
10
|
+
* - English (`en`) is the fallback table. When a key is missing from `en`
|
|
11
|
+
* too, the key itself is the English text, so a sentence key needs no
|
|
12
|
+
* English entry and an id key needs one.
|
|
13
|
+
* - Placeholders are `{name}` and `{{name}}` alike; `fillPlaceholders` (and
|
|
14
|
+
* `translate(key, params)`) fill both.
|
|
15
|
+
* - A per-language file (`/translations/da.json`) holds one language's table,
|
|
16
|
+
* wrapped as `{ "da": { … } }` (or bare, `{ … }`, which `readLanguageFile`
|
|
17
|
+
* wraps).
|
|
18
|
+
* - A product can ship the same shape as a TypeScript module and pass it to
|
|
19
|
+
* `loadTranslations`.
|
|
20
|
+
*
|
|
21
|
+
* A word is looked up in the language, its primary subtag (`ja-JP` reads
|
|
22
|
+
* `ja`), its relatives (`nn` reads `nb`, `pt-BR` reads `pt`), then English,
|
|
23
|
+
* then the key itself. See `resolveText`.
|
|
24
|
+
*/
|
|
25
|
+
import { DEFAULT_LANGUAGE, LANGUAGES, fallbackLanguages } from "./languages";
|
|
26
|
+
|
|
27
|
+
/** One language's words, key to text. Values may be absent (a `Partial` table). */
|
|
28
|
+
export type TranslationTable = { readonly [key: string]: string | undefined };
|
|
29
|
+
|
|
30
|
+
/** Every language's words, keyed by language code. */
|
|
31
|
+
export type TranslationsFile = { readonly [language: string]: TranslationTable | undefined };
|
|
32
|
+
|
|
33
|
+
/** Values for a text's placeholders, by name. */
|
|
34
|
+
export type TranslationParams = { readonly [name: string]: string | number | boolean };
|
|
35
|
+
|
|
36
|
+
/** The language whose table is the fallback. */
|
|
37
|
+
export const FALLBACK_LANGUAGE = DEFAULT_LANGUAGE;
|
|
38
|
+
|
|
39
|
+
const PLACEHOLDER = /\{\{\s*([\w.-]+)\s*\}\}|\{([\w.-]+)\}/g;
|
|
40
|
+
|
|
41
|
+
/** The names of a text's placeholders, `{name}` and `{{name}}` alike, each once. */
|
|
42
|
+
export function placeholdersIn(text: string): string[] {
|
|
43
|
+
const names: string[] = [];
|
|
44
|
+
for (const match of String(text ?? "").matchAll(PLACEHOLDER)) {
|
|
45
|
+
const name = match[1] ?? match[2];
|
|
46
|
+
if (name && !names.includes(name)) {
|
|
47
|
+
names.push(name);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return names;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Fill a text's placeholders, `{name}` and `{{name}}` alike. A placeholder
|
|
55
|
+
* with no value is left as written, so it shows rather than vanishing.
|
|
56
|
+
*/
|
|
57
|
+
export function fillPlaceholders(text: string, params?: TranslationParams): string {
|
|
58
|
+
if (!params) {
|
|
59
|
+
return text;
|
|
60
|
+
}
|
|
61
|
+
return text.replace(PLACEHOLDER, (whole, double: string | undefined, single: string | undefined) => {
|
|
62
|
+
const name = (double ?? single) as string;
|
|
63
|
+
return Object.prototype.hasOwnProperty.call(params, name) ? String(params[name]) : whole;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** A key's English text: the `en` table's, else the key itself. */
|
|
68
|
+
export function englishText(file: TranslationsFile, key: string): string {
|
|
69
|
+
return file[FALLBACK_LANGUAGE]?.[key] || key;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type ResolvedText = {
|
|
73
|
+
text: string;
|
|
74
|
+
/** The language the text was found in, or null when the key itself was used */
|
|
75
|
+
language: string | null;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* A key's text in `language`, from several sets of words: for each language
|
|
80
|
+
* in the fallback order (the language, its primary subtag, its relatives,
|
|
81
|
+
* English), the first set that has the key wins. With no text anywhere, the
|
|
82
|
+
* key itself. Placeholders are filled from `params`.
|
|
83
|
+
*/
|
|
84
|
+
export function resolveText(
|
|
85
|
+
key: string,
|
|
86
|
+
language: string,
|
|
87
|
+
sources: readonly (TranslationsFile | undefined)[],
|
|
88
|
+
params?: TranslationParams
|
|
89
|
+
): ResolvedText {
|
|
90
|
+
const order = fallbackLanguages(language);
|
|
91
|
+
if (!order.includes(FALLBACK_LANGUAGE)) {
|
|
92
|
+
order.push(FALLBACK_LANGUAGE);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (const code of order) {
|
|
96
|
+
for (const source of sources) {
|
|
97
|
+
const text = source?.[code]?.[key];
|
|
98
|
+
if (text) {
|
|
99
|
+
return { text: fillPlaceholders(text, params), language: code };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { text: fillPlaceholders(key, params), language: null };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
107
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A per-language file's words as a translations file: `{ "da": { … } }` as it
|
|
112
|
+
* is, a bare `{ … }` table wrapped under `language`. Null when it is neither.
|
|
113
|
+
*/
|
|
114
|
+
export function readLanguageFile(language: string, value: unknown): TranslationsFile | null {
|
|
115
|
+
if (!isPlainObject(value)) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const wrapped = value[language];
|
|
119
|
+
if (isPlainObject(wrapped)) {
|
|
120
|
+
return value as TranslationsFile;
|
|
121
|
+
}
|
|
122
|
+
const values = Object.values(value);
|
|
123
|
+
if (values.length > 0 && values.every((text) => typeof text === "string")) {
|
|
124
|
+
return { [language]: value as TranslationTable };
|
|
125
|
+
}
|
|
126
|
+
if (values.length > 0 && values.every(isPlainObject)) {
|
|
127
|
+
return value as TranslationsFile;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type TranslationsCheck = {
|
|
133
|
+
/** True when the value is a translations file a product can load */
|
|
134
|
+
valid: boolean;
|
|
135
|
+
/** What makes it unloadable */
|
|
136
|
+
errors: string[];
|
|
137
|
+
/** What loads but is likely a mistake */
|
|
138
|
+
warnings: string[];
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export type TranslationsCheckOptions = {
|
|
142
|
+
/** The languages the file may hold. Defaults to the language list. */
|
|
143
|
+
languages?: readonly string[];
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const ID_KEY = /^[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)+$/;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Check a value against the format. Errors: it is not an object of language
|
|
150
|
+
* tables, or a text is not a string. Warnings: a language outside the list,
|
|
151
|
+
* an id key (`settings.language`) with no English text, a translation whose
|
|
152
|
+
* placeholders differ from its English text's.
|
|
153
|
+
*/
|
|
154
|
+
export function validateTranslations(
|
|
155
|
+
value: unknown,
|
|
156
|
+
options: TranslationsCheckOptions = {}
|
|
157
|
+
): TranslationsCheck {
|
|
158
|
+
const errors: string[] = [];
|
|
159
|
+
const warnings: string[] = [];
|
|
160
|
+
|
|
161
|
+
if (!isPlainObject(value)) {
|
|
162
|
+
return {
|
|
163
|
+
valid: false,
|
|
164
|
+
errors: ["Expected an object keyed by language code."],
|
|
165
|
+
warnings,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const known = new Set((options.languages ?? LANGUAGES).map((code) => code.toLowerCase()));
|
|
170
|
+
const file = value as Record<string, unknown>;
|
|
171
|
+
const english = isPlainObject(file[FALLBACK_LANGUAGE])
|
|
172
|
+
? (file[FALLBACK_LANGUAGE] as Record<string, unknown>)
|
|
173
|
+
: {};
|
|
174
|
+
|
|
175
|
+
for (const [language, table] of Object.entries(file)) {
|
|
176
|
+
if (!isPlainObject(table)) {
|
|
177
|
+
errors.push(`"${language}" should hold an object of words.`);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (!known.has(language.toLowerCase())) {
|
|
181
|
+
warnings.push(`"${language}" is not in the language list.`);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
for (const [key, text] of Object.entries(table)) {
|
|
185
|
+
if (text === undefined) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (typeof text !== "string") {
|
|
189
|
+
errors.push(`"${language}" → "${key}" should be a string.`);
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (language === FALLBACK_LANGUAGE) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const source = typeof english[key] === "string" ? (english[key] as string) : undefined;
|
|
197
|
+
if (source === undefined && ID_KEY.test(key)) {
|
|
198
|
+
warnings.push(`"${key}" has no English text, so English readers see the key.`);
|
|
199
|
+
}
|
|
200
|
+
const expected = placeholdersIn(source ?? key).sort().join(", ");
|
|
201
|
+
const found = placeholdersIn(text).sort().join(", ");
|
|
202
|
+
if (expected !== found) {
|
|
203
|
+
warnings.push(
|
|
204
|
+
`"${language}" → "${key}" has placeholders [${found}] where English has [${expected}].`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return { valid: errors.length === 0, errors, warnings: [...new Set(warnings)] };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Whether a value is a translations file a product can load. */
|
|
214
|
+
export function isTranslationsFile(value: unknown): value is TranslationsFile {
|
|
215
|
+
return validateTranslations(value).valid;
|
|
216
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* Shape is a surface preference. Keep these base lengths unscaled: each
|
|
2
|
+
* component resolves them with its own --ds-sf in component-metrics.css. */
|
|
3
|
+
[data-ds-shape="square"],
|
|
4
|
+
:host([data-ds-shape="square"]) {
|
|
5
|
+
--ds-corner-size: 0px;
|
|
6
|
+
--ds-corner-shape: round;
|
|
7
|
+
--ds-button-inset: 0.5px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-ds-shape="rounded"],
|
|
11
|
+
:host([data-ds-shape="rounded"]) {
|
|
12
|
+
--ds-corner-size: 4px;
|
|
13
|
+
--ds-corner-shape: round;
|
|
14
|
+
--ds-button-inset: 2.5px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-ds-shape="circular"],
|
|
18
|
+
:host([data-ds-shape="circular"]) {
|
|
19
|
+
--ds-corner-size: 999px;
|
|
20
|
+
--ds-corner-shape: round;
|
|
21
|
+
--ds-button-inset: 5px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* A squircle needs twice an arc's radius for the same apparent corner.
|
|
25
|
+
* Circular controls keep true semicircles even in a squircle browser. */
|
|
26
|
+
@supports (corner-shape: squircle) {
|
|
27
|
+
[data-ds-shape="rounded"],
|
|
28
|
+
:host([data-ds-shape="rounded"]) {
|
|
29
|
+
--ds-corner-size: 8px;
|
|
30
|
+
--ds-corner-shape: squircle;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import "./component-appearance.css";
|
|
2
|
+
|
|
3
|
+
/* Resolve dimensions where a component is drawn. Inherited calc() values have
|
|
4
|
+
* already used their ancestor's scale. Base tokens stay unscaled and inherit;
|
|
5
|
+
* resolved tokens can still be overridden directly on a component.
|
|
6
|
+
* data-ds-surface gives ordinary layout elements the same scaled measures.
|
|
7
|
+
*/
|
|
8
|
+
:root,
|
|
9
|
+
:host,
|
|
10
|
+
:where([data-ds-surface]) {
|
|
11
|
+
--ds-unit: calc(var(--ds-1, 20px) * var(--ds-sf, 1));
|
|
12
|
+
--ds-control-height: calc(var(--ds-control-size, var(--ds-08, 16px)) * var(--ds-sf, 1));
|
|
13
|
+
--ds-row-height: calc(var(--ds-row-size, var(--ds-1, 20px)) * var(--ds-sf, 1));
|
|
14
|
+
--ds-type-size-default: calc(var(--ds-text-size, 14px) * var(--ds-sf, 1));
|
|
15
|
+
--ds-type-size-small: calc(var(--ds-small-text-size, 10px) * var(--ds-sf, 1));
|
|
16
|
+
--ds-type-size-heading: calc(var(--ds-heading-text-size, 13px) * var(--ds-sf, 1));
|
|
17
|
+
--ds-type-lineheight-default: calc(var(--ds-text-leading, 16px) * var(--ds-sf, 1));
|
|
18
|
+
--ds-type-letterspacing-default: calc(var(--ds-text-tracking, -0.3px) * var(--ds-sf, 1));
|
|
19
|
+
--ds-radius: calc(var(--ds-corner-size, 4px) * var(--ds-sf, 1));
|
|
20
|
+
--ds-radius-card: calc(var(--ds-card-corner-size, 4px) * var(--ds-sf, 1));
|
|
21
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@import "./component-metrics.css";
|
|
2
|
+
|
|
3
|
+
/* Shared component tokens. Scoped names keep embedded documents independent.
|
|
4
|
+
* Products may set tokens at their surface; component implementations stay shared.
|
|
5
|
+
*/
|
|
6
|
+
:root {
|
|
7
|
+
/* Component scale is independent of an embedded document. */
|
|
8
|
+
--ds-sf: 1;
|
|
9
|
+
|
|
10
|
+
/* ----------------------------------------------------------
|
|
11
|
+
SIZING SCALE
|
|
12
|
+
One base unit and its multipliers, as in DS one.
|
|
13
|
+
---------------------------------------------------------- */
|
|
14
|
+
|
|
15
|
+
--ds-1: 20px;
|
|
16
|
+
--ds-01: calc(var(--ds-1) * 0.1);
|
|
17
|
+
--ds-025: calc(var(--ds-1) * 0.25);
|
|
18
|
+
--ds-05: calc(var(--ds-1) * 0.5);
|
|
19
|
+
--ds-08: calc(var(--ds-1) * 0.8);
|
|
20
|
+
--ds-2: calc(var(--ds-1) * 2);
|
|
21
|
+
--ds-3: calc(var(--ds-1) * 3);
|
|
22
|
+
--ds-4: calc(var(--ds-1) * 4);
|
|
23
|
+
|
|
24
|
+
/* ----------------------------------------------------------
|
|
25
|
+
PALETTE
|
|
26
|
+
---------------------------------------------------------- */
|
|
27
|
+
|
|
28
|
+
--ds-white: #ffffff;
|
|
29
|
+
--ds-black: #1f1f1f;
|
|
30
|
+
--ds-slate: #1e1e1e;
|
|
31
|
+
--ds-slate-light: #ececec;
|
|
32
|
+
--ds-slate-dark: #363636;
|
|
33
|
+
--ds-grey: #7a7a7a;
|
|
34
|
+
|
|
35
|
+
--ds-tuned-red: #ff5f5f;
|
|
36
|
+
--ds-pink: #f5aad1;
|
|
37
|
+
--ds-sharp-blue: #594dff;
|
|
38
|
+
--ds-zenith-blue: #ccccff;
|
|
39
|
+
--ds-apple-green: #99ff73;
|
|
40
|
+
--ds-yellow: #eaff00;
|
|
41
|
+
--ds-orange: #fec20d;
|
|
42
|
+
|
|
43
|
+
--ds-accent-color: light-dark(var(--ds-yellow), #bbcc00);
|
|
44
|
+
|
|
45
|
+
/* ----------------------------------------------------------
|
|
46
|
+
TYPE
|
|
47
|
+
---------------------------------------------------------- */
|
|
48
|
+
|
|
49
|
+
--ds-typeface-regular:
|
|
50
|
+
"Inter Arrows", "GT America", "GT-America-Standard-Regular", Inter, system-ui, -apple-system, sans-serif;
|
|
51
|
+
--ds-typeface-compressed: "Inter Arrows", "GT-America-Compressed-Regular", var(--ds-typeface-regular);
|
|
52
|
+
--ds-typeface-regular-jp: "Inter Arrows", "GT America", "Noto Sans JP", sans-serif;
|
|
53
|
+
/* GT America exposes circular dots as stylistic set 05. */
|
|
54
|
+
--ds-font-features: "ss05" 1;
|
|
55
|
+
|
|
56
|
+
--ds-type-weight-default: 400;
|
|
57
|
+
--ds-type-weight-bold: 500;
|
|
58
|
+
|
|
59
|
+
/* ----------------------------------------------------------
|
|
60
|
+
SURFACES
|
|
61
|
+
The chrome's `--chrome-panel-*` tokens read these.
|
|
62
|
+
---------------------------------------------------------- */
|
|
63
|
+
|
|
64
|
+
--ds-paper: light-dark(#f4f4f4, #2c2c2c);
|
|
65
|
+
--ds-text-color: light-dark(var(--ds-black), var(--ds-white));
|
|
66
|
+
--ds-text-color-muted: light-dark(#5f5f5f, #cacaca);
|
|
67
|
+
--ds-title-color: light-dark(var(--ds-grey), #9a9a9a);
|
|
68
|
+
--ds-border-color: light-dark(#d8d8d8, #3d3d3d);
|
|
69
|
+
--ds-fill: light-dark(var(--ds-slate-light), var(--ds-slate-dark));
|
|
70
|
+
--ds-fill-hover: light-dark(#e2e2e2, #404040);
|
|
71
|
+
--ds-focus-ring: var(--ds-sharp-blue);
|
|
72
|
+
|
|
73
|
+
--ds-button-text-color: var(--ds-text-color);
|
|
74
|
+
--ds-button-background-color-primary: var(--ds-accent-color);
|
|
75
|
+
--ds-button-text-color-on-accent: var(--ds-black);
|
|
76
|
+
--ds-button-background-color-secondary: var(--ds-fill);
|
|
77
|
+
--ds-icon-color: currentColor;
|
|
78
|
+
|
|
79
|
+
/* Shared fields, including the row treatment carried over from Ezo's forms. */
|
|
80
|
+
--ds-input-background: light-dark(#e8e8e8, #303030);
|
|
81
|
+
--ds-input-color: light-dark(#2a2a2a, #f5f5f5);
|
|
82
|
+
--ds-input-placeholder-color: light-dark(#797979, #ababab);
|
|
83
|
+
--ds-input-disabled-color: light-dark(#555555, #d0d0d0);
|
|
84
|
+
--ds-input-reveal-color: light-dark(#1e1e1e, #f5f5f5);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* A page written in Japanese sets its labels in the Japanese face. */
|
|
88
|
+
:root:lang(ja) {
|
|
89
|
+
--ds-typeface-regular: var(--ds-typeface-regular-jp);
|
|
90
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
@import "./component-metrics.css";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Native controls in shared dress.
|
|
5
|
+
*
|
|
6
|
+
* DS one keeps a few components as plain classes on native elements. shared does
|
|
7
|
+
* the same for everything a person types into or picks from: text fields,
|
|
8
|
+
* selects and checkboxes stay `<input>` and `<select>`, so labels, form
|
|
9
|
+
* semantics and React's controlled inputs work as they always have.
|
|
10
|
+
*
|
|
11
|
+
* `.ds-button` is the `ds-button` element's look on a native `<button>`,
|
|
12
|
+
* for a button inside a drag handle. The drag library recognises only native
|
|
13
|
+
* controls: inside a handle it would lift the row on Space where a
|
|
14
|
+
* `ds-button` was meant to be pressed. Both read the same custom properties.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.ds-button {
|
|
18
|
+
appearance: none;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
flex: 0 0 auto;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: var(--ds-button-align, flex-start);
|
|
24
|
+
gap: var(--ds-button-gap, calc(4px * var(--ds-sf)));
|
|
25
|
+
height: var(--ds-button-height, var(--ds-control-height));
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: var(--ds-button-padding, 0);
|
|
28
|
+
border: 0;
|
|
29
|
+
border-radius: var(--ds-radius);
|
|
30
|
+
background: var(--ds-button-background, transparent);
|
|
31
|
+
color: var(--ds-button-color, var(--ds-button-text-color));
|
|
32
|
+
font-family: var(--ds-typeface-regular);
|
|
33
|
+
font-feature-settings: var(--ds-font-features);
|
|
34
|
+
font-size: var(--ds-type-size-default);
|
|
35
|
+
line-height: var(--ds-type-lineheight-default);
|
|
36
|
+
letter-spacing: var(--ds-type-letterspacing-default);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
-webkit-tap-highlight-color: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-button--icon {
|
|
43
|
+
justify-content: center;
|
|
44
|
+
width: var(--ds-button-height, var(--ds-control-height));
|
|
45
|
+
padding: 0;
|
|
46
|
+
color: var(--ds-button-color, var(--ds-text-color-muted));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-button--icon:hover:not(:disabled) {
|
|
50
|
+
--ds-button-color: var(--ds-text-color);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ds-button:focus-visible {
|
|
54
|
+
outline: 2px solid var(--ds-focus-ring);
|
|
55
|
+
outline-offset: 1px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ds-button:disabled {
|
|
59
|
+
cursor: default;
|
|
60
|
+
opacity: 0.5;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ds-input,
|
|
64
|
+
.ds-select {
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
height: var(--ds-input-height, var(--ds-control-height));
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0 calc(4px * var(--ds-sf));
|
|
70
|
+
border: 0;
|
|
71
|
+
border-radius: var(--ds-radius);
|
|
72
|
+
background: var(--ds-fill);
|
|
73
|
+
color: var(--ds-text-color);
|
|
74
|
+
font-family: var(--ds-typeface-regular);
|
|
75
|
+
font-feature-settings: var(--ds-font-features);
|
|
76
|
+
font-size: var(--ds-type-size-default);
|
|
77
|
+
line-height: var(--ds-type-lineheight-default);
|
|
78
|
+
letter-spacing: var(--ds-type-letterspacing-default);
|
|
79
|
+
outline: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-input::placeholder {
|
|
83
|
+
color: var(--ds-title-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ds-input:focus-visible,
|
|
87
|
+
.ds-select:focus-visible,
|
|
88
|
+
.ds-checkbox:focus-visible {
|
|
89
|
+
outline: 2px solid var(--ds-focus-ring);
|
|
90
|
+
outline-offset: 1px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ds-input:disabled,
|
|
94
|
+
.ds-select:disabled,
|
|
95
|
+
.ds-checkbox:disabled {
|
|
96
|
+
cursor: default;
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ds-select {
|
|
101
|
+
appearance: none;
|
|
102
|
+
padding-right: calc(16px * var(--ds-sf));
|
|
103
|
+
background-image:
|
|
104
|
+
linear-gradient(45deg, transparent 50%, currentColor 50%),
|
|
105
|
+
linear-gradient(135deg, currentColor 50%, transparent 50%);
|
|
106
|
+
background-position:
|
|
107
|
+
calc(100% - 9px) 50%,
|
|
108
|
+
calc(100% - 6px) 50%;
|
|
109
|
+
background-size:
|
|
110
|
+
3px 3px,
|
|
111
|
+
3px 3px;
|
|
112
|
+
background-repeat: no-repeat;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ds-checkbox {
|
|
117
|
+
width: calc(12px * var(--ds-sf));
|
|
118
|
+
height: calc(12px * var(--ds-sf));
|
|
119
|
+
margin: 0;
|
|
120
|
+
accent-color: var(--ds-text-color);
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
* `.ds-button--primary` and `--secondary` are the element's variants on a
|
|
126
|
+
* native button: a form's submit button stays native so Enter in a field
|
|
127
|
+
* submits the form.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
.ds-button--primary,
|
|
131
|
+
.ds-button--secondary {
|
|
132
|
+
--ds-button-padding: 0 calc(4px * var(--ds-sf));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ds-button--primary {
|
|
136
|
+
--ds-button-background: var(--ds-button-background-color-primary);
|
|
137
|
+
--ds-button-color: var(--ds-button-text-color-on-accent);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ds-button--secondary {
|
|
141
|
+
--ds-button-background: var(--ds-button-background-color-secondary);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ds-button--secondary:hover:not(:disabled) {
|
|
145
|
+
--ds-button-background: var(--ds-fill-hover);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ds-button--wide {
|
|
149
|
+
justify-content: center;
|
|
150
|
+
width: 100%;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
* `.ds-menu` is the `ds-menu` element's look on a menu a library draws:
|
|
155
|
+
* the context menu's items come from Radix, which owns their roles, focus and
|
|
156
|
+
* keys, so they stay Radix's and take shared's paper, rows and type.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
.ds-menu {
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
gap: 1px;
|
|
164
|
+
min-width: calc(8 * var(--ds-unit));
|
|
165
|
+
max-width: calc(12 * var(--ds-unit));
|
|
166
|
+
max-height: var(--ds-menu-max-height, calc(16 * var(--ds-unit)));
|
|
167
|
+
overflow-y: auto;
|
|
168
|
+
padding: calc(4px * var(--ds-sf));
|
|
169
|
+
border: 1px solid var(--ds-border-color);
|
|
170
|
+
border-radius: var(--ds-radius-card);
|
|
171
|
+
background: var(--ds-paper);
|
|
172
|
+
color: var(--ds-text-color);
|
|
173
|
+
box-shadow: 0 8px 24px color-mix(in srgb, #000000 18%, transparent);
|
|
174
|
+
font-family: var(--ds-typeface-regular);
|
|
175
|
+
font-feature-settings: var(--ds-font-features);
|
|
176
|
+
font-size: var(--ds-type-size-default);
|
|
177
|
+
font-weight: var(--ds-type-weight-default);
|
|
178
|
+
line-height: var(--ds-type-lineheight-default);
|
|
179
|
+
letter-spacing: var(--ds-type-letterspacing-default);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ds-menu__item {
|
|
183
|
+
position: relative;
|
|
184
|
+
box-sizing: border-box;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
gap: calc(4px * var(--ds-sf));
|
|
188
|
+
width: 100%;
|
|
189
|
+
min-height: var(--ds-row-height);
|
|
190
|
+
padding: calc(2px * var(--ds-sf)) calc(6px * var(--ds-sf));
|
|
191
|
+
border-radius: calc(4px * var(--ds-sf));
|
|
192
|
+
color: var(--ds-text-color);
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
text-overflow: ellipsis;
|
|
196
|
+
cursor: default;
|
|
197
|
+
user-select: none;
|
|
198
|
+
outline: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ds-menu__item--inset {
|
|
202
|
+
padding-left: calc(var(--ds-unit) + calc(4px * var(--ds-sf)));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.ds-menu__item:hover,
|
|
206
|
+
.ds-menu__item:focus-visible,
|
|
207
|
+
.ds-menu__item[data-highlighted] {
|
|
208
|
+
background: var(--ds-fill);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ds-menu__item[data-variant="destructive"] {
|
|
212
|
+
color: var(--ds-tuned-red);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ds-menu__item[data-disabled],
|
|
216
|
+
.ds-menu__item[aria-disabled="true"] {
|
|
217
|
+
opacity: 0.5;
|
|
218
|
+
pointer-events: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ds-menu__indicator {
|
|
222
|
+
position: absolute;
|
|
223
|
+
left: calc(6px * var(--ds-sf));
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
width: calc(12px * var(--ds-sf));
|
|
228
|
+
height: calc(12px * var(--ds-sf));
|
|
229
|
+
pointer-events: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ds-menu__indicator svg {
|
|
233
|
+
width: 100%;
|
|
234
|
+
height: 100%;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ds-menu__chevron {
|
|
238
|
+
width: calc(12px * var(--ds-sf));
|
|
239
|
+
height: calc(12px * var(--ds-sf));
|
|
240
|
+
margin-left: auto;
|
|
241
|
+
color: var(--ds-text-color-muted);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.ds-menu__label {
|
|
245
|
+
padding: calc(2px * var(--ds-sf)) calc(6px * var(--ds-sf));
|
|
246
|
+
color: var(--ds-title-color);
|
|
247
|
+
font-size: var(--ds-type-size-small);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.ds-menu__separator {
|
|
251
|
+
height: 1px;
|
|
252
|
+
margin: calc(4px * var(--ds-sf)) calc(6px * var(--ds-sf));
|
|
253
|
+
background: var(--ds-border-color);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.ds-menu__shortcut {
|
|
257
|
+
margin-left: auto;
|
|
258
|
+
padding-left: var(--ds-unit);
|
|
259
|
+
color: var(--ds-title-color);
|
|
260
|
+
font-size: var(--ds-type-size-small);
|
|
261
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Inter
|
|
2
|
+
|
|
3
|
+
`Inter-Arrows.woff2` is Inter Regular 4.1, cut down to its arrows (U+2190–21FF, U+27F0–27FF, U+2900–297F, U+2B00–2BFF). It is loaded as "Inter Arrows" and leads every typeface token, so an arrow is drawn in Inter whatever the text around it is set in.
|
|
4
|
+
|
|
5
|
+
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter).
|
|
6
|
+
|
|
7
|
+
This font software is licensed under the SIL Open Font License, Version 1.1, available with a FAQ at https://openfontlicense.org.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Iosevka
|
|
2
|
+
|
|
3
|
+
`Iosevka-Regular.woff2` is Iosevka Regular 33.3.6, cut down to the characters code uses (Latin, punctuation, arrows, maths, box drawing). It is the font of `--typeface-mono`.
|
|
4
|
+
|
|
5
|
+
Copyright 2015-2025, Renzhi Li (aka. Belleve Invis, belleve@typeof.net).
|
|
6
|
+
|
|
7
|
+
This font software is licensed under the SIL Open Font License, Version 1.1, available with a FAQ at https://openfontlicense.org. Iosevka: https://github.com/be5invis/Iosevka
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Design system 1 shared sizing foundation */
|
|
2
|
+
:root {
|
|
3
|
+
--sf: 1;
|
|
4
|
+
--01: calc(var(--1) * 0.1);
|
|
5
|
+
--025: calc(var(--1) * 0.25);
|
|
6
|
+
--05: calc(var(--1) * 0.5);
|
|
7
|
+
--08: calc(var(--1) * 0.8);
|
|
8
|
+
--1: 20px; /* SET BASE UNIT HERE FOR EXAMPLE 20px */
|
|
9
|
+
--2: calc(var(--1) * 2);
|
|
10
|
+
--3: calc(var(--1) * 3);
|
|
11
|
+
--4: calc(var(--1) * 4);
|
|
12
|
+
--8: calc(var(--1) * 8);
|
|
13
|
+
--12: calc(var(--1) * 12);
|
|
14
|
+
--20: calc(var(--1) * 20);
|
|
15
|
+
|
|
16
|
+
/* Semantic sizing units */
|
|
17
|
+
|
|
18
|
+
--tenth: var(--01);
|
|
19
|
+
--quarter: var(--025);
|
|
20
|
+
--half: var(--05);
|
|
21
|
+
--eight-tenth: var(--08);
|
|
22
|
+
--unit: var(--1);
|
|
23
|
+
--double: var(--2);
|
|
24
|
+
--triple: var(--3);
|
|
25
|
+
--quad: var(--4);
|
|
26
|
+
--oct: var(--8);
|
|
27
|
+
--dozen: var(--12);
|
|
28
|
+
--twenty: var(--20);
|
|
29
|
+
|
|
30
|
+
--ds-grid-unit: calc(var(--unit) * var(--sf));
|
|
31
|
+
}
|