@unofficialbox/box-open-elements 0.1.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/LICENSE +21 -0
- package/README.md +125 -0
- package/dist/components/actions/button-group.d.ts +22 -0
- package/dist/components/actions/button-group.js +255 -0
- package/dist/components/actions/button.d.ts +16 -0
- package/dist/components/actions/button.js +190 -0
- package/dist/components/actions/icon-button.d.ts +20 -0
- package/dist/components/actions/icon-button.js +187 -0
- package/dist/components/actions/link-button.d.ts +14 -0
- package/dist/components/actions/link-button.js +137 -0
- package/dist/components/actions/menu-item.d.ts +17 -0
- package/dist/components/actions/menu-item.js +137 -0
- package/dist/components/actions/menu.d.ts +22 -0
- package/dist/components/actions/menu.js +178 -0
- package/dist/components/actions/segmented-control.d.ts +27 -0
- package/dist/components/actions/segmented-control.js +273 -0
- package/dist/components/collections/card.d.ts +13 -0
- package/dist/components/collections/card.js +110 -0
- package/dist/components/collections/carousel.d.ts +40 -0
- package/dist/components/collections/carousel.js +406 -0
- package/dist/components/collections/datalist-item.d.ts +32 -0
- package/dist/components/collections/datalist-item.js +196 -0
- package/dist/components/collections/draggable-list.d.ts +33 -0
- package/dist/components/collections/draggable-list.js +306 -0
- package/dist/components/collections/grid-view.d.ts +38 -0
- package/dist/components/collections/grid-view.js +321 -0
- package/dist/components/collections/pagination.d.ts +19 -0
- package/dist/components/collections/pagination.js +147 -0
- package/dist/components/collections/tree-grid.d.ts +47 -0
- package/dist/components/collections/tree-grid.js +593 -0
- package/dist/components/collections/tree.d.ts +37 -0
- package/dist/components/collections/tree.js +526 -0
- package/dist/components/feedback/alert.d.ts +27 -0
- package/dist/components/feedback/alert.js +263 -0
- package/dist/components/feedback/badge.d.ts +12 -0
- package/dist/components/feedback/badge.js +99 -0
- package/dist/components/feedback/chip.d.ts +33 -0
- package/dist/components/feedback/chip.js +261 -0
- package/dist/components/feedback/empty-state.d.ts +19 -0
- package/dist/components/feedback/empty-state.js +137 -0
- package/dist/components/feedback/error-mask.d.ts +25 -0
- package/dist/components/feedback/error-mask.js +199 -0
- package/dist/components/feedback/help-text.d.ts +22 -0
- package/dist/components/feedback/help-text.js +176 -0
- package/dist/components/feedback/nudge.d.ts +32 -0
- package/dist/components/feedback/nudge.js +299 -0
- package/dist/components/feedback/progress-bar.d.ts +18 -0
- package/dist/components/feedback/progress-bar.js +128 -0
- package/dist/components/feedback/progress-ring.d.ts +21 -0
- package/dist/components/feedback/progress-ring.js +155 -0
- package/dist/components/feedback/progress-steps.d.ts +25 -0
- package/dist/components/feedback/progress-steps.js +276 -0
- package/dist/components/feedback/skeleton.d.ts +14 -0
- package/dist/components/feedback/skeleton.js +95 -0
- package/dist/components/feedback/spinner.d.ts +10 -0
- package/dist/components/feedback/spinner.js +80 -0
- package/dist/components/feedback/toast.d.ts +26 -0
- package/dist/components/feedback/toast.js +205 -0
- package/dist/components/files/drop-zone.d.ts +19 -0
- package/dist/components/files/drop-zone.js +169 -0
- package/dist/components/forms/calendar.d.ts +47 -0
- package/dist/components/forms/calendar.js +499 -0
- package/dist/components/forms/category-selector.d.ts +35 -0
- package/dist/components/forms/category-selector.js +269 -0
- package/dist/components/forms/checkbox-group.d.ts +31 -0
- package/dist/components/forms/checkbox-group.js +267 -0
- package/dist/components/forms/checkbox.d.ts +28 -0
- package/dist/components/forms/checkbox.js +250 -0
- package/dist/components/forms/color-picker.d.ts +34 -0
- package/dist/components/forms/color-picker.js +314 -0
- package/dist/components/forms/combobox.d.ts +37 -0
- package/dist/components/forms/combobox.js +234 -0
- package/dist/components/forms/date-field.d.ts +27 -0
- package/dist/components/forms/date-field.js +187 -0
- package/dist/components/forms/dropdown.d.ts +38 -0
- package/dist/components/forms/dropdown.js +405 -0
- package/dist/components/forms/dual-listbox.d.ts +44 -0
- package/dist/components/forms/dual-listbox.js +484 -0
- package/dist/components/forms/fieldset.d.ts +32 -0
- package/dist/components/forms/fieldset.js +168 -0
- package/dist/components/forms/multi-select.d.ts +30 -0
- package/dist/components/forms/multi-select.js +264 -0
- package/dist/components/forms/number-input.d.ts +32 -0
- package/dist/components/forms/number-input.js +245 -0
- package/dist/components/forms/pill-cloud.d.ts +35 -0
- package/dist/components/forms/pill-cloud.js +230 -0
- package/dist/components/forms/pill-selector-dropdown.d.ts +55 -0
- package/dist/components/forms/pill-selector-dropdown.js +499 -0
- package/dist/components/forms/radio-group.d.ts +32 -0
- package/dist/components/forms/radio-group.js +285 -0
- package/dist/components/forms/range-slider.d.ts +36 -0
- package/dist/components/forms/range-slider.js +294 -0
- package/dist/components/forms/rating.d.ts +31 -0
- package/dist/components/forms/rating.js +302 -0
- package/dist/components/forms/rich-text-input.d.ts +32 -0
- package/dist/components/forms/rich-text-input.js +403 -0
- package/dist/components/forms/search-field.d.ts +27 -0
- package/dist/components/forms/search-field.js +293 -0
- package/dist/components/forms/select.d.ts +30 -0
- package/dist/components/forms/select.js +198 -0
- package/dist/components/forms/slider.d.ts +31 -0
- package/dist/components/forms/slider.js +221 -0
- package/dist/components/forms/spin-button.d.ts +33 -0
- package/dist/components/forms/spin-button.js +352 -0
- package/dist/components/forms/switch.d.ts +32 -0
- package/dist/components/forms/switch.js +302 -0
- package/dist/components/forms/tag-input.d.ts +46 -0
- package/dist/components/forms/tag-input.js +420 -0
- package/dist/components/forms/text-area.d.ts +26 -0
- package/dist/components/forms/text-area.js +188 -0
- package/dist/components/forms/text-field.d.ts +24 -0
- package/dist/components/forms/text-field.js +151 -0
- package/dist/components/forms/time-field.d.ts +29 -0
- package/dist/components/forms/time-field.js +203 -0
- package/dist/components/identity/avatar.d.ts +21 -0
- package/dist/components/identity/avatar.js +191 -0
- package/dist/components/identity/contact-datalist-item.d.ts +31 -0
- package/dist/components/identity/contact-datalist-item.js +235 -0
- package/dist/components/identity/persona.d.ts +28 -0
- package/dist/components/identity/persona.js +272 -0
- package/dist/components/layout/app-shell.d.ts +26 -0
- package/dist/components/layout/app-shell.js +258 -0
- package/dist/components/layout/divider.d.ts +12 -0
- package/dist/components/layout/divider.js +119 -0
- package/dist/components/layout/nav-sidebar.d.ts +23 -0
- package/dist/components/layout/nav-sidebar.js +167 -0
- package/dist/components/layout/section.d.ts +20 -0
- package/dist/components/layout/section.js +143 -0
- package/dist/components/layout/sidebar-toggle-button.d.ts +26 -0
- package/dist/components/layout/sidebar-toggle-button.js +137 -0
- package/dist/components/layout/split-view.d.ts +19 -0
- package/dist/components/layout/split-view.js +157 -0
- package/dist/components/navigation/accordion.d.ts +25 -0
- package/dist/components/navigation/accordion.js +253 -0
- package/dist/components/navigation/tabs.d.ts +27 -0
- package/dist/components/navigation/tabs.js +289 -0
- package/dist/components/overlays/dialog.d.ts +26 -0
- package/dist/components/overlays/dialog.js +267 -0
- package/dist/components/overlays/drawer.d.ts +32 -0
- package/dist/components/overlays/drawer.js +323 -0
- package/dist/components/overlays/popover.d.ts +35 -0
- package/dist/components/overlays/popover.js +317 -0
- package/dist/components/overlays/tooltip.d.ts +26 -0
- package/dist/components/overlays/tooltip.js +204 -0
- package/dist/components/visuals/illustration.d.ts +26 -0
- package/dist/components/visuals/illustration.js +319 -0
- package/dist/core/controller.d.ts +11 -0
- package/dist/core/controller.js +23 -0
- package/dist/core/element.d.ts +22 -0
- package/dist/core/element.js +28 -0
- package/dist/core/event-emitter.d.ts +9 -0
- package/dist/core/event-emitter.js +33 -0
- package/dist/core/form-associated.d.ts +63 -0
- package/dist/core/form-associated.js +218 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +4 -0
- package/dist/core/json-schema.d.ts +1 -0
- package/dist/core/json-schema.js +1 -0
- package/dist/foundations/a11y/focus.d.ts +17 -0
- package/dist/foundations/a11y/focus.js +94 -0
- package/dist/foundations/a11y/heading.d.ts +26 -0
- package/dist/foundations/a11y/heading.js +40 -0
- package/dist/foundations/a11y/index.d.ts +5 -0
- package/dist/foundations/a11y/index.js +3 -0
- package/dist/foundations/a11y/keyboard.d.ts +28 -0
- package/dist/foundations/a11y/keyboard.js +77 -0
- package/dist/foundations/geometry/index.d.ts +1 -0
- package/dist/foundations/geometry/index.js +1 -0
- package/dist/foundations/geometry/tokens.d.ts +123 -0
- package/dist/foundations/geometry/tokens.js +154 -0
- package/dist/foundations/icons/box-iconography.d.ts +479 -0
- package/dist/foundations/icons/box-iconography.generated.d.ts +2370 -0
- package/dist/foundations/icons/box-iconography.generated.js +4010 -0
- package/dist/foundations/icons/box-iconography.js +39 -0
- package/dist/foundations/icons/index.d.ts +1 -0
- package/dist/foundations/icons/index.js +1 -0
- package/dist/foundations/motion/index.d.ts +2 -0
- package/dist/foundations/motion/index.js +1 -0
- package/dist/foundations/motion/tokens.d.ts +39 -0
- package/dist/foundations/motion/tokens.js +43 -0
- package/dist/foundations/tokens/box-dark.d.ts +11 -0
- package/dist/foundations/tokens/box-dark.js +46 -0
- package/dist/foundations/tokens/box-defaults.d.ts +5 -0
- package/dist/foundations/tokens/box-defaults.js +52 -0
- package/dist/foundations/tokens/index.d.ts +5 -0
- package/dist/foundations/tokens/index.js +4 -0
- package/dist/foundations/tokens/interaction.d.ts +28 -0
- package/dist/foundations/tokens/interaction.js +72 -0
- package/dist/foundations/tokens/registry.d.ts +14 -0
- package/dist/foundations/tokens/registry.js +92 -0
- package/dist/foundations/tokens/types.d.ts +16 -0
- package/dist/foundations/tokens/types.js +1 -0
- package/dist/foundations/typography/index.d.ts +2 -0
- package/dist/foundations/typography/index.js +1 -0
- package/dist/foundations/typography/tokens.d.ts +76 -0
- package/dist/foundations/typography/tokens.js +27 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +98 -0
- package/dist/patterns/content-explorer/actions/controller.d.ts +12 -0
- package/dist/patterns/content-explorer/actions/controller.js +36 -0
- package/dist/patterns/content-explorer/actions/index.d.ts +2 -0
- package/dist/patterns/content-explorer/actions/index.js +1 -0
- package/dist/patterns/content-explorer/actions/types.d.ts +13 -0
- package/dist/patterns/content-explorer/actions/types.js +1 -0
- package/dist/patterns/content-explorer/adapters/action-menu.d.ts +24 -0
- package/dist/patterns/content-explorer/adapters/action-menu.js +312 -0
- package/dist/patterns/content-explorer/adapters/breadcrumbs.d.ts +15 -0
- package/dist/patterns/content-explorer/adapters/breadcrumbs.js +161 -0
- package/dist/patterns/content-explorer/adapters/item-summary.d.ts +11 -0
- package/dist/patterns/content-explorer/adapters/item-summary.js +72 -0
- package/dist/patterns/content-explorer/adapters/items.d.ts +4 -0
- package/dist/patterns/content-explorer/adapters/items.js +12 -0
- package/dist/patterns/content-explorer/adapters/list.d.ts +28 -0
- package/dist/patterns/content-explorer/adapters/list.js +527 -0
- package/dist/patterns/content-explorer/adapters/table.d.ts +23 -0
- package/dist/patterns/content-explorer/adapters/table.js +467 -0
- package/dist/patterns/content-explorer/adapters/toolbar.d.ts +19 -0
- package/dist/patterns/content-explorer/adapters/toolbar.js +234 -0
- package/dist/patterns/content-explorer/box-transport.d.ts +44 -0
- package/dist/patterns/content-explorer/box-transport.js +229 -0
- package/dist/patterns/content-explorer/collection/controller.d.ts +17 -0
- package/dist/patterns/content-explorer/collection/controller.js +67 -0
- package/dist/patterns/content-explorer/collection/index.d.ts +2 -0
- package/dist/patterns/content-explorer/collection/index.js +1 -0
- package/dist/patterns/content-explorer/collection/types.d.ts +20 -0
- package/dist/patterns/content-explorer/collection/types.js +1 -0
- package/dist/patterns/content-explorer/content-explorer.d.ts +85 -0
- package/dist/patterns/content-explorer/content-explorer.js +745 -0
- package/dist/patterns/content-explorer/contracts.d.ts +32 -0
- package/dist/patterns/content-explorer/contracts.js +114 -0
- package/dist/patterns/content-explorer/controller.d.ts +34 -0
- package/dist/patterns/content-explorer/controller.js +399 -0
- package/dist/patterns/content-explorer/host-bindings.d.ts +50 -0
- package/dist/patterns/content-explorer/host-bindings.js +76 -0
- package/dist/patterns/content-explorer/index.d.ts +18 -0
- package/dist/patterns/content-explorer/index.js +24 -0
- package/dist/patterns/content-explorer/navigation/controller.d.ts +10 -0
- package/dist/patterns/content-explorer/navigation/controller.js +48 -0
- package/dist/patterns/content-explorer/navigation/index.d.ts +2 -0
- package/dist/patterns/content-explorer/navigation/index.js +1 -0
- package/dist/patterns/content-explorer/navigation/types.d.ts +20 -0
- package/dist/patterns/content-explorer/navigation/types.js +1 -0
- package/dist/patterns/content-explorer/schemas.d.ts +6 -0
- package/dist/patterns/content-explorer/schemas.js +120 -0
- package/dist/patterns/content-explorer/selection/controller.d.ts +12 -0
- package/dist/patterns/content-explorer/selection/controller.js +54 -0
- package/dist/patterns/content-explorer/selection/index.d.ts +2 -0
- package/dist/patterns/content-explorer/selection/index.js +1 -0
- package/dist/patterns/content-explorer/selection/types.d.ts +14 -0
- package/dist/patterns/content-explorer/selection/types.js +1 -0
- package/dist/patterns/content-explorer/types.d.ts +209 -0
- package/dist/patterns/content-explorer/types.js +10 -0
- package/dist/patterns/file-request/file-request-builder.d.ts +36 -0
- package/dist/patterns/file-request/file-request-builder.js +344 -0
- package/dist/patterns/file-request/index.d.ts +1 -0
- package/dist/patterns/file-request/index.js +1 -0
- package/dist/patterns/governance/governance-panel.d.ts +40 -0
- package/dist/patterns/governance/governance-panel.js +351 -0
- package/dist/patterns/governance/index.d.ts +1 -0
- package/dist/patterns/governance/index.js +1 -0
- package/dist/patterns/insights/bar-chart.d.ts +43 -0
- package/dist/patterns/insights/bar-chart.js +462 -0
- package/dist/patterns/insights/chart-panel.d.ts +43 -0
- package/dist/patterns/insights/chart-panel.js +436 -0
- package/dist/patterns/insights/donut-chart.d.ts +43 -0
- package/dist/patterns/insights/donut-chart.js +535 -0
- package/dist/patterns/insights/index.d.ts +5 -0
- package/dist/patterns/insights/index.js +5 -0
- package/dist/patterns/insights/line-chart.d.ts +46 -0
- package/dist/patterns/insights/line-chart.js +511 -0
- package/dist/patterns/insights/metric-card.d.ts +36 -0
- package/dist/patterns/insights/metric-card.js +278 -0
- package/dist/patterns/item/bulk-action-bar.d.ts +35 -0
- package/dist/patterns/item/bulk-action-bar.js +325 -0
- package/dist/patterns/item/index.d.ts +4 -0
- package/dist/patterns/item/index.js +4 -0
- package/dist/patterns/item/item-details-panel.d.ts +61 -0
- package/dist/patterns/item/item-details-panel.js +429 -0
- package/dist/patterns/item/item-form.d.ts +54 -0
- package/dist/patterns/item/item-form.js +485 -0
- package/dist/patterns/item/preview-header.d.ts +46 -0
- package/dist/patterns/item/preview-header.js +323 -0
- package/dist/patterns/metadata/contracts.d.ts +75 -0
- package/dist/patterns/metadata/contracts.js +91 -0
- package/dist/patterns/metadata/index.d.ts +4 -0
- package/dist/patterns/metadata/index.js +4 -0
- package/dist/patterns/metadata/metadata-filter-builder.d.ts +43 -0
- package/dist/patterns/metadata/metadata-filter-builder.js +362 -0
- package/dist/patterns/metadata/metadata-inspector.d.ts +31 -0
- package/dist/patterns/metadata/metadata-inspector.js +245 -0
- package/dist/patterns/metadata/schemas.d.ts +5 -0
- package/dist/patterns/metadata/schemas.js +66 -0
- package/dist/patterns/preview/annotation-inspector.d.ts +44 -0
- package/dist/patterns/preview/annotation-inspector.js +380 -0
- package/dist/patterns/preview/annotation-thread.d.ts +37 -0
- package/dist/patterns/preview/annotation-thread.js +338 -0
- package/dist/patterns/preview/annotation-toolbar.d.ts +42 -0
- package/dist/patterns/preview/annotation-toolbar.js +393 -0
- package/dist/patterns/preview/content-preview-adapter.d.ts +13 -0
- package/dist/patterns/preview/content-preview-adapter.js +30 -0
- package/dist/patterns/preview/index.d.ts +6 -0
- package/dist/patterns/preview/index.js +6 -0
- package/dist/patterns/preview/preview-element.d.ts +41 -0
- package/dist/patterns/preview/preview-element.js +429 -0
- package/dist/patterns/preview/provider-adapter.d.ts +36 -0
- package/dist/patterns/preview/provider-adapter.js +29 -0
- package/dist/patterns/search/filter-bar.d.ts +50 -0
- package/dist/patterns/search/filter-bar.js +379 -0
- package/dist/patterns/search/index.d.ts +3 -0
- package/dist/patterns/search/index.js +3 -0
- package/dist/patterns/search/saved-view-picker.d.ts +25 -0
- package/dist/patterns/search/saved-view-picker.js +239 -0
- package/dist/patterns/search/search-results-header.d.ts +34 -0
- package/dist/patterns/search/search-results-header.js +288 -0
- package/dist/patterns/share/access-stats.d.ts +19 -0
- package/dist/patterns/share/access-stats.js +204 -0
- package/dist/patterns/share/collaborator-avatars.d.ts +22 -0
- package/dist/patterns/share/collaborator-avatars.js +214 -0
- package/dist/patterns/share/contracts.d.ts +65 -0
- package/dist/patterns/share/contracts.js +75 -0
- package/dist/patterns/share/index.d.ts +14 -0
- package/dist/patterns/share/index.js +14 -0
- package/dist/patterns/share/invite-collaborators-contracts.d.ts +38 -0
- package/dist/patterns/share/invite-collaborators-contracts.js +1 -0
- package/dist/patterns/share/invite-collaborators-controller.d.ts +40 -0
- package/dist/patterns/share/invite-collaborators-controller.js +86 -0
- package/dist/patterns/share/invite-collaborators-modal.d.ts +46 -0
- package/dist/patterns/share/invite-collaborators-modal.js +465 -0
- package/dist/patterns/share/permission-matrix.d.ts +37 -0
- package/dist/patterns/share/permission-matrix.js +360 -0
- package/dist/patterns/share/presence-contracts.d.ts +26 -0
- package/dist/patterns/share/presence-contracts.js +1 -0
- package/dist/patterns/share/presence-controller.d.ts +31 -0
- package/dist/patterns/share/presence-controller.js +47 -0
- package/dist/patterns/share/presence.d.ts +32 -0
- package/dist/patterns/share/presence.js +255 -0
- package/dist/patterns/share/schemas.d.ts +4 -0
- package/dist/patterns/share/schemas.js +41 -0
- package/dist/patterns/share/share-panel.d.ts +75 -0
- package/dist/patterns/share/share-panel.js +565 -0
- package/dist/patterns/share/unified-share-controller.d.ts +52 -0
- package/dist/patterns/share/unified-share-controller.js +97 -0
- package/dist/patterns/share/unified-share-modal.d.ts +50 -0
- package/dist/patterns/share/unified-share-modal.js +646 -0
- package/dist/patterns/task/index.d.ts +2 -0
- package/dist/patterns/task/index.js +2 -0
- package/dist/patterns/task/review-queue-item.d.ts +45 -0
- package/dist/patterns/task/review-queue-item.js +403 -0
- package/dist/patterns/task/task-assignment-panel.d.ts +50 -0
- package/dist/patterns/task/task-assignment-panel.js +450 -0
- package/package.json +151 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { BaseElement } from "../../core/index.js";
|
|
2
|
+
import { boePanel } from "../../foundations/geometry/index.js";
|
|
3
|
+
const DEFAULT_TAG_NAME = "box-line-chart";
|
|
4
|
+
const escapeHtml = (value) => value
|
|
5
|
+
.replaceAll("&", "&")
|
|
6
|
+
.replaceAll("<", "<")
|
|
7
|
+
.replaceAll(">", ">")
|
|
8
|
+
.replaceAll('"', """)
|
|
9
|
+
.replaceAll("'", "'");
|
|
10
|
+
const elementStyles = `
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
color: inherit;
|
|
14
|
+
font: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[part="panel"] {
|
|
18
|
+
display: grid;
|
|
19
|
+
gap: ${boePanel.gap};
|
|
20
|
+
padding: ${boePanel.padding};
|
|
21
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 82%, transparent);
|
|
22
|
+
border-radius: ${boePanel.radius};
|
|
23
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface-secondary, #fbfbfb) 96%, var(--boe-token-surface-surface, #ffffff) 4%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part="header"] {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
gap: ${boePanel.gap};
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: start;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part="meta"] {
|
|
35
|
+
display: grid;
|
|
36
|
+
gap: 0.3rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part="header-side"] {
|
|
40
|
+
display: grid;
|
|
41
|
+
gap: 0.45rem;
|
|
42
|
+
justify-items: end;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[part="title"] {
|
|
46
|
+
margin: 0;
|
|
47
|
+
font: inherit;
|
|
48
|
+
font-size: 1.05rem;
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
color: var(--boe-token-text-text, #1f1e1b);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[part="summary"] {
|
|
54
|
+
font-size: 1.35rem;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
line-height: 1.05;
|
|
57
|
+
letter-spacing: -0.03em;
|
|
58
|
+
color: var(--boe-token-text-text, #1f1e1b);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[part="message"] {
|
|
62
|
+
color: var(--boe-token-text-text-secondary, #6f6f6f);
|
|
63
|
+
line-height: 1.4;
|
|
64
|
+
max-inline-size: 42rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[part="timeframe"] {
|
|
68
|
+
font-size: 0.72rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
letter-spacing: 0.08em;
|
|
71
|
+
text-transform: uppercase;
|
|
72
|
+
color: var(--boe-token-text-text-secondary, #6f6f6f);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[part="actions"] {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
gap: 0.5rem;
|
|
79
|
+
justify-content: flex-end;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part="action"] {
|
|
83
|
+
appearance: none;
|
|
84
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 64%, transparent);
|
|
85
|
+
border-radius: 999px;
|
|
86
|
+
background: var(--boe-token-surface-surface, #ffffff);
|
|
87
|
+
color: inherit;
|
|
88
|
+
font: inherit;
|
|
89
|
+
padding: 0.4rem 0.7rem;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[part="action"][data-tone="primary"] {
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
background: var(--boe-token-surface-surface-brand, #0061d5);
|
|
96
|
+
color: var(--boe-token-text-text-on-brand, #ffffff);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[part="visual"] {
|
|
100
|
+
display: grid;
|
|
101
|
+
grid-template-rows: auto auto;
|
|
102
|
+
gap: ${boePanel.gap};
|
|
103
|
+
padding: 0.2rem 0.2rem 0.45rem;
|
|
104
|
+
border-radius: ${boePanel.radius};
|
|
105
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 48%, transparent);
|
|
106
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface, #ffffff) 86%, #eef4fb 14%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[part="chart"] {
|
|
110
|
+
display: block;
|
|
111
|
+
inline-size: 100%;
|
|
112
|
+
block-size: auto;
|
|
113
|
+
aspect-ratio: 16 / 6;
|
|
114
|
+
min-block-size: 13rem;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[part="grid-line"] {
|
|
118
|
+
stroke: color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 52%, transparent);
|
|
119
|
+
stroke-width: 0.7;
|
|
120
|
+
stroke-dasharray: 0.85 2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[part="area"] {
|
|
124
|
+
fill: url(#line-chart-area-gradient);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[part="path"] {
|
|
128
|
+
fill: none;
|
|
129
|
+
stroke: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 82%, transparent);
|
|
130
|
+
stroke-width: 0.65;
|
|
131
|
+
stroke-linecap: round;
|
|
132
|
+
stroke-linejoin: round;
|
|
133
|
+
filter: drop-shadow(
|
|
134
|
+
0 6px 10px color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 18%, transparent)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[part="dot-halo"] {
|
|
139
|
+
fill: rgba(255, 255, 255, 0.92);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[part="dot"] {
|
|
143
|
+
fill: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 88%, var(--boe-token-surface-surface, #ffffff) 12%);
|
|
144
|
+
stroke: rgba(255, 255, 255, 0.98);
|
|
145
|
+
stroke-width: 0.75;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[part="dot"][data-tone="accent"] {
|
|
149
|
+
fill: rgba(90, 124, 247, 0.94);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[part="dot"][data-tone="success"] {
|
|
153
|
+
fill: rgba(38, 194, 129, 0.94);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[part="points"] {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-wrap: wrap;
|
|
159
|
+
gap: 0.6rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[part="point"] {
|
|
163
|
+
appearance: none;
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 0.45rem;
|
|
167
|
+
padding: 0.45rem 0.7rem;
|
|
168
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 52%, transparent);
|
|
169
|
+
border-radius: 999px;
|
|
170
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface-secondary, #fbfbfb) 90%, var(--boe-token-surface-surface, #ffffff) 10%);
|
|
171
|
+
color: inherit;
|
|
172
|
+
font: inherit;
|
|
173
|
+
text-align: left;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[part="point"]:focus-visible {
|
|
178
|
+
outline: 2px solid color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 34%, transparent);
|
|
179
|
+
outline-offset: 2px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[part="point-label"] {
|
|
183
|
+
font-size: 0.74rem;
|
|
184
|
+
font-weight: 700;
|
|
185
|
+
color: var(--boe-token-text-text, #1f1e1b);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[part="point-value"] {
|
|
189
|
+
font-size: 0.72rem;
|
|
190
|
+
color: var(--boe-token-text-text-secondary, #6f6f6f);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[part="legend"] {
|
|
194
|
+
display: flex;
|
|
195
|
+
flex-wrap: wrap;
|
|
196
|
+
gap: 0.5rem;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
[part="legend-item"] {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: 0.45rem;
|
|
203
|
+
padding: 0.34rem 0.56rem;
|
|
204
|
+
border-radius: 999px;
|
|
205
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface, #ffffff) 86%, #eef4fb 14%);
|
|
206
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 48%, transparent);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[part="legend-swatch"] {
|
|
210
|
+
inline-size: 0.7rem;
|
|
211
|
+
block-size: 0.7rem;
|
|
212
|
+
border-radius: 999px;
|
|
213
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 88%, var(--boe-token-surface-surface, #ffffff) 12%);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
[part="legend-item"][data-tone="accent"] [part="legend-swatch"] {
|
|
217
|
+
background: rgba(90, 124, 247, 0.94);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
[part="legend-item"][data-tone="success"] [part="legend-swatch"] {
|
|
221
|
+
background: rgba(38, 194, 129, 0.94);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
[part="legend-label"] {
|
|
225
|
+
font-size: 0.76rem;
|
|
226
|
+
font-weight: 700;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
[part="legend-value"] {
|
|
230
|
+
font-size: 0.72rem;
|
|
231
|
+
color: var(--boe-token-text-text-secondary, #6f6f6f);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
[part="empty"] {
|
|
235
|
+
padding: ${boePanel.padding};
|
|
236
|
+
border-radius: ${boePanel.radius};
|
|
237
|
+
border: 1px dashed color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 70%, transparent);
|
|
238
|
+
color: var(--boe-token-text-text-secondary, #6f6f6f);
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
export class BoxLineChartElement extends BaseElement {
|
|
242
|
+
static get observedAttributes() {
|
|
243
|
+
return ["actions", "legend", "message", "points", "summary", "timeframe", "heading"];
|
|
244
|
+
}
|
|
245
|
+
get actions() {
|
|
246
|
+
return this.parseJsonAttribute("actions", []);
|
|
247
|
+
}
|
|
248
|
+
set actions(value) {
|
|
249
|
+
this.setAttribute("actions", JSON.stringify(value));
|
|
250
|
+
}
|
|
251
|
+
get legend() {
|
|
252
|
+
return this.parseJsonAttribute("legend", []);
|
|
253
|
+
}
|
|
254
|
+
set legend(value) {
|
|
255
|
+
this.setAttribute("legend", JSON.stringify(value));
|
|
256
|
+
}
|
|
257
|
+
get message() {
|
|
258
|
+
return this.getAttribute("message") ?? "";
|
|
259
|
+
}
|
|
260
|
+
set message(value) {
|
|
261
|
+
if (!value) {
|
|
262
|
+
this.removeAttribute("message");
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.setAttribute("message", value);
|
|
266
|
+
}
|
|
267
|
+
get points() {
|
|
268
|
+
return this.parseJsonAttribute("points", []);
|
|
269
|
+
}
|
|
270
|
+
set points(value) {
|
|
271
|
+
this.setAttribute("points", JSON.stringify(value));
|
|
272
|
+
}
|
|
273
|
+
get summary() {
|
|
274
|
+
return this.getAttribute("summary") ?? "";
|
|
275
|
+
}
|
|
276
|
+
set summary(value) {
|
|
277
|
+
if (!value) {
|
|
278
|
+
this.removeAttribute("summary");
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.setAttribute("summary", value);
|
|
282
|
+
}
|
|
283
|
+
get timeframe() {
|
|
284
|
+
return this.getAttribute("timeframe") ?? "";
|
|
285
|
+
}
|
|
286
|
+
set timeframe(value) {
|
|
287
|
+
if (!value) {
|
|
288
|
+
this.removeAttribute("timeframe");
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.setAttribute("timeframe", value);
|
|
292
|
+
}
|
|
293
|
+
get heading() {
|
|
294
|
+
return this.getAttribute("heading") ?? "Line Chart";
|
|
295
|
+
}
|
|
296
|
+
set heading(value) {
|
|
297
|
+
this.setAttribute("heading", value);
|
|
298
|
+
}
|
|
299
|
+
connectedCallback() {
|
|
300
|
+
super.connectedCallback();
|
|
301
|
+
}
|
|
302
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
303
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
304
|
+
}
|
|
305
|
+
parseJsonAttribute(name, fallback) {
|
|
306
|
+
const raw = this.getAttribute(name);
|
|
307
|
+
if (!raw) {
|
|
308
|
+
return fallback;
|
|
309
|
+
}
|
|
310
|
+
try {
|
|
311
|
+
return JSON.parse(raw);
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
return fallback;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
emitAction(actionId) {
|
|
318
|
+
this.dispatchEvent(new CustomEvent("action", {
|
|
319
|
+
bubbles: true,
|
|
320
|
+
composed: true,
|
|
321
|
+
detail: { action: actionId },
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
emitPointSelected(point) {
|
|
325
|
+
this.dispatchEvent(new CustomEvent("point-selected", {
|
|
326
|
+
bubbles: true,
|
|
327
|
+
composed: true,
|
|
328
|
+
detail: point,
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
getCoordinates(points) {
|
|
332
|
+
if (points.length === 0) {
|
|
333
|
+
return [];
|
|
334
|
+
}
|
|
335
|
+
const max = points.reduce((value, point) => Math.max(value, point.value), 0) || 1;
|
|
336
|
+
const min = points.reduce((value, point) => Math.min(value, point.value), points[0]?.value ?? 0);
|
|
337
|
+
const spread = Math.max(max - min, 1);
|
|
338
|
+
const horizontalInset = 0;
|
|
339
|
+
const chartWidth = 100 - horizontalInset * 2;
|
|
340
|
+
return points.map((point, index) => {
|
|
341
|
+
const x = points.length === 1 ? 50 : horizontalInset + (index / (points.length - 1)) * chartWidth;
|
|
342
|
+
const y = 47 - ((point.value - min) / spread) * 40;
|
|
343
|
+
return {
|
|
344
|
+
point,
|
|
345
|
+
x: Number(x.toFixed(2)),
|
|
346
|
+
y: Number(Math.max(4, Math.min(47, y)).toFixed(2)),
|
|
347
|
+
};
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
buildSmoothPath(coordinates) {
|
|
351
|
+
if (coordinates.length === 0) {
|
|
352
|
+
return "";
|
|
353
|
+
}
|
|
354
|
+
if (coordinates.length === 1) {
|
|
355
|
+
const { x, y } = coordinates[0];
|
|
356
|
+
return `M ${x} ${y}`;
|
|
357
|
+
}
|
|
358
|
+
let path = `M ${coordinates[0].x} ${coordinates[0].y}`;
|
|
359
|
+
for (let index = 0; index < coordinates.length - 1; index += 1) {
|
|
360
|
+
const current = coordinates[index];
|
|
361
|
+
const next = coordinates[index + 1];
|
|
362
|
+
const controlX = Number(((current.x + next.x) / 2).toFixed(2));
|
|
363
|
+
path += ` C ${controlX} ${current.y}, ${controlX} ${next.y}, ${next.x} ${next.y}`;
|
|
364
|
+
}
|
|
365
|
+
return path;
|
|
366
|
+
}
|
|
367
|
+
buildAreaPath(coordinates) {
|
|
368
|
+
if (coordinates.length === 0) {
|
|
369
|
+
return "";
|
|
370
|
+
}
|
|
371
|
+
const linePath = this.buildSmoothPath(coordinates);
|
|
372
|
+
const first = coordinates[0];
|
|
373
|
+
const last = coordinates[coordinates.length - 1];
|
|
374
|
+
return `${linePath} L ${last.x} 52 L ${first.x} 52 Z`;
|
|
375
|
+
}
|
|
376
|
+
renderTemplate() {
|
|
377
|
+
if (!this.shadowRoot) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
this.shadowRoot.innerHTML = `
|
|
381
|
+
<style>${elementStyles}</style>
|
|
382
|
+
<div part="content-host"></div>
|
|
383
|
+
`;
|
|
384
|
+
}
|
|
385
|
+
update() {
|
|
386
|
+
if (!this.shadowRoot) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const messageMarkup = this.message ? `<div part="message">${escapeHtml(this.message)}</div>` : "";
|
|
390
|
+
const summaryMarkup = this.summary ? `<div part="summary">${escapeHtml(this.summary)}</div>` : "";
|
|
391
|
+
const timeframeMarkup = this.timeframe ? `<div part="timeframe">${escapeHtml(this.timeframe)}</div>` : "";
|
|
392
|
+
const actionsMarkup = this.actions.length
|
|
393
|
+
? `
|
|
394
|
+
<div part="actions">
|
|
395
|
+
${this.actions
|
|
396
|
+
.map(action => `
|
|
397
|
+
<button type="button" part="action" data-action-id="${escapeHtml(action.id)}" data-tone="${escapeHtml(action.tone ?? "neutral")}">
|
|
398
|
+
${escapeHtml(action.label)}
|
|
399
|
+
</button>
|
|
400
|
+
`)
|
|
401
|
+
.join("")}
|
|
402
|
+
</div>
|
|
403
|
+
`
|
|
404
|
+
: "";
|
|
405
|
+
const coordinates = this.getCoordinates(this.points);
|
|
406
|
+
const linePath = this.buildSmoothPath(coordinates);
|
|
407
|
+
const areaPath = this.buildAreaPath(coordinates);
|
|
408
|
+
const chartMarkup = this.points.length
|
|
409
|
+
? `
|
|
410
|
+
<div part="visual">
|
|
411
|
+
<svg part="chart" viewBox="0 0 100 56" role="img" aria-label="${escapeHtml(this.heading)} trend line">
|
|
412
|
+
<defs>
|
|
413
|
+
<linearGradient id="line-chart-area-gradient" x1="0" y1="0" x2="0" y2="1">
|
|
414
|
+
<stop offset="0%" stop-color="color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 26%, transparent)"></stop>
|
|
415
|
+
<stop offset="100%" stop-color="color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 3%, transparent)"></stop>
|
|
416
|
+
</linearGradient>
|
|
417
|
+
</defs>
|
|
418
|
+
<line part="grid-line" x1="0" y1="5" x2="100" y2="5"></line>
|
|
419
|
+
<line part="grid-line" x1="0" y1="20.5" x2="100" y2="20.5"></line>
|
|
420
|
+
<line part="grid-line" x1="0" y1="36" x2="100" y2="36"></line>
|
|
421
|
+
<line part="grid-line" x1="0" y1="51.5" x2="100" y2="51.5"></line>
|
|
422
|
+
<path part="area" d="${areaPath}"></path>
|
|
423
|
+
<path part="path" d="${linePath}"></path>
|
|
424
|
+
${coordinates
|
|
425
|
+
.map(({ point, x, y }) => {
|
|
426
|
+
return `
|
|
427
|
+
<circle part="dot-halo" cx="${x}" cy="${y}" r="2.2"></circle>
|
|
428
|
+
<circle part="dot" data-tone="${escapeHtml(point.tone ?? "neutral")}" cx="${x}" cy="${y}" r="1.2"></circle>
|
|
429
|
+
`;
|
|
430
|
+
})
|
|
431
|
+
.join("")}
|
|
432
|
+
</svg>
|
|
433
|
+
<div part="points" role="list" aria-label="${escapeHtml(this.heading)} points">
|
|
434
|
+
${coordinates
|
|
435
|
+
.map(({ point }) => `
|
|
436
|
+
<button
|
|
437
|
+
type="button"
|
|
438
|
+
part="point"
|
|
439
|
+
data-point-id="${escapeHtml(point.id)}"
|
|
440
|
+
data-tone="${escapeHtml(point.tone ?? "neutral")}"
|
|
441
|
+
aria-label="${escapeHtml(`${point.label}: ${point.value}`)}"
|
|
442
|
+
>
|
|
443
|
+
<span part="point-label">${escapeHtml(point.label)}</span>
|
|
444
|
+
<span part="point-value">${escapeHtml(String(point.value))}</span>
|
|
445
|
+
</button>
|
|
446
|
+
`)
|
|
447
|
+
.join("")}
|
|
448
|
+
</div>
|
|
449
|
+
</div>
|
|
450
|
+
`
|
|
451
|
+
: `<div part="empty">No line-chart data available.</div>`;
|
|
452
|
+
const legendMarkup = this.legend.length
|
|
453
|
+
? `
|
|
454
|
+
<div part="legend">
|
|
455
|
+
${this.legend
|
|
456
|
+
.map(item => `
|
|
457
|
+
<div part="legend-item" data-tone="${escapeHtml(item.tone ?? "neutral")}">
|
|
458
|
+
<span part="legend-swatch"></span>
|
|
459
|
+
<span part="legend-label">${escapeHtml(item.label)}</span>
|
|
460
|
+
${item.value ? `<span part="legend-value">${escapeHtml(item.value)}</span>` : ""}
|
|
461
|
+
</div>
|
|
462
|
+
`)
|
|
463
|
+
.join("")}
|
|
464
|
+
</div>
|
|
465
|
+
`
|
|
466
|
+
: "";
|
|
467
|
+
const host = this.shadowRoot.querySelector('[part="content-host"]');
|
|
468
|
+
if (!host) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
host.innerHTML = `
|
|
472
|
+
<article part="panel">
|
|
473
|
+
<header part="header">
|
|
474
|
+
<div part="meta">
|
|
475
|
+
<h2 part="title">${escapeHtml(this.heading)}</h2>
|
|
476
|
+
${summaryMarkup}
|
|
477
|
+
${messageMarkup}
|
|
478
|
+
</div>
|
|
479
|
+
<div part="header-side">
|
|
480
|
+
${timeframeMarkup}
|
|
481
|
+
${actionsMarkup}
|
|
482
|
+
</div>
|
|
483
|
+
</header>
|
|
484
|
+
${chartMarkup}
|
|
485
|
+
${legendMarkup}
|
|
486
|
+
</article>
|
|
487
|
+
`;
|
|
488
|
+
this.shadowRoot.querySelectorAll('[part="action"]').forEach(button => {
|
|
489
|
+
button.addEventListener("click", () => {
|
|
490
|
+
const actionId = button.getAttribute("data-action-id");
|
|
491
|
+
if (actionId) {
|
|
492
|
+
this.emitAction(actionId);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
this.shadowRoot.querySelectorAll('[part="point"]').forEach(button => {
|
|
497
|
+
button.addEventListener("click", () => {
|
|
498
|
+
const pointId = button.getAttribute("data-point-id");
|
|
499
|
+
const point = this.points.find(item => item.id === pointId);
|
|
500
|
+
if (point) {
|
|
501
|
+
this.emitPointSelected(point);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
export const defineBoxLineChartElement = (tagName = DEFAULT_TAG_NAME) => {
|
|
508
|
+
if (!customElements.get(tagName)) {
|
|
509
|
+
customElements.define(tagName, BoxLineChartElement);
|
|
510
|
+
}
|
|
511
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseElement } from "../../core/index.js";
|
|
2
|
+
type MetricCardAction = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
tone?: string;
|
|
6
|
+
};
|
|
7
|
+
type MetricCardTrend = {
|
|
8
|
+
direction?: "up" | "down" | "flat";
|
|
9
|
+
label: string;
|
|
10
|
+
tone?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class BoxMetricCardElement extends BaseElement {
|
|
13
|
+
static get observedAttributes(): string[];
|
|
14
|
+
get action(): MetricCardAction | null;
|
|
15
|
+
set action(value: MetricCardAction | null);
|
|
16
|
+
get eyebrow(): string;
|
|
17
|
+
set eyebrow(value: string);
|
|
18
|
+
get message(): string;
|
|
19
|
+
set message(value: string);
|
|
20
|
+
get status(): string;
|
|
21
|
+
set status(value: string);
|
|
22
|
+
get heading(): string;
|
|
23
|
+
set heading(value: string);
|
|
24
|
+
get trend(): MetricCardTrend | null;
|
|
25
|
+
set trend(value: MetricCardTrend | null);
|
|
26
|
+
get value(): string;
|
|
27
|
+
set value(value: string);
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
30
|
+
private parseJsonAttribute;
|
|
31
|
+
private emitAction;
|
|
32
|
+
protected renderTemplate(): void;
|
|
33
|
+
protected update(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare const defineBoxMetricCardElement: (tagName?: string) => void;
|
|
36
|
+
export {};
|