@ids-group-ltd/ids-design-system 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +755 -0
- package/agent/INDEX.md +8 -7
- package/agent/charts/ds-scatter-chart.md +1 -1
- package/agent/feedback/ds-badge.md +2 -2
- package/agent/feedback/ds-chat-message.md +1 -1
- package/agent/feedback/ds-chat-step.md +2 -2
- package/agent/feedback/ds-chat-thread.md +1 -1
- package/agent/feedback/ds-stat.md +1 -1
- package/agent/feedback/ds-toast.md +2 -2
- package/agent/feedback/ds-tree.md +1 -1
- package/agent/forms/ds-button.md +3 -3
- package/agent/forms/ds-dropzone.md +1 -1
- package/agent/forms/ds-icon-button.md +3 -3
- package/agent/forms/ds-number-stepper.md +3 -3
- package/agent/forms/ds-search.md +1 -1
- package/agent/forms/ds-split-button.md +1 -1
- package/agent/foundations/tokens.md +4 -3
- package/agent/navigation/ds-app-layout.md +1 -1
- package/agent/navigation/ds-nav-divider.md +6 -0
- package/agent/navigation/{ds-sidenav-footer.md → ds-nav-footer.md} +3 -3
- package/agent/navigation/{ds-sidenav-group.md → ds-nav-group.md} +2 -2
- package/agent/navigation/{ds-sidenav-item.md → ds-nav-item.md} +6 -6
- package/agent/navigation/ds-nav.md +15 -0
- package/agent/overlays/ds-drawer.md +1 -1
- package/agent/platform/toast-service.md +1 -1
- package/components/README.md +24 -24
- package/components.md +51 -45
- package/design-system.md +8 -7
- package/eslint/deprecated-api.json +108 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge-badge-count-roll.component-BDNXADJZ.mjs +182 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge-badge-count-roll.component-BDNXADJZ.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +37 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +5 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +76 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs +77 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-chat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +65 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +76 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +6 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-inline-edit.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-nav-footer.mjs +113 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-nav-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-nav.mjs +228 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-nav.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +61 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +36 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-reveal.mjs +56 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reveal.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +10 -39
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +7 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +33 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +4 -98
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +11 -179
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +68 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +41 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +6 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +27 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +54 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +8 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +21 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +153 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +11 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +4 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/1.1.1.json +14 -4
- package/migrations/1.1.2.json +11 -3
- package/migrations/1.2.0.json +1433 -0
- package/migrations/README.md +8 -1
- package/package.json +25 -1
- package/schematics/check-overrides/index.cjs +28 -3
- package/schematics/check-overrides/scan.cjs +151 -2
- package/schematics/check-overrides/schema.json +4 -0
- package/schematics/check-overrides/surface.json +389 -74
- package/schematics/collection.json +1 -1
- package/stylelint/deprecated-tokens.json +7 -0
- package/styles/_check-box.scss +4 -3
- package/styles/_dropdown-overlay.scss +6 -8
- package/styles/_ds-color.scss +7 -2
- package/styles/_field-state.scss +4 -2
- package/styles/_focus.scss +12 -5
- package/styles/_link.scss +4 -4
- package/styles/_optical-center.scss +29 -0
- package/styles/_reveal.scss +8 -0
- package/styles/_status.scss +17 -7
- package/styles/_step-marker.scss +192 -6
- package/styles/_surface-level.scss +16 -0
- package/styles/_text-shimmer.scss +21 -0
- package/styles/_theme-activation.scss +17 -4
- package/styles/_tokens.scss +26 -7
- package/styles/ds.scss +1 -0
- package/themes/README.md +16 -21
- package/themes/_semantic.scss +129 -64
- package/themes/dark/_theme.scss +17 -25
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +20 -1
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +14 -3
- package/types/ids-group-ltd-ids-design-system-components-chat.d.ts +49 -4
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +9 -1
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +28 -2
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +8 -5
- package/types/ids-group-ltd-ids-design-system-components-nav-footer.d.ts +88 -0
- package/types/ids-group-ltd-ids-design-system-components-nav.d.ts +152 -0
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +21 -3
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-reveal.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +2 -8
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +12 -83
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +21 -131
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +27 -6
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +9 -5
- package/types/ids-group-ltd-ids-design-system-components.d.ts +26 -1
- package/types/ids-group-ltd-ids-design-system-core.d.ts +19 -1
- package/types/ids-group-ltd-ids-design-system.d.ts +7 -4
- package/agent/navigation/ds-sidenav.md +0 -13
|
@@ -28,7 +28,7 @@ class W3wComponent {
|
|
|
28
28
|
navigator.clipboard.writeText(`${this.prefix()}${address}`).then(() => this.copied.emit(address), () => undefined);
|
|
29
29
|
}
|
|
30
30
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: W3wComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: W3wComponent, isStandalone: true, selector: "ds-w3w", inputs: { prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, address: { classPropertyName: "address", publicName: "address", isSignal: true, isRequired: true, transformFunction: null }, copyable: { classPropertyName: "copyable", publicName: "copyable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { copied: "copied" }, host: { listeners: { "click": "onCopy()", "keydown.enter": "onCopy()", "keydown.space": "onKeyActivate($event)" }, properties: { "attr.role": "copyable() ? 'button' : null", "attr.tabindex": "copyable() ? 0 : null", "attr.aria-label": "copyable() ? intl().what3words.copy(prefix() + address()) : null" } }, ngImport: i0, template: "<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_w3w-bg-color: var(--ds-w3w-bg-color, var(--accent-subtitle));--_w3w-text-color: var(--ds-w3w-text-color, var(--accent));--_w3w-hover-bg-color: var(--ds-w3w-hover-bg-color, var(--accent-muted));--_w3w-mark-color: var(--ds-w3w-mark-color, var(--error));display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--_w3w-bg-color);color:var(--_w3w-text-color);border-radius:var(--radius-
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: W3wComponent, isStandalone: true, selector: "ds-w3w", inputs: { prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, address: { classPropertyName: "address", publicName: "address", isSignal: true, isRequired: true, transformFunction: null }, copyable: { classPropertyName: "copyable", publicName: "copyable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { copied: "copied" }, host: { listeners: { "click": "onCopy()", "keydown.enter": "onCopy()", "keydown.space": "onKeyActivate($event)" }, properties: { "attr.role": "copyable() ? 'button' : null", "attr.tabindex": "copyable() ? 0 : null", "attr.aria-label": "copyable() ? intl().what3words.copy(prefix() + address()) : null" } }, ngImport: i0, template: "<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_w3w-bg-color: var(--ds-w3w-bg-color, var(--accent-subtitle));--_w3w-text-color: var(--ds-w3w-text-color, var(--accent));--_w3w-hover-bg-color: var(--ds-w3w-hover-bg-color, var(--accent-muted));--_w3w-mark-color: var(--ds-w3w-mark-color, var(--error));display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--_w3w-bg-color);color:var(--_w3w-text-color);border-radius:var(--ds-radius-control);font-family:var(--font-mono);font-size:var(--font-size-mono);cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard)}:host:hover{background:var(--_w3w-hover-bg-color)}:host .words{display:inline-flex}:host .mark{color:var(--_w3w-mark-color);font-weight:var(--font-weight-bold)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
32
32
|
}
|
|
33
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: W3wComponent, decorators: [{
|
|
34
34
|
type: Component,
|
|
@@ -39,7 +39,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
39
39
|
'(click)': 'onCopy()',
|
|
40
40
|
'(keydown.enter)': 'onCopy()',
|
|
41
41
|
'(keydown.space)': 'onKeyActivate($event)',
|
|
42
|
-
}, template: "<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_w3w-bg-color: var(--ds-w3w-bg-color, var(--accent-subtitle));--_w3w-text-color: var(--ds-w3w-text-color, var(--accent));--_w3w-hover-bg-color: var(--ds-w3w-hover-bg-color, var(--accent-muted));--_w3w-mark-color: var(--ds-w3w-mark-color, var(--error));display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--_w3w-bg-color);color:var(--_w3w-text-color);border-radius:var(--radius-
|
|
42
|
+
}, template: "<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n", styles: [":where(:host){box-sizing:border-box;interpolate-size:allow-keywords}:where(*){box-sizing:border-box}:where(button,input,select,textarea){font-family:inherit}:where(h1,h2,h3,h4,h5,h6){margin:0}:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:where(:host(:focus-visible),:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_w3w-bg-color: var(--ds-w3w-bg-color, var(--accent-subtitle));--_w3w-text-color: var(--ds-w3w-text-color, var(--accent));--_w3w-hover-bg-color: var(--ds-w3w-hover-bg-color, var(--accent-muted));--_w3w-mark-color: var(--ds-w3w-mark-color, var(--error));display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-1) var(--space-2);background:var(--_w3w-bg-color);color:var(--_w3w-text-color);border-radius:var(--ds-radius-control);font-family:var(--font-mono);font-size:var(--font-size-mono);cursor:pointer;transition:background-color var(--duration-fast) var(--ease-standard)}:host:hover{background:var(--_w3w-hover-bg-color)}:host .words{display:inline-flex}:host .mark{color:var(--_w3w-mark-color);font-weight:var(--font-weight-bold)}\n"] }]
|
|
43
43
|
}], propDecorators: { prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], address: [{ type: i0.Input, args: [{ isSignal: true, alias: "address", required: true }] }], copyable: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyable", required: false }] }], copied: [{ type: i0.Output, args: ["copied"] }] } });
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-w3w.mjs","sources":["../../../src/lib/components/w3w/w3w.component.ts","../../../src/lib/components/w3w/w3w.component.html","../../../src/lib/components/w3w/ids-group-ltd-ids-design-system-components-w3w.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-w3w',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './w3w.component.html',\n styleUrl: './w3w.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.role]': \"copyable() ? 'button' : null\",\n '[attr.tabindex]': 'copyable() ? 0 : null',\n '[attr.aria-label]':\n 'copyable() ? intl().what3words.copy(prefix() + address()) : null',\n '(click)': 'onCopy()',\n '(keydown.enter)': 'onCopy()',\n '(keydown.space)': 'onKeyActivate($event)',\n },\n})\nexport class W3wComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Marker before the address. */\n readonly prefix = input<string>('///');\n /** The three-word address, rendered after `prefix`. */\n readonly address = input.required<string>();\n /** Makes the address clickable/focusable and copies `prefix` + `address` to the clipboard. */\n readonly copyable = input(true, { transform: booleanAttribute });\n /** Fires with `address` after a successful copy. */\n readonly copied = output<string>();\n\n protected onKeyActivate(event: Event): void {\n event.preventDefault();\n this.onCopy();\n }\n\n protected onCopy(): void {\n if (!this.copyable()) {\n return;\n }\n if (typeof navigator === 'undefined' || !navigator.clipboard) {\n return;\n }\n const address = this.address();\n navigator.clipboard.writeText(`${this.prefix()}${address}`).then(\n () => this.copied.emit(address),\n () => undefined,\n );\n }\n}\n","<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA4Ba,YAAY,CAAA;AACJ,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;;AAGhC,IAAA,MAAM,GAAG,KAAK,CAAS,KAAK,6EAAC;;AAE7B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAU;;IAElC,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEvD,MAAM,GAAG,MAAM,EAAU;AAExB,IAAA,aAAa,CAAC,KAAY,EAAA;QAClC,KAAK,CAAC,cAAc,EAAE;QACtB,IAAI,CAAC,MAAM,EAAE;IACf;IAEU,MAAM,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB;QACF;QACA,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC5D;QACF;AACA,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,QAAA,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA,EAAG,IAAI,CAAC,MAAM,EAAE,CAAA,EAAG,OAAO,CAAA,CAAE,CAAC,CAAC,IAAI,CAC9D,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAC/B,MAAM,SAAS,CAChB;IACH;wGA7BW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,uBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,8BAAA,EAAA,eAAA,EAAA,uBAAA,EAAA,iBAAA,EAAA,kEAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5BzB,4OAgBA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-w3w.mjs","sources":["../../../src/lib/components/w3w/w3w.component.ts","../../../src/lib/components/w3w/w3w.component.html","../../../src/lib/components/w3w/ids-group-ltd-ids-design-system-components-w3w.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-w3w',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './w3w.component.html',\n styleUrl: './w3w.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.role]': \"copyable() ? 'button' : null\",\n '[attr.tabindex]': 'copyable() ? 0 : null',\n '[attr.aria-label]':\n 'copyable() ? intl().what3words.copy(prefix() + address()) : null',\n '(click)': 'onCopy()',\n '(keydown.enter)': 'onCopy()',\n '(keydown.space)': 'onKeyActivate($event)',\n },\n})\nexport class W3wComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Marker before the address. */\n readonly prefix = input<string>('///');\n /** The three-word address, rendered after `prefix`. */\n readonly address = input.required<string>();\n /** Makes the address clickable/focusable and copies `prefix` + `address` to the clipboard. */\n readonly copyable = input(true, { transform: booleanAttribute });\n /** Fires with `address` after a successful copy. */\n readonly copied = output<string>();\n\n protected onKeyActivate(event: Event): void {\n event.preventDefault();\n this.onCopy();\n }\n\n protected onCopy(): void {\n if (!this.copyable()) {\n return;\n }\n if (typeof navigator === 'undefined' || !navigator.clipboard) {\n return;\n }\n const address = this.address();\n navigator.clipboard.writeText(`${this.prefix()}${address}`).then(\n () => this.copied.emit(address),\n () => undefined,\n );\n }\n}\n","<ds-icon\n name=\"map\"\n [size]=\"14\" />\n\n<span class=\"words\">\n <span class=\"mark\">\n {{ prefix() }}\n </span>\n {{ address() }}\n</span>\n\n@if (copyable()) {\n <ds-icon\n name=\"copy\"\n [size]=\"12\" />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -2162,6 +2162,158 @@ function focusRescue() {
|
|
|
2162
2162
|
}, { injector });
|
|
2163
2163
|
}
|
|
2164
2164
|
|
|
2165
|
+
const SHAPES = 'path, line, polyline, polygon, circle, ellipse, rect';
|
|
2166
|
+
// A glyph centred by its box looks off inside a circle when its strokes are heavier on one side (a
|
|
2167
|
+
// flag, a folder, a check). Each glyph is centred on the point midway between the centre of the box
|
|
2168
|
+
// its strokes span and the centre of their length, so a symmetric glyph lands on its box centre and a
|
|
2169
|
+
// lopsided one moves half the way toward balancing its weight.
|
|
2170
|
+
function opticalOffset(glyph) {
|
|
2171
|
+
const viewBox = glyph.viewBox.baseVal;
|
|
2172
|
+
const size = glyph.width.baseVal.value;
|
|
2173
|
+
if (!viewBox?.width || !size) {
|
|
2174
|
+
return null;
|
|
2175
|
+
}
|
|
2176
|
+
let left = Infinity;
|
|
2177
|
+
let top = Infinity;
|
|
2178
|
+
let right = -Infinity;
|
|
2179
|
+
let bottom = -Infinity;
|
|
2180
|
+
let length = 0;
|
|
2181
|
+
let sumX = 0;
|
|
2182
|
+
let sumY = 0;
|
|
2183
|
+
for (const shape of glyph.querySelectorAll(SHAPES)) {
|
|
2184
|
+
const box = shape.getBBox();
|
|
2185
|
+
left = Math.min(left, box.x);
|
|
2186
|
+
top = Math.min(top, box.y);
|
|
2187
|
+
right = Math.max(right, box.x + box.width);
|
|
2188
|
+
bottom = Math.max(bottom, box.y + box.height);
|
|
2189
|
+
const total = shape.getTotalLength();
|
|
2190
|
+
const steps = Math.max(8, Math.ceil(total * 2));
|
|
2191
|
+
for (let step = 0; step < steps; step++) {
|
|
2192
|
+
const point = shape.getPointAtLength(((step + 0.5) * total) / steps);
|
|
2193
|
+
sumX += (point.x * total) / steps;
|
|
2194
|
+
sumY += (point.y * total) / steps;
|
|
2195
|
+
}
|
|
2196
|
+
length += total;
|
|
2197
|
+
}
|
|
2198
|
+
if (!length) {
|
|
2199
|
+
return null;
|
|
2200
|
+
}
|
|
2201
|
+
const scale = size / viewBox.width;
|
|
2202
|
+
const opticalX = ((left + right) / 2 + sumX / length) / 2;
|
|
2203
|
+
const opticalY = ((top + bottom) / 2 + sumY / length) / 2;
|
|
2204
|
+
return {
|
|
2205
|
+
x: (viewBox.x + viewBox.width / 2 - opticalX) * scale,
|
|
2206
|
+
y: (viewBox.y + viewBox.height / 2 - opticalY) * scale,
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
/**
|
|
2210
|
+
* Moves each `ds-icon` inside the host's `.node` marker so its optical centre sits on the marker's centre.
|
|
2211
|
+
* @internal
|
|
2212
|
+
*/
|
|
2213
|
+
function centreMarkerGlyphs(host) {
|
|
2214
|
+
for (const icon of host.querySelectorAll('.node ds-icon')) {
|
|
2215
|
+
const glyph = icon.querySelector('svg');
|
|
2216
|
+
let offset = null;
|
|
2217
|
+
try {
|
|
2218
|
+
offset = glyph ? opticalOffset(glyph) : null;
|
|
2219
|
+
}
|
|
2220
|
+
catch {
|
|
2221
|
+
// getBBox throws on a glyph that is not rendered (Firefox, display: none).
|
|
2222
|
+
}
|
|
2223
|
+
icon.style.translate = offset
|
|
2224
|
+
? `${offset.x.toFixed(2)}px ${offset.y.toFixed(2)}px`
|
|
2225
|
+
: '';
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Splits each `ds-icon` path inside the host's `.node` marker into one path per stroke and gives every
|
|
2230
|
+
* shape `pathLength="1"`, so the marker can draw its glyph stroke by stroke with a dash offset.
|
|
2231
|
+
* @internal
|
|
2232
|
+
*/
|
|
2233
|
+
function prepareMarkerStrokes(host) {
|
|
2234
|
+
for (const glyph of host.querySelectorAll('.node ds-icon svg')) {
|
|
2235
|
+
for (const path of glyph.querySelectorAll('path')) {
|
|
2236
|
+
// Only an absolute moveto starts a stroke that stands on its own.
|
|
2237
|
+
const strokes = (path.getAttribute('d') ?? '')
|
|
2238
|
+
.split(/(?=M)/)
|
|
2239
|
+
.filter((part) => part.trim());
|
|
2240
|
+
let last = path;
|
|
2241
|
+
for (const stroke of strokes.slice(1)) {
|
|
2242
|
+
const next = path.cloneNode();
|
|
2243
|
+
next.setAttribute('d', stroke);
|
|
2244
|
+
last.after(next);
|
|
2245
|
+
last = next;
|
|
2246
|
+
}
|
|
2247
|
+
if (strokes.length > 1) {
|
|
2248
|
+
path.setAttribute('d', strokes[0]);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
for (const shape of glyph.querySelectorAll(SHAPES)) {
|
|
2252
|
+
shape.setAttribute('pathLength', '1');
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
const heldArcs = new WeakMap();
|
|
2257
|
+
/**
|
|
2258
|
+
* Reads the running spinner's angle and arc length inside the host's `.node` marker, so the arc that
|
|
2259
|
+
* closes in its place goes on from where the spinner is. Call before the spinner leaves the DOM, then
|
|
2260
|
+
* `startMarkerArc` once the arc renders.
|
|
2261
|
+
* @internal
|
|
2262
|
+
*/
|
|
2263
|
+
function holdMarkerArc(host) {
|
|
2264
|
+
const spinner = host.querySelector('.node ds-spinner');
|
|
2265
|
+
const turn = spinner
|
|
2266
|
+
?.getAnimations()
|
|
2267
|
+
.find((animation) => animation.effect?.getComputedTiming().iterations === Infinity);
|
|
2268
|
+
const period = Number(turn?.effect?.getComputedTiming().duration);
|
|
2269
|
+
if (!spinner || !turn || !period) {
|
|
2270
|
+
host.style.removeProperty('--_step-arc-from');
|
|
2271
|
+
host.style.removeProperty('--_step-arc-length');
|
|
2272
|
+
heldArcs.delete(host);
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
heldArcs.set(host, {
|
|
2276
|
+
angle: ((Number(turn.currentTime) % period) / period) * 360,
|
|
2277
|
+
clock: Number(document.timeline.currentTime),
|
|
2278
|
+
period,
|
|
2279
|
+
});
|
|
2280
|
+
host.style.setProperty('--_step-arc-length', getComputedStyle(spinner).getPropertyValue('--_step-arc-sweep'));
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Starts the closing arc at the angle the spinner has turned to since `holdMarkerArc` read it, in the
|
|
2284
|
+
* frame the arc first renders.
|
|
2285
|
+
* @internal
|
|
2286
|
+
*/
|
|
2287
|
+
function startMarkerArc(host) {
|
|
2288
|
+
const held = heldArcs.get(host);
|
|
2289
|
+
const node = host.querySelector('.node');
|
|
2290
|
+
heldArcs.delete(host);
|
|
2291
|
+
if (!held || !node) {
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
const start = () => {
|
|
2295
|
+
const arcs = node
|
|
2296
|
+
.getAnimations({ subtree: true })
|
|
2297
|
+
.filter((animation) => animation.animationName?.includes('ds-step-arc'));
|
|
2298
|
+
if (!arcs.length) {
|
|
2299
|
+
return false;
|
|
2300
|
+
}
|
|
2301
|
+
const now = Number(document.timeline.currentTime);
|
|
2302
|
+
host.style.setProperty('--_step-arc-from', `${(held.angle + ((now - held.clock) / held.period) * 360) % 360}deg`);
|
|
2303
|
+
for (const arc of arcs) {
|
|
2304
|
+
arc.startTime = now;
|
|
2305
|
+
}
|
|
2306
|
+
return true;
|
|
2307
|
+
};
|
|
2308
|
+
if (start()) {
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
// Angular adds the enter class that draws the arc a task after the render.
|
|
2312
|
+
const observer = new MutationObserver(() => start() && observer.disconnect());
|
|
2313
|
+
observer.observe(node, { subtree: true, attributeFilter: ['class'] });
|
|
2314
|
+
setTimeout(() => observer.disconnect(), 1000);
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2165
2317
|
let nextId = 0;
|
|
2166
2318
|
/** Process-wide counter for SSR-safe control ids (no DOM dependency).
|
|
2167
2319
|
* @internal
|
|
@@ -2729,5 +2881,5 @@ function createTypeAhead() {
|
|
|
2729
2881
|
* Generated bundle index. Do not edit.
|
|
2730
2882
|
*/
|
|
2731
2883
|
|
|
2732
|
-
export { CHART_GLIDE_HEAD_START_MS, CHART_HEAT_COLORS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_SKELETON_COUNT, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChartBase, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsFormControlBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, afterTwoFrames, announceOptionCount, areaPath, bandPath, bandScale, chartColors, chartDelay, chartDwell, chartHoverDelayMs, chartOf, chartRenderGate, chartTiming, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, dimmedBy, disposeWithLeave, domainMinOf, dropdownMinWidth, dropdownOverlay, dsAriaCurrent, dsDestination, dwellHighlight, elementWidth, focusIsInside, focusMark, focusRescue, fontsLoaded, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, labelInterval, largestRemainder, leaveMark, leftMark, linePath, lineSegments, linearScale, listenForEscape, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, moveFocusOutOf, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, pointArrowAtHost, prepareOverlayEnter, readOnHostResize, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, skeletonColumnHeights, skeletonFunnelClips, skeletonLineClip, skeletonMarkCount, skeletonWaterfallSteps, staggerDelay, tickValues, trimmedText, tweenMarks, valueControlBridge, watchElementWidth };
|
|
2884
|
+
export { CHART_GLIDE_HEAD_START_MS, CHART_HEAT_COLORS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_SKELETON_COUNT, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChartBase, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsFormControlBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, afterTwoFrames, announceOptionCount, areaPath, bandPath, bandScale, centreMarkerGlyphs, chartColors, chartDelay, chartDwell, chartHoverDelayMs, chartOf, chartRenderGate, chartTiming, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, dimmedBy, disposeWithLeave, domainMinOf, dropdownMinWidth, dropdownOverlay, dsAriaCurrent, dsDestination, dwellHighlight, elementWidth, focusIsInside, focusMark, focusRescue, fontsLoaded, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, holdMarkerArc, labelInterval, largestRemainder, leaveMark, leftMark, linePath, lineSegments, linearScale, listenForEscape, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, moveFocusOutOf, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, pointArrowAtHost, prepareMarkerStrokes, prepareOverlayEnter, readOnHostResize, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, skeletonColumnHeights, skeletonFunnelClips, skeletonLineClip, skeletonMarkCount, skeletonWaterfallSteps, staggerDelay, startMarkerArc, tickValues, trimmedText, tweenMarks, valueControlBridge, watchElementWidth };
|
|
2733
2885
|
//# sourceMappingURL=ids-group-ltd-ids-design-system-components.mjs.map
|