@unofficialbox/box-open-elements 0.3.0 → 0.5.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/README.md +37 -12
- package/dist/components/actions/button-group.d.ts +2 -2
- package/dist/components/actions/button-group.js +3 -9
- package/dist/components/actions/button.d.ts +2 -2
- package/dist/components/actions/button.js +3 -9
- package/dist/components/actions/icon-button.d.ts +2 -2
- package/dist/components/actions/icon-button.js +3 -9
- package/dist/components/actions/link-button.d.ts +11 -2
- package/dist/components/actions/link-button.js +58 -13
- package/dist/components/actions/menu-item.d.ts +2 -2
- package/dist/components/actions/menu-item.js +3 -9
- package/dist/components/actions/menu.d.ts +2 -2
- package/dist/components/actions/menu.js +3 -9
- package/dist/components/actions/segmented-control.d.ts +2 -2
- package/dist/components/actions/segmented-control.js +3 -9
- package/dist/components/collections/card.d.ts +2 -2
- package/dist/components/collections/card.js +3 -9
- package/dist/components/collections/carousel.d.ts +9 -2
- package/dist/components/collections/carousel.js +74 -13
- package/dist/components/collections/datalist-item.d.ts +8 -2
- package/dist/components/collections/datalist-item.js +42 -10
- package/dist/components/collections/draggable-list.d.ts +2 -2
- package/dist/components/collections/draggable-list.js +4 -10
- package/dist/components/collections/grid-view.d.ts +2 -2
- package/dist/components/collections/grid-view.js +10 -12
- package/dist/components/collections/pagination.d.ts +2 -2
- package/dist/components/collections/pagination.js +3 -9
- package/dist/components/collections/table.d.ts +2 -2
- package/dist/components/collections/table.js +3 -9
- package/dist/components/collections/thumbnail-card.d.ts +2 -2
- package/dist/components/collections/thumbnail-card.js +3 -9
- package/dist/components/collections/tree-grid.d.ts +2 -2
- package/dist/components/collections/tree-grid.js +3 -9
- package/dist/components/collections/tree.d.ts +2 -2
- package/dist/components/collections/tree.js +3 -9
- package/dist/components/feedback/alert.d.ts +4 -2
- package/dist/components/feedback/alert.js +33 -10
- package/dist/components/feedback/badge.d.ts +12 -2
- package/dist/components/feedback/badge.js +73 -13
- package/dist/components/feedback/badgeable.d.ts +2 -2
- package/dist/components/feedback/badgeable.js +3 -9
- package/dist/components/feedback/chip.d.ts +7 -2
- package/dist/components/feedback/chip.js +77 -11
- package/dist/components/feedback/empty-state.d.ts +2 -2
- package/dist/components/feedback/empty-state.js +3 -9
- package/dist/components/feedback/error-mask.d.ts +4 -2
- package/dist/components/feedback/error-mask.js +26 -9
- package/dist/components/feedback/help-text.d.ts +2 -2
- package/dist/components/feedback/help-text.js +10 -9
- package/dist/components/feedback/nudge.d.ts +2 -2
- package/dist/components/feedback/nudge.js +3 -9
- package/dist/components/feedback/progress-bar.d.ts +2 -2
- package/dist/components/feedback/progress-bar.js +3 -9
- package/dist/components/feedback/progress-ring.d.ts +2 -2
- package/dist/components/feedback/progress-ring.js +3 -9
- package/dist/components/feedback/progress-steps.d.ts +2 -2
- package/dist/components/feedback/progress-steps.js +3 -9
- package/dist/components/feedback/skeleton.d.ts +2 -2
- package/dist/components/feedback/skeleton.js +3 -9
- package/dist/components/feedback/spinner.d.ts +6 -2
- package/dist/components/feedback/spinner.js +33 -11
- package/dist/components/feedback/toast.d.ts +7 -2
- package/dist/components/feedback/toast.js +62 -20
- package/dist/components/files/drop-zone.d.ts +2 -2
- package/dist/components/files/drop-zone.js +3 -9
- package/dist/components/forms/calendar.d.ts +2 -2
- package/dist/components/forms/calendar.js +3 -9
- package/dist/components/forms/category-selector.d.ts +13 -2
- package/dist/components/forms/category-selector.js +214 -26
- package/dist/components/forms/checkbox-group.d.ts +2 -2
- package/dist/components/forms/checkbox-group.js +3 -9
- package/dist/components/forms/checkbox.d.ts +8 -2
- package/dist/components/forms/checkbox.js +61 -10
- package/dist/components/forms/color-picker.d.ts +2 -2
- package/dist/components/forms/color-picker.js +3 -9
- package/dist/components/forms/combobox.d.ts +32 -3
- package/dist/components/forms/combobox.js +351 -53
- package/dist/components/forms/date-field.d.ts +9 -2
- package/dist/components/forms/date-field.js +76 -10
- package/dist/components/forms/dropdown.d.ts +7 -2
- package/dist/components/forms/dropdown.js +35 -12
- package/dist/components/forms/dual-listbox.d.ts +2 -2
- package/dist/components/forms/dual-listbox.js +3 -9
- package/dist/components/forms/fieldset.d.ts +2 -2
- package/dist/components/forms/fieldset.js +3 -9
- package/dist/components/forms/multi-select.d.ts +2 -2
- package/dist/components/forms/multi-select.js +3 -9
- package/dist/components/forms/number-input.d.ts +2 -2
- package/dist/components/forms/number-input.js +3 -9
- package/dist/components/forms/pill-cloud.d.ts +2 -2
- package/dist/components/forms/pill-cloud.js +3 -9
- package/dist/components/forms/pill-selector-dropdown.d.ts +2 -2
- package/dist/components/forms/pill-selector-dropdown.js +3 -9
- package/dist/components/forms/radio-group.d.ts +11 -10
- package/dist/components/forms/radio-group.js +46 -15
- package/dist/components/forms/range-slider.d.ts +2 -2
- package/dist/components/forms/range-slider.js +3 -9
- package/dist/components/forms/rating.d.ts +2 -2
- package/dist/components/forms/rating.js +3 -9
- package/dist/components/forms/rich-text-input.d.ts +2 -2
- package/dist/components/forms/rich-text-input.js +3 -9
- package/dist/components/forms/search-field.d.ts +10 -2
- package/dist/components/forms/search-field.js +58 -22
- package/dist/components/forms/select.d.ts +20 -10
- package/dist/components/forms/select.js +107 -23
- package/dist/components/forms/slider.d.ts +2 -2
- package/dist/components/forms/slider.js +3 -9
- package/dist/components/forms/spin-button.d.ts +2 -2
- package/dist/components/forms/spin-button.js +3 -9
- package/dist/components/forms/switch.d.ts +2 -2
- package/dist/components/forms/switch.js +3 -9
- package/dist/components/forms/tag-input.d.ts +2 -2
- package/dist/components/forms/tag-input.js +3 -9
- package/dist/components/forms/text-area.d.ts +2 -2
- package/dist/components/forms/text-area.js +3 -9
- package/dist/components/forms/text-field.d.ts +15 -2
- package/dist/components/forms/text-field.js +139 -10
- package/dist/components/forms/time-field.d.ts +13 -2
- package/dist/components/forms/time-field.js +54 -9
- package/dist/components/identity/avatar.d.ts +6 -2
- package/dist/components/identity/avatar.js +68 -10
- package/dist/components/identity/contact-datalist-item.d.ts +10 -2
- package/dist/components/identity/contact-datalist-item.js +74 -11
- package/dist/components/identity/persona.d.ts +2 -2
- package/dist/components/identity/persona.js +3 -9
- package/dist/components/layout/app-shell.d.ts +2 -2
- package/dist/components/layout/app-shell.js +3 -9
- package/dist/components/layout/divider.d.ts +2 -2
- package/dist/components/layout/divider.js +3 -9
- package/dist/components/layout/nav-sidebar.d.ts +2 -2
- package/dist/components/layout/nav-sidebar.js +26 -9
- package/dist/components/layout/section.d.ts +2 -2
- package/dist/components/layout/section.js +3 -9
- package/dist/components/layout/sidebar-toggle-button.d.ts +5 -2
- package/dist/components/layout/sidebar-toggle-button.js +24 -11
- package/dist/components/layout/split-view.d.ts +2 -2
- package/dist/components/layout/split-view.js +3 -9
- package/dist/components/navigation/accordion.d.ts +5 -2
- package/dist/components/navigation/accordion.js +20 -11
- package/dist/components/navigation/breadcrumb.d.ts +2 -2
- package/dist/components/navigation/breadcrumb.js +3 -9
- package/dist/components/navigation/tabs.d.ts +2 -2
- package/dist/components/navigation/tabs.js +3 -9
- package/dist/components/overlays/context-menu.d.ts +2 -2
- package/dist/components/overlays/context-menu.js +3 -9
- package/dist/components/overlays/dialog.d.ts +2 -2
- package/dist/components/overlays/dialog.js +3 -9
- package/dist/components/overlays/drawer.d.ts +2 -2
- package/dist/components/overlays/drawer.js +3 -9
- package/dist/components/overlays/guide-tooltip.d.ts +51 -0
- package/dist/components/overlays/guide-tooltip.js +355 -0
- package/dist/components/overlays/popover.d.ts +2 -2
- package/dist/components/overlays/popover.js +3 -9
- package/dist/components/overlays/tooltip.d.ts +12 -2
- package/dist/components/overlays/tooltip.js +77 -20
- package/dist/components/visuals/illustration.d.ts +2 -2
- package/dist/components/visuals/illustration.js +3 -9
- package/dist/core/element.d.ts +5 -1
- package/dist/core/element.js +29 -1
- package/dist/entries/access-stats.d.ts +1 -0
- package/dist/entries/access-stats.js +1 -0
- package/dist/entries/accordion.d.ts +1 -0
- package/dist/entries/accordion.js +1 -0
- package/dist/entries/alert.d.ts +1 -0
- package/dist/entries/alert.js +1 -0
- package/dist/entries/annotation-inspector.d.ts +1 -0
- package/dist/entries/annotation-inspector.js +1 -0
- package/dist/entries/annotation-thread.d.ts +1 -0
- package/dist/entries/annotation-thread.js +1 -0
- package/dist/entries/annotation-toolbar.d.ts +1 -0
- package/dist/entries/annotation-toolbar.js +1 -0
- package/dist/entries/app-shell.d.ts +1 -0
- package/dist/entries/app-shell.js +1 -0
- package/dist/entries/avatar.d.ts +1 -0
- package/dist/entries/avatar.js +1 -0
- package/dist/entries/badge.d.ts +1 -0
- package/dist/entries/badge.js +1 -0
- package/dist/entries/badgeable.d.ts +1 -0
- package/dist/entries/badgeable.js +1 -0
- package/dist/entries/bar-chart.d.ts +1 -0
- package/dist/entries/bar-chart.js +1 -0
- package/dist/entries/breadcrumb.d.ts +1 -0
- package/dist/entries/breadcrumb.js +1 -0
- package/dist/entries/bulk-action-bar.d.ts +1 -0
- package/dist/entries/bulk-action-bar.js +1 -0
- package/dist/entries/button-group.d.ts +1 -0
- package/dist/entries/button-group.js +1 -0
- package/dist/entries/button.d.ts +1 -0
- package/dist/entries/button.js +1 -0
- package/dist/entries/calendar.d.ts +1 -0
- package/dist/entries/calendar.js +1 -0
- package/dist/entries/card.d.ts +1 -0
- package/dist/entries/card.js +1 -0
- package/dist/entries/carousel.d.ts +1 -0
- package/dist/entries/carousel.js +1 -0
- package/dist/entries/category-selector.d.ts +1 -0
- package/dist/entries/category-selector.js +1 -0
- package/dist/entries/chart-panel.d.ts +1 -0
- package/dist/entries/chart-panel.js +1 -0
- package/dist/entries/checkbox-group.d.ts +1 -0
- package/dist/entries/checkbox-group.js +1 -0
- package/dist/entries/checkbox.d.ts +1 -0
- package/dist/entries/checkbox.js +1 -0
- package/dist/entries/chip.d.ts +1 -0
- package/dist/entries/chip.js +1 -0
- package/dist/entries/collaborator-avatars.d.ts +1 -0
- package/dist/entries/collaborator-avatars.js +1 -0
- package/dist/entries/color-picker.d.ts +1 -0
- package/dist/entries/color-picker.js +1 -0
- package/dist/entries/combobox.d.ts +1 -0
- package/dist/entries/combobox.js +1 -0
- package/dist/entries/contact-datalist-item.d.ts +1 -0
- package/dist/entries/contact-datalist-item.js +1 -0
- package/dist/entries/content-explorer.d.ts +1 -0
- package/dist/entries/content-explorer.js +1 -0
- package/dist/entries/context-menu.d.ts +1 -0
- package/dist/entries/context-menu.js +1 -0
- package/dist/entries/datalist-item.d.ts +1 -0
- package/dist/entries/datalist-item.js +1 -0
- package/dist/entries/date-field.d.ts +1 -0
- package/dist/entries/date-field.js +1 -0
- package/dist/entries/dialog.d.ts +1 -0
- package/dist/entries/dialog.js +1 -0
- package/dist/entries/divider.d.ts +1 -0
- package/dist/entries/divider.js +1 -0
- package/dist/entries/donut-chart.d.ts +1 -0
- package/dist/entries/donut-chart.js +1 -0
- package/dist/entries/draggable-list.d.ts +1 -0
- package/dist/entries/draggable-list.js +1 -0
- package/dist/entries/drawer.d.ts +1 -0
- package/dist/entries/drawer.js +1 -0
- package/dist/entries/drop-zone.d.ts +1 -0
- package/dist/entries/drop-zone.js +1 -0
- package/dist/entries/dropdown.d.ts +1 -0
- package/dist/entries/dropdown.js +1 -0
- package/dist/entries/dual-listbox.d.ts +1 -0
- package/dist/entries/dual-listbox.js +1 -0
- package/dist/entries/empty-state.d.ts +1 -0
- package/dist/entries/empty-state.js +1 -0
- package/dist/entries/error-mask.d.ts +1 -0
- package/dist/entries/error-mask.js +1 -0
- package/dist/entries/explorer-action-menu.d.ts +1 -0
- package/dist/entries/explorer-action-menu.js +1 -0
- package/dist/entries/explorer-breadcrumbs.d.ts +1 -0
- package/dist/entries/explorer-breadcrumbs.js +1 -0
- package/dist/entries/explorer-items.d.ts +1 -0
- package/dist/entries/explorer-items.js +1 -0
- package/dist/entries/explorer-list.d.ts +1 -0
- package/dist/entries/explorer-list.js +1 -0
- package/dist/entries/explorer-table.d.ts +1 -0
- package/dist/entries/explorer-table.js +1 -0
- package/dist/entries/explorer-toolbar.d.ts +1 -0
- package/dist/entries/explorer-toolbar.js +1 -0
- package/dist/entries/fieldset.d.ts +1 -0
- package/dist/entries/fieldset.js +1 -0
- package/dist/entries/file-request-builder.d.ts +1 -0
- package/dist/entries/file-request-builder.js +1 -0
- package/dist/entries/filter-bar.d.ts +1 -0
- package/dist/entries/filter-bar.js +1 -0
- package/dist/entries/governance-panel.d.ts +1 -0
- package/dist/entries/governance-panel.js +1 -0
- package/dist/entries/grid-view.d.ts +1 -0
- package/dist/entries/grid-view.js +1 -0
- package/dist/entries/guide-tooltip.d.ts +1 -0
- package/dist/entries/guide-tooltip.js +1 -0
- package/dist/entries/help-text.d.ts +1 -0
- package/dist/entries/help-text.js +1 -0
- package/dist/entries/icon-button.d.ts +1 -0
- package/dist/entries/icon-button.js +1 -0
- package/dist/entries/illustration.d.ts +1 -0
- package/dist/entries/illustration.js +1 -0
- package/dist/entries/invite-collaborators-modal.d.ts +1 -0
- package/dist/entries/invite-collaborators-modal.js +1 -0
- package/dist/entries/item-details-panel.d.ts +1 -0
- package/dist/entries/item-details-panel.js +1 -0
- package/dist/entries/item-form.d.ts +1 -0
- package/dist/entries/item-form.js +1 -0
- package/dist/entries/line-chart.d.ts +1 -0
- package/dist/entries/line-chart.js +1 -0
- package/dist/entries/link-button.d.ts +1 -0
- package/dist/entries/link-button.js +1 -0
- package/dist/entries/menu-item.d.ts +1 -0
- package/dist/entries/menu-item.js +1 -0
- package/dist/entries/menu.d.ts +1 -0
- package/dist/entries/menu.js +1 -0
- package/dist/entries/metadata-filter-builder.d.ts +1 -0
- package/dist/entries/metadata-filter-builder.js +1 -0
- package/dist/entries/metadata-inspector.d.ts +1 -0
- package/dist/entries/metadata-inspector.js +1 -0
- package/dist/entries/metric-card.d.ts +1 -0
- package/dist/entries/metric-card.js +1 -0
- package/dist/entries/multi-select.d.ts +1 -0
- package/dist/entries/multi-select.js +1 -0
- package/dist/entries/nav-sidebar.d.ts +1 -0
- package/dist/entries/nav-sidebar.js +1 -0
- package/dist/entries/nudge.d.ts +1 -0
- package/dist/entries/nudge.js +1 -0
- package/dist/entries/number-input.d.ts +1 -0
- package/dist/entries/number-input.js +1 -0
- package/dist/entries/pagination.d.ts +1 -0
- package/dist/entries/pagination.js +1 -0
- package/dist/entries/permission-matrix.d.ts +1 -0
- package/dist/entries/permission-matrix.js +1 -0
- package/dist/entries/persona.d.ts +1 -0
- package/dist/entries/persona.js +1 -0
- package/dist/entries/pill-cloud.d.ts +1 -0
- package/dist/entries/pill-cloud.js +1 -0
- package/dist/entries/pill-selector-dropdown.d.ts +1 -0
- package/dist/entries/pill-selector-dropdown.js +1 -0
- package/dist/entries/popover.d.ts +1 -0
- package/dist/entries/popover.js +1 -0
- package/dist/entries/presence.d.ts +1 -0
- package/dist/entries/presence.js +1 -0
- package/dist/entries/preview-header.d.ts +1 -0
- package/dist/entries/preview-header.js +1 -0
- package/dist/entries/preview.d.ts +1 -0
- package/dist/entries/preview.js +1 -0
- package/dist/entries/progress-bar.d.ts +1 -0
- package/dist/entries/progress-bar.js +1 -0
- package/dist/entries/progress-ring.d.ts +1 -0
- package/dist/entries/progress-ring.js +1 -0
- package/dist/entries/progress-steps.d.ts +1 -0
- package/dist/entries/progress-steps.js +1 -0
- package/dist/entries/radio-group.d.ts +1 -0
- package/dist/entries/radio-group.js +1 -0
- package/dist/entries/range-slider.d.ts +1 -0
- package/dist/entries/range-slider.js +1 -0
- package/dist/entries/rating.d.ts +1 -0
- package/dist/entries/rating.js +1 -0
- package/dist/entries/review-queue-item.d.ts +1 -0
- package/dist/entries/review-queue-item.js +1 -0
- package/dist/entries/rich-text-input.d.ts +1 -0
- package/dist/entries/rich-text-input.js +1 -0
- package/dist/entries/saved-view-picker.d.ts +1 -0
- package/dist/entries/saved-view-picker.js +1 -0
- package/dist/entries/search-field.d.ts +1 -0
- package/dist/entries/search-field.js +1 -0
- package/dist/entries/search-results-header.d.ts +1 -0
- package/dist/entries/search-results-header.js +1 -0
- package/dist/entries/section.d.ts +1 -0
- package/dist/entries/section.js +1 -0
- package/dist/entries/segmented-control.d.ts +1 -0
- package/dist/entries/segmented-control.js +1 -0
- package/dist/entries/select.d.ts +1 -0
- package/dist/entries/select.js +1 -0
- package/dist/entries/share-panel.d.ts +1 -0
- package/dist/entries/share-panel.js +1 -0
- package/dist/entries/sidebar-toggle-button.d.ts +1 -0
- package/dist/entries/sidebar-toggle-button.js +1 -0
- package/dist/entries/skeleton.d.ts +1 -0
- package/dist/entries/skeleton.js +1 -0
- package/dist/entries/slider.d.ts +1 -0
- package/dist/entries/slider.js +1 -0
- package/dist/entries/spin-button.d.ts +1 -0
- package/dist/entries/spin-button.js +1 -0
- package/dist/entries/spinner.d.ts +1 -0
- package/dist/entries/spinner.js +1 -0
- package/dist/entries/split-view.d.ts +1 -0
- package/dist/entries/split-view.js +1 -0
- package/dist/entries/switch.d.ts +1 -0
- package/dist/entries/switch.js +1 -0
- package/dist/entries/table.d.ts +1 -0
- package/dist/entries/table.js +1 -0
- package/dist/entries/tabs.d.ts +1 -0
- package/dist/entries/tabs.js +1 -0
- package/dist/entries/tag-input.d.ts +1 -0
- package/dist/entries/tag-input.js +1 -0
- package/dist/entries/task-assignment-panel.d.ts +1 -0
- package/dist/entries/task-assignment-panel.js +1 -0
- package/dist/entries/text-area.d.ts +1 -0
- package/dist/entries/text-area.js +1 -0
- package/dist/entries/text-field.d.ts +1 -0
- package/dist/entries/text-field.js +1 -0
- package/dist/entries/thumbnail-card.d.ts +1 -0
- package/dist/entries/thumbnail-card.js +1 -0
- package/dist/entries/time-field.d.ts +1 -0
- package/dist/entries/time-field.js +1 -0
- package/dist/entries/toast.d.ts +1 -0
- package/dist/entries/toast.js +1 -0
- package/dist/entries/tooltip.d.ts +1 -0
- package/dist/entries/tooltip.js +1 -0
- package/dist/entries/tree-grid.d.ts +1 -0
- package/dist/entries/tree-grid.js +1 -0
- package/dist/entries/tree.d.ts +1 -0
- package/dist/entries/tree.js +1 -0
- package/dist/entries/unified-share-modal.d.ts +1 -0
- package/dist/entries/unified-share-modal.js +1 -0
- package/dist/foundations/geometry/tokens.d.ts +46 -45
- package/dist/foundations/geometry/tokens.js +46 -45
- package/dist/foundations/motion/tokens.d.ts +10 -10
- package/dist/foundations/motion/tokens.js +10 -10
- package/dist/foundations/overlay/positioning.js +5 -1
- package/dist/foundations/profiles/built-ins.d.ts +4 -0
- package/dist/foundations/profiles/built-ins.js +131 -0
- package/dist/foundations/profiles/controller.d.ts +4 -0
- package/dist/foundations/profiles/controller.js +107 -0
- package/dist/foundations/profiles/index.d.ts +4 -0
- package/dist/foundations/profiles/index.js +3 -0
- package/dist/foundations/profiles/registry.d.ts +72 -0
- package/dist/foundations/profiles/registry.js +119 -0
- package/dist/foundations/profiles/types.d.ts +94 -0
- package/dist/foundations/profiles/types.js +1 -0
- package/dist/foundations/theming/controller.d.ts +37 -0
- package/dist/foundations/theming/controller.js +176 -0
- package/dist/foundations/theming/index.d.ts +2 -0
- package/dist/foundations/theming/index.js +1 -0
- package/dist/foundations/tokens/box-dark.d.ts +3 -3
- package/dist/foundations/tokens/box-defaults.d.ts +3 -3
- package/dist/foundations/tokens/index.d.ts +2 -2
- package/dist/foundations/tokens/index.js +1 -1
- package/dist/foundations/tokens/registry.d.ts +37 -7
- package/dist/foundations/tokens/registry.js +55 -5
- package/dist/foundations/tokens/types.d.ts +38 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -1
- package/dist/patterns/content-explorer/adapters/action-menu.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/action-menu.js +3 -9
- package/dist/patterns/content-explorer/adapters/breadcrumbs.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/breadcrumbs.js +3 -9
- package/dist/patterns/content-explorer/adapters/items.d.ts +3 -3
- package/dist/patterns/content-explorer/adapters/items.js +4 -10
- package/dist/patterns/content-explorer/adapters/list.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/list.js +3 -9
- package/dist/patterns/content-explorer/adapters/table.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/table.js +3 -9
- package/dist/patterns/content-explorer/adapters/toolbar.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/toolbar.js +7 -13
- package/dist/patterns/content-explorer/content-explorer.d.ts +15 -15
- package/dist/patterns/content-explorer/content-explorer.js +5 -11
- package/dist/patterns/file-request/file-request-builder.d.ts +2 -2
- package/dist/patterns/file-request/file-request-builder.js +3 -9
- package/dist/patterns/governance/governance-panel.d.ts +2 -2
- package/dist/patterns/governance/governance-panel.js +3 -6
- package/dist/patterns/insights/bar-chart.d.ts +2 -2
- package/dist/patterns/insights/bar-chart.js +3 -6
- package/dist/patterns/insights/chart-panel.d.ts +2 -2
- package/dist/patterns/insights/chart-panel.js +3 -6
- package/dist/patterns/insights/donut-chart.d.ts +2 -2
- package/dist/patterns/insights/donut-chart.js +3 -6
- package/dist/patterns/insights/line-chart.d.ts +2 -2
- package/dist/patterns/insights/line-chart.js +3 -6
- package/dist/patterns/insights/metric-card.d.ts +2 -2
- package/dist/patterns/insights/metric-card.js +3 -6
- package/dist/patterns/item/bulk-action-bar.d.ts +2 -2
- package/dist/patterns/item/bulk-action-bar.js +3 -6
- package/dist/patterns/item/item-details-panel.d.ts +2 -2
- package/dist/patterns/item/item-details-panel.js +3 -9
- package/dist/patterns/item/item-form.d.ts +2 -2
- package/dist/patterns/item/item-form.js +3 -9
- package/dist/patterns/item/preview-header.d.ts +2 -2
- package/dist/patterns/item/preview-header.js +3 -9
- package/dist/patterns/metadata/metadata-filter-builder.d.ts +2 -2
- package/dist/patterns/metadata/metadata-filter-builder.js +3 -9
- package/dist/patterns/metadata/metadata-inspector.d.ts +2 -2
- package/dist/patterns/metadata/metadata-inspector.js +3 -9
- package/dist/patterns/preview/annotation-inspector.d.ts +2 -2
- package/dist/patterns/preview/annotation-inspector.js +3 -9
- package/dist/patterns/preview/annotation-thread.d.ts +2 -2
- package/dist/patterns/preview/annotation-thread.js +3 -9
- package/dist/patterns/preview/annotation-toolbar.d.ts +2 -2
- package/dist/patterns/preview/annotation-toolbar.js +3 -9
- package/dist/patterns/preview/preview-element.d.ts +2 -2
- package/dist/patterns/preview/preview-element.js +3 -9
- package/dist/patterns/search/filter-bar.d.ts +2 -2
- package/dist/patterns/search/filter-bar.js +3 -9
- package/dist/patterns/search/saved-view-picker.d.ts +2 -2
- package/dist/patterns/search/saved-view-picker.js +3 -9
- package/dist/patterns/search/search-results-header.d.ts +2 -2
- package/dist/patterns/search/search-results-header.js +3 -9
- package/dist/patterns/share/access-stats.d.ts +2 -2
- package/dist/patterns/share/access-stats.js +3 -9
- package/dist/patterns/share/collaborator-avatars.d.ts +2 -2
- package/dist/patterns/share/collaborator-avatars.js +3 -9
- package/dist/patterns/share/invite-collaborators-modal.d.ts +2 -2
- package/dist/patterns/share/invite-collaborators-modal.js +3 -9
- package/dist/patterns/share/permission-matrix.d.ts +2 -2
- package/dist/patterns/share/permission-matrix.js +3 -9
- package/dist/patterns/share/presence.d.ts +2 -2
- package/dist/patterns/share/presence.js +3 -9
- package/dist/patterns/share/share-panel.d.ts +2 -2
- package/dist/patterns/share/share-panel.js +3 -9
- package/dist/patterns/share/unified-share-modal.d.ts +2 -2
- package/dist/patterns/share/unified-share-modal.js +3 -9
- package/dist/patterns/task/review-queue-item.d.ts +2 -2
- package/dist/patterns/task/review-queue-item.js +3 -6
- package/dist/patterns/task/task-assignment-panel.d.ts +2 -2
- package/dist/patterns/task/task-assignment-panel.js +3 -6
- package/package.json +5 -1
|
@@ -90,6 +90,22 @@ const alertStyles = `
|
|
|
90
90
|
display: none;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/* Rich body — slotted markup (links, buttons) beyond the plain message.
|
|
94
|
+
Hidden (taking no grid gap) until content is assigned. */
|
|
95
|
+
[part="rich"] {
|
|
96
|
+
display: block;
|
|
97
|
+
line-height: 1.45;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[part="rich"]:not(.has-content) {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[part="rich"]::slotted(a) {
|
|
105
|
+
color: var(--boe-token-surface-surface-brand, #0061d5);
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
}
|
|
108
|
+
|
|
93
109
|
.sr-only {
|
|
94
110
|
position: absolute;
|
|
95
111
|
inline-size: 1px;
|
|
@@ -120,7 +136,8 @@ const alertStyles = `
|
|
|
120
136
|
|
|
121
137
|
${boeNeutralInteractiveStyles('[part="dismiss"]')}
|
|
122
138
|
`;
|
|
123
|
-
export class
|
|
139
|
+
export class Alert extends BaseElement {
|
|
140
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
124
141
|
static get observedAttributes() {
|
|
125
142
|
return ["description", "heading", "message", "open", "tone"];
|
|
126
143
|
}
|
|
@@ -129,6 +146,7 @@ export class BoxAlertElement extends BaseElement {
|
|
|
129
146
|
toneLabelEl;
|
|
130
147
|
titleEl;
|
|
131
148
|
messageEl;
|
|
149
|
+
richSlot;
|
|
132
150
|
dismissEl;
|
|
133
151
|
get open() {
|
|
134
152
|
return this.openValue;
|
|
@@ -202,6 +220,7 @@ export class BoxAlertElement extends BaseElement {
|
|
|
202
220
|
<span part="tone-label" class="sr-only"></span>
|
|
203
221
|
<h2 part="title" id="alert-title" hidden></h2>
|
|
204
222
|
<span part="description message" hidden></span>
|
|
223
|
+
<slot part="rich"></slot>
|
|
205
224
|
</div>
|
|
206
225
|
<button type="button" part="dismiss" aria-label="Dismiss alert">Dismiss</button>
|
|
207
226
|
</div>
|
|
@@ -210,19 +229,30 @@ export class BoxAlertElement extends BaseElement {
|
|
|
210
229
|
this.toneLabelEl = this.shadowRoot.querySelector('[part="tone-label"]');
|
|
211
230
|
this.titleEl = this.shadowRoot.querySelector('[part="title"]');
|
|
212
231
|
this.messageEl = this.shadowRoot.querySelector('[part~="description"]');
|
|
232
|
+
this.richSlot = this.shadowRoot.querySelector('slot[part="rich"]');
|
|
213
233
|
this.dismissEl = this.shadowRoot.querySelector('[part="dismiss"]');
|
|
214
234
|
}
|
|
235
|
+
hasRichContent() {
|
|
236
|
+
return this.richSlot?.assignedNodes({ flatten: true }).length > 0;
|
|
237
|
+
}
|
|
215
238
|
setupListeners() {
|
|
216
239
|
this.dismissEl.addEventListener("click", () => {
|
|
217
240
|
this.dismiss();
|
|
218
241
|
});
|
|
242
|
+
this.richSlot.addEventListener("slotchange", () => {
|
|
243
|
+
if (this.isRendered) {
|
|
244
|
+
this.update();
|
|
245
|
+
}
|
|
246
|
+
});
|
|
219
247
|
}
|
|
220
248
|
update() {
|
|
221
249
|
if (!this.alertEl) {
|
|
222
250
|
return;
|
|
223
251
|
}
|
|
224
|
-
const
|
|
252
|
+
const hasRich = this.hasRichContent();
|
|
253
|
+
const visible = this.openValue && Boolean(this.heading || this.message || hasRich);
|
|
225
254
|
this.hidden = !visible;
|
|
255
|
+
this.richSlot.classList.toggle("has-content", hasRich);
|
|
226
256
|
if (!visible) {
|
|
227
257
|
return;
|
|
228
258
|
}
|
|
@@ -253,11 +283,4 @@ export class BoxAlertElement extends BaseElement {
|
|
|
253
283
|
}
|
|
254
284
|
}
|
|
255
285
|
}
|
|
256
|
-
|
|
257
|
-
const existingElement = customElements.get(tagName);
|
|
258
|
-
if (existingElement) {
|
|
259
|
-
return existingElement;
|
|
260
|
-
}
|
|
261
|
-
customElements.define(tagName, BoxAlertElement);
|
|
262
|
-
return BoxAlertElement;
|
|
263
|
-
};
|
|
286
|
+
Alert.register();
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { BaseElement } from "../../core/index.js";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class Badge extends BaseElement {
|
|
3
|
+
static readonly tagName: string;
|
|
3
4
|
static get observedAttributes(): string[];
|
|
4
5
|
private badgeEl;
|
|
6
|
+
private lastText;
|
|
5
7
|
get label(): string;
|
|
6
8
|
set label(value: string);
|
|
7
9
|
get tone(): string;
|
|
8
10
|
set tone(value: string);
|
|
11
|
+
/** When the label is a count, cap the displayed number, e.g. max=99 → "99+". */
|
|
12
|
+
get max(): number | null;
|
|
13
|
+
set max(value: number | null);
|
|
14
|
+
/** Hide the badge entirely when the count is zero or the label is empty. */
|
|
15
|
+
get hideWhenZero(): boolean;
|
|
16
|
+
set hideWhenZero(value: boolean);
|
|
17
|
+
/** The label after applying the `max` cap (e.g. "128" with max=99 → "99+"). */
|
|
18
|
+
private displayText;
|
|
19
|
+
private isEmptyCount;
|
|
9
20
|
protected renderTemplate(): void;
|
|
10
21
|
protected update(): void;
|
|
11
22
|
}
|
|
12
|
-
export declare const defineBoxBadgeElement: (tagName?: string) => typeof BoxBadgeElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseElement } from "../../core/index.js";
|
|
2
2
|
import { boeRadius } from "../../foundations/geometry/index.js";
|
|
3
|
-
import { boeMotionDuration, boeMotionEasing } from "../../foundations/motion/index.js";
|
|
3
|
+
import { boeMotionDuration, boeMotionEasing, boeReducedMotionStyles, } from "../../foundations/motion/index.js";
|
|
4
4
|
const DEFAULT_TAG_NAME = "box-badge";
|
|
5
5
|
const badgeStyles = `
|
|
6
6
|
:host {
|
|
@@ -52,12 +52,32 @@ const badgeStyles = `
|
|
|
52
52
|
background: var(--boe-token-surface-status-surface-inprogress, #f5b31b);
|
|
53
53
|
color: #ffffff;
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
/* Hidden when used as a count that is zero/empty with hide-when-zero. */
|
|
57
|
+
:host([hidden]) {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Count "pop" when the value changes (opt-in via the animate attribute). */
|
|
62
|
+
[part="badge"].boe-pop {
|
|
63
|
+
animation: boe-badge-pop ${boeMotionDuration.interactive} ${boeMotionEasing.standard};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes boe-badge-pop {
|
|
67
|
+
0% { transform: scale(0.7); }
|
|
68
|
+
60% { transform: scale(1.15); }
|
|
69
|
+
100% { transform: scale(1); }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
${boeReducedMotionStyles('[part="badge"].boe-pop', "animation: none;")}
|
|
55
73
|
`;
|
|
56
|
-
export class
|
|
74
|
+
export class Badge extends BaseElement {
|
|
75
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
57
76
|
static get observedAttributes() {
|
|
58
|
-
return ["label", "tone"];
|
|
77
|
+
return ["label", "tone", "max", "hide-when-zero", "animate"];
|
|
59
78
|
}
|
|
60
79
|
badgeEl;
|
|
80
|
+
lastText = null;
|
|
61
81
|
get label() {
|
|
62
82
|
return this.getAttribute("label") ?? "";
|
|
63
83
|
}
|
|
@@ -70,6 +90,42 @@ export class BoxBadgeElement extends BaseElement {
|
|
|
70
90
|
set tone(value) {
|
|
71
91
|
this.setAttribute("tone", value);
|
|
72
92
|
}
|
|
93
|
+
/** When the label is a count, cap the displayed number, e.g. max=99 → "99+". */
|
|
94
|
+
get max() {
|
|
95
|
+
const raw = this.getAttribute("max");
|
|
96
|
+
if (raw === null)
|
|
97
|
+
return null;
|
|
98
|
+
const parsed = Number(raw);
|
|
99
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
100
|
+
}
|
|
101
|
+
set max(value) {
|
|
102
|
+
if (value === null) {
|
|
103
|
+
this.removeAttribute("max");
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.setAttribute("max", String(value));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** Hide the badge entirely when the count is zero or the label is empty. */
|
|
110
|
+
get hideWhenZero() {
|
|
111
|
+
return this.hasAttribute("hide-when-zero");
|
|
112
|
+
}
|
|
113
|
+
set hideWhenZero(value) {
|
|
114
|
+
this.toggleAttribute("hide-when-zero", value);
|
|
115
|
+
}
|
|
116
|
+
/** The label after applying the `max` cap (e.g. "128" with max=99 → "99+"). */
|
|
117
|
+
displayText() {
|
|
118
|
+
const raw = this.label;
|
|
119
|
+
const max = this.max;
|
|
120
|
+
if (max !== null && /^\d+$/.test(raw.trim()) && Number(raw) > max) {
|
|
121
|
+
return `${max}+`;
|
|
122
|
+
}
|
|
123
|
+
return raw;
|
|
124
|
+
}
|
|
125
|
+
isEmptyCount() {
|
|
126
|
+
const raw = this.label.trim();
|
|
127
|
+
return raw === "" || raw === "0";
|
|
128
|
+
}
|
|
73
129
|
renderTemplate() {
|
|
74
130
|
if (!this.shadowRoot) {
|
|
75
131
|
return;
|
|
@@ -84,16 +140,20 @@ export class BoxBadgeElement extends BaseElement {
|
|
|
84
140
|
if (!this.badgeEl) {
|
|
85
141
|
return;
|
|
86
142
|
}
|
|
143
|
+
// Hide when used as a count that is zero/empty and hide-when-zero is set.
|
|
144
|
+
const shouldHide = this.hideWhenZero && this.isEmptyCount();
|
|
145
|
+
this.toggleAttribute("hidden", shouldHide);
|
|
146
|
+
const text = this.displayText();
|
|
87
147
|
this.badgeEl.dataset.tone = this.tone;
|
|
88
|
-
this.badgeEl.setAttribute("aria-label",
|
|
89
|
-
this.badgeEl.textContent =
|
|
148
|
+
this.badgeEl.setAttribute("aria-label", text);
|
|
149
|
+
this.badgeEl.textContent = text;
|
|
150
|
+
// Re-trigger the pop animation when an animated count actually changes.
|
|
151
|
+
if (this.hasAttribute("animate") && this.lastText !== null && this.lastText !== text) {
|
|
152
|
+
this.badgeEl.classList.remove("boe-pop");
|
|
153
|
+
void this.badgeEl.offsetWidth; // force reflow so the animation restarts
|
|
154
|
+
this.badgeEl.classList.add("boe-pop");
|
|
155
|
+
}
|
|
156
|
+
this.lastText = text;
|
|
90
157
|
}
|
|
91
158
|
}
|
|
92
|
-
|
|
93
|
-
const existingElement = customElements.get(tagName);
|
|
94
|
-
if (existingElement) {
|
|
95
|
-
return existingElement;
|
|
96
|
-
}
|
|
97
|
-
customElements.define(tagName, BoxBadgeElement);
|
|
98
|
-
return BoxBadgeElement;
|
|
99
|
-
};
|
|
159
|
+
Badge.register();
|
|
@@ -5,10 +5,10 @@ import { BaseElement } from "../../core/index.js";
|
|
|
5
5
|
* named slot (`top-left`, `top-right`, `bottom-left`, `bottom-right`). Corners
|
|
6
6
|
* with no assigned content are hidden so they don't capture pointer events.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class Badgeable extends BaseElement {
|
|
9
|
+
static readonly tagName: string;
|
|
9
10
|
private corners;
|
|
10
11
|
protected renderTemplate(): void;
|
|
11
12
|
protected setupListeners(): void;
|
|
12
13
|
protected update(): void;
|
|
13
14
|
}
|
|
14
|
-
export declare const defineBoxBadgeableElement: (tagName?: string) => typeof BoxBadgeableElement;
|
|
@@ -41,7 +41,8 @@ const badgeableStyles = `
|
|
|
41
41
|
* named slot (`top-left`, `top-right`, `bottom-left`, `bottom-right`). Corners
|
|
42
42
|
* with no assigned content are hidden so they don't capture pointer events.
|
|
43
43
|
*/
|
|
44
|
-
export class
|
|
44
|
+
export class Badgeable extends BaseElement {
|
|
45
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
45
46
|
corners = new Map();
|
|
46
47
|
renderTemplate() {
|
|
47
48
|
if (!this.shadowRoot) {
|
|
@@ -74,11 +75,4 @@ export class BoxBadgeableElement extends BaseElement {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
const existingElement = customElements.get(tagName);
|
|
79
|
-
if (existingElement) {
|
|
80
|
-
return existingElement;
|
|
81
|
-
}
|
|
82
|
-
customElements.define(tagName, BoxBadgeableElement);
|
|
83
|
-
return BoxBadgeableElement;
|
|
84
|
-
};
|
|
78
|
+
Badgeable.register();
|
|
@@ -4,11 +4,16 @@ import { BaseElement } from "../../core/index.js";
|
|
|
4
4
|
* is interactive: it can be selected and it can be dismissed, emitting `remove`
|
|
5
5
|
* with its `value` so a host list can drop it.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class Chip extends BaseElement {
|
|
8
|
+
static readonly tagName: string;
|
|
8
9
|
static get observedAttributes(): string[];
|
|
9
10
|
private chipEl;
|
|
10
11
|
private labelEl;
|
|
12
|
+
private iconSlot;
|
|
11
13
|
private removeEl;
|
|
14
|
+
/** Chip size: `medium` (default) or `small`. */
|
|
15
|
+
get size(): string;
|
|
16
|
+
set size(value: string);
|
|
12
17
|
get label(): string;
|
|
13
18
|
set label(value: string);
|
|
14
19
|
get value(): string;
|
|
@@ -28,6 +33,6 @@ export declare class BoxChipElement extends BaseElement {
|
|
|
28
33
|
protected renderTemplate(): void;
|
|
29
34
|
protected setupListeners(): void;
|
|
30
35
|
private syncRemoveButton;
|
|
36
|
+
private syncIconSlot;
|
|
31
37
|
protected update(): void;
|
|
32
38
|
}
|
|
33
|
-
export declare const defineBoxChipElement: (tagName?: string) => typeof BoxChipElement;
|
|
@@ -42,12 +42,59 @@ const chipStyles = `
|
|
|
42
42
|
background: color-mix(in srgb, var(--boe-token-surface-surface-hover, #f4f4f4) 70%, var(--boe-token-surface-surface-secondary, #fbfbfb) 30%);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
[part="chip"][data-tone="brand"]
|
|
45
|
+
[part="chip"][data-tone="brand"],
|
|
46
|
+
[part="chip"][data-tone="info"] {
|
|
46
47
|
border-color: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 26%, transparent);
|
|
47
48
|
background: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 10%, var(--boe-token-surface-surface, #ffffff) 90%);
|
|
48
49
|
color: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 72%, var(--boe-token-text-text, #222222));
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
[part="chip"][data-tone="success"] {
|
|
53
|
+
border-color: color-mix(in srgb, var(--boe-token-surface-status-surface-success, #26c281) 32%, transparent);
|
|
54
|
+
background: color-mix(in srgb, var(--boe-token-surface-status-surface-success, #26c281) 12%, var(--boe-token-surface-surface, #ffffff) 88%);
|
|
55
|
+
color: color-mix(in srgb, var(--boe-token-surface-status-surface-success, #26c281) 60%, var(--boe-token-text-text, #222222));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[part="chip"][data-tone="warning"] {
|
|
59
|
+
border-color: color-mix(in srgb, var(--boe-token-surface-status-surface-inprogress, #f5b31b) 40%, transparent);
|
|
60
|
+
background: color-mix(in srgb, var(--boe-token-surface-status-surface-inprogress, #f5b31b) 16%, var(--boe-token-surface-surface, #ffffff) 84%);
|
|
61
|
+
color: color-mix(in srgb, var(--boe-token-surface-status-surface-inprogress, #f5b31b) 58%, var(--boe-token-text-text, #222222));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[part="chip"][data-tone="error"] {
|
|
65
|
+
border-color: color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 30%, transparent);
|
|
66
|
+
background: color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 10%, var(--boe-token-surface-surface, #ffffff) 90%);
|
|
67
|
+
color: color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 70%, var(--boe-token-text-text, #222222));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Compact size. */
|
|
71
|
+
[part="chip"][data-size="small"] {
|
|
72
|
+
gap: 0.25rem;
|
|
73
|
+
padding: 0.14rem 0.28rem 0.14rem 0.55rem;
|
|
74
|
+
font-size: 0.74rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[part="chip"][data-size="small"]:not([data-removable="true"]) {
|
|
78
|
+
padding-inline-end: 0.55rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Leading icon slot — hidden (and taking no gap) until content is assigned. */
|
|
82
|
+
[part="icon"] {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
flex: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[part="icon"]:not(.has-content) {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[part="icon"]::slotted(*) {
|
|
93
|
+
inline-size: 0.95rem;
|
|
94
|
+
block-size: 0.95rem;
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
51
98
|
[part="chip"][data-selected="true"],
|
|
52
99
|
[part="chip"][data-selected="true"]:hover:not([data-disabled="true"]),
|
|
53
100
|
[part="chip"][data-selected="true"]:active:not([data-disabled="true"]) {
|
|
@@ -92,13 +139,22 @@ const chipStyles = `
|
|
|
92
139
|
* is interactive: it can be selected and it can be dismissed, emitting `remove`
|
|
93
140
|
* with its `value` so a host list can drop it.
|
|
94
141
|
*/
|
|
95
|
-
export class
|
|
142
|
+
export class Chip extends BaseElement {
|
|
143
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
96
144
|
static get observedAttributes() {
|
|
97
|
-
return ["disabled", "label", "removable", "selectable", "selected", "tone", "value"];
|
|
145
|
+
return ["disabled", "label", "removable", "selectable", "selected", "size", "tone", "value"];
|
|
98
146
|
}
|
|
99
147
|
chipEl;
|
|
100
148
|
labelEl;
|
|
149
|
+
iconSlot;
|
|
101
150
|
removeEl = null;
|
|
151
|
+
/** Chip size: `medium` (default) or `small`. */
|
|
152
|
+
get size() {
|
|
153
|
+
return this.getAttribute("size") === "small" ? "small" : "medium";
|
|
154
|
+
}
|
|
155
|
+
set size(value) {
|
|
156
|
+
this.setAttribute("size", value);
|
|
157
|
+
}
|
|
102
158
|
get label() {
|
|
103
159
|
return this.getAttribute("label") ?? "";
|
|
104
160
|
}
|
|
@@ -169,13 +225,16 @@ export class BoxChipElement extends BaseElement {
|
|
|
169
225
|
this.shadowRoot.innerHTML = `
|
|
170
226
|
<style>${chipStyles}</style>
|
|
171
227
|
<span part="chip">
|
|
228
|
+
<slot name="icon" part="icon"></slot>
|
|
172
229
|
<span part="label"></span>
|
|
173
230
|
</span>
|
|
174
231
|
`;
|
|
175
232
|
this.chipEl = this.shadowRoot.querySelector('[part="chip"]');
|
|
176
233
|
this.labelEl = this.shadowRoot.querySelector('[part="label"]');
|
|
234
|
+
this.iconSlot = this.shadowRoot.querySelector('slot[name="icon"]');
|
|
177
235
|
}
|
|
178
236
|
setupListeners() {
|
|
237
|
+
this.iconSlot.addEventListener("slotchange", () => this.syncIconSlot());
|
|
179
238
|
this.chipEl.addEventListener("click", event => {
|
|
180
239
|
if (event.target.closest('[part="remove"]')) {
|
|
181
240
|
return;
|
|
@@ -217,11 +276,25 @@ export class BoxChipElement extends BaseElement {
|
|
|
217
276
|
this.removeEl = null;
|
|
218
277
|
}
|
|
219
278
|
}
|
|
279
|
+
syncIconSlot() {
|
|
280
|
+
if (!this.iconSlot) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const hasContent = this.iconSlot.assignedNodes({ flatten: true }).length > 0;
|
|
284
|
+
this.iconSlot.classList.toggle("has-content", hasContent);
|
|
285
|
+
}
|
|
220
286
|
update() {
|
|
221
287
|
if (!this.chipEl) {
|
|
222
288
|
return;
|
|
223
289
|
}
|
|
224
290
|
this.chipEl.dataset.tone = this.tone;
|
|
291
|
+
if (this.size === "medium") {
|
|
292
|
+
this.chipEl.removeAttribute("data-size");
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.chipEl.dataset.size = this.size;
|
|
296
|
+
}
|
|
297
|
+
this.syncIconSlot();
|
|
225
298
|
this.chipEl.dataset.removable = this.removable ? "true" : "false";
|
|
226
299
|
this.chipEl.dataset.selected = this.selected ? "true" : "false";
|
|
227
300
|
this.chipEl.dataset.disabled = this.disabled ? "true" : "false";
|
|
@@ -251,11 +324,4 @@ export class BoxChipElement extends BaseElement {
|
|
|
251
324
|
this.syncRemoveButton();
|
|
252
325
|
}
|
|
253
326
|
}
|
|
254
|
-
|
|
255
|
-
const existingElement = customElements.get(tagName);
|
|
256
|
-
if (existingElement) {
|
|
257
|
-
return existingElement;
|
|
258
|
-
}
|
|
259
|
-
customElements.define(tagName, BoxChipElement);
|
|
260
|
-
return BoxChipElement;
|
|
261
|
-
};
|
|
327
|
+
Chip.register();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseElement } from "../../core/index.js";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class EmptyState extends BaseElement {
|
|
3
|
+
static readonly tagName: string;
|
|
3
4
|
static get observedAttributes(): string[];
|
|
4
5
|
private titleEl;
|
|
5
6
|
private messageEl;
|
|
@@ -16,4 +17,3 @@ export declare class BoxEmptyStateElement extends BaseElement {
|
|
|
16
17
|
protected setupListeners(): void;
|
|
17
18
|
protected update(): void;
|
|
18
19
|
}
|
|
19
|
-
export declare const defineBoxEmptyStateElement: (tagName?: string) => typeof BoxEmptyStateElement;
|
|
@@ -55,7 +55,8 @@ const emptyStateStyles = `
|
|
|
55
55
|
display: none;
|
|
56
56
|
}
|
|
57
57
|
`;
|
|
58
|
-
export class
|
|
58
|
+
export class EmptyState extends BaseElement {
|
|
59
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
59
60
|
static get observedAttributes() {
|
|
60
61
|
return ["action-label", "description", "heading", "message"];
|
|
61
62
|
}
|
|
@@ -127,11 +128,4 @@ export class BoxEmptyStateElement extends BaseElement {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
-
const existingElement = customElements.get(tagName);
|
|
132
|
-
if (existingElement) {
|
|
133
|
-
return existingElement;
|
|
134
|
-
}
|
|
135
|
-
customElements.define(tagName, BoxEmptyStateElement);
|
|
136
|
-
return BoxEmptyStateElement;
|
|
137
|
-
};
|
|
131
|
+
EmptyState.register();
|
|
@@ -5,10 +5,12 @@ import { BaseElement } from "../../core/index.js";
|
|
|
5
5
|
* assertively via `role="alert"` and offers an optional retry action that emits
|
|
6
6
|
* a `retry` event; the host owns the actual reload.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class ErrorMask extends BaseElement {
|
|
9
|
+
static readonly tagName: string;
|
|
9
10
|
static get observedAttributes(): string[];
|
|
10
11
|
private titleEl;
|
|
11
12
|
private messageEl;
|
|
13
|
+
private bodySlot;
|
|
12
14
|
private actionEl;
|
|
13
15
|
get heading(): string;
|
|
14
16
|
set heading(value: string);
|
|
@@ -19,7 +21,7 @@ export declare class BoxErrorMaskElement extends BaseElement {
|
|
|
19
21
|
get actionLabel(): string;
|
|
20
22
|
set actionLabel(value: string);
|
|
21
23
|
protected renderTemplate(): void;
|
|
24
|
+
protected setupListeners(): void;
|
|
22
25
|
private syncActionButton;
|
|
23
26
|
protected update(): void;
|
|
24
27
|
}
|
|
25
|
-
export declare const defineBoxErrorMaskElement: (tagName?: string) => typeof BoxErrorMaskElement;
|
|
@@ -57,6 +57,17 @@ const errorMaskStyles = `
|
|
|
57
57
|
display: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/* Optional rich body — slotted markup below the message.
|
|
61
|
+
Hidden (no column gap) until content is assigned. */
|
|
62
|
+
[part="body"] {
|
|
63
|
+
display: block;
|
|
64
|
+
max-width: 32rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[part="body"]:not(.has-content) {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
60
71
|
[part="action"] {
|
|
61
72
|
appearance: none;
|
|
62
73
|
box-sizing: border-box;
|
|
@@ -94,12 +105,14 @@ const errorMaskStyles = `
|
|
|
94
105
|
* assertively via `role="alert"` and offers an optional retry action that emits
|
|
95
106
|
* a `retry` event; the host owns the actual reload.
|
|
96
107
|
*/
|
|
97
|
-
export class
|
|
108
|
+
export class ErrorMask extends BaseElement {
|
|
109
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
98
110
|
static get observedAttributes() {
|
|
99
111
|
return ["action-label", "description", "heading", "message"];
|
|
100
112
|
}
|
|
101
113
|
titleEl;
|
|
102
114
|
messageEl;
|
|
115
|
+
bodySlot;
|
|
103
116
|
actionEl = null;
|
|
104
117
|
get heading() {
|
|
105
118
|
return this.getAttribute("heading") ?? "Something went wrong";
|
|
@@ -141,10 +154,19 @@ export class BoxErrorMaskElement extends BaseElement {
|
|
|
141
154
|
</span>
|
|
142
155
|
<h2 part="title"></h2>
|
|
143
156
|
<span part="message description" hidden></span>
|
|
157
|
+
<slot part="body"></slot>
|
|
144
158
|
</section>
|
|
145
159
|
`;
|
|
146
160
|
this.titleEl = this.shadowRoot.querySelector('[part="title"]');
|
|
147
161
|
this.messageEl = this.shadowRoot.querySelector('[part~="message"]');
|
|
162
|
+
this.bodySlot = this.shadowRoot.querySelector('slot[part="body"]');
|
|
163
|
+
}
|
|
164
|
+
setupListeners() {
|
|
165
|
+
this.bodySlot.addEventListener("slotchange", () => {
|
|
166
|
+
if (this.isRendered) {
|
|
167
|
+
this.update();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
148
170
|
}
|
|
149
171
|
syncActionButton() {
|
|
150
172
|
const section = this.shadowRoot?.querySelector('[part="error-mask"]');
|
|
@@ -178,6 +200,8 @@ export class BoxErrorMaskElement extends BaseElement {
|
|
|
178
200
|
return;
|
|
179
201
|
}
|
|
180
202
|
this.titleEl.textContent = this.heading;
|
|
203
|
+
const hasBody = this.bodySlot.assignedNodes({ flatten: true }).length > 0;
|
|
204
|
+
this.bodySlot.classList.toggle("has-content", hasBody);
|
|
181
205
|
if (this.message) {
|
|
182
206
|
this.messageEl.hidden = false;
|
|
183
207
|
this.messageEl.textContent = this.message;
|
|
@@ -189,11 +213,4 @@ export class BoxErrorMaskElement extends BaseElement {
|
|
|
189
213
|
this.syncActionButton();
|
|
190
214
|
}
|
|
191
215
|
}
|
|
192
|
-
|
|
193
|
-
const existingElement = customElements.get(tagName);
|
|
194
|
-
if (existingElement) {
|
|
195
|
-
return existingElement;
|
|
196
|
-
}
|
|
197
|
-
customElements.define(tagName, BoxErrorMaskElement);
|
|
198
|
-
return BoxErrorMaskElement;
|
|
199
|
-
};
|
|
216
|
+
ErrorMask.register();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseElement } from "../../core/index.js";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class HelpText extends BaseElement {
|
|
3
|
+
static readonly tagName: string;
|
|
3
4
|
private readonly handleDesignSystemChange;
|
|
4
5
|
static get observedAttributes(): string[];
|
|
5
6
|
private helpTextEl;
|
|
@@ -19,4 +20,3 @@ export declare class BoxHelpTextElement extends BaseElement {
|
|
|
19
20
|
protected renderTemplate(): void;
|
|
20
21
|
protected update(): void;
|
|
21
22
|
}
|
|
22
|
-
export declare const defineBoxHelpTextElement: (tagName?: string) => typeof BoxHelpTextElement;
|
|
@@ -80,7 +80,8 @@ const helpTextStyles = `
|
|
|
80
80
|
display: none;
|
|
81
81
|
}
|
|
82
82
|
`;
|
|
83
|
-
export class
|
|
83
|
+
export class HelpText extends BaseElement {
|
|
84
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
84
85
|
handleDesignSystemChange = () => {
|
|
85
86
|
this.update();
|
|
86
87
|
};
|
|
@@ -152,6 +153,13 @@ export class BoxHelpTextElement extends BaseElement {
|
|
|
152
153
|
: "info";
|
|
153
154
|
const iconMarkup = resolveDesignIcon(iconName) ?? "i";
|
|
154
155
|
this.helpTextEl.dataset.tone = this.tone;
|
|
156
|
+
// Error help text is an inline validation error: announce it assertively.
|
|
157
|
+
if (this.tone === "error") {
|
|
158
|
+
this.helpTextEl.setAttribute("role", "alert");
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.helpTextEl.setAttribute("role", "note");
|
|
162
|
+
}
|
|
155
163
|
this.helpTextEl.setAttribute("aria-label", this.label || "Help text");
|
|
156
164
|
this.iconEl.setAttribute("data-icon-source", iconMarkup === "i" ? "text" : "design-system");
|
|
157
165
|
this.iconEl.innerHTML = iconMarkup;
|
|
@@ -166,11 +174,4 @@ export class BoxHelpTextElement extends BaseElement {
|
|
|
166
174
|
this.messageEl.textContent = this.message;
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
|
-
|
|
170
|
-
const existingElement = customElements.get(tagName);
|
|
171
|
-
if (existingElement) {
|
|
172
|
-
return existingElement;
|
|
173
|
-
}
|
|
174
|
-
customElements.define(tagName, BoxHelpTextElement);
|
|
175
|
-
return BoxHelpTextElement;
|
|
176
|
-
};
|
|
177
|
+
HelpText.register();
|
|
@@ -5,7 +5,8 @@ import { BaseElement } from "../../core/index.js";
|
|
|
5
5
|
* (emits `action`) and can be dismissed (emits `dismiss` and hides). Announced
|
|
6
6
|
* politely via `role="status"`; the host decides what the action does.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class Nudge extends BaseElement {
|
|
9
|
+
static readonly tagName: string;
|
|
9
10
|
static get observedAttributes(): string[];
|
|
10
11
|
private openValue;
|
|
11
12
|
private hostEl;
|
|
@@ -29,4 +30,3 @@ export declare class BoxNudgeElement extends BaseElement {
|
|
|
29
30
|
private syncActionButton;
|
|
30
31
|
protected update(): void;
|
|
31
32
|
}
|
|
32
|
-
export declare const defineBoxNudgeElement: (tagName?: string) => typeof BoxNudgeElement;
|
|
@@ -116,7 +116,8 @@ const nudgeStyles = `
|
|
|
116
116
|
* (emits `action`) and can be dismissed (emits `dismiss` and hides). Announced
|
|
117
117
|
* politely via `role="status"`; the host decides what the action does.
|
|
118
118
|
*/
|
|
119
|
-
export class
|
|
119
|
+
export class Nudge extends BaseElement {
|
|
120
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
120
121
|
static get observedAttributes() {
|
|
121
122
|
return ["action-label", "heading", "message", "open"];
|
|
122
123
|
}
|
|
@@ -289,11 +290,4 @@ export class BoxNudgeElement extends BaseElement {
|
|
|
289
290
|
this.syncActionButton();
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
|
-
|
|
293
|
-
const existingElement = customElements.get(tagName);
|
|
294
|
-
if (existingElement) {
|
|
295
|
-
return existingElement;
|
|
296
|
-
}
|
|
297
|
-
customElements.define(tagName, BoxNudgeElement);
|
|
298
|
-
return BoxNudgeElement;
|
|
299
|
-
};
|
|
293
|
+
Nudge.register();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseElement } from "../../core/index.js";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class ProgressBar extends BaseElement {
|
|
3
|
+
static readonly tagName: string;
|
|
3
4
|
static get observedAttributes(): string[];
|
|
4
5
|
private progressEl;
|
|
5
6
|
private labelEl;
|
|
@@ -15,4 +16,3 @@ export declare class BoxProgressBarElement extends BaseElement {
|
|
|
15
16
|
protected renderTemplate(): void;
|
|
16
17
|
protected update(): void;
|
|
17
18
|
}
|
|
18
|
-
export declare const defineBoxProgressBarElement: (tagName?: string) => typeof BoxProgressBarElement;
|