@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
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { registerDesignProfile } from "./registry.js";
|
|
2
|
+
export const boxDefaultDesignProfile = {
|
|
3
|
+
name: "box-default",
|
|
4
|
+
description: "Box web-app geometry, density, elevation, typography, and motion.",
|
|
5
|
+
spacing: {
|
|
6
|
+
unit: "4px",
|
|
7
|
+
space1: "4px",
|
|
8
|
+
space2: "8px",
|
|
9
|
+
space3: "12px",
|
|
10
|
+
space4: "16px",
|
|
11
|
+
space5: "20px",
|
|
12
|
+
space6: "24px",
|
|
13
|
+
space8: "32px",
|
|
14
|
+
space10: "40px",
|
|
15
|
+
space12: "48px",
|
|
16
|
+
},
|
|
17
|
+
radius: {
|
|
18
|
+
size: "4px",
|
|
19
|
+
medium: "12px",
|
|
20
|
+
large: "16px",
|
|
21
|
+
xlarge: "20px",
|
|
22
|
+
control: "20px",
|
|
23
|
+
field: "24px",
|
|
24
|
+
nav: "28px",
|
|
25
|
+
pill: "999px",
|
|
26
|
+
},
|
|
27
|
+
density: {
|
|
28
|
+
panelPadding: "12px",
|
|
29
|
+
panelGap: "12px",
|
|
30
|
+
overlayPadding: "12px",
|
|
31
|
+
overlayItemPadding: "8px 48px 8px 8px",
|
|
32
|
+
overlayItemMinHeight: "30px",
|
|
33
|
+
modalPadding: "30px",
|
|
34
|
+
modalWidth: "460px",
|
|
35
|
+
drawerWidth: "340px",
|
|
36
|
+
controlHeight: "32px",
|
|
37
|
+
controlHeightLarge: "40px",
|
|
38
|
+
controlPaddingInline: "16px",
|
|
39
|
+
inputPadding: "7px",
|
|
40
|
+
selectHeight: "34px",
|
|
41
|
+
disabledOpacity: "0.4",
|
|
42
|
+
},
|
|
43
|
+
typography: {
|
|
44
|
+
fontFamilyBase: "InterVariable, Inter, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
45
|
+
controlFontSize: "13px",
|
|
46
|
+
controlLetterSpacing: "0.035em",
|
|
47
|
+
modalTitleSize: "16px",
|
|
48
|
+
},
|
|
49
|
+
elevation: {
|
|
50
|
+
panel: "0 1px 2px rgb(15 23 42 / 4%)",
|
|
51
|
+
overlay: "0 4px 12px 0 rgb(0 0 0 / 10%)",
|
|
52
|
+
modal: "0 1px 1px 1px rgb(0 0 0 / 5%)",
|
|
53
|
+
inputInset: "inset 0 2px 4px rgb(0 0 0 / 10%)",
|
|
54
|
+
primaryFocus: "inset 0 0 0 1px rgb(255 255 255 / 80%), 0 1px 2px rgb(0 0 0 / 10%)",
|
|
55
|
+
},
|
|
56
|
+
motion: {
|
|
57
|
+
fast: "120ms",
|
|
58
|
+
interactive: "140ms",
|
|
59
|
+
medium: "160ms",
|
|
60
|
+
slow: "240ms",
|
|
61
|
+
spin: "0.8s",
|
|
62
|
+
shimmer: "1.4s",
|
|
63
|
+
easingStandard: "ease",
|
|
64
|
+
easingEnter: "ease-out",
|
|
65
|
+
easingExit: "ease-in",
|
|
66
|
+
easingLinear: "linear",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const compactNeutralDesignProfile = {
|
|
70
|
+
name: "compact-neutral",
|
|
71
|
+
description: "A denser, restrained application profile for information-heavy tools.",
|
|
72
|
+
spacing: {
|
|
73
|
+
space1: "3px",
|
|
74
|
+
space2: "6px",
|
|
75
|
+
space3: "10px",
|
|
76
|
+
space4: "14px",
|
|
77
|
+
space5: "18px",
|
|
78
|
+
space6: "20px",
|
|
79
|
+
space8: "28px",
|
|
80
|
+
space10: "36px",
|
|
81
|
+
space12: "44px",
|
|
82
|
+
},
|
|
83
|
+
radius: {
|
|
84
|
+
size: "3px",
|
|
85
|
+
medium: "6px",
|
|
86
|
+
large: "8px",
|
|
87
|
+
xlarge: "10px",
|
|
88
|
+
control: "6px",
|
|
89
|
+
field: "8px",
|
|
90
|
+
nav: "6px",
|
|
91
|
+
pill: "999px",
|
|
92
|
+
},
|
|
93
|
+
density: {
|
|
94
|
+
panelPadding: "10px",
|
|
95
|
+
panelGap: "8px",
|
|
96
|
+
overlayPadding: "6px",
|
|
97
|
+
overlayItemPadding: "6px 32px 6px 8px",
|
|
98
|
+
overlayItemMinHeight: "28px",
|
|
99
|
+
modalPadding: "20px",
|
|
100
|
+
controlHeight: "28px",
|
|
101
|
+
controlHeightLarge: "34px",
|
|
102
|
+
controlPaddingInline: "12px",
|
|
103
|
+
inputPadding: "5px 7px",
|
|
104
|
+
selectHeight: "30px",
|
|
105
|
+
},
|
|
106
|
+
typography: {
|
|
107
|
+
fontFamilyBase: "InterVariable, Inter, sans-serif",
|
|
108
|
+
controlFontSize: "12px",
|
|
109
|
+
controlLetterSpacing: "0",
|
|
110
|
+
modalTitleSize: "15px",
|
|
111
|
+
},
|
|
112
|
+
elevation: {
|
|
113
|
+
panel: "0 1px 2px rgb(0 0 0 / 5%)",
|
|
114
|
+
overlay: "0 8px 24px rgb(0 0 0 / 18%)",
|
|
115
|
+
modal: "0 12px 32px rgb(0 0 0 / 22%)",
|
|
116
|
+
inputInset: "none",
|
|
117
|
+
},
|
|
118
|
+
motion: {
|
|
119
|
+
fast: "80ms",
|
|
120
|
+
interactive: "100ms",
|
|
121
|
+
medium: "140ms",
|
|
122
|
+
slow: "180ms",
|
|
123
|
+
easingStandard: "cubic-bezier(0.2, 0, 0, 1)",
|
|
124
|
+
easingEnter: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
125
|
+
easingExit: "cubic-bezier(0.7, 0, 0.84, 0)",
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
export const registerBuiltInDesignProfiles = () => {
|
|
129
|
+
registerDesignProfile(boxDefaultDesignProfile);
|
|
130
|
+
registerDesignProfile(compactNeutralDesignProfile);
|
|
131
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DesignProfileController, DesignProfileControllerOptions } from "./types.js";
|
|
2
|
+
export declare const DESIGN_PROFILE_CHANGE_EVENT = "boe:design-profile-change";
|
|
3
|
+
export declare const DEFAULT_DESIGN_PROFILE_STORAGE_KEY = "boe-design-profile";
|
|
4
|
+
export declare const createDesignProfileController: (options?: DesignProfileControllerOptions) => DesignProfileController;
|
|
@@ -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;
|