@unofficialbox/box-open-elements 0.18.0 → 0.20.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/dist/components/actions/button-group.js +6 -0
- package/dist/components/actions/button.js +6 -0
- package/dist/components/actions/icon-button.js +6 -0
- package/dist/components/actions/link-button.js +6 -0
- package/dist/components/actions/menu-item.js +6 -0
- package/dist/components/actions/menu.js +6 -0
- package/dist/components/actions/segmented-control.js +6 -0
- package/dist/components/actions/toolbar.js +6 -0
- package/dist/components/collections/card.js +6 -0
- package/dist/components/collections/carousel.js +6 -0
- package/dist/components/collections/check-list.d.ts +10 -0
- package/dist/components/collections/check-list.js +8 -0
- package/dist/components/collections/datalist-item.js +6 -0
- package/dist/components/collections/document-list.d.ts +10 -0
- package/dist/components/collections/document-list.js +8 -0
- package/dist/components/collections/draggable-list.js +6 -0
- package/dist/components/collections/fact-list.d.ts +10 -0
- package/dist/components/collections/fact-list.js +8 -0
- package/dist/components/collections/grid-view.js +6 -0
- package/dist/components/collections/pagination.js +6 -0
- package/dist/components/collections/result-blocks.d.ts +54 -0
- package/dist/components/collections/result-blocks.js +71 -0
- package/dist/components/collections/table.js +6 -0
- package/dist/components/collections/thumbnail-card.js +6 -0
- package/dist/components/collections/tree-grid.js +6 -0
- package/dist/components/collections/tree.js +6 -0
- package/dist/components/feedback/alert.js +1 -1
- package/dist/components/feedback/badge.js +1 -1
- package/dist/components/feedback/badgeable.js +6 -0
- package/dist/components/feedback/chip.js +6 -0
- package/dist/components/feedback/due-badge.js +6 -0
- package/dist/components/feedback/empty-state.js +6 -0
- package/dist/components/feedback/error-mask.js +6 -0
- package/dist/components/feedback/help-text.js +6 -0
- package/dist/components/feedback/indicator.js +1 -1
- package/dist/components/feedback/nudge.js +6 -0
- package/dist/components/feedback/path.js +6 -0
- package/dist/components/feedback/progress-bar.d.ts +9 -0
- package/dist/components/feedback/progress-bar.js +35 -3
- package/dist/components/feedback/progress-ring.js +6 -0
- package/dist/components/feedback/progress-steps.js +6 -0
- package/dist/components/feedback/skeleton.js +6 -0
- package/dist/components/feedback/spinner.js +6 -0
- package/dist/components/feedback/status-icon.d.ts +10 -0
- package/dist/components/feedback/status-icon.js +26 -0
- package/dist/components/feedback/toast.js +1 -1
- package/dist/components/files/drop-zone.js +1 -1
- package/dist/components/forms/calendar.js +6 -0
- package/dist/components/forms/category-selector.js +6 -0
- package/dist/components/forms/checkbox-group.js +6 -0
- package/dist/components/forms/checkbox.js +6 -0
- package/dist/components/forms/color-picker.js +6 -0
- package/dist/components/forms/combobox.js +6 -0
- package/dist/components/forms/date-field.js +6 -0
- package/dist/components/forms/dropdown.js +6 -0
- package/dist/components/forms/dual-listbox.js +6 -0
- package/dist/components/forms/fieldset.js +6 -0
- package/dist/components/forms/multi-select.js +6 -0
- package/dist/components/forms/number-input.js +6 -0
- package/dist/components/forms/pill-cloud.js +6 -0
- package/dist/components/forms/pill-selector-dropdown.js +6 -0
- package/dist/components/forms/radio-group.js +6 -0
- package/dist/components/forms/range-slider.js +6 -0
- package/dist/components/forms/rating.js +6 -0
- package/dist/components/forms/rich-text-input.js +6 -0
- package/dist/components/forms/search-field.js +6 -0
- package/dist/components/forms/select.js +6 -0
- package/dist/components/forms/slider.js +6 -0
- package/dist/components/forms/spin-button.js +6 -0
- package/dist/components/forms/switch.js +6 -0
- package/dist/components/forms/tag-input.js +6 -0
- package/dist/components/forms/text-area.js +6 -0
- package/dist/components/forms/text-field.js +6 -0
- package/dist/components/forms/tile-group.js +1 -1
- package/dist/components/forms/time-field.js +6 -0
- package/dist/components/identity/avatar.js +6 -0
- package/dist/components/identity/contact-datalist-item.js +6 -0
- package/dist/components/identity/persona.js +6 -0
- package/dist/components/layout/app-shell.js +6 -0
- package/dist/components/layout/divider.js +6 -0
- package/dist/components/layout/grid.js +1 -1
- package/dist/components/layout/nav-sidebar.js +6 -0
- package/dist/components/layout/section.js +6 -0
- package/dist/components/layout/sidebar-toggle-button.js +6 -0
- package/dist/components/layout/split-view.js +6 -0
- package/dist/components/navigation/accordion.js +6 -0
- package/dist/components/navigation/breadcrumb.js +6 -0
- package/dist/components/navigation/tabs.js +6 -0
- package/dist/components/output/code-block.js +1 -1
- package/dist/components/output/formatted-value.js +1 -1
- package/dist/components/overlays/command-palette.js +6 -0
- package/dist/components/overlays/context-menu.js +6 -0
- package/dist/components/overlays/guide-tooltip.js +6 -0
- package/dist/components/overlays/popover.js +6 -0
- package/dist/components/overlays/shortcuts-overlay.js +6 -0
- package/dist/components/overlays/tooltip.js +6 -0
- package/dist/components/visuals/illustration.js +6 -0
- package/dist/element-maps.d.ts +39 -19
- package/dist/entries/agent-workspace.d.ts +1 -0
- package/dist/entries/agent-workspace.js +1 -0
- package/dist/entries/call-console.d.ts +1 -0
- package/dist/entries/call-console.js +1 -0
- package/dist/entries/check-list.d.ts +1 -0
- package/dist/entries/check-list.js +1 -0
- package/dist/entries/document-list.d.ts +1 -0
- package/dist/entries/document-list.js +1 -0
- package/dist/entries/fact-list.d.ts +1 -0
- package/dist/entries/fact-list.js +1 -0
- package/dist/entries/result-blocks.d.ts +1 -0
- package/dist/entries/result-blocks.js +1 -0
- package/dist/entries/run-summary.d.ts +1 -0
- package/dist/entries/run-summary.js +1 -0
- package/dist/entries/status-icon.d.ts +1 -0
- package/dist/entries/status-icon.js +1 -0
- package/dist/foundations/motion/behaviors.d.ts +8 -0
- package/dist/foundations/motion/behaviors.js +24 -0
- package/dist/foundations/motion/index.d.ts +2 -0
- package/dist/foundations/motion/index.js +2 -0
- package/dist/foundations/motion/scroll-pin.d.ts +19 -0
- package/dist/foundations/motion/scroll-pin.js +60 -0
- package/dist/foundations/motion/tokens.d.ts +2 -0
- package/dist/foundations/motion/tokens.js +2 -0
- package/dist/foundations/profiles/registry.d.ts +3 -0
- package/dist/foundations/profiles/registry.js +3 -0
- package/dist/foundations/profiles/types.d.ts +3 -0
- package/dist/foundations/status/index.d.ts +6 -0
- package/dist/foundations/status/index.js +33 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/patterns/agent-chat/agent-chat.d.ts +9 -0
- package/dist/patterns/agent-chat/agent-chat.js +141 -21
- package/dist/patterns/agent-chat/controller.d.ts +3 -1
- package/dist/patterns/agent-chat/controller.js +92 -16
- package/dist/patterns/agent-chat/index.d.ts +1 -0
- package/dist/patterns/agent-chat/index.js +1 -0
- package/dist/patterns/agent-chat/ndjson.d.ts +5 -0
- package/dist/patterns/agent-chat/ndjson.js +41 -0
- package/dist/patterns/agent-chat/types.d.ts +44 -1
- package/dist/patterns/agent-workspace/agent-workspace.d.ts +28 -0
- package/dist/patterns/agent-workspace/agent-workspace.js +215 -0
- package/dist/patterns/agent-workspace/controller.d.ts +38 -0
- package/dist/patterns/agent-workspace/controller.js +65 -0
- package/dist/patterns/agent-workspace/index.d.ts +2 -0
- package/dist/patterns/agent-workspace/index.js +2 -0
- package/dist/patterns/audit/activity-density.js +6 -0
- package/dist/patterns/audit/audit-log.js +6 -0
- package/dist/patterns/call-console/call-console.d.ts +17 -0
- package/dist/patterns/call-console/call-console.js +107 -0
- package/dist/patterns/call-console/controller.d.ts +23 -0
- package/dist/patterns/call-console/controller.js +50 -0
- package/dist/patterns/call-console/http-transport.d.ts +3 -0
- package/dist/patterns/call-console/http-transport.js +26 -0
- package/dist/patterns/call-console/index.d.ts +4 -0
- package/dist/patterns/call-console/index.js +4 -0
- package/dist/patterns/call-console/types.d.ts +32 -0
- package/dist/patterns/call-console/types.js +8 -0
- package/dist/patterns/comments/comment-thread.js +6 -0
- package/dist/patterns/content-explorer/adapters/action-menu.js +6 -0
- package/dist/patterns/content-explorer/adapters/breadcrumbs.js +6 -0
- package/dist/patterns/content-explorer/adapters/list.js +6 -0
- package/dist/patterns/content-explorer/adapters/table.js +6 -0
- package/dist/patterns/content-explorer/adapters/toolbar.js +6 -0
- package/dist/patterns/content-explorer/content-explorer.js +6 -0
- package/dist/patterns/content-picker/content-picker.js +6 -0
- package/dist/patterns/content-sidebar/content-sidebar.js +6 -0
- package/dist/patterns/content-uploader/content-uploader.js +8 -1
- package/dist/patterns/diff/compare-view.js +6 -0
- package/dist/patterns/diff/diff-viewer.js +6 -0
- package/dist/patterns/file-request/file-request-builder.js +6 -0
- package/dist/patterns/form-wizard/form-wizard.js +6 -0
- package/dist/patterns/form-wizard/wizard-summary.js +6 -0
- package/dist/patterns/governance/governance-panel.js +6 -0
- package/dist/patterns/insights/bar-chart.js +6 -0
- package/dist/patterns/insights/chart-panel.js +6 -0
- package/dist/patterns/insights/donut-chart.js +6 -0
- package/dist/patterns/insights/line-chart.js +6 -0
- package/dist/patterns/insights/metric-card.js +6 -0
- package/dist/patterns/item/bulk-action-bar.js +6 -0
- package/dist/patterns/item/item-details-panel.js +6 -0
- package/dist/patterns/item/item-form.js +6 -0
- package/dist/patterns/item/preview-header.js +6 -0
- package/dist/patterns/lineage/lineage-graph.js +6 -0
- package/dist/patterns/lineage/provenance-strip.js +6 -0
- package/dist/patterns/metadata/metadata-filter-builder.js +6 -0
- package/dist/patterns/metadata/metadata-inspector.js +6 -0
- package/dist/patterns/notifications/notification-bell.js +6 -0
- package/dist/patterns/notifications/notification-inbox.js +6 -0
- package/dist/patterns/preview/annotation-inspector.js +6 -0
- package/dist/patterns/preview/annotation-toolbar.js +6 -0
- package/dist/patterns/preview/preview-element.js +6 -0
- package/dist/patterns/run/index.d.ts +2 -0
- package/dist/patterns/run/index.js +2 -0
- package/dist/patterns/run/progress.d.ts +24 -0
- package/dist/patterns/run/progress.js +32 -0
- package/dist/patterns/run/run-summary.d.ts +21 -0
- package/dist/patterns/run/run-summary.js +82 -0
- package/dist/patterns/run/run-trace.d.ts +1 -0
- package/dist/patterns/run/run-trace.js +20 -3
- package/dist/patterns/search/filter-bar.js +6 -0
- package/dist/patterns/search/saved-view-picker.js +6 -0
- package/dist/patterns/search/search-results-header.js +6 -0
- package/dist/patterns/share/access-stats.js +6 -0
- package/dist/patterns/share/collaborator-avatars.js +6 -0
- package/dist/patterns/share/invite-collaborators-modal.js +6 -0
- package/dist/patterns/share/permission-matrix.js +6 -0
- package/dist/patterns/share/presence.js +6 -0
- package/dist/patterns/share/share-panel.js +6 -0
- package/dist/patterns/share/unified-share-modal.js +6 -0
- package/dist/patterns/signature/signature-ceremony.js +6 -0
- package/dist/patterns/task/review-queue-item.js +6 -0
- package/dist/patterns/task/task-assignment-panel.js +6 -0
- package/dist/patterns/timeline/timeline.js +6 -0
- package/dist/patterns/versions/version-graph.js +6 -0
- package/dist/patterns/versions/version-list.js +6 -0
- package/dist/patterns/work-queue/work-queue.js +6 -0
- package/dist/patterns/work-queue/workload-board.js +6 -0
- package/package.json +13 -1
|
@@ -15,6 +15,12 @@ const buttonGroupStyles = `
|
|
|
15
15
|
font: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
19
|
+
leaving the element on screen when a host hides it. */
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
[part="group"] {
|
|
19
25
|
display: inline-flex;
|
|
20
26
|
align-items: stretch;
|
|
@@ -15,6 +15,12 @@ const buttonStyles = `
|
|
|
15
15
|
font: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
19
|
+
leaving the element on screen when a host hides it. */
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
button {
|
|
19
25
|
appearance: none;
|
|
20
26
|
box-sizing: border-box;
|
|
@@ -16,6 +16,12 @@ const iconButtonStyles = `
|
|
|
16
16
|
font: inherit;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
20
|
+
leaving the element on screen when a host hides it. */
|
|
21
|
+
:host([hidden]) {
|
|
22
|
+
display: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
[part="button"] {
|
|
20
26
|
appearance: none;
|
|
21
27
|
width: 2rem;
|
|
@@ -30,6 +30,12 @@ const linkButtonStyles = `
|
|
|
30
30
|
font: inherit;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
34
|
+
leaving the element on screen when a host hides it. */
|
|
35
|
+
:host([hidden]) {
|
|
36
|
+
display: none !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
[part="link"] {
|
|
34
40
|
display: inline-flex;
|
|
35
41
|
align-items: center;
|
|
@@ -10,6 +10,12 @@ const menuItemStyles = `
|
|
|
10
10
|
font: inherit;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
14
|
+
leaving the element on screen when a host hides it. */
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
[part="item"] {
|
|
14
20
|
width: 100%;
|
|
15
21
|
appearance: none;
|
|
@@ -17,6 +17,12 @@ const menuStyles = `
|
|
|
17
17
|
font: inherit;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
21
|
+
leaving the element on screen when a host hides it. */
|
|
22
|
+
:host([hidden]) {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
[part="menu"] {
|
|
21
27
|
min-width: 11rem;
|
|
22
28
|
margin: 0;
|
|
@@ -15,6 +15,12 @@ const segmentedControlStyles = `
|
|
|
15
15
|
font: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
19
|
+
leaving the element on screen when a host hides it. */
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
[part="control"] {
|
|
19
25
|
display: inline-flex;
|
|
20
26
|
align-items: stretch;
|
|
@@ -18,6 +18,12 @@ const toolbarStyles = `
|
|
|
18
18
|
font: inherit;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
22
|
+
leaving the element on screen when a host hides it. */
|
|
23
|
+
:host([hidden]) {
|
|
24
|
+
display: none !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
[part="toolbar"] {
|
|
22
28
|
display: flex;
|
|
23
29
|
flex-wrap: wrap;
|
|
@@ -8,6 +8,12 @@ const cardStyles = `
|
|
|
8
8
|
font: inherit;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
12
|
+
leaving the element on screen when a host hides it. */
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
[part="card"] {
|
|
12
18
|
display: grid;
|
|
13
19
|
gap: 0.55rem;
|
|
@@ -16,6 +16,12 @@ const carouselStyles = `
|
|
|
16
16
|
font: inherit;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
20
|
+
leaving the element on screen when a host hides it. */
|
|
21
|
+
:host([hidden]) {
|
|
22
|
+
display: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
[part="carousel"] {
|
|
20
26
|
display: grid;
|
|
21
27
|
gap: 0.55rem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResultBlocks, type ResultBlock } from "./result-blocks.js";
|
|
2
|
+
export declare class CheckList extends ResultBlocks {
|
|
3
|
+
static readonly tagName = "box-check-list";
|
|
4
|
+
get rows(): Extract<ResultBlock, {
|
|
5
|
+
type: "checks";
|
|
6
|
+
}>["rows"];
|
|
7
|
+
set rows(rows: Extract<ResultBlock, {
|
|
8
|
+
type: "checks";
|
|
9
|
+
}>["rows"]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResultBlocks } from "./result-blocks.js";
|
|
2
|
+
const DEFAULT_TAG_NAME = "box-check-list";
|
|
3
|
+
export class CheckList extends ResultBlocks {
|
|
4
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
5
|
+
get rows() { const b = this.blocks[0]; return b?.type === "checks" ? b.rows : []; }
|
|
6
|
+
set rows(rows) { this.blocks = [{ type: "checks", rows }]; }
|
|
7
|
+
}
|
|
8
|
+
CheckList.register();
|
|
@@ -9,6 +9,12 @@ const datalistItemStyles = `
|
|
|
9
9
|
font: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
13
|
+
leaving the element on screen when a host hides it. */
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
[part="item"] {
|
|
13
19
|
display: flex;
|
|
14
20
|
align-items: center;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResultBlocks, type ResultBlock } from "./result-blocks.js";
|
|
2
|
+
export declare class DocumentList extends ResultBlocks {
|
|
3
|
+
static readonly tagName = "box-document-list";
|
|
4
|
+
get items(): Extract<ResultBlock, {
|
|
5
|
+
type: "documents";
|
|
6
|
+
}>["items"];
|
|
7
|
+
set items(items: Extract<ResultBlock, {
|
|
8
|
+
type: "documents";
|
|
9
|
+
}>["items"]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResultBlocks } from "./result-blocks.js";
|
|
2
|
+
const DEFAULT_TAG_NAME = "box-document-list";
|
|
3
|
+
export class DocumentList extends ResultBlocks {
|
|
4
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
5
|
+
get items() { const b = this.blocks[0]; return b?.type === "documents" ? b.items : []; }
|
|
6
|
+
set items(items) { this.blocks = [{ type: "documents", items }]; }
|
|
7
|
+
}
|
|
8
|
+
DocumentList.register();
|
|
@@ -15,6 +15,12 @@ const draggableListStyles = `
|
|
|
15
15
|
font: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
19
|
+
leaving the element on screen when a host hides it. */
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
[part="list"] {
|
|
19
25
|
list-style: none;
|
|
20
26
|
margin: 0;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResultBlocks, type ResultBlock } from "./result-blocks.js";
|
|
2
|
+
export declare class FactList extends ResultBlocks {
|
|
3
|
+
static readonly tagName = "box-fact-list";
|
|
4
|
+
get rows(): Extract<ResultBlock, {
|
|
5
|
+
type: "facts";
|
|
6
|
+
}>["rows"];
|
|
7
|
+
set rows(rows: Extract<ResultBlock, {
|
|
8
|
+
type: "facts";
|
|
9
|
+
}>["rows"]);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResultBlocks } from "./result-blocks.js";
|
|
2
|
+
const DEFAULT_TAG_NAME = "box-fact-list";
|
|
3
|
+
export class FactList extends ResultBlocks {
|
|
4
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
5
|
+
get rows() { const b = this.blocks[0]; return b?.type === "facts" ? b.rows : []; }
|
|
6
|
+
set rows(rows) { this.blocks = [{ type: "facts", rows }]; }
|
|
7
|
+
}
|
|
8
|
+
FactList.register();
|
|
@@ -34,6 +34,12 @@ const gridViewStyles = `
|
|
|
34
34
|
font: inherit;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
38
|
+
leaving the element on screen when a host hides it. */
|
|
39
|
+
:host([hidden]) {
|
|
40
|
+
display: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
[part="grid"] {
|
|
38
44
|
display: grid;
|
|
39
45
|
grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
|
|
@@ -10,6 +10,12 @@ const paginationStyles = `
|
|
|
10
10
|
font: inherit;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
14
|
+
leaving the element on screen when a host hides it. */
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
[part="pagination"] {
|
|
14
20
|
display: inline-flex;
|
|
15
21
|
align-items: center;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BaseElement } from "../../core/element.js";
|
|
2
|
+
export type CheckStatus = "pass" | "warn" | "fail" | "info";
|
|
3
|
+
export type ResultBlock = {
|
|
4
|
+
id?: string;
|
|
5
|
+
} & ({
|
|
6
|
+
type: "facts";
|
|
7
|
+
title?: string;
|
|
8
|
+
rows: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
} | {
|
|
13
|
+
type: "checks";
|
|
14
|
+
title?: string;
|
|
15
|
+
rows: {
|
|
16
|
+
label: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
detail?: string;
|
|
19
|
+
status: CheckStatus;
|
|
20
|
+
}[];
|
|
21
|
+
} | {
|
|
22
|
+
type: "table";
|
|
23
|
+
title?: string;
|
|
24
|
+
columns: string[];
|
|
25
|
+
rows: {
|
|
26
|
+
cells: string[];
|
|
27
|
+
status?: CheckStatus;
|
|
28
|
+
note?: string;
|
|
29
|
+
}[];
|
|
30
|
+
footnote?: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "documents";
|
|
33
|
+
title?: string;
|
|
34
|
+
items: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
detail?: string;
|
|
38
|
+
href?: string;
|
|
39
|
+
}[];
|
|
40
|
+
});
|
|
41
|
+
export declare const resultDocumentIds: (blocks: readonly ResultBlock[]) => string[];
|
|
42
|
+
/** Pure escaped renderer also usable by host-composed conversations. */
|
|
43
|
+
export declare function renderResultBlock(block: ResultBlock): string;
|
|
44
|
+
export declare const resultBlockStyles: string;
|
|
45
|
+
export declare class ResultBlocks extends BaseElement {
|
|
46
|
+
static readonly tagName: string;
|
|
47
|
+
private value;
|
|
48
|
+
get blocks(): ResultBlock[];
|
|
49
|
+
set blocks(value: ResultBlock[]);
|
|
50
|
+
get documentIds(): string[];
|
|
51
|
+
protected renderTemplate(): void;
|
|
52
|
+
protected setupListeners(): void;
|
|
53
|
+
protected update(): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BaseElement } from "../../core/element.js";
|
|
2
|
+
import { isSafeHref } from "../../patterns/internal/safe-href.js";
|
|
3
|
+
import { boeStatusGlyph, boeStatusStyles, statusLabel, toStatusKind } from "../../foundations/status/index.js";
|
|
4
|
+
import { boeEntrance, boeEntranceKeyframes, boeReducedMotionPolicy, boeStaggerStyles } from "../../foundations/motion/index.js";
|
|
5
|
+
const escape = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
6
|
+
const verdict = (s) => ({ pass: "Within policy", warn: "Needs exception", fail: "Outside policy", info: "Information" })[s];
|
|
7
|
+
const glyph = (s) => boeStatusGlyph(toStatusKind(s));
|
|
8
|
+
export const resultDocumentIds = (blocks) => [...new Set(blocks.flatMap(b => b.type === "documents" ? b.items.map(i => i.id) : []))];
|
|
9
|
+
/** Pure escaped renderer also usable by host-composed conversations. */
|
|
10
|
+
export function renderResultBlock(block) {
|
|
11
|
+
const heading = block.title ? `<h3 part="title">${escape(block.title)}</h3>` : "";
|
|
12
|
+
if (block.type === "facts")
|
|
13
|
+
return `${heading}<dl part="facts">${block.rows.map(r => `<div part="row"><dt>${escape(r.label)}</dt><dd>${escape(r.value)}</dd></div>`).join("")}</dl>`;
|
|
14
|
+
if (block.type === "checks")
|
|
15
|
+
return `${heading}<ul part="checks">${block.rows.map(r => `<li part="row">${glyph(r.status)}<div><strong>${escape(r.label)}</strong>${r.detail ? `<p>${escape(r.detail)}</p>` : ""}</div><span part="verdict" data-status="${r.status}">${escape(r.value ?? verdict(r.status))}</span></li>`).join("")}</ul>`;
|
|
16
|
+
if (block.type === "documents")
|
|
17
|
+
return `${heading}<ul part="documents">${block.items.map(i => {
|
|
18
|
+
const content = `<svg aria-hidden="true" width="16" height="20" viewBox="0 0 16 20"><path d="M2 1h8l4 4v14H2zM10 1v5h4" fill="none" stroke="currentColor"/></svg><span><strong>${escape(i.name)}</strong>${i.detail ? `<small>${escape(i.detail)}</small>` : ""}</span>`;
|
|
19
|
+
return `<li part="row">${i.href && isSafeHref(i.href) ? `<a part="document" data-document-id="${escape(i.id)}" href="${escape(i.href)}" target="_blank" rel="noopener noreferrer">${content}</a>` : `<button part="document" data-document-id="${escape(i.id)}">${content}</button>`}</li>`;
|
|
20
|
+
}).join("")}</ul>`;
|
|
21
|
+
return `${heading}<div part="table-frame" role="region" aria-label="${escape(block.title ?? "Results")}" tabindex="0"><table><thead><tr>${block.columns.map(c => `<th scope="col">${escape(c)}</th>`).join("")}</tr></thead><tbody>${block.rows.map(r => `<tr>${r.cells.map((cell, index) => index === 0 ? `<th scope="row">${r.status ? `${glyph(r.status)}<span class="sr">${statusLabel(toStatusKind(r.status))}: </span>` : ""}${escape(cell)}${r.note ? `<small>${escape(r.note)}</small>` : ""}</th>` : `<td>${escape(cell)}</td>`).join("")}</tr>`).join("")}</tbody></table></div>${block.footnote ? `<p>${escape(block.footnote)}</p>` : ""}`;
|
|
22
|
+
}
|
|
23
|
+
export const resultBlockStyles = `
|
|
24
|
+
:host { display:block; min-width:0; color:var(--boe-token-text-text,#222); font:inherit; }
|
|
25
|
+
:host([hidden]){display:none !important} *{box-sizing:border-box} h3{font-size:1em;margin:0 0 .5rem} dl,ul{padding:0;margin:0;list-style:none}
|
|
26
|
+
[part="row"]{border-bottom:1px solid var(--boe-token-stroke-stroke,#ddd);padding:.7rem 0;display:flex;gap:.6rem;align-items:baseline}
|
|
27
|
+
dt{color:var(--boe-token-text-text-secondary,#666)} dd{margin:0 0 0 auto;font-variant-numeric:tabular-nums}
|
|
28
|
+
p{margin:.25rem 0;color:var(--boe-token-text-text-secondary,#666)} small{display:block;font-weight:normal;color:var(--boe-token-text-text-secondary,#666)}
|
|
29
|
+
[part="verdict"]{margin-left:auto;text-align:right} [data-status="warn"]{color:var(--boe-token-text-status-text-warning,#946400)} [data-status="fail"]{color:var(--boe-token-text-status-text-error,#c52a46)}
|
|
30
|
+
[part="document"]{display:flex;gap:.6rem;align-items:center;width:100%;text-align:left;color:inherit;font:inherit;background:none;border:0;text-decoration:none;cursor:pointer}
|
|
31
|
+
[part="table-frame"]{overflow:auto;max-width:100%} table{border-collapse:collapse;min-width:100%;font-variant-numeric:tabular-nums} td,th{padding:.7rem;text-align:left;border-bottom:1px solid var(--boe-token-stroke-stroke,#ddd)} td:last-child{font-weight:600;background:var(--boe-token-surface-surface-secondary,#f7f7f7)}
|
|
32
|
+
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
|
|
33
|
+
[part="block"]{${boeEntrance()}${boeStaggerStyles};margin-block:1rem;min-width:0}
|
|
34
|
+
${boeEntranceKeyframes}${boeStatusStyles}${boeReducedMotionPolicy}`;
|
|
35
|
+
const DEFAULT_TAG_NAME = "box-result-blocks";
|
|
36
|
+
export class ResultBlocks extends BaseElement {
|
|
37
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
38
|
+
value = [];
|
|
39
|
+
get blocks() { return this.value; }
|
|
40
|
+
set blocks(value) { this.value = value; if (this.isRendered)
|
|
41
|
+
this.update(); }
|
|
42
|
+
get documentIds() { return resultDocumentIds(this.value); }
|
|
43
|
+
renderTemplate() { this.shadowRoot.innerHTML = `<style>${resultBlockStyles}</style><div part="blocks"></div>`; }
|
|
44
|
+
setupListeners() {
|
|
45
|
+
this.shadowRoot.addEventListener("click", event => {
|
|
46
|
+
const row = event.target.closest("[data-document-id]");
|
|
47
|
+
if (row)
|
|
48
|
+
this.dispatchEvent(new CustomEvent("document-selected", { bubbles: true, composed: true, detail: { id: row.dataset.documentId } }));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
update() {
|
|
52
|
+
const parent = this.shadowRoot.querySelector('[part="blocks"]');
|
|
53
|
+
this.value.forEach((block, index) => {
|
|
54
|
+
let node = parent.children[index];
|
|
55
|
+
const signature = JSON.stringify(block);
|
|
56
|
+
if (!node) {
|
|
57
|
+
node = document.createElement("section");
|
|
58
|
+
node.setAttribute("part", "block");
|
|
59
|
+
parent.append(node);
|
|
60
|
+
}
|
|
61
|
+
node.style.setProperty("--i", String(index));
|
|
62
|
+
if (node.dataset.signature !== signature) {
|
|
63
|
+
node.innerHTML = renderResultBlock(block);
|
|
64
|
+
node.dataset.signature = signature;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
while (parent.children.length > this.value.length)
|
|
68
|
+
parent.lastElementChild.remove();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
ResultBlocks.register();
|
|
@@ -22,6 +22,12 @@ const tableStyles = `
|
|
|
22
22
|
font: inherit;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
26
|
+
leaving the element on screen when a host hides it. */
|
|
27
|
+
:host([hidden]) {
|
|
28
|
+
display: none !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
[part="shell"] {
|
|
26
32
|
border: ${boePanel.border};
|
|
27
33
|
border-radius: ${boeRadius.large};
|
|
@@ -10,6 +10,12 @@ const thumbnailCardStyles = `
|
|
|
10
10
|
font: inherit;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
14
|
+
leaving the element on screen when a host hides it. */
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
[part="card"] {
|
|
14
20
|
display: grid;
|
|
15
21
|
grid-template-rows: auto auto;
|
|
@@ -25,6 +25,12 @@ const treeGridStyles = `
|
|
|
25
25
|
font: inherit;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
29
|
+
leaving the element on screen when a host hides it. */
|
|
30
|
+
:host([hidden]) {
|
|
31
|
+
display: none !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
[part="controls"] {
|
|
29
35
|
display: flex;
|
|
30
36
|
justify-content: flex-end;
|
|
@@ -25,6 +25,12 @@ const treeStyles = `
|
|
|
25
25
|
font: inherit;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
29
|
+
leaving the element on screen when a host hides it. */
|
|
30
|
+
:host([hidden]) {
|
|
31
|
+
display: none !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
[part="shell"] {
|
|
29
35
|
display: grid;
|
|
30
36
|
grid-template-rows: auto minmax(0, 1fr);
|
|
@@ -9,6 +9,12 @@ const badgeableStyles = `
|
|
|
9
9
|
font: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
13
|
+
leaving the element on screen when a host hides it. */
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
[part="container"] {
|
|
13
19
|
position: relative;
|
|
14
20
|
display: inline-flex;
|
|
@@ -9,6 +9,12 @@ const chipStyles = `
|
|
|
9
9
|
font: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
13
|
+
leaving the element on screen when a host hides it. */
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
[part="chip"] {
|
|
13
19
|
display: inline-flex;
|
|
14
20
|
align-items: center;
|
|
@@ -12,6 +12,12 @@ const elementStyles = `
|
|
|
12
12
|
display: inline-block;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
16
|
+
leaving the element on screen when a host hides it. */
|
|
17
|
+
:host([hidden]) {
|
|
18
|
+
display: none !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
[part="badge"] {
|
|
16
22
|
display: inline-flex;
|
|
17
23
|
align-items: center;
|
|
@@ -10,6 +10,12 @@ const emptyStateStyles = `
|
|
|
10
10
|
font: inherit;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
14
|
+
leaving the element on screen when a host hides it. */
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
[part="empty-state"] {
|
|
14
20
|
display: grid;
|
|
15
21
|
justify-items: center;
|
|
@@ -9,6 +9,12 @@ const errorMaskStyles = `
|
|
|
9
9
|
font: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
13
|
+
leaving the element on screen when a host hides it. */
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
[part="error-mask"] {
|
|
13
19
|
display: flex;
|
|
14
20
|
flex-direction: column;
|
|
@@ -8,6 +8,12 @@ const helpTextStyles = `
|
|
|
8
8
|
font: inherit;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
12
|
+
leaving the element on screen when a host hides it. */
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
[part="help-text"] {
|
|
12
18
|
display: flex;
|
|
13
19
|
align-items: start;
|
|
@@ -9,6 +9,12 @@ const nudgeStyles = `
|
|
|
9
9
|
font: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
13
|
+
leaving the element on screen when a host hides it. */
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
[part="nudge"] {
|
|
13
19
|
display: flex;
|
|
14
20
|
align-items: flex-start;
|
|
@@ -67,6 +67,12 @@ const elementStyles = `
|
|
|
67
67
|
display: block;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* The host's own display would otherwise beat the UA rule for [hidden],
|
|
71
|
+
leaving the element on screen when a host hides it. */
|
|
72
|
+
:host([hidden]) {
|
|
73
|
+
display: none !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
[part="path"] {
|
|
71
77
|
display: flex;
|
|
72
78
|
flex-wrap: wrap;
|
|
@@ -9,6 +9,15 @@ export declare class ProgressBar extends BaseElement {
|
|
|
9
9
|
private indicatorEl;
|
|
10
10
|
get label(): string;
|
|
11
11
|
set label(value: string);
|
|
12
|
+
/**
|
|
13
|
+
* Keep the label as the bar's accessible name but drop it from the layout.
|
|
14
|
+
*
|
|
15
|
+
* For a bar sitting under something that already names it — an upload row
|
|
16
|
+
* showing the filename above it — the visible label is a second copy of text
|
|
17
|
+
* the reader can already see.
|
|
18
|
+
*/
|
|
19
|
+
get hideLabel(): boolean;
|
|
20
|
+
set hideLabel(value: boolean);
|
|
12
21
|
get max(): number;
|
|
13
22
|
set max(value: number);
|
|
14
23
|
get value(): number;
|