@unofficialbox/box-open-elements 0.4.0 → 0.6.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 +39 -14
- 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 +2 -2
- package/dist/components/actions/link-button.js +3 -9
- 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 +2 -2
- package/dist/components/collections/carousel.js +3 -9
- package/dist/components/collections/datalist-item.d.ts +2 -2
- package/dist/components/collections/datalist-item.js +3 -9
- package/dist/components/collections/draggable-list.d.ts +2 -2
- package/dist/components/collections/draggable-list.js +3 -9
- package/dist/components/collections/grid-view.d.ts +2 -2
- package/dist/components/collections/grid-view.js +3 -9
- package/dist/components/collections/pagination.d.ts +2 -2
- package/dist/components/collections/pagination.js +3 -9
- package/dist/components/collections/table.d.ts +59 -5
- package/dist/components/collections/table.js +342 -29
- 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 +2 -2
- package/dist/components/feedback/alert.js +3 -9
- package/dist/components/feedback/badge.d.ts +2 -2
- package/dist/components/feedback/badge.js +3 -9
- package/dist/components/feedback/badgeable.d.ts +2 -2
- package/dist/components/feedback/badgeable.js +3 -9
- package/dist/components/feedback/chip.d.ts +2 -2
- package/dist/components/feedback/chip.js +3 -9
- package/dist/components/feedback/due-badge.d.ts +38 -0
- package/dist/components/feedback/due-badge.js +168 -0
- package/dist/components/feedback/due-types.d.ts +32 -0
- package/dist/components/feedback/due-types.js +91 -0
- 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 +2 -2
- package/dist/components/feedback/error-mask.js +3 -9
- package/dist/components/feedback/help-text.d.ts +2 -2
- package/dist/components/feedback/help-text.js +3 -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 +53 -7
- package/dist/components/feedback/progress-steps.js +203 -31
- package/dist/components/feedback/skeleton.d.ts +2 -2
- package/dist/components/feedback/skeleton.js +3 -9
- package/dist/components/feedback/spinner.d.ts +2 -2
- package/dist/components/feedback/spinner.js +3 -9
- package/dist/components/feedback/stage-path.d.ts +44 -0
- package/dist/components/feedback/stage-path.js +235 -0
- package/dist/components/feedback/toast.d.ts +2 -2
- package/dist/components/feedback/toast.js +3 -9
- 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 +2 -2
- package/dist/components/forms/category-selector.js +3 -9
- 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 +2 -2
- package/dist/components/forms/checkbox.js +3 -9
- 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 +2 -2
- package/dist/components/forms/combobox.js +3 -9
- package/dist/components/forms/date-field.d.ts +2 -2
- package/dist/components/forms/date-field.js +3 -9
- package/dist/components/forms/dropdown.d.ts +2 -2
- package/dist/components/forms/dropdown.js +3 -9
- 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 +2 -2
- package/dist/components/forms/radio-group.js +3 -9
- 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 +2 -2
- package/dist/components/forms/search-field.js +3 -9
- package/dist/components/forms/select.d.ts +23 -2
- package/dist/components/forms/select.js +103 -12
- 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 +23 -2
- package/dist/components/forms/text-field.js +103 -10
- package/dist/components/forms/time-field.d.ts +2 -2
- package/dist/components/forms/time-field.js +4 -10
- package/dist/components/identity/avatar.d.ts +2 -2
- package/dist/components/identity/avatar.js +3 -9
- package/dist/components/identity/contact-datalist-item.d.ts +2 -2
- package/dist/components/identity/contact-datalist-item.js +3 -9
- 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 +16 -2
- package/dist/components/layout/nav-sidebar.js +52 -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 +2 -2
- package/dist/components/layout/sidebar-toggle-button.js +3 -9
- package/dist/components/layout/split-view.d.ts +16 -2
- package/dist/components/layout/split-view.js +83 -10
- package/dist/components/navigation/accordion.d.ts +2 -2
- package/dist/components/navigation/accordion.js +3 -9
- 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/command-palette.d.ts +62 -0
- package/dist/components/overlays/command-palette.js +537 -0
- package/dist/components/overlays/command-types.d.ts +90 -0
- package/dist/components/overlays/command-types.js +259 -0
- 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 +20 -2
- package/dist/components/overlays/drawer.js +138 -18
- package/dist/components/overlays/guide-tooltip.d.ts +2 -2
- package/dist/components/overlays/guide-tooltip.js +3 -9
- package/dist/components/overlays/popover.d.ts +2 -2
- package/dist/components/overlays/popover.js +3 -9
- package/dist/components/overlays/shortcuts-overlay.d.ts +48 -0
- package/dist/components/overlays/shortcuts-overlay.js +385 -0
- package/dist/components/overlays/tooltip.d.ts +2 -2
- package/dist/components/overlays/tooltip.js +4 -10
- 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/element-maps.d.ts +292 -0
- package/dist/element-maps.js +1 -0
- 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/activity-density.d.ts +1 -0
- package/dist/entries/activity-density.js +1 -0
- package/dist/entries/agent-chat.d.ts +1 -0
- package/dist/entries/agent-chat.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/audit-log.d.ts +1 -0
- package/dist/entries/audit-log.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/command-palette.d.ts +1 -0
- package/dist/entries/command-palette.js +1 -0
- package/dist/entries/compare-view.d.ts +1 -0
- package/dist/entries/compare-view.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/diff-viewer.d.ts +1 -0
- package/dist/entries/diff-viewer.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/due-badge.d.ts +1 -0
- package/dist/entries/due-badge.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/form-wizard.d.ts +1 -0
- package/dist/entries/form-wizard.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/lineage-graph.d.ts +1 -0
- package/dist/entries/lineage-graph.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/notification-bell.d.ts +1 -0
- package/dist/entries/notification-bell.js +1 -0
- package/dist/entries/notification-inbox.d.ts +1 -0
- package/dist/entries/notification-inbox.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/provenance-strip.d.ts +1 -0
- package/dist/entries/provenance-strip.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/run-trace.d.ts +1 -0
- package/dist/entries/run-trace.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/shortcuts-overlay.d.ts +1 -0
- package/dist/entries/shortcuts-overlay.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/signature-ceremony.d.ts +1 -0
- package/dist/entries/signature-ceremony.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/stage-path.d.ts +1 -0
- package/dist/entries/stage-path.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/timeline.d.ts +1 -0
- package/dist/entries/timeline.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/entries/version-graph.d.ts +1 -0
- package/dist/entries/version-graph.js +1 -0
- package/dist/entries/version-list.d.ts +1 -0
- package/dist/entries/version-list.js +1 -0
- package/dist/entries/wizard-summary.d.ts +1 -0
- package/dist/entries/wizard-summary.js +1 -0
- package/dist/entries/work-queue.d.ts +1 -0
- package/dist/entries/work-queue.js +1 -0
- package/dist/entries/workload-board.d.ts +1 -0
- package/dist/entries/workload-board.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/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 +27 -2
- package/dist/index.js +24 -1
- package/dist/patterns/agent-chat/agent-chat.d.ts +75 -0
- package/dist/patterns/agent-chat/agent-chat.js +820 -0
- package/dist/patterns/agent-chat/controller.d.ts +27 -0
- package/dist/patterns/agent-chat/controller.js +182 -0
- package/dist/patterns/agent-chat/index.d.ts +3 -0
- package/dist/patterns/agent-chat/index.js +6 -0
- package/dist/patterns/agent-chat/types.d.ts +109 -0
- package/dist/patterns/agent-chat/types.js +1 -0
- package/dist/patterns/audit/activity-density.d.ts +68 -0
- package/dist/patterns/audit/activity-density.js +428 -0
- package/dist/patterns/audit/audit-log.d.ts +81 -0
- package/dist/patterns/audit/audit-log.js +794 -0
- package/dist/patterns/audit/index.d.ts +3 -0
- package/dist/patterns/audit/index.js +7 -0
- package/dist/patterns/audit/shared.d.ts +10 -0
- package/dist/patterns/audit/shared.js +50 -0
- package/dist/patterns/audit/types.d.ts +143 -0
- package/dist/patterns/audit/types.js +327 -0
- package/dist/patterns/content-explorer/actions/controller.js +12 -2
- 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/box-transport.js +117 -25
- package/dist/patterns/content-explorer/content-explorer.d.ts +28 -16
- package/dist/patterns/content-explorer/content-explorer.js +41 -14
- package/dist/patterns/content-explorer/contracts.d.ts +24 -1
- package/dist/patterns/content-explorer/contracts.js +68 -11
- package/dist/patterns/content-explorer/controller.d.ts +16 -1
- package/dist/patterns/content-explorer/controller.js +130 -4
- package/dist/patterns/content-explorer/navigation/controller.js +11 -9
- package/dist/patterns/content-explorer/types.d.ts +58 -1
- package/dist/patterns/content-picker/content-picker.d.ts +71 -0
- package/dist/patterns/content-picker/content-picker.js +747 -0
- package/dist/patterns/content-picker/controller.d.ts +38 -0
- package/dist/patterns/content-picker/controller.js +141 -0
- package/dist/patterns/content-picker/index.d.ts +3 -0
- package/dist/patterns/content-picker/index.js +6 -0
- package/dist/patterns/content-picker/types.d.ts +52 -0
- package/dist/patterns/content-picker/types.js +26 -0
- package/dist/patterns/content-sidebar/content-sidebar.d.ts +43 -0
- package/dist/patterns/content-sidebar/content-sidebar.js +293 -0
- package/dist/patterns/content-sidebar/index.d.ts +2 -0
- package/dist/patterns/content-sidebar/index.js +4 -0
- package/dist/patterns/content-sidebar/types.d.ts +18 -0
- package/dist/patterns/content-sidebar/types.js +20 -0
- package/dist/patterns/content-uploader/box-transport.d.ts +14 -0
- package/dist/patterns/content-uploader/box-transport.js +54 -0
- package/dist/patterns/content-uploader/content-uploader.d.ts +62 -0
- package/dist/patterns/content-uploader/content-uploader.js +559 -0
- package/dist/patterns/content-uploader/controller.d.ts +39 -0
- package/dist/patterns/content-uploader/controller.js +227 -0
- package/dist/patterns/content-uploader/index.d.ts +4 -0
- package/dist/patterns/content-uploader/index.js +8 -0
- package/dist/patterns/content-uploader/types.d.ts +120 -0
- package/dist/patterns/content-uploader/types.js +38 -0
- package/dist/patterns/diff/compare-view.d.ts +47 -0
- package/dist/patterns/diff/compare-view.js +276 -0
- package/dist/patterns/diff/diff-viewer.d.ts +42 -0
- package/dist/patterns/diff/diff-viewer.js +434 -0
- package/dist/patterns/diff/engine.d.ts +22 -0
- package/dist/patterns/diff/engine.js +276 -0
- package/dist/patterns/diff/index.d.ts +4 -0
- package/dist/patterns/diff/index.js +8 -0
- package/dist/patterns/diff/types.d.ts +69 -0
- package/dist/patterns/diff/types.js +24 -0
- 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/form-wizard/controller.d.ts +39 -0
- package/dist/patterns/form-wizard/controller.js +157 -0
- package/dist/patterns/form-wizard/form-wizard.d.ts +63 -0
- package/dist/patterns/form-wizard/form-wizard.js +468 -0
- package/dist/patterns/form-wizard/index.d.ts +4 -0
- package/dist/patterns/form-wizard/index.js +8 -0
- package/dist/patterns/form-wizard/types.d.ts +109 -0
- package/dist/patterns/form-wizard/types.js +83 -0
- package/dist/patterns/form-wizard/wizard-summary.d.ts +62 -0
- package/dist/patterns/form-wizard/wizard-summary.js +324 -0
- 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/internal/safe-href.d.ts +17 -0
- package/dist/patterns/internal/safe-href.js +17 -0
- 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/lineage/index.d.ts +3 -0
- package/dist/patterns/lineage/index.js +6 -0
- package/dist/patterns/lineage/lineage-graph.d.ts +30 -0
- package/dist/patterns/lineage/lineage-graph.js +434 -0
- package/dist/patterns/lineage/provenance-strip.d.ts +22 -0
- package/dist/patterns/lineage/provenance-strip.js +194 -0
- package/dist/patterns/lineage/types.d.ts +53 -0
- package/dist/patterns/lineage/types.js +49 -0
- 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/notifications/index.d.ts +3 -0
- package/dist/patterns/notifications/index.js +6 -0
- package/dist/patterns/notifications/notification-bell.d.ts +38 -0
- package/dist/patterns/notifications/notification-bell.js +198 -0
- package/dist/patterns/notifications/notification-inbox.d.ts +46 -0
- package/dist/patterns/notifications/notification-inbox.js +537 -0
- package/dist/patterns/notifications/types.d.ts +61 -0
- package/dist/patterns/notifications/types.js +108 -0
- package/dist/patterns/preview/annotation-inspector.d.ts +27 -8
- package/dist/patterns/preview/annotation-inspector.js +242 -103
- package/dist/patterns/preview/annotation-thread.d.ts +27 -7
- package/dist/patterns/preview/annotation-thread.js +236 -91
- package/dist/patterns/preview/annotation-toolbar.d.ts +22 -8
- package/dist/patterns/preview/annotation-toolbar.js +165 -105
- package/dist/patterns/preview/content-preview-adapter.d.ts +10 -1
- package/dist/patterns/preview/content-preview-adapter.js +26 -1
- package/dist/patterns/preview/preview-element.d.ts +17 -4
- package/dist/patterns/preview/preview-element.js +226 -61
- package/dist/patterns/preview/provider-adapter.d.ts +47 -0
- package/dist/patterns/preview/provider-adapter.js +17 -0
- package/dist/patterns/run/index.d.ts +2 -0
- package/dist/patterns/run/index.js +4 -0
- package/dist/patterns/run/run-trace.d.ts +40 -0
- package/dist/patterns/run/run-trace.js +441 -0
- package/dist/patterns/run/types.d.ts +66 -0
- package/dist/patterns/run/types.js +152 -0
- 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/signature/index.d.ts +2 -0
- package/dist/patterns/signature/index.js +4 -0
- package/dist/patterns/signature/signature-ceremony.d.ts +33 -0
- package/dist/patterns/signature/signature-ceremony.js +317 -0
- package/dist/patterns/signature/types.d.ts +68 -0
- package/dist/patterns/signature/types.js +89 -0
- 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/dist/patterns/timeline/index.d.ts +2 -0
- package/dist/patterns/timeline/index.js +4 -0
- package/dist/patterns/timeline/timeline.d.ts +27 -0
- package/dist/patterns/timeline/timeline.js +430 -0
- package/dist/patterns/timeline/types.d.ts +36 -0
- package/dist/patterns/timeline/types.js +27 -0
- package/dist/patterns/versions/graph-layout.d.ts +43 -0
- package/dist/patterns/versions/graph-layout.js +159 -0
- package/dist/patterns/versions/index.d.ts +4 -0
- package/dist/patterns/versions/index.js +8 -0
- package/dist/patterns/versions/shared.d.ts +4 -0
- package/dist/patterns/versions/shared.js +13 -0
- package/dist/patterns/versions/types.d.ts +37 -0
- package/dist/patterns/versions/types.js +39 -0
- package/dist/patterns/versions/version-graph.d.ts +36 -0
- package/dist/patterns/versions/version-graph.js +438 -0
- package/dist/patterns/versions/version-list.d.ts +39 -0
- package/dist/patterns/versions/version-list.js +407 -0
- package/dist/patterns/work-queue/controller.d.ts +26 -0
- package/dist/patterns/work-queue/controller.js +150 -0
- package/dist/patterns/work-queue/index.d.ts +4 -0
- package/dist/patterns/work-queue/index.js +7 -0
- package/dist/patterns/work-queue/types.d.ts +128 -0
- package/dist/patterns/work-queue/types.js +45 -0
- package/dist/patterns/work-queue/work-queue.d.ts +48 -0
- package/dist/patterns/work-queue/work-queue.js +534 -0
- package/dist/patterns/work-queue/workload-board.d.ts +53 -0
- package/dist/patterns/work-queue/workload-board.js +608 -0
- package/package.json +93 -5
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { registerBuiltInDesignProfiles } from "./built-ins.js";
|
|
2
|
+
import { applyDesignProfile, getDesignProfile, } from "./registry.js";
|
|
3
|
+
export const DESIGN_PROFILE_CHANGE_EVENT = "boe:design-profile-change";
|
|
4
|
+
export const DEFAULT_DESIGN_PROFILE_STORAGE_KEY = "boe-design-profile";
|
|
5
|
+
const resolveDefaultRoot = () => typeof document === "undefined" ? null : document.documentElement;
|
|
6
|
+
const resolveDefaultStorage = () => {
|
|
7
|
+
try {
|
|
8
|
+
return typeof localStorage === "undefined" ? null : localStorage;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const createDesignProfileController = (options = {}) => {
|
|
15
|
+
const profileAttribute = options.profileAttribute === undefined
|
|
16
|
+
? "data-design-profile"
|
|
17
|
+
: options.profileAttribute;
|
|
18
|
+
const storageKey = options.storageKey === undefined
|
|
19
|
+
? DEFAULT_DESIGN_PROFILE_STORAGE_KEY
|
|
20
|
+
: options.storageKey;
|
|
21
|
+
const shouldResolveDefaultStorage = options.storage === undefined;
|
|
22
|
+
let root = options.root ?? null;
|
|
23
|
+
let storage = options.storage ?? null;
|
|
24
|
+
let profileName = options.profile ?? "box-default";
|
|
25
|
+
let appliedVariables = new Set();
|
|
26
|
+
let started = false;
|
|
27
|
+
const apply = () => {
|
|
28
|
+
if (!root) {
|
|
29
|
+
throw new Error("DesignProfileController requires a root HTMLElement");
|
|
30
|
+
}
|
|
31
|
+
if (!getDesignProfile(profileName)) {
|
|
32
|
+
throw new Error(`Unknown design profile: ${profileName}`);
|
|
33
|
+
}
|
|
34
|
+
const nextVariables = new Set(applyDesignProfile(root, profileName));
|
|
35
|
+
for (const variable of appliedVariables) {
|
|
36
|
+
if (!nextVariables.has(variable)) {
|
|
37
|
+
root.style.removeProperty(variable);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
appliedVariables = nextVariables;
|
|
41
|
+
if (profileAttribute) {
|
|
42
|
+
root.setAttribute(profileAttribute, profileName);
|
|
43
|
+
}
|
|
44
|
+
if (typeof CustomEvent !== "undefined") {
|
|
45
|
+
root.dispatchEvent(new CustomEvent(DESIGN_PROFILE_CHANGE_EVENT, {
|
|
46
|
+
bubbles: true,
|
|
47
|
+
composed: true,
|
|
48
|
+
detail: { profileName },
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
start() {
|
|
54
|
+
if (started) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
root ??= resolveDefaultRoot();
|
|
58
|
+
if (options.registerBuiltIns ?? true) {
|
|
59
|
+
registerBuiltInDesignProfiles();
|
|
60
|
+
}
|
|
61
|
+
if (shouldResolveDefaultStorage) {
|
|
62
|
+
storage = resolveDefaultStorage();
|
|
63
|
+
}
|
|
64
|
+
if (storage && storageKey) {
|
|
65
|
+
try {
|
|
66
|
+
const storedProfile = storage.getItem(storageKey);
|
|
67
|
+
if (storedProfile && getDesignProfile(storedProfile)) {
|
|
68
|
+
profileName = storedProfile;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Storage may be unavailable in privacy-restricted or embedded contexts.
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
started = true;
|
|
76
|
+
apply();
|
|
77
|
+
},
|
|
78
|
+
stop() {
|
|
79
|
+
if (!started || !root) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const variable of appliedVariables) {
|
|
83
|
+
root.style.removeProperty(variable);
|
|
84
|
+
}
|
|
85
|
+
appliedVariables.clear();
|
|
86
|
+
if (profileAttribute) {
|
|
87
|
+
root.removeAttribute(profileAttribute);
|
|
88
|
+
}
|
|
89
|
+
started = false;
|
|
90
|
+
},
|
|
91
|
+
setProfile(name) {
|
|
92
|
+
profileName = name;
|
|
93
|
+
if (started) {
|
|
94
|
+
apply();
|
|
95
|
+
}
|
|
96
|
+
if (storage && storageKey) {
|
|
97
|
+
try {
|
|
98
|
+
storage.setItem(storageKey, name);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// Storage may be unavailable in privacy-restricted or embedded contexts.
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
getProfile: () => profileName,
|
|
106
|
+
};
|
|
107
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { boxDefaultDesignProfile, compactNeutralDesignProfile, registerBuiltInDesignProfiles, } from "./built-ins.js";
|
|
2
|
+
export { DEFAULT_DESIGN_PROFILE_STORAGE_KEY, DESIGN_PROFILE_CHANGE_EVENT, createDesignProfileController, } from "./controller.js";
|
|
3
|
+
export { DESIGN_PROFILE_VARIABLES, applyDesignProfile, createDesignProfileStyleText, getDesignProfile, listDesignProfiles, registerDesignProfile, resolveDesignProfileProperties, } from "./registry.js";
|
|
4
|
+
export type { ApplyDesignProfileOptions, DesignProfileChangeDetail, DesignProfileController, DesignProfileControllerOptions, DesignProfileDefinition, DesignProfileDensity, DesignProfileElevation, DesignProfileMotion, DesignProfileRadius, DesignProfileSpacing, DesignProfileTypography, } from "./types.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { boxDefaultDesignProfile, compactNeutralDesignProfile, registerBuiltInDesignProfiles, } from "./built-ins.js";
|
|
2
|
+
export { DEFAULT_DESIGN_PROFILE_STORAGE_KEY, DESIGN_PROFILE_CHANGE_EVENT, createDesignProfileController, } from "./controller.js";
|
|
3
|
+
export { DESIGN_PROFILE_VARIABLES, applyDesignProfile, createDesignProfileStyleText, getDesignProfile, listDesignProfiles, registerDesignProfile, resolveDesignProfileProperties, } from "./registry.js";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ApplyDesignProfileOptions, DesignProfileDefinition } from "./types.js";
|
|
2
|
+
export declare const DESIGN_PROFILE_VARIABLES: {
|
|
3
|
+
readonly spacing: {
|
|
4
|
+
readonly unit: "--boe-profile-space-unit";
|
|
5
|
+
readonly space1: "--boe-profile-space-1";
|
|
6
|
+
readonly space2: "--boe-profile-space-2";
|
|
7
|
+
readonly space3: "--boe-profile-space-3";
|
|
8
|
+
readonly space4: "--boe-profile-space-4";
|
|
9
|
+
readonly space5: "--boe-profile-space-5";
|
|
10
|
+
readonly space6: "--boe-profile-space-6";
|
|
11
|
+
readonly space8: "--boe-profile-space-8";
|
|
12
|
+
readonly space10: "--boe-profile-space-10";
|
|
13
|
+
readonly space12: "--boe-profile-space-12";
|
|
14
|
+
};
|
|
15
|
+
readonly radius: {
|
|
16
|
+
readonly size: "--boe-profile-radius-size";
|
|
17
|
+
readonly medium: "--boe-profile-radius-medium";
|
|
18
|
+
readonly large: "--boe-profile-radius-large";
|
|
19
|
+
readonly xlarge: "--boe-profile-radius-xlarge";
|
|
20
|
+
readonly control: "--boe-profile-radius-control";
|
|
21
|
+
readonly field: "--boe-profile-radius-field";
|
|
22
|
+
readonly nav: "--boe-profile-radius-nav";
|
|
23
|
+
readonly pill: "--boe-profile-radius-pill";
|
|
24
|
+
};
|
|
25
|
+
readonly density: {
|
|
26
|
+
readonly panelPadding: "--boe-profile-panel-padding";
|
|
27
|
+
readonly panelGap: "--boe-profile-panel-gap";
|
|
28
|
+
readonly overlayPadding: "--boe-profile-overlay-padding";
|
|
29
|
+
readonly overlayItemPadding: "--boe-profile-overlay-item-padding";
|
|
30
|
+
readonly overlayItemMinHeight: "--boe-profile-overlay-item-min-height";
|
|
31
|
+
readonly modalPadding: "--boe-profile-modal-padding";
|
|
32
|
+
readonly modalWidth: "--boe-profile-modal-width";
|
|
33
|
+
readonly drawerWidth: "--boe-profile-drawer-width";
|
|
34
|
+
readonly controlHeight: "--boe-profile-control-height";
|
|
35
|
+
readonly controlHeightLarge: "--boe-profile-control-height-large";
|
|
36
|
+
readonly controlPaddingInline: "--boe-profile-control-padding-inline";
|
|
37
|
+
readonly inputPadding: "--boe-profile-input-padding";
|
|
38
|
+
readonly selectHeight: "--boe-profile-select-height";
|
|
39
|
+
readonly disabledOpacity: "--boe-profile-disabled-opacity";
|
|
40
|
+
};
|
|
41
|
+
readonly typography: {
|
|
42
|
+
readonly fontFamilyBase: "--boe-profile-font-family-base";
|
|
43
|
+
readonly controlFontSize: "--boe-profile-control-font-size";
|
|
44
|
+
readonly controlLetterSpacing: "--boe-profile-control-letter-spacing";
|
|
45
|
+
readonly modalTitleSize: "--boe-profile-modal-title-size";
|
|
46
|
+
};
|
|
47
|
+
readonly elevation: {
|
|
48
|
+
readonly panel: "--boe-profile-shadow-panel";
|
|
49
|
+
readonly overlay: "--boe-profile-shadow-overlay";
|
|
50
|
+
readonly modal: "--boe-profile-shadow-modal";
|
|
51
|
+
readonly inputInset: "--boe-profile-shadow-input-inset";
|
|
52
|
+
readonly primaryFocus: "--boe-profile-shadow-primary-focus";
|
|
53
|
+
};
|
|
54
|
+
readonly motion: {
|
|
55
|
+
readonly fast: "--boe-profile-motion-fast";
|
|
56
|
+
readonly interactive: "--boe-profile-motion-interactive";
|
|
57
|
+
readonly medium: "--boe-profile-motion-medium";
|
|
58
|
+
readonly slow: "--boe-profile-motion-slow";
|
|
59
|
+
readonly spin: "--boe-profile-motion-spin";
|
|
60
|
+
readonly shimmer: "--boe-profile-motion-shimmer";
|
|
61
|
+
readonly easingStandard: "--boe-profile-easing-standard";
|
|
62
|
+
readonly easingEnter: "--boe-profile-easing-enter";
|
|
63
|
+
readonly easingExit: "--boe-profile-easing-exit";
|
|
64
|
+
readonly easingLinear: "--boe-profile-easing-linear";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const resolveDesignProfileProperties: (definition: DesignProfileDefinition) => Record<string, string>;
|
|
68
|
+
export declare const registerDesignProfile: (definition: DesignProfileDefinition) => DesignProfileDefinition;
|
|
69
|
+
export declare const getDesignProfile: (name: string | null | undefined) => DesignProfileDefinition | null;
|
|
70
|
+
export declare const listDesignProfiles: () => DesignProfileDefinition[];
|
|
71
|
+
export declare const applyDesignProfile: (target: HTMLElement, profileOrName: DesignProfileDefinition | string) => string[];
|
|
72
|
+
export declare const createDesignProfileStyleText: (profileOrName: DesignProfileDefinition | string, options?: ApplyDesignProfileOptions) => string;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export const DESIGN_PROFILE_VARIABLES = {
|
|
2
|
+
spacing: {
|
|
3
|
+
unit: "--boe-profile-space-unit",
|
|
4
|
+
space1: "--boe-profile-space-1",
|
|
5
|
+
space2: "--boe-profile-space-2",
|
|
6
|
+
space3: "--boe-profile-space-3",
|
|
7
|
+
space4: "--boe-profile-space-4",
|
|
8
|
+
space5: "--boe-profile-space-5",
|
|
9
|
+
space6: "--boe-profile-space-6",
|
|
10
|
+
space8: "--boe-profile-space-8",
|
|
11
|
+
space10: "--boe-profile-space-10",
|
|
12
|
+
space12: "--boe-profile-space-12",
|
|
13
|
+
},
|
|
14
|
+
radius: {
|
|
15
|
+
size: "--boe-profile-radius-size",
|
|
16
|
+
medium: "--boe-profile-radius-medium",
|
|
17
|
+
large: "--boe-profile-radius-large",
|
|
18
|
+
xlarge: "--boe-profile-radius-xlarge",
|
|
19
|
+
control: "--boe-profile-radius-control",
|
|
20
|
+
field: "--boe-profile-radius-field",
|
|
21
|
+
nav: "--boe-profile-radius-nav",
|
|
22
|
+
pill: "--boe-profile-radius-pill",
|
|
23
|
+
},
|
|
24
|
+
density: {
|
|
25
|
+
panelPadding: "--boe-profile-panel-padding",
|
|
26
|
+
panelGap: "--boe-profile-panel-gap",
|
|
27
|
+
overlayPadding: "--boe-profile-overlay-padding",
|
|
28
|
+
overlayItemPadding: "--boe-profile-overlay-item-padding",
|
|
29
|
+
overlayItemMinHeight: "--boe-profile-overlay-item-min-height",
|
|
30
|
+
modalPadding: "--boe-profile-modal-padding",
|
|
31
|
+
modalWidth: "--boe-profile-modal-width",
|
|
32
|
+
drawerWidth: "--boe-profile-drawer-width",
|
|
33
|
+
controlHeight: "--boe-profile-control-height",
|
|
34
|
+
controlHeightLarge: "--boe-profile-control-height-large",
|
|
35
|
+
controlPaddingInline: "--boe-profile-control-padding-inline",
|
|
36
|
+
inputPadding: "--boe-profile-input-padding",
|
|
37
|
+
selectHeight: "--boe-profile-select-height",
|
|
38
|
+
disabledOpacity: "--boe-profile-disabled-opacity",
|
|
39
|
+
},
|
|
40
|
+
typography: {
|
|
41
|
+
fontFamilyBase: "--boe-profile-font-family-base",
|
|
42
|
+
controlFontSize: "--boe-profile-control-font-size",
|
|
43
|
+
controlLetterSpacing: "--boe-profile-control-letter-spacing",
|
|
44
|
+
modalTitleSize: "--boe-profile-modal-title-size",
|
|
45
|
+
},
|
|
46
|
+
elevation: {
|
|
47
|
+
panel: "--boe-profile-shadow-panel",
|
|
48
|
+
overlay: "--boe-profile-shadow-overlay",
|
|
49
|
+
modal: "--boe-profile-shadow-modal",
|
|
50
|
+
inputInset: "--boe-profile-shadow-input-inset",
|
|
51
|
+
primaryFocus: "--boe-profile-shadow-primary-focus",
|
|
52
|
+
},
|
|
53
|
+
motion: {
|
|
54
|
+
fast: "--boe-profile-motion-fast",
|
|
55
|
+
interactive: "--boe-profile-motion-interactive",
|
|
56
|
+
medium: "--boe-profile-motion-medium",
|
|
57
|
+
slow: "--boe-profile-motion-slow",
|
|
58
|
+
spin: "--boe-profile-motion-spin",
|
|
59
|
+
shimmer: "--boe-profile-motion-shimmer",
|
|
60
|
+
easingStandard: "--boe-profile-easing-standard",
|
|
61
|
+
easingEnter: "--boe-profile-easing-enter",
|
|
62
|
+
easingExit: "--boe-profile-easing-exit",
|
|
63
|
+
easingLinear: "--boe-profile-easing-linear",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const designProfiles = new Map();
|
|
67
|
+
export const resolveDesignProfileProperties = (definition) => {
|
|
68
|
+
const properties = {};
|
|
69
|
+
for (const [sectionName, variableMap] of Object.entries(DESIGN_PROFILE_VARIABLES)) {
|
|
70
|
+
const section = definition[sectionName];
|
|
71
|
+
if (!section) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
for (const [propertyName, value] of Object.entries(section)) {
|
|
75
|
+
const variableName = variableMap[propertyName];
|
|
76
|
+
if (variableName && value !== undefined) {
|
|
77
|
+
properties[variableName] = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (const [variableName, value] of Object.entries(definition.customProperties ?? {})) {
|
|
82
|
+
if (properties[variableName] !== undefined) {
|
|
83
|
+
throw new Error(`Design profile property "${variableName}" was provided by both the typed schema and customProperties`);
|
|
84
|
+
}
|
|
85
|
+
properties[variableName] = value;
|
|
86
|
+
}
|
|
87
|
+
return properties;
|
|
88
|
+
};
|
|
89
|
+
export const registerDesignProfile = (definition) => {
|
|
90
|
+
designProfiles.set(definition.name, definition);
|
|
91
|
+
return definition;
|
|
92
|
+
};
|
|
93
|
+
export const getDesignProfile = (name) => name ? designProfiles.get(name) ?? null : null;
|
|
94
|
+
export const listDesignProfiles = () => Array.from(designProfiles.values());
|
|
95
|
+
const resolveDefinition = (profileOrName) => {
|
|
96
|
+
if (typeof profileOrName !== "string") {
|
|
97
|
+
return profileOrName;
|
|
98
|
+
}
|
|
99
|
+
const definition = getDesignProfile(profileOrName);
|
|
100
|
+
if (!definition) {
|
|
101
|
+
throw new Error(`Unknown design profile: ${profileOrName}`);
|
|
102
|
+
}
|
|
103
|
+
return definition;
|
|
104
|
+
};
|
|
105
|
+
export const applyDesignProfile = (target, profileOrName) => {
|
|
106
|
+
const properties = resolveDesignProfileProperties(resolveDefinition(profileOrName));
|
|
107
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
108
|
+
target.style.setProperty(name, value);
|
|
109
|
+
}
|
|
110
|
+
return Object.keys(properties);
|
|
111
|
+
};
|
|
112
|
+
export const createDesignProfileStyleText = (profileOrName, options = {}) => {
|
|
113
|
+
const selector = options.selector ?? ":root";
|
|
114
|
+
const properties = resolveDesignProfileProperties(resolveDefinition(profileOrName));
|
|
115
|
+
const declarations = Object.entries(properties)
|
|
116
|
+
.map(([name, value]) => ` ${name}: ${value};`)
|
|
117
|
+
.join("\n");
|
|
118
|
+
return `${selector} {\n${declarations}\n}`;
|
|
119
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export interface DesignProfileSpacing {
|
|
2
|
+
unit?: string;
|
|
3
|
+
space1?: string;
|
|
4
|
+
space2?: string;
|
|
5
|
+
space3?: string;
|
|
6
|
+
space4?: string;
|
|
7
|
+
space5?: string;
|
|
8
|
+
space6?: string;
|
|
9
|
+
space8?: string;
|
|
10
|
+
space10?: string;
|
|
11
|
+
space12?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DesignProfileRadius {
|
|
14
|
+
size?: string;
|
|
15
|
+
medium?: string;
|
|
16
|
+
large?: string;
|
|
17
|
+
xlarge?: string;
|
|
18
|
+
control?: string;
|
|
19
|
+
field?: string;
|
|
20
|
+
nav?: string;
|
|
21
|
+
pill?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DesignProfileDensity {
|
|
24
|
+
panelPadding?: string;
|
|
25
|
+
panelGap?: string;
|
|
26
|
+
overlayPadding?: string;
|
|
27
|
+
overlayItemPadding?: string;
|
|
28
|
+
overlayItemMinHeight?: string;
|
|
29
|
+
modalPadding?: string;
|
|
30
|
+
modalWidth?: string;
|
|
31
|
+
drawerWidth?: string;
|
|
32
|
+
controlHeight?: string;
|
|
33
|
+
controlHeightLarge?: string;
|
|
34
|
+
controlPaddingInline?: string;
|
|
35
|
+
inputPadding?: string;
|
|
36
|
+
selectHeight?: string;
|
|
37
|
+
disabledOpacity?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface DesignProfileTypography {
|
|
40
|
+
fontFamilyBase?: string;
|
|
41
|
+
controlFontSize?: string;
|
|
42
|
+
controlLetterSpacing?: string;
|
|
43
|
+
modalTitleSize?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DesignProfileElevation {
|
|
46
|
+
panel?: string;
|
|
47
|
+
overlay?: string;
|
|
48
|
+
modal?: string;
|
|
49
|
+
inputInset?: string;
|
|
50
|
+
primaryFocus?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface DesignProfileMotion {
|
|
53
|
+
fast?: string;
|
|
54
|
+
interactive?: string;
|
|
55
|
+
medium?: string;
|
|
56
|
+
slow?: string;
|
|
57
|
+
spin?: string;
|
|
58
|
+
shimmer?: string;
|
|
59
|
+
easingStandard?: string;
|
|
60
|
+
easingEnter?: string;
|
|
61
|
+
easingExit?: string;
|
|
62
|
+
easingLinear?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface DesignProfileDefinition {
|
|
65
|
+
name: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
spacing?: DesignProfileSpacing;
|
|
68
|
+
radius?: DesignProfileRadius;
|
|
69
|
+
density?: DesignProfileDensity;
|
|
70
|
+
typography?: DesignProfileTypography;
|
|
71
|
+
elevation?: DesignProfileElevation;
|
|
72
|
+
motion?: DesignProfileMotion;
|
|
73
|
+
customProperties?: Record<`--${string}`, string>;
|
|
74
|
+
}
|
|
75
|
+
export interface DesignProfileChangeDetail {
|
|
76
|
+
profileName: string;
|
|
77
|
+
}
|
|
78
|
+
export interface DesignProfileController {
|
|
79
|
+
start(): void;
|
|
80
|
+
stop(): void;
|
|
81
|
+
setProfile(name: string): void;
|
|
82
|
+
getProfile(): string;
|
|
83
|
+
}
|
|
84
|
+
export interface DesignProfileControllerOptions {
|
|
85
|
+
root?: HTMLElement;
|
|
86
|
+
profile?: string;
|
|
87
|
+
registerBuiltIns?: boolean;
|
|
88
|
+
profileAttribute?: string | null;
|
|
89
|
+
storageKey?: string | null;
|
|
90
|
+
storage?: Storage | null;
|
|
91
|
+
}
|
|
92
|
+
export interface ApplyDesignProfileOptions {
|
|
93
|
+
selector?: string;
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const THEME_CHANGE_EVENT = "boe:theme-change";
|
|
2
|
+
export declare const DEFAULT_THEME_STORAGE_KEY = "boe-theme";
|
|
3
|
+
export declare const DARK_MODE_MEDIA_QUERY = "(prefers-color-scheme: dark)";
|
|
4
|
+
export type ThemePreference = "light" | "dark" | "system";
|
|
5
|
+
export type ResolvedTheme = Exclude<ThemePreference, "system">;
|
|
6
|
+
export interface ThemeChangeDetail {
|
|
7
|
+
preference: ThemePreference;
|
|
8
|
+
resolvedTheme: ResolvedTheme;
|
|
9
|
+
designSystemName: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ThemeControllerOptions {
|
|
12
|
+
root?: HTMLElement;
|
|
13
|
+
preference?: ThemePreference;
|
|
14
|
+
storageKey?: string | null;
|
|
15
|
+
storage?: Storage | null;
|
|
16
|
+
mediaQueryList?: MediaQueryList | null;
|
|
17
|
+
lightDesignSystem?: string;
|
|
18
|
+
darkDesignSystem?: string;
|
|
19
|
+
registerBuiltIns?: boolean;
|
|
20
|
+
themeAttribute?: string | null;
|
|
21
|
+
applyColorScheme?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ThemeController {
|
|
24
|
+
start(): void;
|
|
25
|
+
stop(): void;
|
|
26
|
+
toggle(): void;
|
|
27
|
+
setPreference(preference: ThemePreference): void;
|
|
28
|
+
getPreference(): ThemePreference;
|
|
29
|
+
getResolvedTheme(): ResolvedTheme;
|
|
30
|
+
}
|
|
31
|
+
export interface ThemeInitializationScriptOptions {
|
|
32
|
+
preference?: ThemePreference;
|
|
33
|
+
storageKey?: string | null;
|
|
34
|
+
themeAttribute?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export declare const createThemeInitializationScript: (options?: ThemeInitializationScriptOptions) => string;
|
|
37
|
+
export declare const createThemeController: (options?: ThemeControllerOptions) => ThemeController;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { applyDesignTokens, registerBoxDarkDesignSystem, registerBoxDefaultDesignSystem, setActiveDesignSystem, } from "../tokens/index.js";
|
|
2
|
+
export const THEME_CHANGE_EVENT = "boe:theme-change";
|
|
3
|
+
export const DEFAULT_THEME_STORAGE_KEY = "boe-theme";
|
|
4
|
+
export const DARK_MODE_MEDIA_QUERY = "(prefers-color-scheme: dark)";
|
|
5
|
+
const isThemePreference = (value) => value === "light" || value === "dark" || value === "system";
|
|
6
|
+
const resolveDefaultRoot = () => typeof document === "undefined" ? null : document.documentElement;
|
|
7
|
+
const resolveDefaultStorage = () => {
|
|
8
|
+
try {
|
|
9
|
+
return typeof localStorage === "undefined" ? null : localStorage;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const resolveDefaultMediaQueryList = () => typeof matchMedia === "function" ? matchMedia(DARK_MODE_MEDIA_QUERY) : null;
|
|
16
|
+
const safeStoredPreference = (storage, storageKey) => {
|
|
17
|
+
if (!storage || !storageKey) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const value = storage.getItem(storageKey);
|
|
22
|
+
return isThemePreference(value) ? value : null;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const persistPreference = (storage, storageKey, preference) => {
|
|
29
|
+
if (!storage || !storageKey) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
storage.setItem(storageKey, preference);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Storage may be unavailable in privacy-restricted or embedded contexts.
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const escapeInlineScriptValue = (value) => JSON.stringify(value).replaceAll("<", "\\u003c");
|
|
40
|
+
export const createThemeInitializationScript = (options = {}) => {
|
|
41
|
+
const preference = options.preference ?? "system";
|
|
42
|
+
const storageKey = options.storageKey === undefined
|
|
43
|
+
? DEFAULT_THEME_STORAGE_KEY
|
|
44
|
+
: options.storageKey;
|
|
45
|
+
const themeAttribute = options.themeAttribute === undefined
|
|
46
|
+
? "data-theme"
|
|
47
|
+
: options.themeAttribute;
|
|
48
|
+
return `(() => {
|
|
49
|
+
const fallback = ${escapeInlineScriptValue(preference)};
|
|
50
|
+
let preference = fallback;
|
|
51
|
+
try {
|
|
52
|
+
const stored = ${storageKey ? `localStorage.getItem(${escapeInlineScriptValue(storageKey)})` : "null"};
|
|
53
|
+
if (stored === "light" || stored === "dark" || stored === "system") preference = stored;
|
|
54
|
+
} catch {}
|
|
55
|
+
const resolved = preference === "system"
|
|
56
|
+
? (typeof matchMedia === "function" && matchMedia(${escapeInlineScriptValue(DARK_MODE_MEDIA_QUERY)}).matches ? "dark" : "light")
|
|
57
|
+
: preference;
|
|
58
|
+
${themeAttribute ? `document.documentElement.setAttribute(${escapeInlineScriptValue(themeAttribute)}, resolved);` : ""}
|
|
59
|
+
document.documentElement.style.colorScheme = resolved;
|
|
60
|
+
})();`;
|
|
61
|
+
};
|
|
62
|
+
export const createThemeController = (options = {}) => {
|
|
63
|
+
const defaultPreference = options.preference ?? "system";
|
|
64
|
+
const storageKey = options.storageKey === undefined
|
|
65
|
+
? DEFAULT_THEME_STORAGE_KEY
|
|
66
|
+
: options.storageKey;
|
|
67
|
+
const lightDesignSystem = options.lightDesignSystem ?? "box-default";
|
|
68
|
+
const darkDesignSystem = options.darkDesignSystem ?? "box-dark";
|
|
69
|
+
const themeAttribute = options.themeAttribute === undefined
|
|
70
|
+
? "data-theme"
|
|
71
|
+
: options.themeAttribute;
|
|
72
|
+
const shouldApplyColorScheme = options.applyColorScheme ?? true;
|
|
73
|
+
let preference = defaultPreference;
|
|
74
|
+
let resolvedTheme = "light";
|
|
75
|
+
let root = options.root ?? null;
|
|
76
|
+
let storage = options.storage ?? null;
|
|
77
|
+
let mediaQueryList = options.mediaQueryList ?? null;
|
|
78
|
+
const shouldResolveDefaultStorage = options.storage === undefined;
|
|
79
|
+
const shouldResolveDefaultMediaQuery = options.mediaQueryList === undefined;
|
|
80
|
+
let started = false;
|
|
81
|
+
let appliedVariables = new Set();
|
|
82
|
+
const resolveTheme = () => preference === "system"
|
|
83
|
+
? (mediaQueryList?.matches ? "dark" : "light")
|
|
84
|
+
: preference;
|
|
85
|
+
const emitThemeChange = (designSystemName) => {
|
|
86
|
+
if (!root || typeof CustomEvent === "undefined") {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
root.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, {
|
|
90
|
+
bubbles: true,
|
|
91
|
+
composed: true,
|
|
92
|
+
detail: {
|
|
93
|
+
preference,
|
|
94
|
+
resolvedTheme,
|
|
95
|
+
designSystemName,
|
|
96
|
+
},
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
const applyTheme = () => {
|
|
100
|
+
if (!root) {
|
|
101
|
+
throw new Error("ThemeController requires a root HTMLElement");
|
|
102
|
+
}
|
|
103
|
+
resolvedTheme = resolveTheme();
|
|
104
|
+
const designSystemName = resolvedTheme === "dark"
|
|
105
|
+
? darkDesignSystem
|
|
106
|
+
: lightDesignSystem;
|
|
107
|
+
setActiveDesignSystem(designSystemName);
|
|
108
|
+
const nextVariables = new Set(applyDesignTokens(root, designSystemName));
|
|
109
|
+
for (const variable of appliedVariables) {
|
|
110
|
+
if (!nextVariables.has(variable)) {
|
|
111
|
+
root.style.removeProperty(variable);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
appliedVariables = nextVariables;
|
|
115
|
+
if (themeAttribute) {
|
|
116
|
+
root.setAttribute(themeAttribute, resolvedTheme);
|
|
117
|
+
}
|
|
118
|
+
if (shouldApplyColorScheme) {
|
|
119
|
+
root.style.colorScheme = resolvedTheme;
|
|
120
|
+
}
|
|
121
|
+
emitThemeChange(designSystemName);
|
|
122
|
+
};
|
|
123
|
+
const handleSystemThemeChange = () => {
|
|
124
|
+
if (started && preference === "system") {
|
|
125
|
+
applyTheme();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const start = () => {
|
|
129
|
+
if (started) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
root ??= resolveDefaultRoot();
|
|
133
|
+
if (shouldResolveDefaultStorage) {
|
|
134
|
+
storage = resolveDefaultStorage();
|
|
135
|
+
}
|
|
136
|
+
if (shouldResolveDefaultMediaQuery) {
|
|
137
|
+
mediaQueryList = resolveDefaultMediaQueryList();
|
|
138
|
+
}
|
|
139
|
+
if (!root) {
|
|
140
|
+
throw new Error("ThemeController cannot start without a document root");
|
|
141
|
+
}
|
|
142
|
+
if (options.registerBuiltIns ?? true) {
|
|
143
|
+
registerBoxDefaultDesignSystem();
|
|
144
|
+
registerBoxDarkDesignSystem();
|
|
145
|
+
}
|
|
146
|
+
preference = safeStoredPreference(storage, storageKey) ?? defaultPreference;
|
|
147
|
+
mediaQueryList?.addEventListener("change", handleSystemThemeChange);
|
|
148
|
+
started = true;
|
|
149
|
+
applyTheme();
|
|
150
|
+
};
|
|
151
|
+
const stop = () => {
|
|
152
|
+
if (!started) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
mediaQueryList?.removeEventListener("change", handleSystemThemeChange);
|
|
156
|
+
started = false;
|
|
157
|
+
};
|
|
158
|
+
const setPreference = (nextPreference) => {
|
|
159
|
+
if (!isThemePreference(nextPreference)) {
|
|
160
|
+
throw new Error(`Unknown theme preference: ${String(nextPreference)}`);
|
|
161
|
+
}
|
|
162
|
+
preference = nextPreference;
|
|
163
|
+
persistPreference(storage, storageKey, preference);
|
|
164
|
+
if (started) {
|
|
165
|
+
applyTheme();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
start,
|
|
170
|
+
stop,
|
|
171
|
+
toggle: () => setPreference(resolvedTheme === "dark" ? "light" : "dark"),
|
|
172
|
+
setPreference,
|
|
173
|
+
getPreference: () => preference,
|
|
174
|
+
getResolvedTheme: () => resolvedTheme,
|
|
175
|
+
};
|
|
176
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DARK_MODE_MEDIA_QUERY, DEFAULT_THEME_STORAGE_KEY, THEME_CHANGE_EVENT, createThemeController, createThemeInitializationScript, } from "./controller.js";
|
|
2
|
+
export type { ResolvedTheme, ThemeChangeDetail, ThemeController, ThemeControllerOptions, ThemeInitializationScriptOptions, ThemePreference, } from "./controller.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DARK_MODE_MEDIA_QUERY, DEFAULT_THEME_STORAGE_KEY, THEME_CHANGE_EVENT, createThemeController, createThemeInitializationScript, } from "./controller.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RegisteredDesignSystemDefinition } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Box dark theme. Same token keys, icons, and illustrations as
|
|
4
4
|
* `boxDefaultDesignSystem` — only the surface / text / stroke / status values
|
|
5
5
|
* change, so every component that consumes `--boe-token-*` re-themes with no
|
|
6
6
|
* markup change when this bundle is made active.
|
|
7
7
|
*/
|
|
8
|
-
export declare const boxDarkDesignSystem:
|
|
8
|
+
export declare const boxDarkDesignSystem: RegisteredDesignSystemDefinition;
|
|
9
9
|
export declare const registerBoxDarkDesignSystem: (options?: {
|
|
10
10
|
setActive?: boolean;
|
|
11
|
-
}) =>
|
|
11
|
+
}) => RegisteredDesignSystemDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const boxDefaultDesignSystem:
|
|
1
|
+
import type { RegisteredDesignSystemDefinition } from "./types.js";
|
|
2
|
+
export declare const boxDefaultDesignSystem: RegisteredDesignSystemDefinition;
|
|
3
3
|
export declare const registerBoxDefaultDesignSystem: (options?: {
|
|
4
4
|
setActive?: boolean;
|
|
5
|
-
}) =>
|
|
5
|
+
}) => RegisteredDesignSystemDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DESIGN_SYSTEM_CHANGE_EVENT, applyDesignTokens, createDesignTokenStyleText, getActiveDesignSystem, getDesignSystem, listDesignSystems, registerDesignSystem, resolveDesignIcon, resolveDesignIllustration, resolveDesignSystemTokens, setActiveDesignSystem, } from "./registry.js";
|
|
1
|
+
export { DESIGN_SYSTEM_CHANGE_EVENT, SEMANTIC_TOKEN_ALIASES, applyDesignTokens, createDesignTokenStyleText, getActiveDesignSystem, getDesignSystem, listDesignSystems, normalizeDesignTokens, registerDesignSystem, resolveDesignIcon, resolveDesignIllustration, resolveDesignSystemTokens, setActiveDesignSystem, } from "./registry.js";
|
|
2
2
|
export { boxDefaultDesignSystem, registerBoxDefaultDesignSystem } from "./box-defaults.js";
|
|
3
3
|
export { boxDarkDesignSystem, registerBoxDarkDesignSystem } from "./box-dark.js";
|
|
4
4
|
export { boeBrandInteractiveStyles, boeFocusRingShadow, boeFocusVisibleStyles, boeNeutralInteractiveStyles, } from "./interaction.js";
|
|
5
|
-
export type { ApplyDesignTokensOptions, DesignAssetRenderContext, DesignAssetRenderer, DesignSystemDefinition, DesignTokenMap, } from "./types.js";
|
|
5
|
+
export type { ApplyDesignTokensOptions, DesignAssetRenderContext, DesignAssetRenderer, DesignSystemDefinition, DesignTokenInput, DesignTokenMap, RegisteredDesignSystemDefinition, SemanticDesignTokenMap, } from "./types.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DESIGN_SYSTEM_CHANGE_EVENT, applyDesignTokens, createDesignTokenStyleText, getActiveDesignSystem, getDesignSystem, listDesignSystems, registerDesignSystem, resolveDesignIcon, resolveDesignIllustration, resolveDesignSystemTokens, setActiveDesignSystem, } from "./registry.js";
|
|
1
|
+
export { DESIGN_SYSTEM_CHANGE_EVENT, SEMANTIC_TOKEN_ALIASES, applyDesignTokens, createDesignTokenStyleText, getActiveDesignSystem, getDesignSystem, listDesignSystems, normalizeDesignTokens, registerDesignSystem, resolveDesignIcon, resolveDesignIllustration, resolveDesignSystemTokens, setActiveDesignSystem, } from "./registry.js";
|
|
2
2
|
export { boxDefaultDesignSystem, registerBoxDefaultDesignSystem } from "./box-defaults.js";
|
|
3
3
|
export { boxDarkDesignSystem, registerBoxDarkDesignSystem } from "./box-dark.js";
|
|
4
4
|
export { boeBrandInteractiveStyles, boeFocusRingShadow, boeFocusVisibleStyles, boeNeutralInteractiveStyles, } from "./interaction.js";
|